Commit 901900a1 by 蒋勇

d

parent 910042ea
......@@ -25,10 +25,20 @@ class BizOptService extends ServiceBase {
finishedCount=await this.dao.findCount({where:{business_status:'isFinished'}})
closedCount=await this.dao.findCount({where:{business_status:'isClosed'}})
}else{
waittoHandledCount=await this.dao.findCount({where:{business_status:'beforeSubmission',salesman_opcode:opath,'facilitator_id':companyId}})
handlingCount=await this.dao.findCount({where:{business_status:'beforeConfirmation',salesman_opcode:opath,'facilitator_id':companyId}})
finishedCount=await this.dao.findCount({where:{business_status:'isFinished',salesman_opcode:opath,'facilitator_id':companyId}})
closedCount=await this.dao.findCount({where:{business_status:'isClosed',salesman_opcode:opath,'facilitator_id':companyId}})
let opathstr=''
if(opath){
opathstr=opath
waittoHandledCount=await this.dao.findCount({where:{business_status:'beforeSubmission',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
handlingCount=await this.dao.findCount({where:{business_status:'beforeConfirmation',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
finishedCount=await this.dao.findCount({where:{business_status:'isFinished',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
closedCount=await this.dao.findCount({where:{business_status:'isClosed',salesman_opcode:{[this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
}else{
waittoHandledCount=await this.dao.findCount({where:{business_status:'beforeSubmission','facilitator_id':companyId}})
handlingCount=await this.dao.findCount({where:{business_status:'beforeConfirmation','facilitator_id':companyId}})
finishedCount=await this.dao.findCount({where:{business_status:'isFinished','facilitator_id':companyId}})
closedCount=await this.dao.findCount({where:{business_status:'isClosed','facilitator_id':companyId}})
}
}
//成单率
let allChance=waittoHandledCount+handlingCount+finishedCount+closedCount
......
......@@ -30,16 +30,32 @@ class DeliverybillService extends ServiceBase {
settled=await this.dao.findCount({where:{settle_status:'settled'}})
settledAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settled'}})
}else{
waittoHandledCount=await this.dao.findCount({where:{delivery_status:'received',salesman_opcode:opath,'facilitator_id':companyId}})
handlingCount=await this.dao.findCount({where:{delivery_status:{[this.db.Op.notIn]:['received','success','closed']},salesman_opcode:opath,'facilitator_id':companyId}})
finishedCount=await this.dao.findCount({where:{delivery_status:'success',salesman_opcode:opath,'facilitator_id':companyId}})
closedCount=await this.dao.findCount({where:{delivery_status:'closed',salesman_opcode:opath,'facilitator_id':companyId}})
toSettle=await this.dao.findCount({where:{settle_status:'waittosettle',salesman_opcode:opath,'facilitator_id':companyId}})
toSettleAmount=await this.dao.findSum('cost_price',{where:{settle_status:'waittosettle',salesman_opcode:opath,'facilitator_id':companyId}})
settling=await this.dao.findCount({where:{settle_status:'settling',salesman_opcode:opath,'facilitator_id':companyId}})
settlingAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settling',salesman_opcode:opath,'facilitator_id':companyId}})
settled=await this.dao.findCount({where:{settle_status:'settled',salesman_opcode:opath,'facilitator_id':companyId}})
settledAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settled',salesman_opcode:opath,'facilitator_id':companyId}})
let opathstr=''
if(opath){
opathstr=opath
waittoHandledCount=await this.dao.findCount({where:{delivery_status:'received',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
handlingCount=await this.dao.findCount({where:{delivery_status:{[this.db.Op.notIn]:['received','success','closed']},salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
finishedCount=await this.dao.findCount({where:{delivery_status:'success',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
closedCount=await this.dao.findCount({where:{delivery_status:'closed',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
toSettle=await this.dao.findCount({where:{settle_status:'waittosettle',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
toSettleAmount=await this.dao.findSum('cost_price',{where:{settle_status:'waittosettle',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
settling=await this.dao.findCount({where:{settle_status:'settling',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
settlingAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settling',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
settled=await this.dao.findCount({where:{settle_status:'settled',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
settledAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settled',salesman_opcode:{ [this.db.Op.like]:`%${opathstr}%`},'facilitator_id':companyId}})
}else{
waittoHandledCount=await this.dao.findCount({where:{delivery_status:'received','facilitator_id':companyId}})
handlingCount=await this.dao.findCount({where:{delivery_status:{[this.db.Op.notIn]:['received','success','closed']},'facilitator_id':companyId}})
finishedCount=await this.dao.findCount({where:{delivery_status:'success','facilitator_id':companyId}})
closedCount=await this.dao.findCount({where:{delivery_status:'closed','facilitator_id':companyId}})
toSettle=await this.dao.findCount({where:{settle_status:'waittosettle','facilitator_id':companyId}})
toSettleAmount=await this.dao.findSum('cost_price',{where:{settle_status:'waittosettle','facilitator_id':companyId}})
settling=await this.dao.findCount({where:{settle_status:'settling','facilitator_id':companyId}})
settlingAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settling','facilitator_id':companyId}})
settled=await this.dao.findCount({where:{settle_status:'settled','facilitator_id':companyId}})
settledAmount=await this.dao.findSum('cost_price',{where:{settle_status:'settled','facilitator_id':companyId}})
}
}
//成单率
let allHandled=finishedCount+closedCount
......
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