Commit 746b0ef5 by 杨明

fixed

1 parent 8e203b10
...@@ -301,16 +301,19 @@ export default { ...@@ -301,16 +301,19 @@ export default {
let lastCustomerNum = task.staffList.reduce((prev, cur) => { let lastCustomerNum = task.staffList.reduce((prev, cur) => {
return prev + cur.lastCustomerNum || 0 return prev + cur.lastCustomerNum || 0
}, 0) }, 0)
console.log(lastCustomerNum, 'lastCustomerNum')
if (task.assignType == 0) lastCustomerNum = 0 if (task.assignType == 0) lastCustomerNum = 0
if (task.excelUrl && task.staffList.length) { if (task.excelUrl && task.staffList.length) {
task.isFinish = true task.isFinish = true
const customerNumTotal = task.customerNumTotal - lastCustomerNum || 0 // 去除上次跟进人总数 const customerNumTotal = task.customerNumTotal - lastCustomerNum || 0 // 去除上次跟进人总数
console.log(customerNumTotal, 'customerNumTotal')
const length = task.staffList.length const length = task.staffList.length
let avag = Math.ceil(customerNumTotal / length) let avag = Math.ceil(customerNumTotal / length)
let residue = customerNumTotal let residue = customerNumTotal
task.staffList.forEach((item, i) => { task.staffList.forEach((item, i) => {
const lastNum = task.assignType == 0 ? 0 : item.lastCustomerNum const lastNum = task.assignType == 0 ? 0 : item.lastCustomerNum
this.$set(item, 'customerNum', residue > avag ? lastNum || 0 + avag : lastNum || 0 + residue) console.log(lastNum, 'lastNum')
this.$set(item, 'customerNum', residue > avag ? (lastNum || 0) + avag : (lastNum || 0) + residue)
residue = residue - avag residue = residue - avag
avag = Math.ceil(residue / (length - i - 1)) avag = Math.ceil(residue / (length - i - 1))
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!