From ba6e43f9c2b2c4724b961e584de89546b4b21f32 Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期三, 13 九月 2023 16:01:20 +0800
Subject: [PATCH] su

---
 src/views/system/user/index.vue |   75 +++++++++++++++++++++++++++++++------
 1 files changed, 63 insertions(+), 12 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 146e883..c3a6932 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -650,6 +650,27 @@
         <el-button @click="upload.open = false">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
+    <!-- 閲嶇疆瀵嗙爜瀵硅瘽妗� -->
+    <el-dialog
+      title="鎻愮ず"
+      :visible.sync="dialogVisible1"
+      width="30%"
+      :before-close="handleClose">
+      <el-form>
+        <span>璇疯緭鍏モ�渰{row.userName}}鈥濈殑鏂板瘑鐮�</span>
+        <el-form-item>
+          <el-input v-model="password" :type="type" auto-complete="off" placeholder="瀵嗙爜" ref="barcodeMsg">
+            <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
+            <i slot="suffix" class="icon-style" :class="elIcon" autocomplete="auto" @click="flag = !flag" /></el-input>
+        </el-form-item>
+      </el-form>
+      
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="tijiao">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -694,6 +715,10 @@
   components: { Treeselect },
   data() {
     return {
+      row:[],
+      flag: false,
+      password:"",
+      dialogVisible1:false,
       nums: "",
       userInfoList: [],
       hospList: [],
@@ -840,6 +865,14 @@
     deptName(val) {
       this.$refs.tree.filter(val);
     },
+  },
+  computed: {
+    type() {
+      return this.flag ? "text" : "password";
+    },
+    elIcon() {
+      return this.flag ? "el-icon-minus" : "el-icon-view";
+    }
   },
   created() {
     this.getList();
@@ -1073,19 +1106,37 @@
     },
     /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */
     handleResetPwd(row) {
-      this.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        closeOnClickModal: false,
-        inputPattern: /^.{5,20}$/,
-        inputErrorMessage: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿",
+      console.log(row);
+      this.dialogVisible1 = true;
+      this.row = row;
+      // this.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", {
+      //   confirmButtonText: "纭畾",
+      //   cancelButtonText: "鍙栨秷",
+      //   closeOnClickModal: false,
+      //   inputPattern: /^.{5,20}$/,
+      //   inputErrorMessage: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿",
+      //   inputType:'password'
+      // })
+      //   .then(({ value }) => {
+      //     resetUserPwd(row.userId, value).then((response) => {
+      //       this.$modal.msgSuccess("淇敼鎴愬姛");
+      //       // 锛屾柊瀵嗙爜鏄細" + value
+      //     });
+      //   })
+      //   .catch(() => { });
+    },
+    tijiao(){
+      let data = {
+        password:this.password,
+        userId:this.row.userId,
+      }
+      resetUserPwd(data).then(res=>{
+        console.log(res);
+        if(res.code == 200){
+          this.$modal.msgSuccess("淇敼鎴愬姛");
+          this.dialogVisible1 = false;
+        }
       })
-        .then(({ value }) => {
-          resetUserPwd(row.userId, value).then((response) => {
-            this.$modal.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value);
-          });
-        })
-        .catch(() => { });
     },
     /** 鍒嗛厤瑙掕壊鎿嶄綔 */
     handleAuthRole: function (row) {

--
Gitblit v1.8.0