Explorar el Código

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

xieyong hace 1 mes
padre
commit
be05cd3f06
Se han modificado 1 ficheros con 10 adiciones y 3 borrados
  1. 10 3
      src/views/financialManage/prepayment/components/addDialog.vue

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

@@ -393,13 +393,20 @@
     },
     },
     computed: {
     computed: {
       paidAmount() {
       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);
           return sum + (isNaN(val) ? 0 : val);
         }, 0).toFixed(2);
         }, 0).toFixed(2);
       },
       },
       unpaidAmount() {
       unpaidAmount() {
-        const total = parseFloat(this.row.prepayTotalPrice) || 0;
+        const total = parseFloat(this.form.prepayTotalPrice) || 0;
         const paid = parseFloat(this.paidAmount) || 0;
         const paid = parseFloat(this.paidAmount) || 0;
         return (total - paid).toFixed(2);
         return (total - paid).toFixed(2);
       }
       }