Bläddra i källkod

fix(accountstatement): 修正对账明细中金额计算和显示问题

liujt 4 månader sedan
förälder
incheckning
7c82d51276

+ 5 - 4
src/views/purchasingManage/purchaseOrder/accountstatement/components/detailDialog.vue

@@ -37,7 +37,7 @@
       <headerTitle title="对账明细" style="margin-top: 30px">
         <template v-slot>
           <el-row style="font-weight: 700; color: red">
-            <span>总金额:</span>
+            <span>订单总金额:</span>
             <span>{{ dataForm.orderTotalAmount || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已对账金额:</span>
@@ -115,9 +115,10 @@
         this.dialogType = dialogType;
         this.dataForm.type = type;
         let data = await accountstatementInfoAPI(row.id);
-        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + +cur.amountTotalPrice, 0),
-        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + +cur.statementAmount, 0),
-        data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + +cur.unStatementAmount, 0)
+        data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
+      data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+      data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
+      data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
         this.datasource = data.orderList||[];
         this.recorpayList = data.recorpayList || [];
         this.dataForm = data;

+ 5 - 4
src/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue

@@ -35,7 +35,7 @@
       <headerTitle title="对账明细" style="margin-top: 30px">
         <template v-slot>
           <el-row style="font-weight: 700; color: red">
-            <span>总金额:</span>
+            <span>订单总金额:</span>
             <span>{{ dataForm.orderTotalAmount || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已对账金额:</span>
@@ -110,9 +110,10 @@ export default {
 
       this.datasource = data.orderList
       // this.recorpayList = data.recorpayList || [];
-        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.amountTotalPrice * 100), 0) / 100;
-        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
-        data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
+      data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
+      data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+      data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
+      data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
       this.dataForm = data
       switch (this.dataForm.dateType) {
         case 1: