人员管理
This commit is contained in:
@@ -12,8 +12,7 @@
|
||||
v-model="dataForm.professionalTitleConfigId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择职称等级"
|
||||
style="width: 100%"
|
||||
placeholder="请选择职称等级"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in proTitleList"
|
||||
@@ -30,7 +29,6 @@
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择专业技术职务"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in majorStationList"
|
||||
@@ -48,7 +46,6 @@
|
||||
placeholder="请选择取证时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -59,7 +56,6 @@
|
||||
placeholder="请选择职称任职时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -74,7 +70,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="证明材料" prop="materialA">
|
||||
<el-form-item label="证明材料" prop="evidence">
|
||||
<el-upload
|
||||
:headers="headers"
|
||||
:limit="1"
|
||||
@@ -109,8 +105,7 @@ import { Session } from '/@/utils/storage'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { getProfessionalTitleList } from '/@/api/professional/rsbase/professionaltitlelevelconfig'
|
||||
import { getMajorStationList } from '/@/api/professional/rsbase/professionalmajorstation'
|
||||
import { putObj } from '/@/api/professional/professionaluser/professionaltitlerelation'
|
||||
import { getMyTeacherNo, updateOtherInfo } from '/@/api/professional/professionaluser/teacherbase'
|
||||
import { addObj } from '/@/api/professional/professionaluser/professionaltitlerelation'
|
||||
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
||||
|
||||
// Emits
|
||||
@@ -138,7 +133,6 @@ const dataForm = reactive({
|
||||
materialA: '',
|
||||
evidence: '',
|
||||
state: '',
|
||||
teacherNo: '',
|
||||
id: ''
|
||||
})
|
||||
|
||||
@@ -223,15 +217,31 @@ const materiaUploadSuccess = (response: any) => {
|
||||
}
|
||||
// 统一使用 evidence 字段存储证明材料URL(与后端API一致)
|
||||
dataForm.evidence = response.data.url
|
||||
dataForm.materialA = response.data.url
|
||||
}
|
||||
|
||||
// 打开对话框
|
||||
const openDialog = async (row?: any) => {
|
||||
// 新增时 row 可能为 null 或 undefined
|
||||
if (row && row.teacherNo) {
|
||||
// 编辑模式:使用传入的 teacherNo(编辑不需要检查锁定)
|
||||
url.value = `/professional/file/teacherAboutInfoUpload?teacherNo=${row.teacherNo}&type=2`
|
||||
// 新增模式:先检查是否锁定
|
||||
if (!row || !row.id) {
|
||||
try {
|
||||
const lockResponse = await checkLocked('title')
|
||||
if (lockResponse.data) {
|
||||
message.warning("新增功能已锁定,暂不允许操作")
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
message.error('操作失败')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 公共设置
|
||||
url.value = `/professional/file/teacherAboutInfoUpload?type=2`
|
||||
fileList.value = []
|
||||
|
||||
// 根据是否有 row 设置不同的表单数据
|
||||
if (row && row.id) {
|
||||
// 编辑模式:使用传入的数据
|
||||
Object.assign(dataForm, {
|
||||
professionalTitleConfigId: row.professionalTitleConfigId || '',
|
||||
majorStation: row.majorStation || '',
|
||||
@@ -241,50 +251,27 @@ const openDialog = async (row?: any) => {
|
||||
materialA: row.materialA || '',
|
||||
evidence: row.evidence || '',
|
||||
state: row.state || '',
|
||||
teacherNo: row.teacherNo || '',
|
||||
id: row.id || ''
|
||||
})
|
||||
fileList.value = []
|
||||
// 先加载字典数据,再显示表单
|
||||
await initDicData()
|
||||
showForm.value = true
|
||||
dialogVisible.value = true
|
||||
} else {
|
||||
// 新增模式:先检查是否锁定,再获取当前用户的 teacherNo
|
||||
try {
|
||||
const lockResponse = await checkLocked('title')
|
||||
if (lockResponse.data) {
|
||||
// 已锁定
|
||||
message.warning("新增功能已锁定,暂不允许操作")
|
||||
return
|
||||
}
|
||||
|
||||
// 未锁定,继续获取 teacherNo
|
||||
const response = await getMyTeacherNo()
|
||||
const teacherNo = response.data
|
||||
url.value = `/professional/file/teacherAboutInfoUpload?teacherNo=${teacherNo}&type=2`
|
||||
Object.assign(dataForm, {
|
||||
professionalTitleConfigId: '',
|
||||
majorStation: '',
|
||||
certificateTime: '',
|
||||
inOfficeDate: '',
|
||||
certificateNumber: '',
|
||||
materialA: '',
|
||||
evidence: '',
|
||||
state: '',
|
||||
teacherNo: teacherNo,
|
||||
id: ''
|
||||
})
|
||||
fileList.value = []
|
||||
// 先加载字典数据,再显示表单
|
||||
await initDicData()
|
||||
showForm.value = true
|
||||
dialogVisible.value = true
|
||||
} catch (error) {
|
||||
message.error('获取教师编号失败')
|
||||
return
|
||||
}
|
||||
// 新增模式:重置为空
|
||||
Object.assign(dataForm, {
|
||||
professionalTitleConfigId: '',
|
||||
majorStation: '',
|
||||
certificateTime: '',
|
||||
inOfficeDate: '',
|
||||
certificateNumber: '',
|
||||
materialA: '',
|
||||
evidence: '',
|
||||
state: '',
|
||||
id: ''
|
||||
})
|
||||
}
|
||||
|
||||
// 公共操作:加载字典数据并显示对话框
|
||||
await initDicData()
|
||||
showForm.value = true
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
@@ -301,31 +288,24 @@ const dialogSubmit = async () => {
|
||||
if (valid) {
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (dataForm.id) {
|
||||
// 编辑:使用 putObj 接口(管理员编辑)
|
||||
dataForm.state = '0'
|
||||
await putObj(dataForm)
|
||||
message.success("修改成功")
|
||||
} else {
|
||||
// 新增:使用 updateOtherInfo 接口(与 MultiDialog 保持一致)
|
||||
const submitData: any = {
|
||||
type: 2, // 职称类型
|
||||
teacherNo: dataForm.teacherNo,
|
||||
professionalTitleConfigId: dataForm.professionalTitleConfigId,
|
||||
majorStation: dataForm.majorStation,
|
||||
certificateTime: dataForm.certificateTime,
|
||||
inOfficeDate: dataForm.inOfficeDate,
|
||||
certificateNumber: dataForm.certificateNumber,
|
||||
mateA: dataForm.evidence || dataForm.materialA // 使用 mateA 字段(与 MultiDialog 一致)
|
||||
}
|
||||
|
||||
const res = await updateOtherInfo(submitData)
|
||||
if (res.data == '-1') {
|
||||
message.warning("当前不允许提交")
|
||||
} else {
|
||||
message.success("提交成功")
|
||||
}
|
||||
// 统一使用 addObj 接口(新增和编辑都使用)
|
||||
const submitData: any = {
|
||||
professionalTitleConfigId: dataForm.professionalTitleConfigId,
|
||||
majorStation: dataForm.majorStation,
|
||||
certificateTime: dataForm.certificateTime,
|
||||
inOfficeDate: dataForm.inOfficeDate,
|
||||
certificateNumber: dataForm.certificateNumber,
|
||||
evidence: dataForm.evidence,
|
||||
state: '0' // 待审核
|
||||
}
|
||||
|
||||
// 编辑时需要传递 id
|
||||
if (dataForm.id) {
|
||||
submitData.id = dataForm.id
|
||||
}
|
||||
|
||||
await addObj(submitData)
|
||||
message.success(dataForm.id ? "修改成功" : "提交成功")
|
||||
dialogVisible.value = false
|
||||
emit('refreshData')
|
||||
} catch (error: any) {
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<el-input
|
||||
v-model="waitShenheForm.form.certificateNumber"
|
||||
placeholder="请输入证书编号(仅支持英文和数字)"
|
||||
show-word-limit
|
||||
maxlength="64"
|
||||
@input="handleCertificateNumberInput"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -200,6 +202,8 @@
|
||||
<el-input
|
||||
v-model="waitShenheForm.form.certificateNumber"
|
||||
placeholder="请输入证书编号(仅支持英文和数字)"
|
||||
show-word-limit
|
||||
maxlength="32"
|
||||
@input="handleCertificateNumberInput"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user