Browse Source

财务2.4 暂存-1

hbchen 2 năm trước cách đây
mục cha
commit
d9460e6e74
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      src/views/financialStatistics/commodityPayment.vue

+ 12 - 0
src/views/financialStatistics/commodityPayment.vue

@@ -273,6 +273,18 @@ import {downloadByFlow} from '@/utils/common-methods'
   const setServiceInfo=(row)=>{
     rowItem=row
     // 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_payment_id=row.payment_id
     setServiceInfoDia.dataForm.list=row.service_amount_list?JSON.parse(JSON.stringify(row.service_amount_list)):[]