From 4f6cdee3d3a9967b6955aacc354bf557430c0643 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期一, 05 八月 2024 17:05:16 +0800 Subject: [PATCH] 批改 --- src/views/onlineEducation/people/components/stuDialog.vue | 62 +++++++++++++++++++----------- 1 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/views/onlineEducation/people/components/stuDialog.vue b/src/views/onlineEducation/people/components/stuDialog.vue index bdd17dd..b27645e 100644 --- a/src/views/onlineEducation/people/components/stuDialog.vue +++ b/src/views/onlineEducation/people/components/stuDialog.vue @@ -59,7 +59,7 @@ import {ElMessage, ElMessageBox} from "element-plus"; import {verifyPhone, verifyPwd, verifyUsername} from "@/utils/validate"; import { checkUserName, checkPhone } from "@/api/login" -import {resetPwd} from "@/api/onlineEducation/student" +import {changeCompany, resetPwd} from "@/api/onlineEducation/student" import {Base64} from "js-base64" import Cookies from "js-cookie"; import {addStudent, checkStuIdNo, checkStuPhone, editStudent} from "@/api/onlineEducation/student"; @@ -136,28 +136,44 @@ } } checkStuIdNo(param).then((res)=>{ - if(res.data == false){ - callback(new Error('身份证号已被占用,请更换其他身份证号')) - // ElMessageBox.confirm( - // `该人员${state.form.name}(身份证号:${state.form.idNo})与${state.form.idNo}已经绑定,确定将该人员的责任归属变更到贵公企业?`, - // '提示', - // { - // confirmButtonText: '确认', - // cancelButtonText: '取消', - // type: 'warning', - // icon: '' - // } - // ) - // .then(() => { - // ElMessage({ - // type: 'success', - // message: 'Delete completed', - // }) - // }) - // .catch(() => { - // callback(new Error('身份证号已被占用,请更换其他身份证号')) - // }) - }else{ + if(res.data.status == 1){ + callback(new Error('身份证号在该企业已被占用,请更换其他身份证号')) + }else if(res.data.status == 2){ + if(state.title == '新增'){ + ElMessageBox.confirm( + `该人员 ${state.form.name} (身份证号: ${state.form.idNo} )与 ${res.data.companyName} 已经绑定,确定将该人员的责任归属变更到贵公企业?`, + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + icon: '' + } + ) + .then(() => { + const param = { + companyId: state.form.companyId, + studentId: res.data.studentId + } + changeCompany(param).then((res) => { + if(res.code == 200){ + ElMessage({ + type: 'success', + message: '变更成功', + }) + emit('getList') + handleClose() + + callback() + }else { + ElMessage.warning(res.message) + } + }) + }) + }else { + callback(new Error('身份证号在其他企业已被占用,请更换身份证号')) + } + }else { callback() } }) -- Gitblit v1.9.2