From db8f49a69a6f4e5e91ddc337b7c87d782997c974 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期四, 24 十月 2024 09:11:51 +0800
Subject: [PATCH] lkk 10.24

---
 src/views/system/user/index.vue |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 3f2accd..7ad4673 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -9,7 +9,7 @@
         </div>
         <div class="head-container">
           <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
-            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
+            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all  :default-expanded-keys="treeId" highlight-current
             @node-click="handleNodeClick" />
         </div>
       </el-col>
@@ -21,8 +21,9 @@
             <el-input v-model="queryParams.nickName" placeholder="璇疯緭鍏ョ敤鎴峰悕绉�" clearable style="width: 180px"
               @keyup.enter.native="handleQuery" />
           </el-form-item>
-          <el-form-item label="鎵嬫満鍙风爜" prop="phonenumber">
-            <el-input v-model="queryParams.phonenumber" placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" clearable style="width: 180px"
+          
+          <el-form-item label="鐢ㄦ埛宸ュ彿" prop="userName">
+            <el-input v-model="queryParams.userName" placeholder="璇疯緭鍏ョ敤鎴峰伐鍙�" clearable style="width: 180px"
               @keyup.enter.native="handleQuery" />
           </el-form-item>
           <el-form-item label="鐘舵��" prop="status">
@@ -192,6 +193,13 @@
           <el-input v-model="form.userId" placeholder="璇疯緭鍏ョ敤鎴穒d" />
         </el-form-item> -->
           <el-form-item label="鐢ㄦ埛鍚嶇О" prop="nickName">
+             <span
+            slot="label"
+            style="display: inline-block; border-bottom: 2px solid blue"
+            @click="handlePackage"
+          >
+            鐢ㄦ埛鍚嶇О
+          </span>
             <el-input v-model="form.nickName" placeholder="璇疯緭鍏ョ敤鎴锋樀绉�" maxlength="30" style="width: 130px" />
           </el-form-item>
           <el-form-item label="鐢ㄦ埛宸ュ彿" prop="userName">
@@ -634,7 +642,7 @@
     </div>
 
     <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <!-- <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
         :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
@@ -654,7 +662,7 @@
         <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
         <el-button @click="upload.open = false">鍙� 娑�</el-button>
       </div>
-    </el-dialog>
+    </el-dialog> -->
 
     <!-- 閲嶇疆瀵嗙爜瀵硅瘽妗� -->
     <el-dialog title="鎻愮ず" :visible.sync="dialogVisible1" width="30%" :before-close="handleClose">
@@ -672,10 +680,12 @@
         <el-button type="primary" @click="tijiao">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <yonghu ref="aaa" @add="handleChanges" />
   </div>
 </template>
 
 <script>
+import yonghu from "@/components/yonghu";
 import {
   listUser,
   getUser,
@@ -714,7 +724,7 @@
     "dict_user_work",
     "dict_qhdm",
   ],
-  components: { Treeselect },
+  components: { Treeselect, yonghu },
   data() {
     let checkPhoneNum = (rule, value, callback) => {
          console.log( value)
@@ -739,6 +749,7 @@
       userInfoList: [],
       hospList: [],
       activeNames: ["1"],
+      treeId: [],
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -891,8 +902,17 @@
   watch: {
     // 鏍规嵁鍚嶇О绛涢�夐儴闂ㄦ爲
     deptName(val) {
-      this.$refs.tree.filter(val);
+      console.log(val)
     },
+    treeId(newVal, oldVal) {
+      if (newVal) {
+        this.$nextTick(() => {
+          document
+            .querySelector('.el-tree-node__children .el-tree-node__content')
+            .click();
+        });
+      }
+    }
   },
   computed: {
     type() {
@@ -903,8 +923,9 @@
     }
   },
   created() {
-    this.getList();
     this.getDeptTree();
+    this.getList();
+   
     // this.getRoleList();
     // this.getConfigKey("sys.user.initPassword").then((response) => {
     //   this.initPassword = response.msg;
@@ -915,7 +936,8 @@
     /** 鏌ヨ鐢ㄦ埛鍒楄〃 */
     getList() {
       this.loading = true;
-      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
+      if(this.queryParams.deptId){
+        listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
         (response) => {
           response.rows.forEach((item, index) => {
             item.newID =
@@ -928,6 +950,8 @@
           this.loading = false;
         }
       );
+      }
+      
     },
     /** 鏌ヨ宀椾綅鍒楄〃 */
     getPostList() {
@@ -960,6 +984,10 @@
     getDeptTree() {
       deptTreeSelect().then((response) => {
         this.deptOptions = response.data;
+        console.log( this.deptOptions)
+        this.treeId.push(this.deptOptions[0].id)
+        this.queryParams.deptId = this.deptOptions[0].id
+        console.log(this.queryParams.deptId)
       });
     },
     // 绛涢�夎妭鐐�
@@ -972,6 +1000,19 @@
       this.queryParams.deptId = data.id;
       this.handleQuery();
     },
+     handlePackage() {
+      this.$refs.aaa.open = true;
+      this.$refs.aaa.getList();
+      this.$refs.aaa.title = "鏁版嵁瀛楀吀";
+    },
+    handleChanges(param1) {
+      this.form.nickName = param1[0].staffName;
+      // this.form.hisPacId = param1[0].pacId;
+      // if (param1[0].price) {
+      //   this.form.counterPrice = param1[0].price;
+      //   this.form.retailPrice = param1[0].price;
+      // }
+    },
     // 鐢ㄦ埛鐘舵�佷慨鏀�
     handleStatusChange(row) {
       let text = row.status === "0" ? "鍚敤" : "鍋滅敤";

--
Gitblit v1.8.0