|
|
|
@ -51,10 +51,10 @@ |
|
|
|
|
<el-table-column label="部门" key="deptName" prop="deptName" width="100" /> |
|
|
|
|
<el-table-column label="手机号码" prop="mobile" width="120" /> |
|
|
|
|
<el-table-column label="微信号" prop="wxAlias" min-width="80" /> |
|
|
|
|
<el-table-column label="在职状态" key="status" width="120"> |
|
|
|
|
<el-table-column label="在职状态" key="hireStatus" width="120"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-switch |
|
|
|
|
v-model="scope.row.status" |
|
|
|
|
v-model="scope.row.hireStatus" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
active-text="在职" |
|
|
|
@ -65,16 +65,16 @@ |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="启用状态" key="inUse" width="120"> |
|
|
|
|
<el-table-column label="启用状态" key="status" width="120"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-switch |
|
|
|
|
v-model="scope.row.inUse" |
|
|
|
|
v-model="scope.row.status" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
active-text="启用" |
|
|
|
|
inactive-text="禁用" |
|
|
|
|
size="small" |
|
|
|
|
:disabled="scope.row.status == 1" |
|
|
|
|
:disabled="scope.row.hireStatus == 1" |
|
|
|
|
v-hasPermi="['basic:employee:update']" |
|
|
|
|
@change="handleUseChange(scope.row)" |
|
|
|
|
/> |
|
|
|
@ -195,7 +195,7 @@ const openForm = (type: string, id?: number) => { |
|
|
|
|
const handleStatusChange = async (row: UserApi.UserVO) => { |
|
|
|
|
try { |
|
|
|
|
// 修改状态的二次确认 |
|
|
|
|
const text = row.status === CommonStatusEnum.ENABLE ? '入职' : '离职' |
|
|
|
|
const text = row.hireStatus === CommonStatusEnum.ENABLE ? '入职' : '离职' |
|
|
|
|
let result = { value: '' } |
|
|
|
|
if (text == '入职') { |
|
|
|
|
await message.confirm('确认要"' + text + '""' + row.nickname + '"吗?') |
|
|
|
@ -212,14 +212,16 @@ const handleStatusChange = async (row: UserApi.UserVO) => { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 发起修改状态 |
|
|
|
|
await UserApi.updateUserStatus(row.id, row.status, result.value, row.inUse) |
|
|
|
|
await UserApi.updateUserStatus(row.id, row.status, result.value, row.hireStatus) |
|
|
|
|
message.success('修改成功') |
|
|
|
|
// 刷新列表 |
|
|
|
|
await getList() |
|
|
|
|
} catch { |
|
|
|
|
// 取消后,进行恢复按钮 |
|
|
|
|
row.status = |
|
|
|
|
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE |
|
|
|
|
row.hireStatus = |
|
|
|
|
row.hireStatus === CommonStatusEnum.ENABLE |
|
|
|
|
? CommonStatusEnum.DISABLE |
|
|
|
|
: CommonStatusEnum.ENABLE |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -230,7 +232,7 @@ const handleUseChange = async (row: UserApi.UserVO) => { |
|
|
|
|
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '禁用' |
|
|
|
|
await message.confirm('确认要"' + text + '""' + row.nickname + '"吗?') |
|
|
|
|
// 发起修改状态 |
|
|
|
|
await UserApi.updateUserStatus(row.id, row.status, row.retireDate, row.inUse) |
|
|
|
|
await UserApi.updateUserStatus(row.id, row.status, row.retireDate, row.hireStatus) |
|
|
|
|
message.success('修改成功') |
|
|
|
|
// 刷新列表 |
|
|
|
|
await getList() |
|
|
|
|