谢杰标 2 rokov pred
rodič
commit
e795a7b457
2 zmenil súbory, kde vykonal 26 pridanie a 17 odobranie
  1. 0 1
      src/directive/index.js
  2. 26 16
      src/views/financed/cost/dislogSet.vue

+ 0 - 1
src/directive/index.js

@@ -6,7 +6,6 @@ import dialogDragHeight from "./dialog/dragHeight";
 import throttle from "./common/throttle";
 import int from "./common/int";
 import { formatPrice } from "./filter/index";
-console.log(formatPrice, "formatPrice");
 const install = function (Vue) {
   Vue.directive("hasRole", hasRole);
   Vue.directive("hasPermi", hasPermi);

+ 26 - 16
src/views/financed/cost/dislogSet.vue

@@ -291,28 +291,39 @@ export default {
       callback();
     };
     var checkEduId = (rule, value, callback) => {
-      const len = this.itemList.length;
-      if (len > 1) {
-        const len1 = this.itemList.filter(
-          (e) => e.educationTypeId == -1
-        ).length;
-        if (len1 > 0 && len1 != len) {
-          callback(new Error("需统一不限!"));
+      const { itemCategory } = this.itemList[rule.field.split(".")[1]];
+      if (this.itemList.length > 1) {
+        const levelList = this.itemList.filter(
+          (e) => e.itemCategory && e.itemCategory == itemCategory
+        );
+        const len = levelList.length;
+        if (len > 1) {
+          const len1 = levelList.filter((e) => e.educationTypeId == -1).length;
+          if (len1 > 0 && len1 != len) {
+            callback(new Error("需统一不限!"));
+          }
         }
       }
       callback();
     };
     var checkBusId = (rule, value, callback) => {
-      const { educationTypeId } = this.itemList[rule.field.split(".")[1]];
+      const { educationTypeId, itemCategory } =
+        this.itemList[rule.field.split(".")[1]];
       if (this.itemList.length > 1) {
-        const flag = this.itemList.some(
-          (e) => e.educationTypeId == educationTypeId && e.businessId == -1
+        const levelList = this.itemList.filter(
+          (e) =>
+            itemCategory &&
+            educationTypeId &&
+            e.educationTypeId == educationTypeId &&
+            e.itemCategory == itemCategory
         );
-        if (flag) {
-          const flag1 = this.itemList.some(
-            (e) => e.educationTypeId == educationTypeId && e.businessId != -1
-          );
-          flag1 && callback(new Error("需统一不限!"));
+        console.log(levelList, 666);
+        const len = levelList.length;
+        if (len > 1) {
+          const len1 = levelList.filter((e) => e.businessId == -1).length;
+          if (len1 > 0 && len1 != len) {
+            callback(new Error("需统一不限!"));
+          }
         }
       }
       callback();
@@ -520,7 +531,6 @@ export default {
         return a.minValue - b.minValue;
       });
       for (let i = 0, len = list.length - 1; i < len; i++) {
-        console.log(i, list);
         if (list[i].maxValue >= list[i + 1].minValue) {
           return "阶梯计价存在范围冲突";
         }