From a46734b8bd099b4ced0b7a2ff211f5bdca2c1f68 Mon Sep 17 00:00:00 2001 From: zhoulingpo Date: Thu, 18 May 2023 18:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=A4=AB?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/OrgTable.vue | 197 ++++++++++++++++++++++++++++++++++-- src/views/System/Org.vue | 60 ++++++----- 2 files changed, 223 insertions(+), 34 deletions(-) diff --git a/src/components/OrgTable.vue b/src/components/OrgTable.vue index 164ca55..f8e1bf0 100644 --- a/src/components/OrgTable.vue +++ b/src/components/OrgTable.vue @@ -149,6 +149,154 @@ + + + + - 0 ? this.notUserId.toString() : null // getRoleAndUserByOrgIdPage( - if(this.isOrg){ + if(this.isOrg ||this.iscode){ this.$api.org.sysOrgList(param).then((res) => { this.loading.loadData = false this.loading.searching = false @@ -694,10 +846,18 @@ export default { this.tableData = res.data.records const checkedRow = [] this.tableData.map(dataItem => { - const id = dataItem.usid || dataItem.USID || dataItem.orgId || dataItem.id - if (this.checkedIdList.includes(id)) { - checkedRow.push(dataItem) + if(this.isOrg){ + const id = dataItem.usid || dataItem.USID || dataItem.orgId || dataItem.id + if (this.checkedIdList.includes(id)) { + checkedRow.push(dataItem) + } + }else{ + const id = dataItem.departmentCode + if (this.checkedIdList.includes(id)) { + checkedRow.push(dataItem) + } } + }) this.checkedRow(checkedRow) } @@ -843,6 +1003,8 @@ export default { }else if (this.tableData[i].id == row.id && this.isOrg){ this.$refs.orgTable && this.$refs.orgTable.toggleRowSelection(this.tableData[i]) + }else if (this.tableData[i].departmentCode == row.departmentCode && this.iscode){ + this.$refs.orgTable && this.$refs.orgTable.toggleRowSelection(this.tableData[i]) } } }) @@ -942,6 +1104,7 @@ export default { }, watch: { visible (val) { + debugger this.isVisible = val this.tableChecked = null if (this.maxSelected === 1) { @@ -963,7 +1126,15 @@ export default { longName:nameList[index] }) }) - }else{ + }else if(this.isOrg){ + idList.map((id, index) => { + checkedList.push({ + departmentCode:id + + }) + }) + } + else{ idList.map((id, index) => { checkedList.push({ USID: id, @@ -1012,6 +1183,11 @@ export default { id: this.config.value, longName: this.config.valueName }] + }else if(this.iscode){ + this.checkedList = [{ + departmentCode: this.config.value, + // longName: this.config.valueName + }] }else{ this.checkedList = [{ USID: this.config.value, @@ -1034,6 +1210,13 @@ export default { longName: nameList[index] }) }) + }else if(this.isOrg){ + idList.map((id, index) => { + checkedList.push({ + departmentCode: id, + // longName: nameList[index] + }) + }) }else { idList.map((id, index) => { checkedList.push({ diff --git a/src/views/System/Org.vue b/src/views/System/Org.vue index 36eb763..ad9423d 100644 --- a/src/views/System/Org.vue +++ b/src/views/System/Org.vue @@ -89,13 +89,14 @@ - + - + @@ -106,37 +107,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - +
确定
+ @@ -147,6 +128,9 @@ export default { name: 'User', data () { return { + orgTableValName:'', + orgTableVal:'', + visibleOrgTable:false, q: { longName: '', // 用户名 // roleName: '', // 角色名称 @@ -172,6 +156,28 @@ export default { } }, methods: { + isTreeOk(checkedList) { + + const parts = [] + const partsName = [] + checkedList.map((item, index) => { + parts.push(item.departmentCode) + // partsName.push(item.longName) + }) + + this.qcrList = checkedList + this.form.parentID = parts.toString() + // this.form.departmentName = partsName.toString() + + }, + handleClick() { + if (this.dialogTitle == '查看') return + if (this.form.parentID) { + this.orgTableVal = this.form.parentID + this.orgTableValName = '' + } + this.visibleOrgTable = true + }, search () { this.q.page = 1 this.sysOrgList()