|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<div class="p-2">
|
|
|
<el-row :gutter="20">
|
|
|
- <!-- 部门树 -->
|
|
|
+ <!-- 科室树 -->
|
|
|
<el-col :lg="4" :xs="24" style="">
|
|
|
<el-card shadow="hover">
|
|
|
- <el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
|
|
|
+ <el-input v-model="deptName" placeholder="搜索科室" prefix-icon="Search" clearable />
|
|
|
<el-tree
|
|
|
ref="deptTreeRef"
|
|
|
class="mt-2"
|
|
@@ -23,22 +23,23 @@
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
<el-card shadow="hover">
|
|
|
- <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
- <el-form-item label="用户名称" prop="userName">
|
|
|
- <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" />
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="150px">
|
|
|
+ <el-form-item label="角色" prop="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="登录名/姓名/工号" prop="userName">
|
|
|
+ <el-input v-model="queryParams.userName" placeholder="请输入" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="用户昵称" prop="nickName">
|
|
|
+
|
|
|
+ <!--<el-form-item label="用户昵称" prop="nickName">
|
|
|
<el-input v-model="queryParams.nickName" placeholder="请输入用户昵称" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="手机号码" prop="phonenumber">
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="用户状态" clearable>
|
|
|
- <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="创建时间" style="width: 308px">
|
|
|
<el-date-picker
|
|
|
v-model="dateRange"
|
|
@@ -49,7 +50,7 @@
|
|
|
end-placeholder="结束日期"
|
|
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
|
|
></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
@@ -65,7 +66,7 @@
|
|
|
<el-col :span="1.5">
|
|
|
<el-button v-has-permi="['system:user:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
<el-button v-has-permi="['system:user:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()">
|
|
|
修改
|
|
|
</el-button>
|
|
@@ -84,51 +85,58 @@
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
<el-dropdown-item icon="Download" @click="importTemplate">下载模板</el-dropdown-item>
|
|
|
- <!-- 注意 由于el-dropdown-item标签是延迟加载的 所以v-has-permi自定义标签不生效 需要使用v-if调用方法执行 -->
|
|
|
+ 注意 由于el-dropdown-item标签是延迟加载的 所以v-has-permi自定义标签不生效 需要使用v-if调用方法执行
|
|
|
<el-dropdown-item v-if="checkPermi(['system:user:import'])" icon="Top" @click="handleImport">导入数据</el-dropdown-item>
|
|
|
<el-dropdown-item v-if="checkPermi(['system:user:export'])" icon="Download" @click="handleExport">导出数据</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
- </el-col>
|
|
|
+ </el-col>-->
|
|
|
<right-toolbar v-model:show-search="showSearch" :columns="columns" :search="true" @query-table="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
- <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table v-loading="loading" stripe border :data="userList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
- <el-table-column v-if="columns[0].visible" key="userId" label="用户编号" align="center" prop="userId" />
|
|
|
- <el-table-column v-if="columns[1].visible" key="userName" label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column v-if="columns[2].visible" key="nickName" label="用户昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column v-if="columns[3].visible" key="deptName" label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column v-if="columns[4].visible" key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="120" />
|
|
|
- <el-table-column v-if="columns[5].visible" key="status" label="状态" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
|
|
- </template>
|
|
|
+ <!-- <el-table-column key="userId" label="用户编号" align="center" prop="userId" /> -->
|
|
|
+ <el-table-column key="name" label="姓名" align="center" prop="name" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column key="userName" label="登录名" align="center" prop="userName" :show-overflow-tooltip="true" width="130"/>
|
|
|
+ <el-table-column key="jobNumber" label="工号" align="center" prop="jobNumber" :show-overflow-tooltip="true" width="130">
|
|
|
+ <template #default="scope">
|
|
|
+ {{scope.row.jobNumber?scope.row.jobNumber:'--'}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column v-if="columns[6].visible" label="创建时间" align="center" prop="createTime" width="160">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ scope.row.createTime }}</span>
|
|
|
- </template>
|
|
|
+ <el-table-column key="email" label="用户邮箱" align="center" prop="email" :show-overflow-tooltip="true" width="170" >
|
|
|
+ <template #default="scope">
|
|
|
+ {{scope.row.email?scope.row.email:'--'}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="操作" fixed="right" width="180" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="130" >
|
|
|
+ <template #default="scope">
|
|
|
+ {{scope.row.phonenumber?scope.row.phonenumber:'--'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column key="deptName" label="所属科室" align="center" prop="deptName" :show-overflow-tooltip="true" width="170"/>
|
|
|
+ <el-table-column key="roleName" label="角色" align="center" prop="roleName" :show-overflow-tooltip="true" width="170" />
|
|
|
+ <el-table-column key="loginDate" label="上次登录时间" align="center" prop="loginDate" width="170" />
|
|
|
+ <el-table-column label="操作" fixed="right" width="430" class-name="small-padding fixed-width">
|
|
|
<template #default="scope">
|
|
|
- <el-tooltip v-if="scope.row.userId !== 1" content="修改" placement="top">
|
|
|
- <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
|
|
+ <el-tooltip v-if="scope.row.userId !== 1" content="编辑" placement="top">
|
|
|
+ <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(false,scope.row)">编辑</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip v-if="scope.row.userId !== 1" content="详情" placement="top">
|
|
|
+ <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="View" @click="handleUpdate(true,scope.row)">详情</el-button>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip v-if="scope.row.userId !== 1" content="删除" placement="top">
|
|
|
- <el-button v-hasPermi="['system:user:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
|
|
+ <el-button v-hasPermi="['system:user:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</el-tooltip>
|
|
|
|
|
|
<el-tooltip v-if="scope.row.userId !== 1" content="重置密码" placement="top">
|
|
|
- <el-button v-hasPermi="['system:user:resetPwd']" link type="primary" icon="Key" @click="handleResetPwd(scope.row)"></el-button>
|
|
|
+ <el-button v-hasPermi="['system:user:resetPwd']" link type="primary" icon="Key" @click="handleResetPwd(scope.row)">重置密码</el-button>
|
|
|
</el-tooltip>
|
|
|
|
|
|
<el-tooltip v-if="scope.row.userId !== 1" content="分配角色" placement="top">
|
|
|
- <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)"></el-button>
|
|
|
+ <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)">分配角色</el-button>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -146,103 +154,177 @@
|
|
|
</el-row>
|
|
|
|
|
|
<!-- 添加或修改用户配置对话框 -->
|
|
|
- <el-dialog ref="formDialogRef" v-model="dialog.visible" :title="dialog.title" width="600px" append-to-body @close="closeDialog">
|
|
|
- <el-form ref="userFormRef" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-dialog ref="formDialogRef" v-model="dialog.visible" :title="dialog.title" width="800px" append-to-body @close="closeDialog">
|
|
|
+ <el-form ref="userFormRef" :model="form" :rules="rules" label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="姓名" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入姓名" maxlength="11" :disabled="dialog.disabled"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
|
|
+ <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password :disabled="dialog.disabled" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="用户昵称" prop="nickName">
|
|
|
- <el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
|
|
|
+ <el-form-item label="别名" prop="alias">
|
|
|
+ <el-input v-model="form.alias" placeholder="请输入别名" maxlength="30" :disabled="dialog.disabled" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="归属部门" prop="deptId">
|
|
|
- <el-tree-select
|
|
|
+ <el-form-item label="角色" prop="roleIds">
|
|
|
+ <el-select v-model="form.roleIds" filterable placeholder="请选择" :disabled="dialog.disabled">
|
|
|
+ <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-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="性别" prop="sex">
|
|
|
+ <el-select v-model="form.sex" placeholder="请选择" :disabled="dialog.disabled">
|
|
|
+ <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="所属科室" prop="deptId" >
|
|
|
+ <el-tree-select :disabled="dialog.disabled"
|
|
|
v-model="form.deptId"
|
|
|
:data="enabledDeptOptions"
|
|
|
:props="{ value: 'id', label: 'label', children: 'children' } as any"
|
|
|
value-key="id"
|
|
|
- placeholder="请选择归属部门"
|
|
|
+ placeholder="请选择所属科室"
|
|
|
check-strictly
|
|
|
@change="handleDeptChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="手机号码" prop="phonenumber">
|
|
|
- <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
|
|
+ <el-form-item label="登录名" prop="userName" >
|
|
|
+ <el-input v-model="form.userName" placeholder="请输入登录名" maxlength="30" :disabled="dialog.disabled" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="邮箱" prop="email">
|
|
|
- <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
|
|
+ <el-form-item label="所属科室编码" prop="deptCode">
|
|
|
+ <el-input v-model="form.deptCode" placeholder="请输入" :disabled="dialog.disabled" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工号" prop="jobNumber">
|
|
|
+ <el-input v-model="form.jobNumber" placeholder="请输入工号" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <el-divider />
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
|
|
|
- <el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
|
|
|
+ <el-form-item label="身份证号码" prop="idCard">
|
|
|
+ <el-input v-model="form.idCard" placeholder="请输入身份证号码" :disabled="dialog.disabled" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
|
|
- <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
|
|
|
+ <el-form-item label="现住地址" prop="address">
|
|
|
+ <el-input v-model="form.address" placeholder="请输入现住地址" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="用户性别">
|
|
|
- <el-select v-model="form.sex" placeholder="请选择">
|
|
|
- <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="出生日期" prop="birthDate">
|
|
|
+ <el-input v-model="form.birthDate" placeholder="请输入出生日期" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-form-item label="户籍地址" prop="regAddress">
|
|
|
+ <el-input v-model="form.regAddress" placeholder="请输入户籍地址" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="岗位">
|
|
|
- <el-select v-model="form.postIds" multiple placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in postOptions"
|
|
|
- :key="item.postId"
|
|
|
- :label="item.postName"
|
|
|
- :value="item.postId"
|
|
|
- :disabled="item.status == '1'"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="民族" prop="nation">
|
|
|
+ <el-input v-model="form.nation" placeholder="请输入民族" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="角色" prop="roleIds">
|
|
|
- <el-select v-model="form.roleIds" filterable multiple placeholder="请选择">
|
|
|
- <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 label="政治面貌" prop="political">
|
|
|
+ <el-input v-model="form.political" placeholder="请输入政治面貌" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="婚姻状况" prop="marital">
|
|
|
+ <el-input v-model="form.marital" placeholder="请输入婚姻状况" :disabled="dialog.disabled"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="职称" prop="title">
|
|
|
+ <el-input v-model="form.title" placeholder="请输入职称" :disabled="dialog.disabled"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="学历" prop="education">
|
|
|
+ <el-input v-model="form.education" placeholder="请输入学历" :disabled="dialog.disabled" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="手机号码" prop="phonenumber">
|
|
|
+ <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" :disabled="dialog.disabled"/>
|
|
|
+ </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="请输入电子邮箱" :disabled="dialog.disabled"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="职工简介" prop="intro">
|
|
|
+ <el-input v-model="form.intro" placeholder="请输入" type="textarea" :rows="3" :disabled="dialog.disabled"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="擅长疾病" prop="expertise">
|
|
|
+ <el-input v-model="form.expertise" placeholder="请输入" type="textarea" :rows="6" :disabled="dialog.disabled"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="签名图片" prop="signatureImg">
|
|
|
+ <imageUpload v-model="form.signatureImg" :limit="1" :isShowTip="false" :disabled="dialog.disabled"/>
|
|
|
+ <span style="font-size: 11px;color: red;">上传的签名图片将备用于复核管理的复核人签名</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
@@ -338,7 +420,7 @@ const columns = ref<FieldOption[]>([
|
|
|
{ key: 0, label: `用户编号`, visible: false, children: [] },
|
|
|
{ key: 1, label: `用户名称`, visible: true, children: [] },
|
|
|
{ key: 2, label: `用户昵称`, visible: true, children: [] },
|
|
|
- { key: 3, label: `部门`, visible: true, children: [] },
|
|
|
+ { key: 3, label: `科室`, visible: true, children: [] },
|
|
|
{ key: 4, label: `手机号码`, visible: true, children: [] },
|
|
|
{ key: 5, label: `状态`, visible: true, children: [] },
|
|
|
{ key: 6, label: `创建时间`, visible: true, children: [] }
|
|
@@ -352,6 +434,7 @@ const formDialogRef = ref<ElDialogInstance>();
|
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
visible: false,
|
|
|
+ disabled:false,
|
|
|
title: ''
|
|
|
});
|
|
|
|
|
@@ -391,7 +474,7 @@ const initData: PageData<UserForm, UserQuery> = {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
],
|
|
|
- nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
|
|
+ sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
|
|
|
password: [
|
|
|
{ required: true, message: '用户密码不能为空', trigger: 'blur' },
|
|
|
{
|
|
@@ -409,12 +492,11 @@ const initData: PageData<UserForm, UserQuery> = {
|
|
|
trigger: ['blur', 'change']
|
|
|
}
|
|
|
],
|
|
|
- phonenumber: [
|
|
|
- {
|
|
|
- pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
- message: '请输入正确的手机号码',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ name: [
|
|
|
+ { required: true, message: '姓名不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ deptId: [
|
|
|
+ { required: true, message: '请选择所属科室', trigger: 'blur' }
|
|
|
],
|
|
|
roleIds: [{ required: true, message: '用户角色不能为空', trigger: 'blur' }]
|
|
|
}
|
|
@@ -428,7 +510,7 @@ const filterNode = (value: string, data: any) => {
|
|
|
if (!value) return true;
|
|
|
return data.label.indexOf(value) !== -1;
|
|
|
};
|
|
|
-/** 根据名称筛选部门树 */
|
|
|
+/** 根据名称筛选科室树 */
|
|
|
watchEffect(
|
|
|
() => {
|
|
|
deptTreeRef.value?.filter(deptName.value);
|
|
@@ -438,6 +520,8 @@ watchEffect(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/** 查询用户列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
@@ -447,16 +531,18 @@ const getList = async () => {
|
|
|
total.value = res.total;
|
|
|
};
|
|
|
|
|
|
-/** 查询部门下拉树结构 */
|
|
|
+/** 查询科室下拉树结构 */
|
|
|
const getDeptTree = async () => {
|
|
|
const res = await api.deptTreeSelect();
|
|
|
deptOptions.value = res.data;
|
|
|
enabledDeptOptions.value = filterDisabledDept(res.data);
|
|
|
};
|
|
|
|
|
|
-/** 过滤禁用的部门 */
|
|
|
+const deptJson= ref({});
|
|
|
+/** 过滤禁用的科室 */
|
|
|
const filterDisabledDept = (deptList: DeptTreeVO[]) => {
|
|
|
return deptList.filter((dept) => {
|
|
|
+ deptJson.value[dept.id.toString()]=dept;
|
|
|
if (dept.disabled) {
|
|
|
return false;
|
|
|
}
|
|
@@ -608,12 +694,13 @@ const handleAdd = async () => {
|
|
|
};
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
-const handleUpdate = async (row?: UserForm) => {
|
|
|
+const handleUpdate = async (disabled:boolean,row?: UserForm ) => {
|
|
|
reset();
|
|
|
const userId = row?.userId || ids.value[0];
|
|
|
const { data } = await api.getUser(userId);
|
|
|
dialog.visible = true;
|
|
|
dialog.title = '修改用户';
|
|
|
+ dialog.disabled = disabled;
|
|
|
Object.assign(form.value, data.user);
|
|
|
postOptions.value = data.posts;
|
|
|
roleOptions.value = data.roles;
|
|
@@ -653,7 +740,7 @@ const resetForm = () => {
|
|
|
form.value.status = '1';
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
- getDeptTree(); // 初始化部门数据
|
|
|
+ getDeptTree(); // 初始化科室数据
|
|
|
getList(); // 初始化列表数据
|
|
|
proxy?.getConfigKey('sys.user.initPassword').then((response) => {
|
|
|
initPassword.value = response.data;
|
|
@@ -661,8 +748,8 @@ onMounted(() => {
|
|
|
});
|
|
|
|
|
|
async function handleDeptChange(value: number | string) {
|
|
|
- const response = await optionselect(value);
|
|
|
- postOptions.value = response.data;
|
|
|
- form.value.postIds = [];
|
|
|
+ let dept=deptJson.value[value.toString()]
|
|
|
+ form.value.deptCode=dept.deptCategory;
|
|
|
+ console.log(dept,'+++++++++++++++++',value.toString() );
|
|
|
}
|
|
|
</script>
|