|
|
|
@ -654,8 +654,7 @@ export default { |
|
|
|
} |
|
|
|
}).then(res =>{ |
|
|
|
if(res.code != -1){ |
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
|
|
|
//this.$message.success("操作成功"); |
|
|
|
//触发分组明细刷新 |
|
|
|
this.form.id = '' |
|
|
|
//要做延时处理,否则不会触发监听 |
|
|
|
@ -672,28 +671,31 @@ export default { |
|
|
|
madeNewGroupAsbitems(oldGroupAsbitems,newTotal){ |
|
|
|
newTotal = Number(newTotal).toFixed(2) |
|
|
|
let newGroupAsbitems = [] |
|
|
|
let oldTotal = 0 |
|
|
|
let oldTotal = Number(0) |
|
|
|
oldGroupAsbitems.forEach(e =>{ |
|
|
|
oldTotal += Number(e.customerOrgGroupDetailMoney) |
|
|
|
oldTotal += Number(e.asbitemMoney) //customerOrgGroupDetailMoney |
|
|
|
}) |
|
|
|
oldTotal = oldTotal.toFixed(2) |
|
|
|
oldTotal = Number(oldTotal).toFixed(2) |
|
|
|
|
|
|
|
let discount = 0 |
|
|
|
if(oldTotal != 0) discount = (newTotal * 100 /oldTotal).toFixed(2) |
|
|
|
|
|
|
|
oldTotal = 0 |
|
|
|
oldTotal = Number(0) |
|
|
|
oldGroupAsbitems.forEach(e =>{ |
|
|
|
e.customerOrgGroupDetailPrice = (e.customerOrgGroupDetailPrice * discount/100).toFixed(2) |
|
|
|
e.customerOrgGroupDetailPrice = (e.price * discount/100).toFixed(2) |
|
|
|
e.customerOrgGroupDetailMoney = (e.customerOrgGroupDetailPrice * e.customerOrgGroupDetailAmount).toFixed(2) |
|
|
|
oldTotal += Number(e.customerOrgGroupDetailMoney) |
|
|
|
}) |
|
|
|
oldTotal = oldTotal.toFixed(2) |
|
|
|
oldTotal = Number(oldTotal).toFixed(2) |
|
|
|
|
|
|
|
//console.log('discount,oldTotal',discount,oldTotal) |
|
|
|
|
|
|
|
let didTotal = newTotal - oldTotal |
|
|
|
let didTotal = Number(newTotal - oldTotal).toFixed(2) |
|
|
|
if(didTotal != 0){ |
|
|
|
for(let i = 0;i<oldGroupAsbitems.length;i++){ |
|
|
|
if(oldGroupAsbitems[i].customerOrgGroupDetailAmount == 1){ |
|
|
|
oldGroupAsbitems[i].customerOrgGroupDetailPrice += Number(didTotal) |
|
|
|
oldGroupAsbitems[i].customerOrgGroupDetailPrice = (Number(oldGroupAsbitems[i].customerOrgGroupDetailPrice) + Number(didTotal)).toFixed(2) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|