From b4698317fb97d89e389f131e8fd9dcf8d7108c77 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Mon, 29 Jul 2024 17:17:21 +0800
Subject: [PATCH] 修改
---
src/views/onlineEducation/people/components/stuDialog.vue | 64 ++++++++++++++++++++-----------
1 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/src/views/onlineEducation/people/components/stuDialog.vue b/src/views/onlineEducation/people/components/stuDialog.vue
index 3b92dd1..b27645e 100644
--- a/src/views/onlineEducation/people/components/stuDialog.vue
+++ b/src/views/onlineEducation/people/components/stuDialog.vue
@@ -5,6 +5,8 @@
:title="state.title"
width="550px"
:before-close="handleClose"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
>
<el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="180px" >
<el-form-item label="企业:" prop="companyName" v-if="state.title !== '修改密码'">
@@ -57,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";
@@ -134,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