Commit b88d211a by Sxy

fix:列表查询

parent e7ee664a
...@@ -29,7 +29,19 @@ class DeliverybillDao extends Dao { ...@@ -29,7 +29,19 @@ class DeliverybillDao extends Dao {
qw.facilitator_id = Number(qobj.company_id); qw.facilitator_id = Number(qobj.company_id);
// 为空说明是管理员,不需设置组织结构过滤 // 为空说明是管理员,不需设置组织结构过滤
if (qobj.opath && qobj.opath != '') { if (qobj.opath && qobj.opath != '') {
qw.delivery_man_opcode = { [this.db.Op.like]: `%${qobj.opath}%` }; if (!qw.$and) {
qw.$and = []
}
qw.$and.push([{
$or: [
{
delivery_man_opcode: { [this.db.Op.like]: `%${qobj.opath}%` },
},
{
salesman_opcode: { [this.db.Op.like]: `%${qobj.opath}%` },
},
]
}])
} else { // 说明是租户管理员,给租户自己核销结算的功能, } else { // 说明是租户管理员,给租户自己核销结算的功能,
if (qobj.bizpath.indexOf('pmxdeliverrequest') > 0) { // 说明是结算核销路由过来的 if (qobj.bizpath.indexOf('pmxdeliverrequest') > 0) { // 说明是结算核销路由过来的
qw.delivery_status = 'success'; qw.delivery_status = 'success';
...@@ -43,7 +55,17 @@ class DeliverybillDao extends Dao { ...@@ -43,7 +55,17 @@ class DeliverybillDao extends Dao {
}; };
if (qobj.bizpath && qobj.bizpath != '') { if (qobj.bizpath && qobj.bizpath != '') {
if (qobj.bizpath.indexOf('myDeliver') > 0) { // 说明是从商机列表过来的 if (qobj.bizpath.indexOf('myDeliver') > 0) { // 说明是从商机列表过来的
qw.delivery_man_id = qobj.userid; delete qw.delivery_man_opcode;
if (!qw.$and) {
qw.$and = []
}
qw.$and.push([{
$or: [{
delivery_man_id: qobj.userid,
}, {
salesman_id: qobj.userid,
}]
}])
} }
if (qobj.bizpath.indexOf('deliveryNoAllocate') > 0) { //未分配列表 if (qobj.bizpath.indexOf('deliveryNoAllocate') > 0) { //未分配列表
delete qw.delivery_man_opcode; delete qw.delivery_man_opcode;
...@@ -63,7 +85,7 @@ class DeliverybillDao extends Dao { ...@@ -63,7 +85,7 @@ class DeliverybillDao extends Dao {
}); });
} }
if (qobj.bizpath.indexOf('deliveryAllocated') > 0) { //已分配列表 if (qobj.bizpath.indexOf('deliveryAllocated') > 0) { //已分配列表
qw.delivery_man_id = { $and: [{ $not: null }, { $not: '' }] }; delete qw.delivery_man_opcode;
if (!qw.$and) { if (!qw.$and) {
qw.$and = [] qw.$and = []
} }
......
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