ソースを参照

fix: 更新已支付金额计算逻辑,确保使用正确的字段和数据源

xieyong 1 ヶ月 前
親
コミット
be05cd3f06

+ 10 - 3
src/views/financialManage/prepayment/components/addDialog.vue

@@ -393,13 +393,20 @@
     },
     computed: {
       paidAmount() {
-        return this.form.tableData.reduce((sum, item) => {
-          const val = parseFloat(item.paidAmount);
+        let productList =
+          (this.form &&
+            (this.form.redressProductList ||
+              this.form.quoteProductList ||
+              this.form.productList ||
+              this.form.detailList)) ||
+          [];
+        return productList.reduce((sum, item) => {
+          const val = parseFloat(item.paidTotalPrice);
           return sum + (isNaN(val) ? 0 : val);
         }, 0).toFixed(2);
       },
       unpaidAmount() {
-        const total = parseFloat(this.row.prepayTotalPrice) || 0;
+        const total = parseFloat(this.form.prepayTotalPrice) || 0;
         const paid = parseFloat(this.paidAmount) || 0;
         return (total - paid).toFixed(2);
       }