|
@@ -273,6 +273,18 @@ import {downloadByFlow} from '@/utils/common-methods'
|
|
const setServiceInfo=(row)=>{
|
|
const setServiceInfo=(row)=>{
|
|
rowItem=row
|
|
rowItem=row
|
|
// console.log(row.isAverage);
|
|
// console.log(row.isAverage);
|
|
|
|
+ // if(row.type=='权益销售'){}
|
|
|
|
+ // row.payment_amount=1000.15
|
|
|
|
+ let isAverage= row.service_amount_list.some(item => [].includes(item.service_template_id))?false:true
|
|
|
|
+ if(isAverage){
|
|
|
|
+ let average=Math.round((row.payment_amount/(row.service_amount_list.length))*100)/100
|
|
|
|
+ // 除法可能造成除不尽的情况,会造成金额的错误 少一分钱,多一分钱的情况
|
|
|
|
+ let averageDiff = row.payment_amount-average*row.service_amount_list.length
|
|
|
|
+ row.service_amount_list.forEach(element => {
|
|
|
|
+ element.amount= Math.round((row.payment_amount/(row.service_amount_list.length))*100)/100
|
|
|
|
+ });
|
|
|
|
+ row.service_amount_list[0].amount+=averageDiff
|
|
|
|
+ }
|
|
setServiceInfoDia.dataForm.contract_register_id=row.contract_register_id
|
|
setServiceInfoDia.dataForm.contract_register_id=row.contract_register_id
|
|
setServiceInfoDia.dataForm.contract_payment_id=row.payment_id
|
|
setServiceInfoDia.dataForm.contract_payment_id=row.payment_id
|
|
setServiceInfoDia.dataForm.list=row.service_amount_list?JSON.parse(JSON.stringify(row.service_amount_list)):[]
|
|
setServiceInfoDia.dataForm.list=row.service_amount_list?JSON.parse(JSON.stringify(row.service_amount_list)):[]
|