Ver código fonte

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

xieyong 3 semanas atrás
pai
commit
d54cc2e21b

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