明树Git Lab

Commit 43dcb978 authored by zengfanpei's avatar zengfanpei

update

parent 83a1ca9d
......@@ -76,7 +76,8 @@ async function updateDepart(req, res, next) {
}
//如果用此接口删除
if(req.body.del == 1) {
await DB.User.updateMany({depart: req.body._id}, {depart: null})
let a = await DB.User.updateMany({depart: req.body._id}, {depart: null});
console.log(a);
}
let ret = await departModule.findOneAndUpdate({ _id: req.body._id }, updateObj);
res.sendData(ret);
......
......@@ -7,36 +7,7 @@ const moment = require('moment');
*/
const AgrTaskSchema = new Schema({
name: {
type: "任务名称",
},
agrType: {
type: Number,
comment: "农事类型",
},
startTime: {
type: Date,
omment: "任务开始日期",
},
endTime: {
type: Date,
omment: "任务结束日期",
},
leader: {
type: mongoose.Types.ObjectId,
ref: 'User',
comment: "负责人--从分配负责人开始, 任务就开启"
},
status: {
type: Number,
comment: "1. 待分配(没有leader), 3. 进行中, 5 已完成"
},
auditStatus: {
type: Number,
comment: "1. 待审核, 2, 审核通过, 3.审核不通过, 记录最新的审核记录"
},
creator: {
type: mongoose.Types.ObjectId,
......
......@@ -35,12 +35,14 @@ const userSchema = new Schema({
roles: {
type: [mongoose.Types.ObjectId],
ref: "Role",
default: [],
},
/**------------- */
depart: {
type: mongoose.Types.ObjectId,
ref: "Depart",
comment: "一个人只有一个部门 ,若存在一个人多个部门的情况,需要重新设计"
comment: "一个人只有一个部门 ,若存在一个人多个部门的情况,需要重新设计",
default: null,
},
enable: {
......
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