修改外校老师留后门

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

View File

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