ren
This commit is contained in:
@@ -97,8 +97,8 @@
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { Session } from '/@/utils/storage'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { getMyTeacherNo, updateOtherInfo } from '/@/api/professional/professionaluser/teacherbase'
|
||||
import { putObj } from '/@/api/professional/professionaluser/professionalteachercertificaterelation'
|
||||
import { getMyTeacherNo } from '/@/api/professional/professionaluser/teacherbase'
|
||||
import { addObj } from '/@/api/professional/professionaluser/professionalteachercertificaterelation'
|
||||
import { getTeacherCertificateList } from '/@/api/professional/rsbase/professionalteachercertificateconf'
|
||||
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
||||
|
||||
@@ -280,33 +280,30 @@ const dialogSubmit = async () => {
|
||||
if (valid) {
|
||||
submitLoading.value = true
|
||||
try {
|
||||
// 统一使用 addObj 接口(新增和编辑都使用同一个接口)
|
||||
// 确保 evidenceA 或 materialA 有值
|
||||
if (!dataForm.evidenceA && dataForm.materialA) {
|
||||
dataForm.evidenceA = dataForm.materialA
|
||||
}
|
||||
// 确保 evidenceB 或 materialB 有值
|
||||
if (!dataForm.evidenceB && dataForm.materialB) {
|
||||
dataForm.evidenceB = dataForm.materialB
|
||||
}
|
||||
|
||||
if (dataForm.id) {
|
||||
// 编辑:使用 putObj 接口(管理员编辑)
|
||||
// 编辑模式
|
||||
dataForm.state = '0'
|
||||
await putObj(dataForm)
|
||||
await addObj(dataForm)
|
||||
message.success("修改成功")
|
||||
} else {
|
||||
// 新增:使用 updateOtherInfo 接口(与 MultiDialog 保持一致)
|
||||
// 注意:MultiDialog 的 type=0 表单只有 certificateConfId 和 certificateNumber,没有 certificateTime
|
||||
const submitData: any = {
|
||||
type: 0, // 教师资格证类型
|
||||
teacherNo: dataForm.teacherNo,
|
||||
certificateConfId: dataForm.certificateConfId,
|
||||
certificateNumber: dataForm.certificateNumber,
|
||||
mateA: dataForm.evidenceA || dataForm.materialA // 使用 mateA 字段(与 MultiDialog 一致)
|
||||
}
|
||||
|
||||
const res = await updateOtherInfo(submitData)
|
||||
if (res.data == '-1') {
|
||||
message.warning("当前不允许提交")
|
||||
} else {
|
||||
message.success("提交成功")
|
||||
}
|
||||
// 新增模式
|
||||
await addObj(dataForm)
|
||||
message.success("提交成功")
|
||||
}
|
||||
dialogVisible.value = false
|
||||
emit('refreshData')
|
||||
} catch (error: any) {
|
||||
message.error(error?.msg || '操作失败')
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user