人事优化

This commit is contained in:
zhoutianchi
2026-01-12 16:57:17 +08:00
parent 9fcbfb0fd7
commit 204c163cc1
3 changed files with 58 additions and 28 deletions

View File

@@ -717,7 +717,7 @@
</el-col>
<el-col :span="6">
<!-- 新增时可编辑 编辑时不可编辑 -->
<el-form-item label="部门">
<el-form-item label="部门" prop="professionalStationRelation.deptCodeList">
<el-cascader
:disabled="!isAdd"
v-model="form.professionalStationRelation.deptCodeList"
@@ -1672,6 +1672,19 @@
],
entrySchoolDate: [
{required: true, message: '请选进校时间', trigger: 'blur'},
],
deptCodeList: [
{required: true, message: '请选择部门', trigger: 'change'},
{
validator: (rule: any, value: any, callback: any) => {
if (!value || !Array.isArray(value) || value.length === 0) {
callback(new Error('请选择部门'))
} else {
callback()
}
},
trigger: 'change'
}
]
}
const rules = {
@@ -2072,7 +2085,14 @@
return
}
// 两个子标签页都验证通过,执行保存
// 两个子标签页都验证通过,处理数据并执行保存
// 将 deptCodeList 数组的最后一项赋值给 form.baseInfo.deptCode
if (form.professionalStationRelation.deptCodeList &&
Array.isArray(form.professionalStationRelation.deptCodeList) &&
form.professionalStationRelation.deptCodeList.length > 0) {
form.baseInfo.deptCode = form.professionalStationRelation.deptCodeList[form.professionalStationRelation.deptCodeList.length - 1]
}
addInformation(form).then((response: any) => {
const data = response.data;
message.success('保存成功')
@@ -2332,6 +2352,10 @@
proData.value = [];
workData.value = [];
dialogFromVisible.value = true;
// 清除表单验证提示
nextTick(() => {
baseForm.value?.clearValidate()
})
}
const handleEdit = (row: any, index: any) => {
@@ -2456,9 +2480,17 @@
form.professionalStationRelation.deptCodeList[1] = dept.deptCode
}
dialogFromVisible.value = true
// 清除表单验证提示
nextTick(() => {
baseForm.value?.clearValidate()
})
})
} else {
dialogFromVisible.value = true
// 清除表单验证提示
nextTick(() => {
baseForm.value?.clearValidate()
})
}
});
}

View File

@@ -56,12 +56,12 @@
/>
</el-form-item>
<el-form-item label="岗位别" prop="stationTypeId">
<el-form-item label="岗位别" prop="stationTypeId">
<el-select
v-model="search.stationTypeId"
filterable
clearable
placeholder="请选择岗位别"
placeholder="请选择岗位别"
>
<el-option
v-for="item in stationLevelList"
@@ -241,7 +241,9 @@ const search = reactive({
idCard: '',
nf: '',
yf: '',
stationTypeId: ''
stationTypeId: '',
canSearch: 0,
selectList:[]
})
// 配置 useTable
@@ -346,19 +348,14 @@ const delbatch = () => {
// 设置可查询/不可查询
const canSearch = (val: number) => {
if (selectList.value.length === 0) {
message.warning("请至少选择一名人员")
return
}
const params = {
canSearch: val,
selectList: selectList.value
}
search.canSearch=val
search.selectList=selectList.value
messageBox.confirm('确认设置?').then(async () => {
try {
await setCanSearch(params)
await setCanSearch(search)
message.success("设置成功")
getDataList(false) // 设置后保持当前页
} catch (error: any) {

View File

@@ -61,12 +61,12 @@
/>
</el-form-item>
<el-form-item label="岗位别" prop="stationTypeId">
<el-form-item label="岗位别" prop="stationTypeId">
<el-select
v-model="search.stationTypeId"
filterable
clearable
placeholder="请选择岗位别"
placeholder="请选择岗位别"
style="width: 200px"
>
<el-option
@@ -264,7 +264,9 @@ const search = reactive({
idCard: '',
nf: '',
yf: '',
stationTypeId: ''
stationTypeId: '',
canSearch: 0,
selectList:[]
})
// 配置 useTable
@@ -379,19 +381,18 @@ const delbatch = () => {
// 设置可查询/不可查询
const canSearch = (val: number) => {
if (selectList.value.length === 0) {
message.warning("请至少选择一名人员")
return
}
const params = {
canSearch: val,
selectList: selectList.value
}
// if (selectList.value.length === 0) {
// message.warning("请至少选择一名人员")
// return
// }
search.canSearch=val
search.selectList=selectList.value
messageBox.confirm('确认设置?').then(async () => {
try {
await setCanSearch(params)
await setCanSearch(search)
message.success("设置成功")
getDataList(false) // 设置后保持当前页
} catch (error: any) {