| | |
| | | </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> |
| | |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table :data="userList" border @selection-change="handleSelectionChange" v-loading="loading" |
| | | <el-table :data="userList" border @selection-change="handleSelectionChange" v-loading="loading" |
| | | highlight-current-row> |
| | | <el-table-column type="selection" width="50" align="center" fixed="left" /> |
| | | <el-table-column label="序号" align="center" key="newID" prop="newID" width="50px" fixed="left" /> |
| | |
| | | <!-- <el-input v-model="form.nationDesc" placeholder="请输入民族描述"/> --> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="所在院区" prop="hospName"> |
| | | <el-select v-model="form.hospName" placeholder="请选择所在院区" clearable style="width: 200px" filterable> |
| | | <el-form-item label="所在医院" prop="hospId"> |
| | | <el-select v-model="form.hospId" placeholder="请选择所在医院" clearable style="width: 200px" filterable |
| | | @change="sendhospName"> |
| | | <el-option v-for="dict in hospList" :key="dict.hospAreaName" :label="dict.hospAreaName" |
| | | :value="dict.hospAreaId" /> |
| | | </el-select> |
| | | <!-- <el-input v-model="form.hospName" placeholder="请输入组织中文名称" /> --> |
| | | </el-form-item> |
| | | <el-form-item label="归属科室" prop="deptId"> |
| | | <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属科室" |
| | | style="width: 200px" /> |
| | | <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属科室" |
| | | style="width: 200px" /> --> |
| | | <el-select v-model="form.deptId" placeholder="请选择归属科室" clearable style="width: 200px" filterable> |
| | | <el-option v-for="dict in DepartmentList" :key="dict.deptName" :label="dict.deptName" |
| | | :value="dict.deptId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="入职日期" prop="entryDate"> |
| | |
| | | <el-input v-model="form.medicalId" placeholder="请输入医保编码" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="优惠折扣"> |
| | | <el-input-number ref="inputNumber" style="width: 200px" v-model="form.discount" :precision="2" |
| | | :step="0.1" :max="10" :min="1" @change="numberChange"></el-input-number> |
| | | <el-input-number ref="inputNumber" style="width: 200px" v-model="form.discount" :precision="2" :step="0.1" |
| | | :max="10" :min="1" @change="numberChange"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="现住址" prop="liveAddr"> |
| | | <el-input v-model="form.userInfo.liveAddr" placeholder="请输入现居住地址" style="width: 440px" /> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- 重置密码对话框 --> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="dialogVisible1" |
| | | width="30%" |
| | | :before-close="handleClose"> |
| | | <el-dialog title="提示" :visible.sync="dialogVisible1" width="30%" :before-close="handleClose"> |
| | | <el-form :rules="rules1"> |
| | | <span>请输入“{{row.userName}}”的新密码</span> |
| | | <span>请输入“{{ row.userName }}”的新密码</span> |
| | | <el-form-item prop="password"> |
| | | <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 @click="dialogVisible1 = false">取 消</el-button> |
| | | <el-button type="primary" @click="tijiao">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | resetUserPwd, |
| | | changeUserStatus, |
| | | deptTreeSelect, |
| | | getUserInfo, |
| | | getDeptListByDictHospId, |
| | | } from "@/api/system/user"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { getInfo } from "@/api/login"; |
| | | import { listHosp } from "@/api/hosp/hosp"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | |
| | | ], |
| | | components: { Treeselect }, |
| | | data() { |
| | | let checkPhoneNum = (rule, value, callback) => { |
| | | console.log( value) |
| | | let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/); |
| | | if (value == "" && value == undefined && !value) { |
| | | console.log(11111) |
| | | return callback(''); |
| | | } else if(value != undefined && value != ""){ |
| | | console.log(22222) |
| | | return callback(); |
| | | }else if (!patter.test(value)) { |
| | | console.log(33333) |
| | | return callback(''); |
| | | } |
| | | }; |
| | | return { |
| | | row:[], |
| | | row: [], |
| | | flag: false, |
| | | password:"", |
| | | dialogVisible1:false, |
| | | password: "", |
| | | dialogVisible1: false, |
| | | nums: "", |
| | | userInfoList: [], |
| | | hospList: [], |
| | | activeNames: ["1"], |
| | | treeId: [], |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | |
| | | dialogVisible: false, |
| | | // 用户表格数据 |
| | | sysUserList: [], |
| | | DepartmentList: [], |
| | | // 岗位表格数据 |
| | | postList: [], |
| | | // 角色表格数据 |
| | |
| | | brithday: "", |
| | | nationDesc: "", |
| | | entryDate: "", |
| | | hospName: "", |
| | | hospName: "", |
| | | }, |
| | | }, |
| | | forms: {}, |
| | |
| | | // 表单校验 |
| | | rules: { |
| | | userName: [ |
| | | { required: true, message: "用户名称不能为空", trigger: "blur" }, |
| | | { required: true, validator: checkPhoneNum, trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 20, |
| | | message: "用户名称长度必须介于 2 和 20 之间", |
| | | validator: checkPhoneNum, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | nickName: [ |
| | | { required: true, message: "用户昵称不能为空", trigger: "blur" }, |
| | | { required: true, validator: checkPhoneNum, trigger: "blur" }, |
| | | ], |
| | | password: [ |
| | | { required: true, message: "用户密码不能为空", trigger: "blur" }, |
| | | { required: true, validator: checkPhoneNum, trigger: "blur" }, |
| | | { |
| | | min: 5, |
| | | max: 20, |
| | | message: "用户密码长度必须介于 5 和 20 之间", |
| | | validator: checkPhoneNum, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | email: [ |
| | | { |
| | | type: "email", |
| | | message: "请输入正确的邮箱地址", |
| | | validator: checkPhoneNum, |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | phonenumber: [ |
| | | { |
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
| | | message: "请输入正确的手机号码", |
| | | validator: checkPhoneNum, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | rules1: { |
| | | password: [ |
| | | { required: true, message: "用户密码不能为空", trigger: "blur" }, |
| | | { |
| | | min: 5, |
| | | max: 20, |
| | | message: "用户密码长度必须介于 5 和 20 之间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | // password: [ |
| | | // { required: true, message: "用户密码不能为空", trigger: "blur" }, |
| | | // { |
| | | // min: 5, |
| | | // max: 20, |
| | | // message: "用户密码长度必须介于 5 和 20 之间", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | deptName(val) { |
| | | this.$refs.tree.filter(val); |
| | | }, |
| | | treeId(newVal, oldVal) { |
| | | if (newVal) { |
| | | this.$nextTick(() => { |
| | | document |
| | | .querySelector('.el-tree-node__children .el-tree-node__content') |
| | | .click(); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | type() { |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getDeptTree(); |
| | | this.getList(); |
| | | |
| | | // this.getRoleList(); |
| | | // this.getConfigKey("sys.user.initPassword").then((response) => { |
| | | // this.initPassword = response.msg; |
| | |
| | | getlistHosp() { |
| | | listHosp(this.queryParams).then((response) => { |
| | | this.hospList = response.rows; |
| | | |
| | | this.total = response.total; |
| | | }); |
| | | }, |
| | |
| | | getDeptTree() { |
| | | deptTreeSelect().then((response) => { |
| | | this.deptOptions = response.data; |
| | | this.treeId.push(this.deptOptions[0].id) |
| | | this.queryParams.deptId = this.deptOptions[0].id |
| | | }); |
| | | }, |
| | | // 筛选节点 |
| | |
| | | this.title = "用户信息维护"; |
| | | this.getPostList(); |
| | | this.getlistHosp(); |
| | | getInfo(this.queryParams).then((response) => { |
| | | this.form.hospId = response.user.hospId; |
| | | if (this.form.hospId) { |
| | | this.sendhospName() |
| | | } |
| | | }); |
| | | // getUser().then((response) => { |
| | | // this.postOptions = response.posts; |
| | | // this.roleOptions = response.roles; |
| | |
| | | // }); |
| | | }, |
| | | |
| | | sendhospName() { |
| | | let data = { |
| | | id: this.form.hospId |
| | | } |
| | | getDeptListByDictHospId(data).then(res => { |
| | | this.DepartmentList = res.data |
| | | }) |
| | | }, |
| | | |
| | | handleUp(row) { |
| | | this.title = "用户信息维护"; |
| | | 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.getlistHosp(); |
| | | this.reset(); |
| | | this.form = row; |
| | | if (this.form.hospId) { |
| | | this.sendhospName() |
| | | } |
| | | // this.form.userInfo.id = null; |
| | | // if(this.form.userInfo != null){ |
| | | // this.forms = this.form.userInfo; |
| | |
| | | // }) |
| | | // .catch(() => { }); |
| | | }, |
| | | tijiao(){ |
| | | let data = { |
| | | password:this.password, |
| | | userId:this.row.userId, |
| | | } |
| | | resetUserPwd(data).then(res=>{ |
| | | if(res.code == 200){ |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.dialogVisible1 = false; |
| | | tijiao() { |
| | | if (this.password) { |
| | | let data = { |
| | | password: this.password, |
| | | userId: this.row.userId, |
| | | } |
| | | }) |
| | | resetUserPwd(data).then(res => { |
| | | if (res.code == 200) { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.dialogVisible1 = false; |
| | | } |
| | | }) |
| | | } else { |
| | | this.$modal.msgError("用户名密码不能为空"); |
| | | } |
| | | |
| | | }, |
| | | /** 分配角色操作 */ |
| | | handleAuthRole: function (row) { |