From 4ed7e70bb2dd379318da4d9454f86264c7fd6b88 Mon Sep 17 00:00:00 2001 From: shikeying <pxzsky@163.com> Date: 星期四, 23 三月 2023 16:26:22 +0800 Subject: [PATCH] 用户列表显示机构名称 --- src/views/system/user/index.vue | 32 ++++++++++++++++++++++---------- 1 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index a3f4872..ca84ed7 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -141,7 +141,7 @@ <el-table-column label="鐢ㄦ埛缂栧彿" align="left" key="id" prop="id" v-if="columns[0].visible" /> <el-table-column label="鐢ㄦ埛鍚嶇О" align="left" key="user_name" prop="user_name" v-if="columns[1].visible" :show-overflow-tooltip="true" /> <el-table-column label="鐢ㄦ埛鏄电О" align="left" key="nick_name" prop="nick_name" v-if="columns[2].visible" :show-overflow-tooltip="true" /> - <el-table-column label="閮ㄩ棬" align="left" key="dept_id" prop="dept_id" v-if="columns[3].visible" :show-overflow-tooltip="true" /> + <el-table-column label="閮ㄩ棬" align="left" key="dept_id" prop="parameter.dept_name" v-if="columns[3].visible" :show-overflow-tooltip="true" /> <el-table-column label="鎵嬫満鍙风爜" align="left" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> <el-table-column label="鐘舵��" align="left" key="status" prop="status" v-if="columns[5].visible"> <template slot-scope="scope"> @@ -418,14 +418,14 @@ // 璁剧疆涓婁紶鐨勮姹傚ご閮� headers: { Authorization: "Bearer " + getToken() }, // 涓婁紶鐨勫湴鍧� - // url: process.env.VUE_APP_BASE_API + "/system/user/import" // url: process.env.VUE_SERVER_URL + "/system/user/importData" - url: "http://localhost:8082/admin" + "/system/user/import" + // url: "http://localhost:8082/admin" + "/system/user/import" + url: globalConf.baseUrl + "/system/user/import" }, // 鏌ヨ鍙傛暟 queryParams: { pageNum: 1, - pageSize: 10, + pageSize: 15, userName: undefined, phonenumber: undefined, status: undefined, @@ -498,10 +498,18 @@ ); }, /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - getTreeselect() { - treeselect(this.queryParams.deptId).then(response => { + getTreeselect(deptId) { + // treeselect(this.queryParams.deptId).then(response => { + // this.deptOptions = response.data; + // }); + if(deptId == undefined || deptId == ""){ + this.$modal.alert("璇烽�夋嫨涓�涓儴闂�"); + return false; + } + treeselect(deptId).then(response => { this.deptOptions = response.data; }); + return true; }, // 2022-12-08锛屽姞杞介《绾ф満鏋勬爲鍒楄〃 @@ -594,7 +602,9 @@ // this.$modal.msgSuccess("璇峰厛閫夋嫨涓�涓《绾ф満鏋�"); // return; // } - this.getTreeselect(); + if(!this.getTreeselect(this.queryParams.deptId)){ + return; + } // getUser().then(response => { getNewUserRoles(this.queryParams.deptId).then(response => { // this.postOptions = response.posts; @@ -603,11 +613,12 @@ this.title = "娣诲姞鐢ㄦ埛"; this.form.password = this.initPassword; }); + }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.reset(); - this.getTreeselect(); + // this.getTreeselect(); // const userId = row.id || this.ids; const userId = row.id; getUser(userId).then(response => { @@ -619,6 +630,7 @@ this.open = true; this.title = "淇敼鐢ㄦ埛"; this.form.password = ""; + this.getTreeselect(this.form.dept_id); }); }, /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */ @@ -678,7 +690,7 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - this.download('system/user/export', { + this.$download('system/user/export', { ...this.queryParams }, `user_${new Date().getTime()}.xlsx`) }, @@ -690,7 +702,7 @@ /** 涓嬭浇妯℃澘鎿嶄綔 */ importTemplate() { // this.download('system/user/select/downloadTemplate', {}, `user_template_${new Date().getTime()}.xlsx`); - this.download('system/user/select/downloadTemplate', {}, `user_template.xlsx`); + this.$download('system/user/select/downloadTemplate', {}, `user_template.xlsx`); }, // 鏂囦欢涓婁紶涓鐞� handleFileUploadProgress(event, file, fileList) { -- Gitblit v1.9.1