howie 3 lat temu
rodzic
commit
c4e9f9242c
1 zmienionych plików z 35 dodań i 5 usunięć
  1. 35 5
      src/views/sales_policy/components/AddCondition.vue

+ 35 - 5
src/views/sales_policy/components/AddCondition.vue

@@ -532,6 +532,8 @@ export default {
     },
     handleSubmit() {
       var tableData = [];
+
+       this.newConditionBox.push(JSON.parse(JSON.stringify(this.conditionBox)))
       for (let i = 0; i < this.conditionBox.length; i++) {
         for (let j = 0; j < this.conditionBox[i].length; j++) {
           this.conditionBox[i][j].popType = i + 1;
@@ -541,6 +543,7 @@ export default {
         }
         tableData = [...tableData, ...this.conditionBox[i]];
       }
+
       if (!tableData.length) {
         this.$errorMsg("请选择机型");
         return;
@@ -559,7 +562,7 @@ export default {
       };
       addPoliyCondition(params).then((res) => {
         this.$successMsg("添加成功");
-        this.newConditionBox.push(this.conditionBox)
+
         this.conditionBox = [[], []];
         this.conditionBoxs = [];
         this.limit = "";
@@ -624,10 +627,32 @@ export default {
           datas = [...datas, ...this.conditionBox[j]];
         }
 
-          console.log(this.newConditionBox);
           if (this.newConditionBox.length) {
-                 console.log(this.newConditionBox);
-                 this.conditList=[]
+                 this.conditList = res.data.records;
+            for (let j = 0; j < this.newConditionBox.length; j++) {
+              for (let o = 0; o < this.newConditionBox[j].length; o++) {
+                    if (o==index) {
+                              console.log(this.newConditionBox[j][o],'dier');
+                        for (let i = 0; i < res.data.records.length; i++) {
+                          console.log(this.newConditionBox[j][o],o,index,this.newConditionBox[j]);
+
+                            for (let k = 0; k < this.newConditionBox[j][o].length; k++) {
+                            if (this.newConditionBox[j][o][k].id == res.data.records[i].id) {
+                      res.data.records[i].disabled = true;
+
+                    }
+                       }
+                  }
+
+              }else{
+                  this.conditList = res.data.records;
+              }
+
+            }
+
+
+          }
+           this.conditList = res.data.records;
           } else {
         const newData = datas
         if (newData.length) {
@@ -683,7 +708,9 @@ export default {
       }
     },
     handleDiaSubmit() {
-      if (this.conditList2.length) {
+
+
+          if (this.conditList2.length) {
         for (let i = 0; i < this.conditionBox.length; i++) {
           if (i == this.arrIndex) {
             this.$set(this.conditionBox, i, [
@@ -697,6 +724,9 @@ export default {
       } else {
         this.$errorMsg("请选择内容");
       }
+
+
+
     },
     handleresale() {
       Object.assign(this.$data, this.$options.data());