Commit 1245482f by v_vjyjiang

d

parent 8c98b68a
...@@ -4,11 +4,20 @@ class DeliverybillDao extends Dao { ...@@ -4,11 +4,20 @@ class DeliverybillDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(DeliverybillDao)); super(Dao.getModelName(DeliverybillDao));
} }
convertAggResult (aggresult) {
extraModelFilter(pobj) { if (aggresult) {
Object.keys(aggresult).forEach((k) => {
if (k.indexOf("sum") >= 0) {
aggresult[k] = aggresult[k] / 100
}
})
}
return aggresult
}
extraModelFilter (pobj) {
return { "key": "include", "value": { model: this.db.models.settlebill, raw: true, attributes: ['memo'] } }; return { "key": "include", "value": { model: this.db.models.settlebill, raw: true, attributes: ['memo'] } };
} }
extraWhere(qobj, qw, qc) {//根据业务员id获取交付单信息的组装条件 extraWhere (qobj, qw, qc) {//根据业务员id获取交付单信息的组装条件
//qc.raw = true; //qc.raw = true;
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据 //检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据
if (qw["delivery_status"] == "handling") {//解决首页多状态查询 if (qw["delivery_status"] == "handling") {//解决首页多状态查询
...@@ -53,13 +62,13 @@ class DeliverybillDao extends Dao { ...@@ -53,13 +62,13 @@ class DeliverybillDao extends Dao {
} }
/*根据交付单编号获取订单详情*/ /*根据交付单编号获取订单详情*/
async findInfoByDeliverCode(qobj) { async findInfoByDeliverCode (qobj) {
var qcwhere = { "delivery_code": qobj.deliverNumber }; var qcwhere = { "delivery_code": qobj.deliverNumber };
return await this.findOne(qcwhere); return await this.findOne(qcwhere);
} }
/*根据交付单编号更新状态信息*/ /*根据交付单编号更新状态信息*/
async updateStatusByDeliverCode(qobj, t) { async updateStatusByDeliverCode (qobj, t) {
var setobj = { "delivery_status": qobj.deliverStatus }; var setobj = { "delivery_status": qobj.deliverStatus };
if (qobj.statusReason && qobj.statusReason != 'undefined') { if (qobj.statusReason && qobj.statusReason != 'undefined') {
setobj.close_reason = qobj.statusReason; setobj.close_reason = qobj.statusReason;
...@@ -85,9 +94,9 @@ class DeliverybillDao extends Dao { ...@@ -85,9 +94,9 @@ class DeliverybillDao extends Dao {
} }
/*更新业务员/交付员信息*/ /*更新业务员/交付员信息*/
async updateSalesmanInfoByDeliverCode(qobj, t) { async updateSalesmanInfoByDeliverCode (qobj, t) {
var setobj = {}; var setobj = {};
if(qobj.type == "salesman") { if (qobj.type == "salesman") {
if (qobj.salesmanId && qobj.salesmanId != 'undefined') { if (qobj.salesmanId && qobj.salesmanId != 'undefined') {
setobj.salesman_id = qobj.salesmanId; setobj.salesman_id = qobj.salesmanId;
}; };
...@@ -98,7 +107,7 @@ class DeliverybillDao extends Dao { ...@@ -98,7 +107,7 @@ class DeliverybillDao extends Dao {
setobj.salesman_opcode = qobj.salesmanOpcode; setobj.salesman_opcode = qobj.salesmanOpcode;
}; };
} }
if(qobj.type == "deliverman") { if (qobj.type == "deliverman") {
if (qobj.deliverymanId && qobj.deliverymanId != 'undefined') { if (qobj.deliverymanId && qobj.deliverymanId != 'undefined') {
setobj.delivery_man_id = qobj.deliverymanId; setobj.delivery_man_id = qobj.deliverymanId;
}; };
...@@ -123,7 +132,7 @@ class DeliverybillDao extends Dao { ...@@ -123,7 +132,7 @@ class DeliverybillDao extends Dao {
} }
/*根据交付单更新交付材料信息*/ /*根据交付单更新交付材料信息*/
async updateInfoByDeliverCode(qobj, t) {//公司注册、云上园区注册时填写交付材料 async updateInfoByDeliverCode (qobj, t) {//公司注册、云上园区注册时填写交付材料
var whereobj = { "delivery_code": qobj.deliverNumber }; var whereobj = { "delivery_code": qobj.deliverNumber };
var setobj = { "delivery_info": qobj.baseInfo }; var setobj = { "delivery_info": qobj.baseInfo };
if (qobj.deliverStatus && qobj.deliverStatus != 'undefined') { if (qobj.deliverStatus && qobj.deliverStatus != 'undefined') {
...@@ -139,7 +148,7 @@ class DeliverybillDao extends Dao { ...@@ -139,7 +148,7 @@ class DeliverybillDao extends Dao {
} }
/*插入交付单信息*/ /*插入交付单信息*/
async insertInfo(qobj, t) {//到时候看交付单信息后再确定 async insertInfo (qobj, t) {//到时候看交付单信息后再确定
var obj = { var obj = {
"delivery_code": qobj.deliverNumber, "delivery_code": qobj.deliverNumber,
"delivery_status": qobj.deliverStatus, "delivery_status": qobj.deliverStatus,
...@@ -182,7 +191,7 @@ class DeliverybillDao extends Dao { ...@@ -182,7 +191,7 @@ class DeliverybillDao extends Dao {
if (qobj.clerkName && qobj.clerkName != 'undefined') { if (qobj.clerkName && qobj.clerkName != 'undefined') {
obj.delivery_man_name = qobj.clerkName; obj.delivery_man_name = qobj.clerkName;
} }
if (qobj.salesmanName && qobj.salesmanName != 'undefined'){ if (qobj.salesmanName && qobj.salesmanName != 'undefined') {
obj.salesman_name = qobj.salesmanName; obj.salesman_name = qobj.salesmanName;
} }
if (qobj.salesmanPhone && qobj.salesmanPhone != 'undefined') { if (qobj.salesmanPhone && qobj.salesmanPhone != 'undefined') {
......
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