| | |
| | | <div class="search_form"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="用户名称" prop="name"> |
| | | <el-input v-model="queryParams.name" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
| | | <el-form-item label="用户名称" prop="nickName"> |
| | | <el-input v-model="queryParams.nickName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="state"> |
| | | <el-select v-model="queryParams.state" placeholder="用户状态" clearable style="width: 240px"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px"> |
| | | <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-col> |
| | | <el-table v-loading="loading" :data="userList"> |
| | | <el-table-column label="序号" align="center" type="index" /> |
| | | <el-table-column label="姓名" align="center" key="name" prop="name" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="账号" align="center" key="account" prop="account" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="角色" align="center" key="roleName" prop="roleName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="状态" align="center" key="state"> |
| | | <el-table-column label="姓名" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="账号" align="center" key="userName" prop="userName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="状态" align="center" key="status"> |
| | | <template slot-scope="scope"> |
| | | <el-switch v-model="scope.row.state" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch> |
| | | <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="手机号码" align="center" key="phone" prop="phone" width="120" /> |
| | | <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
| | | <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="120" /> |
| | | <el-table-column label="操作" align="center" width="160" class-nickName="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button> |
| | | <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>--> |
| | |
| | | </el-row> |
| | | |
| | | <!-- 添加或修改用户配置对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> |
| | | <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body @close="reset"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="姓名" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请输入用户昵称" maxlength="30" /> |
| | | <el-form-item label="姓名" prop="nickName"> |
| | | <el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="账号" prop="account"> |
| | | <el-input v-model="form.account" placeholder="请输入用户昵称" maxlength="30" /> |
| | | <el-form-item label="账号" prop="userName"> |
| | | <el-input v-model="form.userName" placeholder="请输入用户昵称" maxlength="30" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态" prop="state"> |
| | | <el-radio-group v-model="form.state"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="电话号码" prop="phone"> |
| | | <el-input v-model="form.phone" placeholder="请输入手机号码" maxlength="11" /> |
| | | <el-form-item label="电话号码" prop="phonenumber"> |
| | | <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="角色" prop="roleName"> |
| | | <el-select v-model="form.roleName" placeholder="请选择角色" style="width: 100%" clearable> |
| | | <el-option v-for="item in roleOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | <el-form-item label="角色" prop="roleIds"> |
| | | <el-select v-model="form.roleIds" multiple placeholder="请选择角色" clearable> |
| | | <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="年龄" prop="age"> |
| | | <el-input v-model="form.age" placeholder="请输入用户名称" maxlength="30" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="邮箱" prop="email"> |
| | | <el-input v-model="form.email" placeholder="请输入内容"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单位" prop="company"> |
| | | <el-select v-model="form.company" placeholder="请选择岗位" style="width: 100%" clearable> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="employeeID" label="员工号"> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="员工姓名"> |
| | | <el-table-column prop="nickName" label="员工姓名"> |
| | | </el-table-column> |
| | | <el-table-column prop="department" label="部门" min-width="200"> |
| | | </el-table-column> |
| | |
| | | <span class="required-span">* </span>架构名称: |
| | | </el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input v-model="addOb.name" placeholder="请输入架构名称" clearable size="small"></el-input> |
| | | <el-input v-model="addOb.nickName" placeholder="请输入架构名称" clearable size="small"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | import "splitpanes/dist/splitpanes.css"; |
| | | |
| | | export default { |
| | | name: "User", |
| | | nickName: "User", |
| | | dicts: ['sys_normal_disable', 'sys_user_sex'], |
| | | components: { Treeselect, Splitpanes, Pane }, |
| | | data() { |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: undefined, |
| | | phone: undefined, |
| | | state: undefined, |
| | | nickName: undefined, |
| | | phonenumber: undefined, |
| | | status: undefined, |
| | | deptId: undefined |
| | | }, |
| | | // 列信息 |
| | |
| | | ], |
| | | // 表单校验 |
| | | rules: { |
| | | name: [ |
| | | nickName: [ |
| | | { required: true, message: "请填写姓名", trigger: "blur" }, |
| | | ], |
| | | account: [ |
| | | userName: [ |
| | | { required: true, message: "请填写账号", trigger: "blur" } |
| | | ], |
| | | nameEn: [ |
| | | { required: true, message: "请输入姓名EN", trigger: "blur" } |
| | | ], |
| | | state: [ |
| | | status: [ |
| | | { required: true, message: "请选择状态", trigger: "change" } |
| | | ], |
| | | roleName: [ |
| | | roleIds: [ |
| | | { required: true, message: "请选择角色", trigger: "change" } |
| | | ], |
| | | password: [ |
| | | { required: true, message: "密码不能为空", trigger: "blur" }, |
| | | ], |
| | | phone: [ |
| | | phonenumber: [ |
| | | { |
| | | required: true, |
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
| | |
| | | addDia: false, // 添加架构弹框 |
| | | addOb: { |
| | | fatherId: 10001, |
| | | name: '', |
| | | nickName: '', |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | // 提交架构 |
| | | addStandardTree () { |
| | | if (this.addOb.name == null || this.addOb.factory == '') { |
| | | if (this.addOb.nickName == null || this.addOb.factory == '') { |
| | | this.$message.error('构架名称是必填项') |
| | | return |
| | | } |
| | |
| | | this.addDia = false |
| | | this.getList() |
| | | this.addLoad = false |
| | | this.addOb.name = '' |
| | | this.addOb.nickName = '' |
| | | }).catch(e => { |
| | | this.addDia = false |
| | | this.addLoad = false |
| | |
| | | }, |
| | | // 用户状态修改 |
| | | handleStatusChange(row) { |
| | | let text = row.state === "0" ? "启用" : "停用"; |
| | | this.$modal.confirm('确认要"' + text + '""' + row.name + '"用户吗?').then(function() { |
| | | return changeUserStatus(row.userId, row.state); |
| | | let text = row.status === "0" ? "启用" : "停用"; |
| | | this.$modal.confirm('确认要"' + text + '""' + row.nickName + '"用户吗?').then(function() { |
| | | return changeUserStatus(row.userId, row.status); |
| | | }).then(() => { |
| | | this.$modal.msgSuccess(text + "成功"); |
| | | }).catch(function() { |
| | | row.state = row.state === "0" ? "1" : "0"; |
| | | row.status = row.status === "0" ? "1" : "0"; |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | |
| | | this.form = { |
| | | userId: undefined, |
| | | deptId: undefined, |
| | | name: undefined, |
| | | account: undefined, |
| | | phone: undefined, |
| | | nickName: undefined, |
| | | userName: undefined, |
| | | phonenumber: undefined, |
| | | password: undefined, |
| | | nameEn: undefined, |
| | | email: undefined, |
| | | sex: undefined, |
| | | state: "0", |
| | | status: "0", |
| | | company: '', |
| | | roleName: '' |
| | | roleIds: [] |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | searchPerson() { |
| | | let arr = JSON.parse(JSON.stringify(this.personListCopy)) |
| | | this.personList = arr.filter(a => { |
| | | if (a.employeeID.includes(this.userSearch2) || a.name.includes(this.userSearch2)) { |
| | | if (a.employeeID.includes(this.userSearch2) || a.nickName.includes(this.userSearch2)) { |
| | | return true |
| | | } |
| | | }) |
| | |
| | | selectCustomEnum().then(res => { |
| | | this.postOptions = res.data; |
| | | }) |
| | | selectRoleList().then(res => { |
| | | this.roleOptions = res.data; |
| | | }) |
| | | getUser().then(response => { |
| | | this.roleOptions = response.roles; |
| | | this.title = "添加用户"; |
| | | this.form.password = this.initPassword; |
| | | }); |
| | |
| | | selectCustomEnum().then(res => { |
| | | this.postOptions = res.data; |
| | | }) |
| | | selectRoleList().then(res => { |
| | | this.roleOptions = res.data; |
| | | }) |
| | | const userId = row.userId; |
| | | const userId = row.userId || this.ids; |
| | | getUser(userId).then(response => { |
| | | this.form = response.data; |
| | | this.roleOptions = response.roles; |
| | | this.$set(this.form, "roleIds", response.roleIds); |
| | | this.open = true; |
| | | this.title = "修改用户"; |
| | | this.form.password = ""; |
| | |
| | | }, |
| | | /** 重置密码按钮操作 */ |
| | | handleResetPwd(row) { |
| | | this.$prompt('请输入"' + row.name + '"的新密码', "提示", { |
| | | this.$prompt('请输入"' + row.nickName + '"的新密码', "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | closeOnClickModal: false, |