From cb9fac6f212fe64dbfbd49ba07f5245c1db450ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Mon, 18 Dec 2023 16:10:09 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A1=B9=E7=9B=AE=E5=90=88=E8=A7=84?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectComplianceEvaluationProcess.vue | 4 +++- .../components/StandardList.vue | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/views/workCenter/projectComplianceEvaluationProcess/ProjectComplianceEvaluationProcess.vue b/src/views/workCenter/projectComplianceEvaluationProcess/ProjectComplianceEvaluationProcess.vue index 9a6b1201..43bff5aa 100644 --- a/src/views/workCenter/projectComplianceEvaluationProcess/ProjectComplianceEvaluationProcess.vue +++ b/src/views/workCenter/projectComplianceEvaluationProcess/ProjectComplianceEvaluationProcess.vue @@ -967,6 +967,7 @@ export default { this.$refs.userSelectModal.open() }, handleBatchSelectorOk (list) { + // 转办不走这个方法 if (this.isTransfer) { return } @@ -991,7 +992,8 @@ export default { return } this.dataSource.forEach((item, index) => { - if (this.selectedRowKeys.includes(index)) { + // 给可选人的数据赋值 + if (this.selectedRowKeys.includes(index) && item.canAssignFlag + '' === '1') { item[fieldName] = list.map(tt => tt.id).join(',') item[fieldName + '_dictText'] = list.map(tt => tt.realname + '(' + tt.username + ')').join(',') this.$set(this.dataSource, index, item) diff --git a/src/views/workCenter/projectComplianceEvaluationProcess/components/StandardList.vue b/src/views/workCenter/projectComplianceEvaluationProcess/components/StandardList.vue index b826774c..8ce9617d 100644 --- a/src/views/workCenter/projectComplianceEvaluationProcess/components/StandardList.vue +++ b/src/views/workCenter/projectComplianceEvaluationProcess/components/StandardList.vue @@ -12,7 +12,7 @@ :can-drag="true" :scroll="{x: '100%'}" ref="table" - rowKey="id" + rowKey="tableRowKey" :columns="columns" :dataSource="dataSource" :pagination="ipagination" @@ -128,9 +128,13 @@ export default { }, watch: { echoDataSource: { - handler() { + handler () { if (this.echoDataSource && this.echoDataSource.length > 0) { - this.dataSource = JSON.parse(JSON.stringify(this.echoDataSource)) + const data = JSON.parse(JSON.stringify(this.echoDataSource)) + this.dataSource = data.map((item, index) => { + item.tableRowKey = index + return item + }) } }, immediate: true, @@ -139,6 +143,7 @@ export default { }, methods: { handleAdd () { + this.$refs.selectStandardDrawer.selectedRowKeys = this.dataSource.map(tt => tt.standardNumber) this.$refs.selectStandardDrawer.open(this.projectId) }, batchDel () { @@ -150,7 +155,14 @@ export default { title: this.$t('confirmBatchDeletion'), content: this.$t('deleteAData'), onOk: () => { - this.dataSource = [] + let data = JSON.parse(JSON.stringify(this.dataSource)) + this.dataSource = data.map(item => { + if (this.selectedRowKeys.includes(item.tableRowKey)) { + return null + } + return item + }).filter(tt => !!tt) + console.log(this.dataSource) this.selectedRowKeys = [] this.rowIds = [] } @@ -160,7 +172,7 @@ export default { this.selectedRowKeys = selectedRowKeys }, handleOk (rows) { - this.dataSource = rows.map(item => { + this.dataSource = rows.map((item, index) => { // 默认选中不带入 if (!item.decompositionOrderSource) { item.decompositionOrderSource = '0' @@ -174,6 +186,7 @@ export default { return dictItem }) } + item.tableRowKey = index return item }) },