| | |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:user:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:user:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:user:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | icon="el-icon-upload2" |
| | | size="mini" |
| | | @click="handleImport" |
| | | v-hasPermi="['system:user:import']" |
| | | >导入</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :loading="exportLoading" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:user:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | |
| | |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | class="el-xg" |
| | | icon="el-icon-help" |
| | | @click="handleunlock(scope.row)" |
| | | >解锁</el-button> |
| | | <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-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']"> |
| | | <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"> |
| | | <span class="el-dropdown-link"> |
| | | <i class="el-icon-d-arrow-right el-icon--right"></i>更多 |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item command="handleResetPwd" icon="el-icon-key" |
| | | v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item> |
| | | >重置密码</el-dropdown-item> |
| | | <el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" |
| | | v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item> |
| | | >分配角色</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </template> |
| | |
| | | </el-row> |
| | | |
| | | <!-- 添加或修改参数配置对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-dialog :title="title" :visible.sync="open" width="660px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户昵称" prop="nickName"> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="邮箱" prop="email"> |
| | | <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="机构" prop="orgId"> |
| | | <el-select v-model="form.orgId" filterable clearable placeholder="请选择机构" @change="handleOrgChange"> |
| | | <el-option |
| | | v-for="org in orgOptions" |
| | | :key="org.id" |
| | | :label="org.organizationname" |
| | | :value="org.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="协调员姓名" prop="coordinatorName"> |
| | | <el-input v-model="form.coordinatorName" placeholder="请输入协调员姓名" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="协调员编号" prop="coordinatorNo"> |
| | | <el-input v-model="form.coordinatorNo" placeholder="请输入协调员编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="身份证" prop="idcardno"> |
| | | <el-input v-model="form.idcardno" placeholder="请输入身份证号" maxlength="18" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate } from "@/api/system/user"; |
| | | import { listUser, getUser, delUser, addUser, updateUser, exportUser,handleunlock, resetUserPwd, changeUserStatus, importTemplate } from "@/api/system/user"; |
| | | import { listOrganization } from "@/api/project/organization"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { treeselect } from "@/api/system/dept"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | |
| | | postOptions: [], |
| | | // 角色选项 |
| | | roleOptions: [], |
| | | // 机构选项 |
| | | orgOptions: [], |
| | | // 表单参数 |
| | | form: {}, |
| | | defaultProps: { |
| | |
| | | message: "请输入正确的手机号码", |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | idcardno: [ |
| | | { |
| | | pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, |
| | | message: "请输入正确的身份证号码", |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | |
| | | created() { |
| | | this.getList(); |
| | | this.getTreeselect(); |
| | | this.getOrgList(); |
| | | this.getConfigKey("sys.user.initPassword").then(response => { |
| | | this.initPassword = response.msg; |
| | | }); |
| | |
| | | treeselect().then(response => { |
| | | this.deptOptions = response.data; |
| | | }); |
| | | }, |
| | | /** 查询机构下拉列表 */ |
| | | getOrgList() { |
| | | listOrganization({ pageNum: 1, pageSize: 100000 }).then(response => { |
| | | this.orgOptions = response.rows || []; |
| | | }); |
| | | }, |
| | | /** 机构选择变更,同步机构名称及协调员信息 */ |
| | | handleOrgChange(orgId) { |
| | | const org = this.orgOptions.find(o => o.id === orgId); |
| | | if (org) { |
| | | this.form.orgName = org.organizationname; |
| | | this.form.coordinatorName = org.coordinatorName; |
| | | this.form.coordinatorNo = org.coordinatorNo; |
| | | } else { |
| | | this.form.orgName = undefined; |
| | | this.form.coordinatorName = undefined; |
| | | this.form.coordinatorNo = undefined; |
| | | } |
| | | }, |
| | | // 筛选节点 |
| | | filterNode(value, data) { |
| | |
| | | sex: undefined, |
| | | status: "0", |
| | | remark: undefined, |
| | | orgId: undefined, |
| | | orgName: undefined, |
| | | coordinatorName: undefined, |
| | | coordinatorNo: undefined, |
| | | idcardno: undefined, |
| | | postIds: [], |
| | | roleIds: [] |
| | | }; |
| | |
| | | this.title = "修改用户"; |
| | | this.form.password = ""; |
| | | }); |
| | | }, |
| | | // 解锁 |
| | | handleunlock(row){ |
| | | handleunlock(row.userName).then(response => { |
| | | this.$modal.msgSuccess("解锁成功"); |
| | | }); |
| | | }, |
| | | /** 重置密码按钮操作 */ |
| | | handleResetPwd(row) { |
| | |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .el-xg{ |
| | | color: rgb(40, 194, 91); |
| | | } |
| | | </style> |