liuzhihui vor 2 Jahren
Ursprung
Commit
44a1d16836

+ 8 - 0
CallCenterWeb.UI/RMYY/src/api/systemSetup/roleSetting/userManage.js

@@ -102,3 +102,11 @@ export function GetCompletePhone(params) {
102 102
     params
103 103
   })
104 104
 }
105
+// 重置密码
106
+export function NewResetPwd(data) {
107
+  return request({
108
+    url: 'UserAccount/NewResetPwd',
109
+    method: 'post',
110
+    data
111
+  })
112
+}

+ 72 - 4
CallCenterWeb.UI/RMYY/src/views/systemSetup/roleSetting/userManage/index.vue

@@ -44,7 +44,7 @@
44 44
                 <span v-if="scope.row.F_EnableFlag == 2" style="color: #f56c6c">锁定</span>
45 45
               </template>
46 46
             </el-table-column>
47
-            <el-table-column label="操作" width="200" align="center" class-name="oparate_btn" fixed="right">
47
+            <el-table-column label="操作" width="280" align="center" class-name="oparate_btn" fixed="right">
48 48
               <template slot-scope="scope">
49 49
                 <el-button v-if="scope.row.F_EnableFlag == 1" type="danger" plain @click="onOff(scope.row.F_UserId)">禁用
50 50
                 </el-button>
@@ -58,6 +58,7 @@
58 58
                       scope.row.F_UserCode.toString()
59 59
                     )
60 60
                   ">编辑</el-button>
61
+                <el-button v-show="logincode=='8000'" @click="btn_resetpwd(scope.row.F_UserCode)">重置密码</el-button>
61 62
               </template>
62 63
             </el-table-column>
63 64
           </el-table>
@@ -72,6 +73,26 @@
72 73
         <el-button slot="trigger" size="small" type="primary">上传文件</el-button>
73 74
       </el-upload>
74 75
     </el-dialog>
76
+    <!-- 重置密码 -->
77
+    <el-dialog :visible.sync="dialogPwdVisible" title="重置密码">
78
+       <el-form ref="ruleForm" :model="form" :rules="rules" label-width="100px">
79
+         <el-row>
80
+           <el-col :span="24">
81
+             <el-form-item label="新密码" prop="confirmpas">
82
+               <el-input
83
+                 placeholder="8-20个字符必须包含字母大小写和数字"
84
+                 v-model="form.confirmpas"
85
+                 show-password
86
+                 type="password"
87
+               />
88
+             </el-form-item>
89
+           </el-col>
90
+         </el-row>
91
+         <el-form-item>
92
+           <el-button type="primary" @click="btn_confirmpwd()">确 定</el-button>
93
+         </el-form-item>
94
+       </el-form>
95
+    </el-dialog>
75 96
   </div>
76 97
 </template>
77 98
 
@@ -82,9 +103,8 @@
82 103
     getDelUsers,
83 104
     getUserInput,
84 105
     getUserExport,
85
-    GetCompletePhone
86
-  } from "@/api/systemSetup/roleSetting/userManage";
87
-  import {
106
+    GetCompletePhone,
107
+    NewResetPwd,
88 108
     getDeptTree
89 109
   } from "@/api/systemSetup/roleSetting/userManage";
90 110
   import {
@@ -97,6 +117,8 @@
97 117
   } from "@/utils";
98 118
   import addOrEdit from "./addOrEdit";
99 119
   // import modifyPass from './modifyPass.vue'
120
+  import md5 from 'js-md5';
121
+  import { validPassword, strongvalidPassword } from '@/utils/validate';
100 122
   import Pagination from "@/components/context/Pagination"; // 对el-pagination 二次封装
101 123
   import { encrypt,decrypt } from "@/utils/secretKey"
102 124
   export default {
@@ -105,10 +127,35 @@
105 127
       Pagination,
106 128
     },
107 129
     data() {
130
+      const validatePass = (rule, value, callback) => {
131
+        if (!strongvalidPassword(this.form.confirmpas)) {
132
+          callback(
133
+            new Error(
134
+              '请输入有效的密码(8-20个字符必须包含字母大小写和数字)!'
135
+            )
136
+          )
137
+        } else {
138
+          callback()
139
+        }
140
+      }
108 141
       return {
142
+        logincode: localStorage.getItem('storageUsercode'),
143
+        rules: {
144
+          confirmpas: [{
145
+            required: true,
146
+            trigger: 'blur',
147
+            validator: validatePass
148
+          }]
149
+        },
150
+        form:{
151
+          confirmpas:""
152
+        },
153
+        ruleForm:{},
154
+        resetcode:"",
109 155
         filterText: "",
110 156
         loading: false,
111 157
         dialogTableVisible: false,
158
+        dialogPwdVisible: false,
112 159
         roleId: "",
113 160
         keyword: "",
114 161
         deptid: "",
@@ -159,6 +206,27 @@
159 206
       },
160 207
     },
161 208
     methods: {
209
+      btn_resetpwd(code){
210
+        this.resetcode = code
211
+        this.dialogPwdVisible = true
212
+      },
213
+      btn_confirmpwd(){
214
+        this.$refs.ruleForm.validate((valid) => {
215
+          if (valid) {
216
+            const params = {
217
+              usercode: this.resetcode,
218
+              pwd: md5(this.form.confirmpas)
219
+            }
220
+            NewResetPwd(params).then(res=>{
221
+              if(res.state == 'success'){
222
+                this.$message.success('重置密码成功!')
223
+                this.dialogPwdVisible = false
224
+                this.form.confirmpas = ""
225
+              }
226
+            })
227
+          }
228
+        })
229
+      },
162 230
       clickEye(row,id){
163 231
         row.F_Telephone = decrypt(row.F_TelephoneShow)
164 232
         // const params = {