Эх сурвалжийг харах

fix: 修改应收金额字段名称及计算逻辑

xieyong 1 өдөр өмнө
parent
commit
0a6ef0715e

+ 10 - 12
src/views/saleManage/saleOrder/accountstatement/components/receivableInfo.vue

@@ -247,13 +247,7 @@
           {
             minWidth: 160,
             prop: 'lastReceivedAmt',
-            label: '上期对账金额',
-            align: 'center'
-          },
-          {
-            minWidth: 160,
-            prop: 'statementAmt',
-            label: '本次对账应收总金额',
+            label: '上期累计应收金额',
             align: 'center'
           },
           {
@@ -263,6 +257,12 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            minWidth: 160,
+            prop: 'statementAmt',
+            label: '本次对账应收总金额',
+            align: 'center'
+          },
           {
             minWidth: 120,
             prop: 'receivedAmt',
@@ -392,14 +392,12 @@
           'receivedPrice',
           Math.round((statementAmount - val) * 100) / 100
         );
-        // 累计应收金额 = 本次对账应收总金额 - 预收款确收金额 + 上期对账金额
-        // 本次对账应收总金额优先取 statementAmt,为空时回退到 statementAmount
-        const statementAmt = +row.statementAmt || +row.statementAmount || 0;
-        const lastReceivedAmt = +row.lastReceivedAmt || 0;
+        // 累计应收金额=本次对账金额-预收款确认金额+上期累计应收金额
+        const totalReceivableAmount = statementAmount - row.confirmedTotalAmt + (+row.lastReceivedAmt || 0);
         this.$set(
           row,
           'receivedAmt',
-          Math.round((statementAmt - val + lastReceivedAmt) * 100) / 100
+          Math.round(totalReceivableAmount * 100) / 100
         );
       },
       // 明细表按销售单号汇总本次对账金额后,同步到对应销售单号的应收行