|
|
@@ -44,11 +44,16 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="passUpdate(scope.row)">修改密码</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
|
|
<el-button size="mini" type="text" style="color: red;" @click="handelDel(scope.row.id)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<!-- 分页 -->
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.limit"
|
|
|
@pagination="getList" />
|
|
|
@@ -159,17 +164,56 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 修改密码 -->
|
|
|
+ <el-dialog title="修改密码" :visible.sync="openPass" width="700px" append-to-body destroy-on-close>
|
|
|
+ <el-form ref="formPass" :model="formPass" :rules="rulesPass" label-width="110px">
|
|
|
+ <el-form-item label="旧密码" prop="oldPassword">
|
|
|
+ <el-input v-model="formPass.oldPassword" placeholder="请输入旧密码" type="password" show-password />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="新密码" prop="newPassword">
|
|
|
+ <el-input v-model="formPass.newPassword" placeholder="请输入新密码" type="password" show-password />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="确认密码" prop="confirmPassword">
|
|
|
+ <el-input
|
|
|
+ v-model="formPass.confirmPassword"
|
|
|
+ placeholder="请确认新密码"
|
|
|
+ type="password"
|
|
|
+ show-password
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini" @click="submit">修改</el-button>
|
|
|
+ <el-button type="danger" size="mini" @click="close">关闭</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listData, doctorSave, doctorDel,departmentList } from "@/api/doctor/physician";
|
|
|
+import { updateUserPwd } from "@/api/system/user";
|
|
|
export default {
|
|
|
name: "physician_list",
|
|
|
dicts: ['department', 'dict_sex', 'dict_status', 'physician_title'],
|
|
|
components: {},
|
|
|
data() {
|
|
|
+ const equalToPassword = (rule, value, callback) => {
|
|
|
+ if (this.formPass.newPassword !== value) {
|
|
|
+ callback(new Error("两次输入的密码不一致"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
+ // 修改密码弹出层
|
|
|
+ openPass: false,
|
|
|
+ formPass: {
|
|
|
+ oldPassword: undefined,
|
|
|
+ newPassword: undefined,
|
|
|
+ confirmPassword: undefined
|
|
|
+ },
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 显示搜索条件
|
|
|
@@ -191,6 +235,24 @@ export default {
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
|
|
|
+ },
|
|
|
+ rulesPass:{
|
|
|
+ oldPassword:[
|
|
|
+ { required: true, message: "旧密码不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ newPassword: [
|
|
|
+ { required: true, message: "新密码不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*]).{8,19}$/,
|
|
|
+ message:
|
|
|
+ "密码长度必须大于8位数小于20位数且包含大小写字母,数字,特殊字符(!@#$%^&*)",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ confirmPassword: [
|
|
|
+ { required: true, message: "确认密码不能为空", trigger: "blur" },
|
|
|
+ { required: true, validator: equalToPassword, trigger: "blur" }
|
|
|
+ ],
|
|
|
},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
@@ -257,6 +319,33 @@ export default {
|
|
|
this.getdepartmentList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ submit() {
|
|
|
+ this.$refs["formPass"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ updateUserPwd(this.formPass.id, this.formPass.oldPassword, this.formPass.newPassword).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.close()
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.openPass = false
|
|
|
+ this.formPass = {
|
|
|
+ oldPassword: undefined,
|
|
|
+ newPassword: undefined,
|
|
|
+ confirmPassword: undefined
|
|
|
+ };
|
|
|
+ },
|
|
|
+ passUpdate(row){
|
|
|
+ this.formPass = {
|
|
|
+ oldPassword: undefined,
|
|
|
+ newPassword: undefined,
|
|
|
+ confirmPassword: undefined
|
|
|
+ };
|
|
|
+ this.openPass = true
|
|
|
+ this.formPass.id = row.id
|
|
|
+ },
|
|
|
/** 查询医师列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|