修改外校老师留后门

This commit is contained in:
Qi 2025-05-23 16:19:12 +08:00
parent fa6c669b86
commit 9ed1e5e554
2 changed files with 80 additions and 59 deletions

View File

@ -57,16 +57,6 @@
</template>
</van-field>
<!-- <van-field-->
<!-- v-model="notLocalTeacher.identityId"-->
<!-- name="userCardId"-->
<!-- label="身份证号"-->
<!-- type="text"-->
<!-- placeholder="请输入身份证号"-->
<!-- :rules="[{ validator:userCardId, message: '请输入身份证号' }]"-->
<!-- />-->
<van-field
v-model="notLocalTeacher.phone"
name="phone"
@ -92,7 +82,7 @@
label="职称"
placeholder="点击选择职称"
@click="showPicker = true"
:rules="[{ required: true, message: '请选择职称' }]"
:rules="[{ validator: (value) => notLocalTeacher.identityId?.trim() === '0000000' ? true : !!value, message: '请选择职称' }]"
>
<template #left-icon>
<img
@ -112,7 +102,7 @@
label="职务"
type="text"
placeholder="请输入职务(如教师,教务主任)"
:rules="[{ required: true, message: '请输入职务' }]"
:rules="[{ validator: (value) => notLocalTeacher.identityId?.trim() === '0000000' ? true : !!value, message: '请输入职务' }]"
>
<template #left-icon>
<img
@ -134,7 +124,7 @@
label="单位名称"
type="text"
placeholder="请输入单位名称"
:rules="[{ required: true, message: '请输入单位名称' }]"
:rules="[{ validator: (value) => notLocalTeacher.identityId?.trim() === '0000000' ? true : !!value, message: '请输入单位名称' }]"
>
<template #left-icon>
@ -202,8 +192,12 @@
//
const userName = (value: any) => {
const reg = /^.{2,12}$/;
return reg.test(value);
if(notLocalTeacher.identityId?.trim() === '0000000'){
return true;
}else{
const reg = /^.{2,12}$/;
return reg.test(value);
}
};
const jobTitleTest = (value: any) => {
if (value.length > 0) {
@ -211,16 +205,6 @@
}
return true;
};
//
// const userCardId = (value: any) => {
// const reg = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
// let birthday = value.substring(6, 10) + "-" + value.substring(10, 12) + "-" + value.substring(12, 14)
// let age = calculateAge(birthday);
// notLocalTeacher.age=age
// notLocalTeacher.sex=getSex(value)
// return reg.test(value);
// };
//
function calculateAge(birthday: string) {
const today = new Date();
@ -242,6 +226,10 @@
*/
function userCardId(value) {
let psidno = String(value);
// 70
if (psidno === '0000000') {
return true; //
}
psidno = psidno.toUpperCase();
// 1.
const regPsidno =
@ -398,8 +386,12 @@
}
const phoneNum = (value: string) => {
const reg = /^.{11}$/;
return reg.test(value);
if(notLocalTeacher.identityId?.trim() === '0000000'){
return true;
}else{
const reg = /^.{11}$/;
return reg.test(value);
}
};
const onConfirm = ({ selectedOptions }) => {
notLocalTeacher.jobTitle = selectedOptions[0]?.text;
@ -410,8 +402,30 @@
notLocalTeacher.sex = selectedOptions[0]?.text;
showSex.value = false;
};
//const onSubmit = (values: object) => {
// console.log('submit', values);
// localStorage.setItem('notLocalTeacher', JSON.stringify(notLocalTeacher));
// router.push('/waiTeacherTwo');
//};
const onSubmit = (values: object) => {
console.log('submit', values);
// 70
const isSpecialId = notLocalTeacher.identityId?.trim() === '0000000';
console.log(isSpecialId)
if (isSpecialId) {
// 70
handleSubmit();
} else {
//
notLocalTeacher.value?.validate().then(() => {
handleSubmit();
}).catch((error) => {
console.log('表单验证失败', error);
});
}
};
const handleSubmit = () => {
console.log('提交数据', notLocalTeacher);
localStorage.setItem('notLocalTeacher', JSON.stringify(notLocalTeacher));
router.push('/waiTeacherTwo');
};

View File

@ -498,6 +498,9 @@
// isValidationEnabled
const rules = computed(() => {
if(notLocalTeacherTwo.identityId?.trim() === '0000000'){
isValidationEnabled.value = false;
}
if (isValidationEnabled.value) {
return [{ validator: bankCard }];
}
@ -567,23 +570,31 @@
//
const bankAddr = (value: string) => {
if (value == '---') {
if(notLocalTeacherTwo.identityId?.trim() === '0000000'){
return true;
}else{
if (value == '---') {
return true;
}
if (value.length < 1) {
return '开户所在地不能为空';
}
return true;
}
if (value.length < 1) {
return '开户所在地不能为空';
}
return true;
};
const bankName = (value: string) => {
if (value == '---') {
if(notLocalTeacherTwo.identityId?.trim() === '0000000'){
return true;
}else{
if (value == '---') {
return true;
}
if (value.length < 1) {
return '开户行不能为空';
}
if (value.length < 1) {
return '开户行不能为空';
}
return true;
}
};
const bankCard = (value: string) => {
// if (value.length < 16) {
@ -636,7 +647,6 @@
'*' +
notLocalTeacherTwo.userName.substring(notLocalTeacherTwo.userName.length - 1, notLocalTeacherTwo.userName.length);
}
//notLocalTeacherTwo.identityId18 14*
tid.value = notLocalTeacherTwo.identityId.substring(0, 5) + '****' + notLocalTeacherTwo.identityId.substring(13, 18);
tphone.value = notLocalTeacherTwo.phone.substring(0, 3) + '****' + notLocalTeacherTwo.phone.substring(7, 11);
@ -649,31 +659,28 @@
let myObj = {};
//
const onSubmit = (values: object) => {
// console.log('submit', {...values,...storedData});
// alert({...values,...storedData}.toString())
// 70
const isSpecialId = notLocalTeacherTwo.identityId?.trim() === '0000000';
if (isSpecialId) {
// 70
myShowDialog.value = true;
console.log("storedData",storedData)
console.log("storedData", storedData);
myObj = { ...values, ...storedData };
//--
myObj.pyCard = notLocalTeacherTwo.pyCard;
console.log("myObj", myObj)
console.log("myObj", myObj);
return;
// waiTApi.save({...values,...storedData}).then(res => {
// console.log(res)
// if (res.data.code == 500){
// alert(res.data.msg)
// return
// }
// if (res.data.code == 200) {
// alert("")
// console.log(res.data)
// store.login(res.data.user)
// localStorage.removeItem("notLocalTeacher")
// router.push(res.data.router)
// }
// }, err => {
// console.log(err)
// })
} else {
//
notLocalTeacherTwo.value?.validate().then(() => {
myShowDialog.value = true;
console.log("storedData", storedData);
myObj = { ...values, ...storedData };
myObj.pyCard = notLocalTeacherTwo.pyCard;
console.log("myObj", myObj);
}).catch((error) => {
console.log('表单验证失败', error);
});
}
};
const confirm = () => {
waiTeacherSave(myObj).then(