diff --git a/pages/apply/subPages/SK/safeCheckRecordEditNew.vue b/pages/apply/subPages/SK/safeCheckRecordEditNew.vue index 00a0eb8..f32a554 100644 --- a/pages/apply/subPages/SK/safeCheckRecordEditNew.vue +++ b/pages/apply/subPages/SK/safeCheckRecordEditNew.vue @@ -62,7 +62,7 @@ 检查内容 - + - + @@ -88,7 +88,7 @@ - + @@ -99,20 +99,20 @@ - + - + - + @@ -133,7 +133,7 @@ - + @@ -506,14 +506,14 @@ }) }, - handleDelQuestion(index) { - this.model.Nav_CheckRecordDetails[index].Nav_Question = {} - this.model.Nav_CheckRecordDetails[index].CHECK_QUESTION_ID = '' + handleDelQuestion(item) { + item.Nav_Question = {} + item.CHECK_QUESTION_ID = '' this.$forceUpdate() }, - handleDelRowBefore(index) { - this.nowIndex = index - this.showDelModalIndex = index + handleDelRowBefore(item) { + item.IS_DELETED = true + this.$forceUpdate() }, confirmDel() { @@ -567,15 +567,6 @@ } - }, - handleShowSheetForArea(item, todo) { - const validDetails = this.model.Nav_CheckRecordDetails.filter(i => !i.IS_DELETED); - const index = validDetails.indexOf(item); - this.handleShowSheet({ - title: todo.title, - name: todo.name, - index: index - }); }, async handleShowSheet(p) { const orgId = uni.getStorageSync('orgId') @@ -630,9 +621,8 @@ if (p.val) { extendRule(json, 'DESCREPTION', 9, p.val); } - let data = this.model.Nav_CheckRecordDetails[p.index] - if (data.CHECK_CONTENTS_ID && data.CHECK_CONTENTS_ID !== '') { - extendRule(json, 'CHECK_CONTENTS_ID', 1, data.CHECK_CONTENTS_ID); + if (p.itemData.CHECK_CONTENTS_ID && p.itemData.CHECK_CONTENTS_ID !== '') { + extendRule(json, 'CHECK_CONTENTS_ID', 1, p.itemData.CHECK_CONTENTS_ID); } json.Sort = 'DESCREPTION' dataSelect = await GetHiddenScripList(json).then(res => { @@ -679,26 +669,23 @@ handleSelected(e) { this.selectorInfo.showPopup = false - const validDetails = this.model.Nav_CheckRecordDetails.filter(i => !i.IS_DELETED); - const index = this.selectorInfo.index; - const realIndex = this.model.Nav_CheckRecordDetails.findIndex(item => item === validDetails[index]); if (this.selectorInfo.name == 'Nav_RiskArea') { - this.model.Nav_CheckRecordDetails[realIndex].Nav_RiskArea = e; - this.model.Nav_CheckRecordDetails[realIndex].RISK_AREA_ID = e.ID; + this.selectorInfo.itemData.Nav_RiskArea = e; + this.selectorInfo.itemData.RISK_AREA_ID = e.ID; } else if (this.selectorInfo.name == 'Nav_Contents') { - this.model.Nav_CheckRecordDetails[realIndex].Nav_Contents = e; - this.model.Nav_CheckRecordDetails[realIndex].CHECK_CONTENTS_ID = e.ID; + this.selectorInfo.itemData.Nav_Contents = e; + this.selectorInfo.itemData.CHECK_CONTENTS_ID = e.ID; } else if (this.selectorInfo.name == 'Nav_Question') { - this.model.Nav_CheckRecordDetails[realIndex].Nav_Question = e; - this.model.Nav_CheckRecordDetails[realIndex].CHECK_QUESTION_ID = e.ID; - this.model.Nav_CheckRecordDetails[realIndex].HIDDEN_LEVEL = e.QUESTION_LEVEL - this.model.Nav_CheckRecordDetails[realIndex].HIDDEN_LEVELName = this.enumsData['SKHiddenLevel'].find(item1 => item1.code === e.QUESTION_LEVEL).name; + this.selectorInfo.itemData.Nav_Question = e; + this.selectorInfo.itemData.CHECK_QUESTION_ID = e.ID; + this.selectorInfo.itemData.HIDDEN_LEVEL = e.QUESTION_LEVEL + this.selectorInfo.itemData.HIDDEN_LEVELName = this.enumsData['SKHiddenLevel'].find(item1 => item1.code === e.QUESTION_LEVEL).name; } }, submit() { - for (let item of this.model.Nav_CheckRecordDetails) { + for (let item of this.model.Nav_CheckRecordDetails.filter(i => !i.IS_DELETED)) { if (!item.Nav_CheckRecordDetailUsers || item.Nav_CheckRecordDetailUsers.length == 0) { uni.showToast({ title: '请选择检查人员',