From 46aa44e8f9cb95f691971f3395db99094956705a Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 26 Jun 2024 09:58:40 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=B8=8D=E7=AC=A6=E5=90=88=E9=A1=B9?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../regulatoryComplianceAssessmentDatabase.js | 5 +---- .../nonmatchItem/NonmatchItemList.vue | 15 +++++++++------ .../modules/NonmatchItemCloseModal.vue | 16 ++++------------ 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/api/regulatoryComplianceAssessmentDatabase.js b/src/api/regulatoryComplianceAssessmentDatabase.js index 4bd8ee6..52735a1 100644 --- a/src/api/regulatoryComplianceAssessmentDatabase.js +++ b/src/api/regulatoryComplianceAssessmentDatabase.js @@ -1,11 +1,8 @@ import { getAction, postAction } from './manage' -// 不符合项库-关闭 -const nonmatchItemClose = (params) => postAction('', params) -// 不符合项库-批量关闭 +// 不符合项库-批量关闭-关闭 const nonmatchItemBatchClose = (params) => postAction('/assessment/lawsEvaluationNotMet/batchClose', params) export { - nonmatchItemClose, nonmatchItemBatchClose } diff --git a/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/NonmatchItemList.vue b/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/NonmatchItemList.vue index bf1c516..515ccc2 100644 --- a/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/NonmatchItemList.vue +++ b/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/NonmatchItemList.vue @@ -274,13 +274,16 @@ export default { { text: this.$t('view'), clickEvent: 'handleLook', - has: '' + has: 'lawsEvaluationNotMet:look' }, // 关闭 { text: this.$t('close'), clickEvent: 'handleClose', - has: '' + has: 'lawsEvaluationNotMet:batchClose', + show: (record) => { + return record.rectifyStatus === RectificationState.TO_BE_RECTIFIED.value + } } ], url: { @@ -344,13 +347,13 @@ export default { // 批量关闭 batchClose () { // 只有待整改状态的可以关闭 - const isHaveClosed = this.selectionRows.includes(i => i.rectifyStatus === RectificationState.TARGET_IS_CLOSED.value) + const isHaveClosed = this.selectionRows.find(i => i.rectifyStatus !== RectificationState.TO_BE_RECTIFIED.value) if (isHaveClosed) { // 存在已关闭的数据 this.$message.warning(this.$t('regulatoryComplianceAssessmentDatabase.nonmatchItem.isHaveClosed')) return } - this.$refs.nonmatchItemCloseModal.open({ ids: this.selectedRowKeys.join(',') }) + this.$refs.nonmatchItemCloseModal.open(this.selectedRowKeys.join(',')) }, previewFile (record) { // 截取文件后缀名 @@ -394,12 +397,12 @@ export default { }, // 关闭 handleClose (record) { - this.$refs.nonmatchItemCloseModal.open({ id: record.id }) + this.$refs.nonmatchItemCloseModal.open(record.id) }, filterTreeOption (input, option) { const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label return text.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, + } } } diff --git a/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/modules/NonmatchItemCloseModal.vue b/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/modules/NonmatchItemCloseModal.vue index d793e9b..2896fc2 100644 --- a/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/modules/NonmatchItemCloseModal.vue +++ b/src/views/regulatoryComplianceAssessmentDatabase/nonmatchItem/modules/NonmatchItemCloseModal.vue @@ -86,11 +86,10 @@ export default { } }, methods: { - open (object) { + open (ids) { this.visible = true this.form.resetFields() - this.model.ids = object.ids - this.model.id = object.id + this.model.ids = ids }, handleCancel () { this.close() @@ -101,15 +100,8 @@ export default { if (!err) { this.confirmLoading = true const param = Object.assign({}, values) - let func - if (this.model.ids) { - func = nonmatchItemBatchClose - param.ids = this.model.ids - } else if (this.model.id) { - func = nonmatchItemClose - param.id = this.model.id - } - func(param).then(res => { + param.ids = this.model.ids + nonmatchItemBatchClose(param).then(res => { if (res.success) { this.$message.success(res.message) this.$emit('ok')