Bladeren bron

fix: 禁止选择存在机型

zh 2 jaren geleden
bovenliggende
commit
ebeab87f66
2 gewijzigde bestanden met toevoegingen van 15 en 17 verwijderingen
  1. 15 7
      src/views/sales_policy/components/AddCondition.vue
  2. 0 10
      src/views/sales_policy/components/editPolicy.vue

+ 15 - 7
src/views/sales_policy/components/AddCondition.vue

@@ -502,17 +502,13 @@ export default {
       if (id) {
         this.id = id
       }
-
-      console.log(555, policyId)
       if (this.id || policyId) {
         if (policyId) {
           this.edit = 'eidt'
         }
-        console.log(this.policyId, policyId, this.id)
         const res = await getConditionMaterialDetail({
           id: this.policyId || policyId || this.id
         })
-        console.log()
         this.pop = res.data.pop
         const pop = res.data.pop.split(':')
         this.conditionBox = []
@@ -533,6 +529,8 @@ export default {
             policyConditionId: res.data.id,
             popType: k + 1
           })
+          console.log(data.records, 'kanakn', policyId)
+
           if (policyId) {
             this.conditionBox.push(data.records)
           } else {
@@ -540,6 +538,12 @@ export default {
           }
           this.listLoadingArr[`listLoading${k}`] = false
         }
+        // if (this.conditionBox.length) {
+        //   for (let i = 0; i < this.conditionBox.length; i++) {
+        //     this.newConditionBox = [...this.newConditionBox, ...this.conditionBox[i]]
+        //   }
+        // }
+        // console.log( this.newConditionBox,' 999');
       }
     },
     toggleSelection(rows) {
@@ -652,7 +656,7 @@ export default {
         for (let j = 0; j < this.conditionBox.length; j++) {
           datas = [...datas, ...this.conditionBox[j]]
         }
-
+        console.log(datas, 'bianji');
         /**
          * @value newConditionBox 首页保存的所有选中者,即条件1
          * @value res.data.records,this.conditList 每次点击添加获取的最新数据
@@ -666,12 +670,11 @@ export default {
               for (let m = 0; m < this.newConditionBox[n].length; m++) {
                 if (m == index) {
                   this.$set(this.newConditionBox[n], m, [...this.conditionBox[index], ...this.newConditionBox[n][m]])
-                  console.log(this.newConditionBox, 'newenewnwn')
                 }
               }
             }
           }
-
+          console.log('编辑——————————')
           for (let j = 0; j < this.newConditionBox.length; j++) {
             for (let o = 0; o < this.newConditionBox[j].length; o++) {
               if (o == index) {
@@ -689,10 +692,15 @@ export default {
           }
           this.conditList = res.data.records
         } else {
+          console.log('新增——————————',datas,res.data.records)
+
           const newData = datas
           if (newData.length) {
             for (let i = 0; i < res.data.records.length; i++) {
               for (let k = 0; k < newData.length; k++) {
+                if (newData[k].policyMaterialId == res.data.records[i].id) {
+                  res.data.records[i].disabled = true
+                }
                 if (newData[k].id == res.data.records[i].id) {
                   res.data.records[i].disabled = true
                 }

+ 0 - 10
src/views/sales_policy/components/editPolicy.vue

@@ -495,16 +495,6 @@
       @handleSubmitCon="handleSubmitCon"
       @back="handleBack"
     />
-    <AddCondition
-      v-show="isCondition === 2"
-      :id="cid"
-      ref="cond"
-      :code="searchForm.code"
-      :is-show="isShow"
-      :is-flag="isFlag"
-      :is-condition="isCondition"
-      @back="handleBack"
-    />
   </div>
 </template>