Commit 376bca69 by Sxy

fix: 交付单 切换 业务员

parent f05629a6
......@@ -16,7 +16,7 @@ class DeliverybillCtl extends CtlBase {
this.logService = system.getObject("service.bizchance.statuslogSve");
this.cacheManager = system.getObject("db.common.cacheManager");
this.fitaxschemeService = system.getObject("service.bizchance.fitaxschemeSve");
this.bizoptService = system.getObject("service.bizchance.bizoptSve");
this.bizoptService = system.getObject("service.bizchance.bizoptSve");
}
/**
......@@ -29,7 +29,7 @@ class DeliverybillCtl extends CtlBase {
const rs = await this.service.findAndCountAll(pobj);
let result = [];
for (let val of rs.results.rows) {
let { id, delivery_code, service_address, delivery_info, created_at, updated_at, delivery_status, salesman_name } = val;
let { id, delivery_code, service_address, delivery_info, created_at, updated_at, delivery_status, delivery_man_name } = val;
result.push({
deliveryId: id, // id
deliveryNumber: delivery_code, // 交付单编号
......@@ -40,7 +40,7 @@ class DeliverybillCtl extends CtlBase {
companyBizType: delivery_info.companyBizType,// 公司类型 1-商贸型;2-服务型;3-特殊行业;4-其他
contactsName: delivery_info.contactsName,// 联系人
contactsPhone: delivery_info.contactsPhone,// 联系电话
owner: salesman_name,//所属人
owner: delivery_man_name,//所属人
deliveryStatus: delivery_status, // 交付单状态
setupStatus: delivery_info.setupStatus || System.SERVERSESTATUS.NOTSETUP,//建账状态 notsetup | setup
createdAt: created_at,
......@@ -198,7 +198,7 @@ class DeliverybillCtl extends CtlBase {
obj.demand_code = scheme.demand_code;
//根据需求编号获取业务员信息
var bizopt = await this.bizoptService.findInfoByDemandCode({ "demand_code": obj.demand_code });
if (bizopt){
if (bizopt) {
obj.salesman_opcode = bizopt.salesman_opcode;
obj.salesman_id = bizopt.salesman_id;
obj.salesman_name = bizopt.salesman_name;
......@@ -206,7 +206,7 @@ class DeliverybillCtl extends CtlBase {
obj.delivery_man_opcode = bizopt.salesman_opcode;
obj.delivery_man_id = bizopt.salesman_id;
obj.delivery_man_name = bizopt.salesman_name;
}
}
......
......@@ -20,17 +20,17 @@ class DeliverybillDao extends Dao {
filters.push({
$or: [
{
salesman_opcode: {
delivery_man_opcode: {
$eq: null
}
}, {
salesman_opcode: { $like: `%${qobj.opath}%` }
delivery_man_opcode: { $like: `%${qobj.opath}%` }
}
]
});
} else { // 销售 查询自己的
filters.push({
salesman_opcode: { $like: `%${qobj.opath}%` }
delivery_man_opcode: { $like: `%${qobj.opath}%` }
});
}
......@@ -99,7 +99,7 @@ class DeliverybillDao extends Dao {
if (qc.where.owner) {
filters.push({
salesman_name: qc.where.owner
delivery_man_name: qc.where.owner
});
delete qc.where.owner;
}
......
......@@ -113,7 +113,7 @@ class DeliverybillService extends ServiceBase {
area: deliverData.service_address, // 服务 地区 编码
contactsName: deliverData.delivery_info.contactsName,// 联系人
contactsPhone: deliverData.delivery_info.contactsPhone,// 联系电话
owner: deliverData.salesman_name,//所属人
owner: deliverData.delivery_man_name,//所属人
deliveryStatus: deliverData.delivery_status, // 交付单状态
setupStatus: deliverData.delivery_info.setupStatus || System.SERVERSESTATUS.NOTSETUP,//建账状态 notsetup | setup
createdAt: deliverData.created_at,
......@@ -154,10 +154,9 @@ class DeliverybillService extends ServiceBase {
throw new Error("请检查单号是否正确");
}
await this.dao.updateByWhere({
salesman_id: userId,
salesman_opcode: opCode,
salesman_phone: phone,
salesman_name: nickName
delivery_man_id: userId,
delivery_man_opcode: opCode,
delivery_man_name: nickName
}, {
delivery_code: {
$in: numbers
......@@ -174,9 +173,9 @@ class DeliverybillService extends ServiceBase {
},
operation_type: "distribution",
operation_details: {
isFirst: val.salesman_id ? true : false,
fromUserId: val.salesman_id,
fromUserName: val.salesman_name,
isFirst: val.delivery_man_id ? true : false,
fromUserId: val.delivery_man_id,
fromUserName: val.delivery_man_name,
toUserId: userId,
toUserName: nickName
},
......
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