ly il y a 1 an
Parent
commit
9361b2eca3
1 fichiers modifiés avec 21 ajouts et 20 suppressions
  1. 21 20
      src/views/business/financial/contract/form.vue

+ 21 - 20
src/views/business/financial/contract/form.vue

@@ -453,7 +453,7 @@
       }
       form.value.details.forEach(item => {
         if (item.amount < item.arriveAmount) {
-          proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
+          proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
           return;
         }
       });
@@ -461,6 +461,7 @@
       const countAmount= res.data.map((item) => item.arriveAmount).reduce((total, number) => {
         return total + number;
       });
+      console.log("res.data",res.data);
       const amount = countAmount + form.value.arriveAmount;
       if (amount > form.value.contractAmount) {
         proxy.$modal.msgError("当前的合同提过的收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
@@ -468,7 +469,7 @@
       }
       form.value.details.forEach(item => {
         if (item.amount < match.add(item.arriveAmount, item.arrived)) {
-          proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
+          proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
           return;
         }
       });
@@ -476,24 +477,24 @@
 
 
 
-    // if (form.value.arriveAmount > form.value.contractAmount) {
-    //   proxy.$modal.msgError("实际收款金额不能大于合同收款金额");
-    //   return;
-    // }
-    // proxy.$refs["orderRef"].validate((valid) => {
-    //   if (valid && detailValid()) {
-    //     const formValue = form.value;
-    //     saveCollection(formValue).then((res) => {
-    //       if (res.code === 200) {
-    //         archiveInput.value.collectionStatus = 1;
-    //         setCollectionStatus(archiveInput.value);
-    //         proxy.$message.success("保存成功");
-    //       }
-    //       cancel();
-    //       getList.value();
-    //     });
-    //   }
-    // });
+    if (form.value.arriveAmount > form.value.contractAmount) {
+      proxy.$modal.msgError("实际收款金额不能大于合同收款金额");
+      return;
+    }
+    proxy.$refs["orderRef"].validate((valid) => {
+      if (valid && detailValid()) {
+        const formValue = form.value;
+        saveCollection(formValue).then((res) => {
+          if (res.code === 200) {
+            archiveInput.value.collectionStatus = 1;
+            setCollectionStatus(archiveInput.value);
+            proxy.$message.success("保存成功");
+          }
+          cancel();
+          getList.value();
+        });
+      }
+    });
   }
 
   function detailValid() {