Parcourir la source

fix:修改支付逻辑

ly il y a 9 mois
Parent
commit
2c6e2c70f2
1 fichiers modifiés avec 14 ajouts et 5 suppressions
  1. 14 5
      src/views/business/financial/payment/form.vue

+ 14 - 5
src/views/business/financial/payment/form.vue

@@ -220,7 +220,7 @@
 
                   <el-table-column label="可支出金额" align="center">
                     <template #default="scope">
-                      {{rowNum((Number(scope.row.reallyAmount) || 0) - (Number(scope.row.payment) || 0))}}
+                      {{rowNum((Number(scope.row.reallyAmount) || 0) - (Number(scope.row.payment) || 0)) - (Number(scope.row.reviewAmount || 0))}}
                     </template>
                   </el-table-column>
                   <el-table-column label="本次支出金额" prop="paymentAmount" width="100" align="center">
@@ -604,10 +604,14 @@
       proxy.$modal.msgError("请输入支出金额");
       return;
     }
+    for (let i = 0; i < form.value.details.length; i++) {
+      let item = form.value.details[i];
 
-    if (form.value.amount > form.value.contractAmount - form.value.payedAmount) {
-      proxy.$modal.msgError("支出金额大于合同金额");
-      return;
+      const tempAmount = rowNum((Number(item.reallyAmount) || 0) - (Number(item.payment) || 0)) - (Number(item.reviewAmount || 0));
+      if (item.paymentAmount !== 0 && tempAmount <  item.paymentAmount) {
+        proxy.$modal.msgError("当前的" + item.taskTypeName + "填写的支出金额大于现系统内支出的全部金额");
+        return;
+      }
     }
     proxy.$refs["orderRef"].validate((valid) => {
       if (valid && detailValid()) {
@@ -933,7 +937,8 @@
         taskTypeName: item.taskTypeName,
         payment: item.payment,
         reallyAmount: item.reallyAmount,
-        explain: item.explain
+        explain: item.explain,
+        reviewAmount : item.reviewAmount
       };
       form.value.details.push(detail);
     });
@@ -979,6 +984,10 @@
   const reForm = () => {
     open(form.value.id);
   }
+  const amountFormat = (row) => {
+    console.log(row.reallyAmount,row.payment,row.reviewAmount)
+    //rowNum((Number(scope.row.reallyAmount) || 0) - (Number(scope.row.payment) || 0)) - (Number(scope.row.reviewAmount || 0))
+  }
   /** 暴露给父组件的方法 */
   defineExpose({
     open,