Selaa lähdekoodia

fix: 销售政策

zh 2 vuotta sitten
vanhempi
commit
c7ef6c22de

+ 17 - 8
src/views/sales_policy/components/AddCondition.vue

@@ -372,7 +372,16 @@ export default {
     },
     isFlag:{
       type: [Number,String],
-    }
+    },
+    isEdit:{
+      type: [Number,String],
+    },
+    isCondition:{
+      type: [Number,String],
+    },
+    code:{
+      type: [Number,String],
+    },
   },
   watch: {
     conditList: {
@@ -457,9 +466,9 @@ export default {
     handleBack() {
       const isShow = this.isShow
       if ([4, 5].includes(isShow)) {
-        this.$parent.isEdit = 1
+        this.$emit('back')
       } else {
-        this.$parent.isCondition = 0
+        this.$emit('back')
         Object.assign(this.$data, this.$options.data())
       }
     },
@@ -542,7 +551,7 @@ export default {
       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
-          this.conditionBox[i][j].policyId = this.$parent.searchForm.code || this.comCode
+          this.conditionBox[i][j].policyId = this.code || this.comCode
           this.conditionBox[i][j].id = ''
           //  this.conditionBox[i][j].policyMaterialId =this.conditionBox[i][j].materialId
         }
@@ -561,7 +570,7 @@ export default {
       const params = {
         id: '',
         policyConditionMaterials: tableData,
-        policyId: this.$parent.searchForm.code || this.comCode,
+        policyId: this.code || this.comCode,
         policyName: '',
         pop: pop.join(':')
       }
@@ -573,10 +582,10 @@ export default {
         this.limit = ''
         this.pop = ''
         this.popArr = {}
-        this.$parent.isCondition = 0
         this.isFlag = 1
         // Object.assign(this.$data, this.$options.data());
-        this.$emit('handleSubmitCon', this.$parent.searchForm.code || this.comCode)
+        this.$emit('back')
+        this.$emit('handleSubmitCon', this.code || this.comCode)
       })
     },
     handleSelectionChange(val) {
@@ -626,7 +635,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         saleTypeCode: this.saleTypeCode,
-        policyId: this.$parent.searchForm.code || this.comCode
+        policyId: this.code || this.comCode
       }).then(res => {
         let datas = []
 

+ 5 - 1
src/views/sales_policy/components/AddPolicy.vue

@@ -455,7 +455,7 @@
         </div>
       </div>
     </div>
-    <AddCondition v-show="isCondition == 1" @handleSubmitCon="handleSubmitCon"  :isShow="isShow" :isFlag="isFlag"/>
+    <AddCondition v-show="isCondition == 1" :code="searchForm.code" @handleSubmitCon="handleSubmitCon" @back="handleBack"  :isShow="isShow" :isFlag="isFlag" :isCondition="isCondition"/>
   </div>
 </template>
 
@@ -1005,6 +1005,10 @@ export default {
     handleReset() {
       Object.assign(this.$data, this.$options.data())
       this.getCommonApi()
+    },
+    handleBack(){
+      this.isCondition = 0 
+      this.$emit('upDataIsFlag')
     }
   },
   components: {

+ 4 - 1
src/views/sales_policy/components/Examine.vue

@@ -569,7 +569,7 @@
         </div>
       </div>
     </div>
-    <AddCondition v-else :id="cid" @close="handleConditionClose" />
+    <AddCondition v-else :id="cid" @close="handleConditionClose" @back="handleBack" :isEdit="isEdit" />
   </div>
 </template>
 
@@ -780,6 +780,9 @@ export default {
       this.currentPages = 1
       this.getCond()
     },
+    handleBack() {
+      this.isEdit = 1
+    },
     // 检查文件类型
     checkFileType(url) {
       if (!url) return ''

+ 4 - 1
src/views/sales_policy/components/details.vue

@@ -642,7 +642,7 @@
         </div>
       </div>
     </div>
-    <AddCondition v-else :id="cid" @close="handleConditionClose" />
+    <AddCondition v-else :id="cid" @close="handleConditionClose" @back="handleBack" :isEdit="isEdit" :isShow="isShow"/>
   </div>
 </template>
 
@@ -761,6 +761,9 @@ export default {
       const title = '详情页'
       return title
     },
+    handleBack(){
+      this.isEdit = 1
+    },
     getList() {
       this.listLoading = true
       getPolicyDetail({ policyId: this.id }).then(res => {

+ 30 - 9
src/views/sales_policy/components/editPolicy.vue

@@ -459,8 +459,26 @@
         </div>
       </div>
     </div>
-    <AddCondition v-show="isCondition === 1" ref="comDom" @handleSubmitCon="handleSubmitCon" :isShow="isShow" :isFlag="isFlag"/>
-    <AddCondition v-show="isCondition === 2" :id="cid" ref="cond" :isShow="isShow" :isFlag="isFlag"/>
+    <AddCondition
+      v-show="isCondition === 1"
+      ref="comDom"
+      :code="searchForm.code"
+      @handleSubmitCon="handleSubmitCon"
+      @back="handleBack"
+      :isShow="isShow"
+      :isFlag="isFlag"
+      :isCondition="isCondition"
+    />
+    <AddCondition
+      v-show="isCondition === 2"
+      :id="cid"
+      ref="cond"
+      :code="searchForm.code"
+      :isShow="isShow"
+      :isFlag="isFlag"
+      @back="handleBack"
+      :isCondition="isCondition"
+    />
   </div>
 </template>
 
@@ -496,11 +514,11 @@ export default {
       type: String,
       default: ''
     },
-    isShow:{
-      type: Number,
+    isShow: {
+      type: Number
     },
-    isFlag:{
-      type: [Number,String],
+    isFlag: {
+      type: [Number, String]
     }
   },
   directives: {
@@ -593,9 +611,7 @@ export default {
     })
   },
 
-  created() {
-
-  },
+  created() {},
   methods: {
     ...mapMutations('sales', ['initData']),
     handleStatus(id, status) {
@@ -1067,6 +1083,11 @@ export default {
     handleReset() {
       Object.assign(this.$data, this.$options.data())
       this.getCommonApi()
+    },
+    handleBack() {
+      this.isCondition = 0
+ 
+      this.$emit('upDataIsFlag')
     }
   },
   components: {

+ 19 - 3
src/views/sales_policy/policy_list.vue

@@ -11,10 +11,23 @@
   >
     <Popu v-if="isShow !== 1">
       <el-page-header slot="head" :content="content" @back="handleClose" />
-      <AddPolicy v-if="isShow === 2" @close="handleClose" :isShow="isShow" :isFlag="isFlag"/>
-      <EditPolicy v-if="isShow === 3" :id="id" @close="handleClose" :isShow="isShow" :isFlag="isFlag"/>
+      <AddPolicy
+        v-if="isShow === 2"
+        @close="handleClose"
+        @upDataIsFlag="upDataIsFlag"
+        :isShow="isShow"
+        :isFlag="isFlag"
+      />
+      <EditPolicy
+        v-if="isShow === 3"
+        :id="id"
+        @close="handleClose"
+        @upDataIsFlag="upDataIsFlag"
+        :isShow="isShow"
+        :isFlag="isFlag"
+      />
       <Details v-if="isShow === 4" @close="handleClose" :id="id" :isShow="isShow" />
-      <Examine v-if="isShow === 5" @close="handleClose" :id="id" :isShow="isShow"/>
+      <Examine v-if="isShow === 5" @close="handleClose" :id="id" :isShow="isShow" />
     </Popu>
   </template-page>
 </template>
@@ -166,6 +179,9 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
+    upDataIsFlag() {
+      this.isFlag = 1
+    },
     handleClose() {
       this.addOff(() => {
         this.isShow = 1