From ff76fffa2cfc1c588364e53f8e22b9ae47a364a7 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Thu, 4 Jan 2024 15:30:24 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9=E4=BC=81=E6=A0=87?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BF=9D=E5=AD=98=E5=90=8E=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ProcessCommonLayout.vue | 3 +- src/components/SelectUser.vue | 42 +++-- src/components/SelectUserByWorkGroup.vue | 47 +++++- src/enums/commonEnums.js | 7 +- .../AnnualRevisionPlanActivelyReport.vue | 24 ++- .../AnnualRevisionPlanStandardizationInit.vue | 22 ++- .../EnterpriseStandardInitChange.vue | 16 +- .../EnterpriseStandardRevision.vue | 28 ++-- .../module/ConfirmWhetherCommentBaseInfo.vue | 7 +- .../module/DepartLiaisonIssueBaseInfo.vue | 3 + .../module/StandardizationCheckBaseInfo.vue | 143 +++++++++++------- 11 files changed, 236 insertions(+), 106 deletions(-) diff --git a/src/components/ProcessCommonLayout.vue b/src/components/ProcessCommonLayout.vue index 580cb69..bd8733a 100644 --- a/src/components/ProcessCommonLayout.vue +++ b/src/components/ProcessCommonLayout.vue @@ -114,7 +114,7 @@ export default { } getPersonInfoList(param).then(res => { if (res.success) { - console.log(res.result) + console.log('-------------获取人员信息完成', res.result) // 处理人员信息数据,判断每个节点是否能选人 this.personnelInfoData = res.result.map(item => { return { @@ -128,6 +128,7 @@ export default { }, // 从草稿进来填过的人员需要回显 draftInitPersonInfo (personInfoObj) { + console.log('--------------draftInitPersonInfo 草稿进来回显') this.personnelInfoData = this.personnelInfoData.map(item => { return { ...item, diff --git a/src/components/SelectUser.vue b/src/components/SelectUser.vue index 3fa1018..fbc5ef2 100644 --- a/src/components/SelectUser.vue +++ b/src/components/SelectUser.vue @@ -135,6 +135,7 @@ import ListMixin from '../mixins/ListMixin' import CustomHeader from '@/components/CustomHeader' import { queryAllRole, queryDepartTreeList } from '../api/api' +import { getAction } from '@/api/manage' export default { name: 'SelectUser', @@ -167,16 +168,16 @@ export default { default: 'radio' } }, - // watch: { - // selectedData: { - // immediate: true, - // deep: true, - // handler (val) { - // console.log(val) - // this.handleCheckedArr() - // } - // } - // }, + watch: { + selectedData: { + immediate: true, + handler (val) { + if (val) { + this.getUserListByIds(val) + } + } + } + }, data () { return { realname: '', // 搜索框数据 @@ -193,7 +194,8 @@ export default { pageSize: 10 }, url: { - list: '/sys/user/page' + list: '/sys/user/page', + userListByIds: '/sys/user/queryByIds' }, checkedArr: [], selectedDataArr: [], @@ -231,6 +233,12 @@ export default { arr.push(i) } } + for (const i of this.selectedDataArr) { + if (!arr.find(item => item.id === i.id)) { + // 已加载完的列表里还没有的选中数据,按顺序推入 + arr.push(i) + } + } this.selectedDataArr = arr } else { console.log('------------删除了数据------------') @@ -242,6 +250,18 @@ export default { } console.log(this.selectedDataArr) }, + // 根据id获取用户信息,初始化选中数据,不查选中数据的话如果没有划到那一页,名字带不出来 + getUserListByIds (ids) { + const params = {} + params.userIds = ids + getAction(this.url.userListByIds, params).then((res) => { + if (res.success) { + this.selectedDataArr = res.result || [] + } else { + this.$message(res.message) + } + }) + }, handleCheckedArr () { // 清空选中的数据 if (this.type === 'checkbox') { diff --git a/src/components/SelectUserByWorkGroup.vue b/src/components/SelectUserByWorkGroup.vue index ae370fe..309c631 100644 --- a/src/components/SelectUserByWorkGroup.vue +++ b/src/components/SelectUserByWorkGroup.vue @@ -64,7 +64,7 @@ stop-propagation :before-close="handleBeforeClose">