From a4d79237c73a1db49649a8d3108eec95a8e67c37 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期一, 11 八月 2025 14:54:02 +0800 Subject: [PATCH] qx --- src/views/system/user/index.vue | 66 +++++++++++++++++++-------------- 1 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index b8a4d2a..bccf0f7 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -36,7 +36,6 @@ :filter-node-method="filterNode" ref="tree" node-key="id" - default-expand-all :default-expanded-keys="treeId" highlight-current @node-click="handleNodeClick" @@ -375,7 +374,7 @@ icon="el-icon-d-arrow-right" title="鏇村" ></el-button> - <el-dropdown-menu slot="dropdown"> + <el-dropdown-menu slot="dropdown" :append-to-body="true"> <el-dropdown-item command="handleResetPwd" icon="el-icon-key" @@ -388,15 +387,6 @@ v-hasPermi="['system:user:edit']" >鍒嗛厤瑙掕壊</el-dropdown-item > - <!-- 娣诲姞鐢ㄦ埛璇︽儏鎸夐挳 鐐瑰嚮璺冲嚭璇ョ敤鎴风殑璇︾粏淇℃伅椤甸潰 --> - <!-- <el-button - size="mini" - type="text" - icon="el-icon-share" - @click="handleSearch(scope.row)" - v-hasPermi="['hosp:Userinfo:list']" - >璇︾粏淇℃伅</el-button - > --> </el-dropdown-menu> </el-dropdown> </template> @@ -564,11 +554,10 @@ </el-select> <!-- <el-input v-model="form.hospName" placeholder="璇疯緭鍏ョ粍缁囦腑鏂囧悕绉�" /> --> </el-form-item> - <el-form-item label="褰掑睘绉戝" prop="deptId"> + <el-form-item label="褰掑睘绉戝" prop="deptId" > <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="璇烽�夋嫨褰掑睘绉戝" style="width: 200px" /> --> - <el-select - v-if="DepartmentList.length > 0" + <el-select v-model="form.deptId" placeholder="璇烽�夋嫨褰掑睘绉戝" clearable @@ -1332,7 +1321,7 @@ </el-collapse> </el-form> <div slot="footer" class="dialog-footer1"> - <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button :disabled="submit" type="primary" @click="submitForm">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> </div> </el-dialog> @@ -1467,6 +1456,7 @@ hospList: [], activeNames: ["1"], treeId: [], + selectedDeptId: null, // 閬僵灞� loading: true, // 閫変腑鏁扮粍 @@ -1475,6 +1465,7 @@ single: true, // 闈炲涓鐢� multiple: true, + submit: false, // 鏄剧ず鎼滅储鏉′欢 showSearch: true, // 鎬绘潯鏁� @@ -1620,6 +1611,7 @@ // 鏍规嵁鍚嶇О绛涢�夐儴闂ㄦ爲 deptName(val) { console.log(val); + this.$refs.tree.filter(val); }, treeId(newVal, oldVal) { if (newVal) { @@ -1720,6 +1712,7 @@ // 鑺傜偣鍗曞嚮浜嬩欢 handleNodeClick(data) { this.queryParams.deptId = data.id; + this.selectedDeptId = data.id; this.handleQuery(); }, handlePackage() { @@ -1754,10 +1747,11 @@ cancel() { this.open = false; this.reset(); - this.$tab.refreshPage(); + // this.$tab.refreshPage(); }, handleClose() { - this.$tab.refreshPage(); + this.cancel(); + // this.$tab.refreshPage(); }, // 琛ㄥ崟閲嶇疆 reset() { @@ -1805,6 +1799,9 @@ this.ids = selection.map((item) => item.userId); this.single = selection.length != 1; this.multiple = !selection.length; + if (selection.length >= 1) { + this.queryParams.userName = selection[0].userName + } }, // 鏇村鎿嶄綔瑙﹀彂 @@ -1835,6 +1832,9 @@ this.sendhospName(); } }); + if (this.selectedDeptId) { + this.form.deptId = this.selectedDeptId; + } // getUser().then((response) => { // this.postOptions = response.posts; // this.roleOptions = response.roles; @@ -1850,22 +1850,24 @@ getDeptListByDictHospId(data).then((res) => { console.log(res, 123456); this.DepartmentList = res.data; - this.form.deptId = String(this.form.deptId); + // this.form.deptId = String(this.form.deptId); }); }, - handleUp(row) { + handleUp(row) { this.title = "鐢ㄦ埛淇℃伅缁存姢"; + + // this.form = row; + this.open = true; - this.form = row; - this.form.hospId = Number(row.hospId); - // listUser(this.addDateRange(this.queryParams, this.dateRange)).then( - // (response) => { - // response.rows.forEach((item, index) => { - // this.form = item; - // }); - // } - // ); + this.submit = false + listUser(this.addDateRange(this.queryParams, this.dateRange)).then( + (response) => { + response.rows.forEach((item, index) => { + this.form = item; + }); + } + ); }, select(val) { this.postList.forEach((item) => { @@ -1881,6 +1883,10 @@ this.getlistHosp(); this.reset(); this.form = row; + this.form = { + ...row, + deptId: row.deptId != null ? String(row.deptId) : null, // 馃憟 纭繚涓哄瓧绗︿覆 + }; if (this.form.hospId) { this.sendhospName(); } @@ -1889,6 +1895,7 @@ // this.forms = this.form.userInfo; // } this.open = true; + this.submit = false this.title = "鐢ㄦ埛淇℃伅缁存姢"; }, @@ -1898,9 +1905,11 @@ this.$refs["form"].validate((valid) => { if (valid) { if (_this.form.userId !== undefined) { + _this.submit = true updateUser(_this.form).then((response) => { _this.$modal.msgSuccess("淇敼鎴愬姛"); _this.open = false; + _this.submit = false _this.getList(); }); } else { @@ -2046,6 +2055,7 @@ width: 600px; /* 璁剧疆鍐呭鐨勫搴︼紝浠ヨЕ鍙戞按骞虫粴鍔ㄦ潯 */ height: 1000px; /* 璁剧疆鍐呭鐨勯珮搴︼紝浠ヨЕ鍙戝瀭鐩存粴鍔ㄦ潯 */ } + .pag { width: 100%; display: flex; -- Gitblit v1.8.0