Explorar o código

fix:收款管理页面收款校验修改

ly hai 9 meses
pai
achega
b1746b79ae
Modificáronse 1 ficheiros con 10 adicións e 2 borrados
  1. 10 2
      src/views/business/financial/collection/form.vue

+ 10 - 2
src/views/business/financial/collection/form.vue

@@ -601,7 +601,7 @@
         }
       }
     } else {
-      const countAmount = res.data.map((item) => item.arriveAmount).reduce((total, number) => {
+      const countAmount = res.data.map((item) => item.status === 1&&item.arriveAmount).reduce((total, number) => {
         return total + number;
       });
       const amount = countAmount + form.value.arriveAmount;
@@ -618,10 +618,14 @@
             countAmount += match.arriveAmount;
           }
         }
-        if (item.amount < match.add(item.arriveAmount, countAmount)) {
+        if (item.amount < match.add(item.arriveAmount)) {
           proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
           return false;
         }
+        if ((rowNum((Number(item.amount) || 0) - (Number(item.arrived) || 0))) < item.arriveAmount) {
+          proxy.$modal.msgError("当前的" + item.taskTypeName + "本次收款金额超过待收款金额,不可提交,请联系财务人员。");
+          return false;
+        }
       }
     }
 
@@ -757,6 +761,10 @@
           proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
           return false;
         }
+        if ((rowNum((Number(item.amount) || 0) - (Number(item.arrived) || 0))) < item.arriveAmount) {
+          proxy.$modal.msgError("当前的" + item.taskTypeName + "本次收款金额超过待收款金额,不可提交,请联系财务人员。");
+          return false;
+        }
       }
     }