人事优化
This commit is contained in:
@@ -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()
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user