明树Git Lab

Commit 50ecaa39 authored by zfp1's avatar zfp1

update

parent 9fb3709d
...@@ -89,7 +89,7 @@ async function queryMatApprList(req, res, next) { ...@@ -89,7 +89,7 @@ async function queryMatApprList(req, res, next) {
let pageSize = req.body.pageSize || 10; let pageSize = req.body.pageSize || 10;
let skip = (page - 1) * pageSize; let skip = (page - 1) * pageSize;
let count = await DB.AgrMatApproval.countDocuments(search) let count = await DB.AgrMatApproval.countDocuments(search)
let list = await DB.AgrMatApproval.find(search).skip(skip).limit(pageSize).lean().exec(); let list = await DB.AgrMatApproval.find(search).populate({path: "creator"}).skip(skip).limit(pageSize).lean().exec();
res.sendData({ count, list }); res.sendData({ count, list });
} catch (error) { } catch (error) {
next(error) next(error)
...@@ -348,7 +348,7 @@ async function inMat(req, res, next) { ...@@ -348,7 +348,7 @@ async function inMat(req, res, next) {
let inApproval = { let inApproval = {
_id: inApprovalId, _id: inApprovalId,
type: 1, type: 1,
name: "入库单", name: req.body.name || "入库单",
creator, creator,
file: fileInfo && fileInfo._id, file: fileInfo && fileInfo._id,
} }
...@@ -410,7 +410,7 @@ async function outMat(req, res, next) { ...@@ -410,7 +410,7 @@ async function outMat(req, res, next) {
let inApproval = { let inApproval = {
_id: inApprovalId, _id: inApprovalId,
type: 2, type: 2,
name: "出库单", name: req.body.name || "出库单",
creator, creator,
file: fileInfo && fileInfo._id, file: fileInfo && fileInfo._id,
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment