فهرست منبع

fix: 优化应收总金额计算逻辑,确保正确处理空值和小数精度

xieyong 3 هفته پیش
والد
کامیت
d54cc2e21b
1فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 6 5
      src/views/saleManage/saleOrder/accountstatement/components/receivableInfo.vue

+ 6 - 5
src/views/saleManage/saleOrder/accountstatement/components/receivableInfo.vue

@@ -288,13 +288,14 @@
         return this.dataForm?.statReceipt?.statementAdvanceTotalPrice || 0;
       },
       receivedTotalPrice() {
-        return (
-          Math.round(
-            ((+this.dataForm.amountTotalPrice || 0) -
-              this.statementAdvanceTotalPrice) *
-              100
+        const value = (
+          this.dataForm?.statReceipt?.statReceiptDetailList?.reduce(
+            (pre, cur) =>
+              pre + Math.round((+cur.statementAmt || 0) * 100),
+            0
           ) / 100
         );
+        return isNaN(value) ? 0 : value;
       }
     },
     watch: {