chen 2 роки тому
батько
коміт
93f2a063e2
1 змінених файлів з 18 додано та 12 видалено
  1. 18 12
      src/views/finance/change_apply.vue

+ 18 - 12
src/views/finance/change_apply.vue

@@ -212,14 +212,16 @@ export default {
         type: "REBATE",
       });
 
-      if (index == 1) {
-        let aa = res.data.filter(
-          (v) => v.customerWalletId != this.dataList[0].name
-        );
-        this.$set(this.dataList[index], "typeList", aa);
-      } else {
-        this.$set(this.dataList[index], "typeList", res.data);
-      }
+      this.$set(this.dataList[index], "typeList", res.data);
+
+      // if (index == 1) {
+      //   let aa = res.data.filter(
+      //     (v) => v.customerWalletId != this.dataList[0].name
+      //   );
+      //   this.$set(this.dataList[index], "typeList", aa);
+      // } else {
+      //   this.$set(this.dataList[index], "typeList", res.data);
+      // }
     },
 
     // async typeFn(row) {
@@ -253,10 +255,6 @@ export default {
           this.$message.error("请输入返利金额");
           return v;
         }
-        if (v.allowanceAmount < 0 || v.money < 0) {
-          this.$message.error("金额必须为正数");
-          return v;
-        }
         if (v.customerId == "") {
           this.$message.error("请选择经销商");
           return v;
@@ -270,6 +268,14 @@ export default {
       if (aaa != undefined) {
         return;
       }
+      if (this.dataList[0].money > 0) {
+        this.$message.error("转出金额必须为负数");
+        return;
+      }
+      if (this.dataList[1].money < 0 && this.dataList[1].allowanceAmount < 0) {
+        this.$message.error("转入金额必须为正数");
+        return;
+      }
       if (
         Number(this.dataList[0].money) !=
         Number(this.dataList[1].money) +