瀏覽代碼

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: {