This commit is contained in:
guochunsi
2026-01-22 10:37:27 +08:00
parent 38ebce9769
commit 790b22a7fc
2 changed files with 15 additions and 29 deletions

View File

@@ -97,6 +97,10 @@ service.interceptors.request.use(
*/ */
const handleResponse = (response: AxiosResponse<any>) => { const handleResponse = (response: AxiosResponse<any>) => {
if (response.data.code === 1) { if (response.data.code === 1) {
// 业务错误,统一弹出错误提示
if (response.data.msg) {
useMessage().error(response.data.msg);
}
throw response.data; throw response.data;
} }

View File

@@ -39,14 +39,9 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="证件类型" prop="idCardType"> <el-form-item label="证件类型" prop="idCardType">
<el-select v-model="dataForm.idCardType" filterable placeholder="请选择证件类型" class="w-full" :disabled="!isEdit"> <el-radio-group v-model="dataForm.idCardType" :disabled="!isEdit">
<el-option <el-radio v-for="item in idCardTypeList" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
v-for="item in idCardTypeList" </el-radio-group>
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@@ -668,7 +663,7 @@
import { ref, reactive, nextTick, watch, computed } from 'vue' import { ref, reactive, nextTick, watch, computed } from 'vue'
import { ElNotification } from 'element-plus' import { ElNotification } from 'element-plus'
import { Picture } from '@element-plus/icons-vue' import { Picture } from '@element-plus/icons-vue'
import { useMessageBox } from '/@/hooks/message' import { useMessage, useMessageBox } from '/@/hooks/message'
import { getObj, putObj, addObj ,makeCorrectScore} from '/@/api/recruit/recruitstudentsignup' import { getObj, putObj, addObj ,makeCorrectScore} from '/@/api/recruit/recruitstudentsignup'
import { list as listByGroupId } from '/@/api/recruit/recruitstudentschool' import { list as listByGroupId } from '/@/api/recruit/recruitstudentschool'
import { getList } from "/@/api/recruit/recruitstudentplangroup" import { getList } from "/@/api/recruit/recruitstudentplangroup"
@@ -681,8 +676,8 @@ import { queryAllTeacher } from "/@/api/professional/professionaluser/teacherbas
import { getNationalList } from "/@/api/basic/basicnation" import { getNationalList } from "/@/api/basic/basicnation"
import { verifyIdCardAll, verifyAdmissionNumber } from '/@/utils/toolsValidate' import { verifyIdCardAll, verifyAdmissionNumber } from '/@/utils/toolsValidate'
const message = useMessage()
const messageBox = useMessageBox() const messageBox = useMessageBox()
// Emits // Emits
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'refreshDataList'): void (e: 'refreshDataList'): void
@@ -796,7 +791,7 @@ const dataForm = reactive({
jsOtherCity:"", jsOtherCity:"",
householdPic:"", householdPic:"",
otherProvince:"", otherProvince:"",
idCardType:"", idCardType:"0",
scorePhotoList: [] as string[], scorePhotoList: [] as string[],
graPicList: [] as string[], graPicList: [] as string[],
yyPicList: [] as string[], yyPicList: [] as string[],
@@ -833,6 +828,9 @@ const dataRule = {
residenceType: [ residenceType: [
{required: true, message: '户口性质不能为空', trigger: 'change'} {required: true, message: '户口性质不能为空', trigger: 'change'}
], ],
idCardType: [
{required: true, message: '证件类型不能为空', trigger: 'change'}
],
idNumber: [ idNumber: [
{required: true, message: '身份证不能为空', trigger: 'change'}, {required: true, message: '身份证不能为空', trigger: 'change'},
{ {
@@ -1391,34 +1389,18 @@ const dataFormSubmit = (state: string) => {
if (dataForm.id) { if (dataForm.id) {
// 编辑模式 // 编辑模式
putObj(dataForm).then(() => { putObj(dataForm).then(() => {
ElNotification.success({ message.success('操作成功')
title: '成功',
message: '操作成功'
})
visible.value = false visible.value = false
emit('refreshDataList') emit('refreshDataList')
}).catch((e: any) => {
ElNotification.error({
title: '错误',
message: e || '操作失败'
})
}).finally(() => { }).finally(() => {
canSubmit.value = true canSubmit.value = true
}) })
} else { } else {
// 新增模式 // 新增模式
addObj(dataForm).then(() => { addObj(dataForm).then(() => {
ElNotification.success({ message.success('新增成功')
title: '成功',
message: '新增成功'
})
visible.value = false visible.value = false
emit('refreshDataList') emit('refreshDataList')
}).catch((e: any) => {
ElNotification.error({
title: '错误',
message: e || '新增失败'
})
}).finally(() => { }).finally(() => {
canSubmit.value = true canSubmit.value = true
}) })