|
@@ -61,6 +61,8 @@ import { beforeSubmit } from './order-state';
|
|
|
import { useInterval, useIntervalFn } from '@vueuse/core';
|
|
|
import MPopup from '@/components/m-popup';
|
|
|
import UserAuth from './component/user-auth';
|
|
|
+import MMessageTip from '@/components/m-message-tip';
|
|
|
+import SelectStudent from './modal/select-student';
|
|
|
|
|
|
const classList: any = [];
|
|
|
for (let i = 1; i <= 40; i++) {
|
|
@@ -120,12 +122,19 @@ export default defineComponent({
|
|
|
const forms = reactive({
|
|
|
schoolId: route.query.sId as any,
|
|
|
paymentType: '', // 支付类型
|
|
|
+ multi_user_limit: 1, // 限制注册学生数量
|
|
|
// popupShow: false,
|
|
|
+ registerDetails: {} as any,
|
|
|
details: [] as any[],
|
|
|
// schoolType: '', // 学校类型
|
|
|
gradeYear: '', // 学制
|
|
|
schoolInstrumentSetType: null as any,
|
|
|
// bugGoods: false, // 是否购买AI
|
|
|
+
|
|
|
+ isRegister: 'create' as 'create' | 'update' | '', // 是否注册学生
|
|
|
+ isTipRegister: true, // 是否显示名字不一致 - 默认显示
|
|
|
+ isChangeSchool: false, // 是否切换学校
|
|
|
+
|
|
|
registerType: '', // 报名类型
|
|
|
detailVip: {} as any,
|
|
|
giftVipDay: 0, // 赠送天数
|
|
@@ -143,8 +152,6 @@ export default defineComponent({
|
|
|
gradeStatus: false,
|
|
|
classStatus: false,
|
|
|
loading: false,
|
|
|
- // dialogStatusVisible: false,
|
|
|
- // dialogStatusMessage: '',
|
|
|
|
|
|
dialogStatus: false,
|
|
|
dialogMessage: '',
|
|
@@ -156,8 +163,9 @@ export default defineComponent({
|
|
|
contract_sign: false, // 是否实名认证
|
|
|
countDownTimePay: 60 * 1000,
|
|
|
dialogConfig: {} as any,
|
|
|
- showOtherSchool: false,
|
|
|
- showOtherMessage: '',
|
|
|
+ showSelectStudent: false, // 选择学生
|
|
|
+ studentList: [], // 手机号关联学生列表
|
|
|
+ studentItem: {} as any, // 选择的学生
|
|
|
joinType: '' as 'digitalize' | 'tradition',
|
|
|
gradeList: [] as any,
|
|
|
classList: [] as any,
|
|
@@ -174,6 +182,20 @@ export default defineComponent({
|
|
|
classPopupIndex: [] as any // 班级下拉索引
|
|
|
});
|
|
|
|
|
|
+ const otherParams = reactive({
|
|
|
+ showOtherSchool: false,
|
|
|
+ showOtherMessage: '',
|
|
|
+ /** limit 超限制,change 更换学生,nickname 名称不一致 */
|
|
|
+ otherType: '' as 'limit' | 'change' | 'nickname',
|
|
|
+ showCancelButton: true,
|
|
|
+ cancelButtonColor: '',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ showConfirmButton: true,
|
|
|
+ confirmButtonColor: '',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ messageAlign: 'left' as 'center' | 'left' | 'right'
|
|
|
+ });
|
|
|
+
|
|
|
const state = reactive({
|
|
|
showQrcode: false,
|
|
|
qrCodeUrl: '',
|
|
@@ -185,8 +207,21 @@ export default defineComponent({
|
|
|
paymentStatus: false,
|
|
|
orderTimer: null as any
|
|
|
});
|
|
|
+
|
|
|
+ /*
|
|
|
+ 新用户:
|
|
|
+ autoRegister: true
|
|
|
+ loginType: 'SMS'
|
|
|
+
|
|
|
+ 已存在用户:
|
|
|
+ autoRegister: false
|
|
|
+ loginType: 'TOKEN'
|
|
|
+ password: xxx
|
|
|
+ */
|
|
|
+
|
|
|
const studentInfo = reactive({
|
|
|
autoRegister: true,
|
|
|
+ multiUser: true, // 是否为多用户
|
|
|
client_id: 'cooleshow-student',
|
|
|
client_secret: 'cooleshow-student',
|
|
|
extra: {
|
|
@@ -206,24 +241,10 @@ export default defineComponent({
|
|
|
const pageTimer = useInterval(1000, { controls: true });
|
|
|
pageTimer.pause();
|
|
|
|
|
|
- // const countDown = useCountDown({
|
|
|
- // // 倒计时 60 秒
|
|
|
- // time: forms.countDownTimePay,
|
|
|
- // onChange(current: CurrentTime) {
|
|
|
- // forms.dialogStatusMessage = `有待支付订单,请在${Math.ceil(
|
|
|
- // current.total / 1000
|
|
|
- // )}s后重试`;
|
|
|
- // },
|
|
|
- // onFinish() {
|
|
|
- // forms.dialogStatusVisible = false;
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
const overCountDown = useCountDown({
|
|
|
time: forms.activeOverTime,
|
|
|
onFinish() {
|
|
|
forms.activeOverStatus = true;
|
|
|
- console.log(forms.submitLoading, 'forms.submitLoading');
|
|
|
if (forms.submitLoading) return;
|
|
|
applyOver();
|
|
|
}
|
|
@@ -275,6 +296,7 @@ export default defineComponent({
|
|
|
// 默认选中商品
|
|
|
studentRegisterStore.setVip(data.details || []);
|
|
|
forms.details = deepClone(data.details || []);
|
|
|
+ forms.registerDetails = data;
|
|
|
|
|
|
forms.registerExpireTime = data.registerExpireTime; // '2024-03-27 17:33:52'; //
|
|
|
if (forms.registerExpireTime) {
|
|
@@ -317,10 +339,6 @@ export default defineComponent({
|
|
|
});
|
|
|
});
|
|
|
forms.gradeList.sort((a: any, b: any) => a.value - b.value);
|
|
|
- // console.log(
|
|
|
- // forms.gradeList.sort((a: any, b: any) => a.value - b.value),
|
|
|
- // 'forms.gradeList.sort((a: any, b: any) => a.value - b.value)'
|
|
|
- // );
|
|
|
forms.classList = classList;
|
|
|
} else if (data.schoolInstrumentSetType === 'CLASS') {
|
|
|
// 班级
|
|
@@ -413,6 +431,12 @@ export default defineComponent({
|
|
|
};
|
|
|
});
|
|
|
|
|
|
+ // 格式化提示状态
|
|
|
+ const changeTipStatus = (register: boolean, school: boolean) => {
|
|
|
+ forms.isTipRegister = register;
|
|
|
+ forms.isChangeSchool = school;
|
|
|
+ };
|
|
|
+
|
|
|
const checkForm = (status = true) => {
|
|
|
if (!checkPhone(studentInfo.username)) {
|
|
|
status && showToast('请输入正确的手机号码');
|
|
@@ -433,18 +457,114 @@ export default defineComponent({
|
|
|
return false;
|
|
|
};
|
|
|
|
|
|
- // 登记成功之后购买
|
|
|
+ //
|
|
|
+ const checkSubmit = () => {
|
|
|
+ const { extra } = studentInfo;
|
|
|
+ // console.log(
|
|
|
+ // forms.studentItem.nickname,
|
|
|
+ // extra.nickname,
|
|
|
+ // forms.isRegister,
|
|
|
+ // forms.isTipRegister,
|
|
|
+ // 'isRegister'
|
|
|
+ // );
|
|
|
+ if (
|
|
|
+ forms.studentItem.nickname !== extra.nickname &&
|
|
|
+ forms.isTipRegister
|
|
|
+ ) {
|
|
|
+ otherParams.showOtherMessage =
|
|
|
+ '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
|
|
|
+ otherParams.showOtherSchool = true;
|
|
|
+ otherParams.showCancelButton = true;
|
|
|
+ otherParams.cancelButtonColor =
|
|
|
+ 'linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)';
|
|
|
+ otherParams.cancelButtonText = '新建学生';
|
|
|
+ otherParams.confirmButtonColor =
|
|
|
+ 'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
|
|
|
+ otherParams.confirmButtonText = '修改信息';
|
|
|
+ otherParams.otherType = 'nickname';
|
|
|
+ otherParams.messageAlign = 'left';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断新建学员是否上限了
|
|
|
+ if (
|
|
|
+ forms.isRegister === 'create' &&
|
|
|
+ forms.studentList.length >= forms.multi_user_limit
|
|
|
+ ) {
|
|
|
+ otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
|
|
|
+ otherParams.showOtherSchool = true;
|
|
|
+ otherParams.showCancelButton = false;
|
|
|
+ otherParams.confirmButtonColor =
|
|
|
+ 'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
|
|
|
+ otherParams.confirmButtonText = '我知道了';
|
|
|
+ otherParams.otherType = 'limit';
|
|
|
+ otherParams.messageAlign = 'center';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断是否为同一个学校
|
|
|
+ if (
|
|
|
+ forms.studentItem.schoolId !== forms.registerDetails.schoolId &&
|
|
|
+ !forms.isChangeSchool &&
|
|
|
+ forms.isRegister === 'update'
|
|
|
+ ) {
|
|
|
+ otherParams.showOtherMessage = `您已绑定【${
|
|
|
+ forms.registerDetails.schoolName || ''
|
|
|
+ }】,提交后将更换到【${
|
|
|
+ forms.studentItem?.schoolName
|
|
|
+ }】,是否确认提交?`;
|
|
|
+ otherParams.showOtherSchool = true;
|
|
|
+ otherParams.showCancelButton = true;
|
|
|
+ otherParams.cancelButtonColor = '';
|
|
|
+ otherParams.cancelButtonText = '取消';
|
|
|
+ otherParams.confirmButtonColor = '';
|
|
|
+ otherParams.confirmButtonText = '确定';
|
|
|
+ otherParams.otherType = 'change';
|
|
|
+ otherParams.messageAlign = 'left';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 登记成功之后购买
|
|
|
+ */
|
|
|
const onSubmit = async () => {
|
|
|
forms.submitLoading = true;
|
|
|
try {
|
|
|
- if (checkForm()) {
|
|
|
+ if (checkForm() || checkSubmit()) {
|
|
|
forms.submitLoading = false;
|
|
|
return;
|
|
|
}
|
|
|
- const { extra, ...res } = studentInfo;
|
|
|
+ const { extra, loginType, autoRegister, password, multiUser, ...res } =
|
|
|
+ studentInfo;
|
|
|
+ /*
|
|
|
+ 新用户:
|
|
|
+ autoRegister: true
|
|
|
+ loginType: 'SMS'
|
|
|
+
|
|
|
+ 已存在用户:
|
|
|
+ autoRegister: false
|
|
|
+ loginType: 'TOKEN'
|
|
|
+ password: xxx
|
|
|
+ */
|
|
|
+ let tLoginType = loginType,
|
|
|
+ tAutoRegister = autoRegister,
|
|
|
+ tPassword = password,
|
|
|
+ tMultiUser = multiUser;
|
|
|
+ if (forms.isRegister === 'update') {
|
|
|
+ tLoginType = 'TOKEN';
|
|
|
+ tAutoRegister = false;
|
|
|
+ tPassword = forms.studentItem.token;
|
|
|
+ tMultiUser = false;
|
|
|
+ }
|
|
|
const result = await request.post('/edu-app/userlogin', {
|
|
|
requestType: 'form',
|
|
|
data: {
|
|
|
+ loginType: tLoginType,
|
|
|
+ autoRegister: tAutoRegister,
|
|
|
+ password: tPassword,
|
|
|
+ multiUser: tMultiUser,
|
|
|
...res,
|
|
|
extra: JSON.stringify({
|
|
|
...extra,
|
|
@@ -502,6 +622,8 @@ export default defineComponent({
|
|
|
await onRegisterSubmit();
|
|
|
}
|
|
|
} catch {
|
|
|
+ // 重置信息 - 如果是新建则不提示
|
|
|
+ changeTipStatus(forms.isRegister === 'create' ? false : true, false);
|
|
|
} finally {
|
|
|
forms.submitLoading = false;
|
|
|
}
|
|
@@ -540,12 +662,9 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
await paymentContinue();
|
|
|
- } catch (e: any) {
|
|
|
- //
|
|
|
- if (e.message === '当前学生已有在读学校') {
|
|
|
- showToast('当前学生已有在读学校');
|
|
|
- }
|
|
|
- console.log(e.message, 'any');
|
|
|
+ } catch {
|
|
|
+ // 重置信息 - 如果是新建则不提示
|
|
|
+ changeTipStatus(forms.isRegister === 'create' ? false : true, false);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -561,38 +680,37 @@ export default defineComponent({
|
|
|
const { data } = await request.get(
|
|
|
`/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
|
|
|
);
|
|
|
- if (data) {
|
|
|
- if (!studentInfo.extra.nickname) {
|
|
|
- studentInfo.extra.nickname = data.nickname;
|
|
|
- }
|
|
|
-
|
|
|
- if (!studentInfo.extra.currentGradeNum) {
|
|
|
- const tempGrade: any = forms.gradeList || [];
|
|
|
- // console.log(tempGrade, 'tempGrade');
|
|
|
- tempGrade?.forEach((i: any) => {
|
|
|
- if (i.value === data.currentGradeNum) {
|
|
|
- forms.instrumentCode = i.instrumentCode;
|
|
|
- forms.gradeNumText = i.text;
|
|
|
- studentInfo.extra.currentGradeNum = data.currentGradeNum;
|
|
|
- if (forms.schoolInstrumentSetType === 'CLASS') {
|
|
|
- forms.classList = i.classList;
|
|
|
- }
|
|
|
+ forms.studentList = data || [];
|
|
|
+
|
|
|
+ if (forms.studentList.length > 0) {
|
|
|
+ const firstStudent: any = forms.studentList[0];
|
|
|
+ forms.studentItem = firstStudent;
|
|
|
+ studentInfo.extra.nickname = firstStudent.nickname;
|
|
|
+ const tempGrade: any = forms.gradeList || [];
|
|
|
+ tempGrade?.forEach((i: any) => {
|
|
|
+ if (i.value === firstStudent.currentGradeNum) {
|
|
|
+ forms.instrumentCode = i.instrumentCode;
|
|
|
+ forms.gradeNumText = i.text;
|
|
|
+ studentInfo.extra.currentGradeNum = firstStudent.currentGradeNum;
|
|
|
+ if (forms.schoolInstrumentSetType === 'CLASS') {
|
|
|
+ forms.classList = i.classList;
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ forms.classList.forEach((i: any) => {
|
|
|
+ if (i.value === firstStudent.currentClass) {
|
|
|
+ forms.currentClassText = i.text;
|
|
|
+ studentInfo.extra.currentClass = firstStudent.currentClass;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ studentInfo.extra.gender = firstStudent.gender;
|
|
|
|
|
|
- if (!studentInfo.extra.currentClass) {
|
|
|
- forms.classList.forEach((i: any) => {
|
|
|
- if (i.value === data.currentClass) {
|
|
|
- forms.currentClassText = i.text;
|
|
|
- studentInfo.extra.currentClass = data.currentClass;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- studentInfo.extra.gender =
|
|
|
- studentInfo.extra.gender !== data.gender
|
|
|
- ? data.gender
|
|
|
- : studentInfo.extra.gender;
|
|
|
+ forms.isRegister = 'update';
|
|
|
+ changeTipStatus(true, false);
|
|
|
+ } else {
|
|
|
+ forms.isRegister = 'create';
|
|
|
+ changeTipStatus(true, false);
|
|
|
+ forms.studentItem = [];
|
|
|
}
|
|
|
} catch {
|
|
|
//
|
|
@@ -668,29 +786,6 @@ export default defineComponent({
|
|
|
state.orderNo = paddingConfig?.orderNo;
|
|
|
await lastSubmit();
|
|
|
return true;
|
|
|
- // 判断是否可以取消订单
|
|
|
- // if (paddingData.cancelPayment) {
|
|
|
- // await request.post(
|
|
|
- // '/edu-app/userPaymentOrder/cancelPayment/' +
|
|
|
- // paddingConfig.orderNo
|
|
|
- // );
|
|
|
- // return false;
|
|
|
- // } else {
|
|
|
- // // forms.countDownTime = paddingData.cancelTimes;
|
|
|
- // // countDown.reset(Number(paddingData.cancelTimes));
|
|
|
- // // countDown.start();
|
|
|
- // // forms.dialogStatusMessage = `有待支付订单,请在${Math.ceil(
|
|
|
- // // countDown.current.value.total / 1000
|
|
|
- // // )}s后重试`;
|
|
|
- // // forms.dialogStatusVisible = true;
|
|
|
- // // forms.dialogConfig = paddingData;
|
|
|
- // // 继续支付
|
|
|
- // // const paymentConfig = forms.dialogConfig;
|
|
|
- // state.config = paddingConfig?.paymentConfig;
|
|
|
- // state.orderNo = paddingConfig?.orderNo;
|
|
|
- // await lastSubmit();
|
|
|
- // return true;
|
|
|
- // }
|
|
|
}
|
|
|
|
|
|
return false;
|
|
@@ -698,7 +793,8 @@ export default defineComponent({
|
|
|
return false;
|
|
|
}
|
|
|
} catch {
|
|
|
- //
|
|
|
+ // 重置信息 - 如果是新建则不提示
|
|
|
+ changeTipStatus(forms.isRegister === 'create' ? false : true, false);
|
|
|
}
|
|
|
return result;
|
|
|
};
|
|
@@ -793,6 +889,8 @@ export default defineComponent({
|
|
|
}
|
|
|
} catch (e: any) {
|
|
|
console.log(e, 'any');
|
|
|
+ // 重置信息 - 如果是新建则不提示
|
|
|
+ changeTipStatus(forms.isRegister === 'create' ? false : true, false);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -829,7 +927,8 @@ export default defineComponent({
|
|
|
onCallback();
|
|
|
}
|
|
|
} catch {
|
|
|
- //
|
|
|
+ // 重置信息 - 如果是新建则不提示
|
|
|
+ changeTipStatus(forms.isRegister === 'create' ? false : true, false);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1057,7 +1156,34 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- await getRegisterGoods();
|
|
|
+ try {
|
|
|
+ // 获取支付类型
|
|
|
+ const { data } = await request.get(
|
|
|
+ '/edu-app/open/paramConfig/queryByParamNameList',
|
|
|
+ {
|
|
|
+ requestType: 'form',
|
|
|
+ params: {
|
|
|
+ paramNames:
|
|
|
+ 'payment_service_provider,contract_sign,multi_user_limit'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ if (data && Array.isArray(data)) {
|
|
|
+ data.forEach((item: any) => {
|
|
|
+ if (item.paramName === 'contract_sign') {
|
|
|
+ forms.contract_sign = item.paramValue === '1' ? true : false;
|
|
|
+ } else if (item.paramName === 'payment_service_provider') {
|
|
|
+ forms.paymentType = item.paramValue || '';
|
|
|
+ } else if (item.paramName === 'multi_user_limit') {
|
|
|
+ forms.multi_user_limit = item.paramValue
|
|
|
+ ? Number(item.paramValue)
|
|
|
+ : 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ await getRegisterGoods();
|
|
|
+ } catch {}
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|
|
@@ -1095,14 +1221,10 @@ export default defineComponent({
|
|
|
)}
|
|
|
|
|
|
<div
|
|
|
- class={[
|
|
|
- styles.studentSection,
|
|
|
- styles.studentSectionForm,
|
|
|
- forms.giftVipDay <= 0 && styles.noSendDay
|
|
|
- ]}
|
|
|
+ class={[styles.studentSection, styles.studentSectionForm]}
|
|
|
// style={{ display: 'none' }}
|
|
|
>
|
|
|
- <div class={styles.title1}></div>
|
|
|
+ <div class={styles.title3}></div>
|
|
|
|
|
|
<Form labelAlign="left" class={styles.registerForm}>
|
|
|
<Field
|
|
@@ -1170,6 +1292,41 @@ export default defineComponent({
|
|
|
)
|
|
|
}}
|
|
|
</Field>
|
|
|
+ </Form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.studentSection,
|
|
|
+ styles.studentSectionForm,
|
|
|
+ forms.giftVipDay <= 0 && styles.noSendDay
|
|
|
+ ]}
|
|
|
+ // style={{ display: 'none' }}
|
|
|
+ >
|
|
|
+ <div class={styles.title1}></div>
|
|
|
+
|
|
|
+ <Form labelAlign="left" class={styles.registerForm}>
|
|
|
+ {/* 大于等于2,则可以切换学生 */}
|
|
|
+ {forms.studentList.length > 1 && (
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.selectStudentGroup,
|
|
|
+ forms.showSelectStudent && styles.selectStudentGroupChecked
|
|
|
+ ]}
|
|
|
+ onClick={() => (forms.showSelectStudent = true)}>
|
|
|
+ <i
|
|
|
+ class={[
|
|
|
+ styles.studentIcon,
|
|
|
+ !forms.studentItem.userId && styles.studentIconAdd
|
|
|
+ ]}></i>
|
|
|
+ <span>
|
|
|
+ {forms.studentItem.userId
|
|
|
+ ? forms.studentItem.nickname
|
|
|
+ : '新增学生'}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
<Field
|
|
|
clearable={false}
|
|
|
required
|
|
@@ -1577,29 +1734,6 @@ export default defineComponent({
|
|
|
}}
|
|
|
/>
|
|
|
|
|
|
- {/* <MDialog
|
|
|
- title="提示"
|
|
|
- v-model:show={forms.dialogStatusVisible}
|
|
|
- message={forms.dialogStatusMessage}
|
|
|
- allowHtml={true}
|
|
|
- primaryColor="#FF8057"
|
|
|
- confirmButtonText="继续支付"
|
|
|
- onConfirm={async () => {
|
|
|
- countDown.pause();
|
|
|
- const paymentConfig = forms.dialogConfig.paymentConfig;
|
|
|
- state.config = paymentConfig?.paymentConfig;
|
|
|
- state.orderNo = paymentConfig?.orderNo;
|
|
|
- await lastSubmit();
|
|
|
- }}
|
|
|
- onCancel={(val: any) => {
|
|
|
- countDown.pause();
|
|
|
- //取消支付,判断是否有结束时间,是否已经结束
|
|
|
- if (forms.registerExpireTime && forms.activeOverStatus) {
|
|
|
- applyOver();
|
|
|
- }
|
|
|
- }}
|
|
|
- /> */}
|
|
|
-
|
|
|
<MDialog
|
|
|
title="提示"
|
|
|
v-model:show={forms.dialogStatus}
|
|
@@ -1688,6 +1822,94 @@ export default defineComponent({
|
|
|
buttonText="刷新"
|
|
|
onConfirm={() => window.location.reload()}
|
|
|
/>
|
|
|
+
|
|
|
+ <MMessageTip
|
|
|
+ show={otherParams.showOtherSchool}
|
|
|
+ messageAlign={otherParams.messageAlign}
|
|
|
+ message={otherParams.showOtherMessage}
|
|
|
+ showCancelButton={otherParams.showCancelButton}
|
|
|
+ cancelButtonColor={otherParams.cancelButtonColor}
|
|
|
+ cancelButtonText={otherParams.cancelButtonText}
|
|
|
+ confirmButtonColor={otherParams.confirmButtonColor}
|
|
|
+ confirmButtonText={otherParams.confirmButtonText}
|
|
|
+ onCancel={() => {
|
|
|
+ otherParams.showOtherSchool = false;
|
|
|
+ if (otherParams.otherType === 'nickname') {
|
|
|
+ forms.isRegister = 'create'; // 新建
|
|
|
+ changeTipStatus(false, false);
|
|
|
+ onSubmit();
|
|
|
+ } else if (otherParams.otherType === 'limit') {
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ onConfirm={() => {
|
|
|
+ otherParams.showOtherSchool = false;
|
|
|
+ // 名字
|
|
|
+ if (otherParams.otherType === 'nickname') {
|
|
|
+ forms.isRegister = 'update'; // 修改
|
|
|
+ changeTipStatus(false, false);
|
|
|
+ // 直接注册
|
|
|
+ onSubmit();
|
|
|
+ } else if (otherParams.otherType === 'change') {
|
|
|
+ // 学校更换
|
|
|
+ forms.isChangeSchool = true;
|
|
|
+ // 直接注册
|
|
|
+ onSubmit();
|
|
|
+ } else if (otherParams.otherType === 'limit') {
|
|
|
+ // 人数超限制
|
|
|
+ changeTipStatus(true, false);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ v-model:show={forms.showSelectStudent}
|
|
|
+ round
|
|
|
+ position="bottom"
|
|
|
+ safeAreaInsetBottom
|
|
|
+ closeable>
|
|
|
+ <SelectStudent
|
|
|
+ studentItem={forms.studentItem}
|
|
|
+ list={forms.studentList}
|
|
|
+ onClose={() => (forms.showSelectStudent = false)}
|
|
|
+ onConfirm={(val: any) => {
|
|
|
+ forms.studentItem = val;
|
|
|
+ if (val.userId) {
|
|
|
+ const firstStudent = val;
|
|
|
+ studentInfo.extra.nickname = firstStudent.nickname;
|
|
|
+ const tempGrade: any = forms.gradeList || [];
|
|
|
+ tempGrade?.forEach((i: any) => {
|
|
|
+ if (i.value === firstStudent.currentGradeNum) {
|
|
|
+ forms.instrumentCode = i.instrumentCode;
|
|
|
+ forms.gradeNumText = i.text;
|
|
|
+ studentInfo.extra.currentGradeNum =
|
|
|
+ firstStudent.currentGradeNum;
|
|
|
+ if (forms.schoolInstrumentSetType === 'CLASS') {
|
|
|
+ forms.classList = i.classList;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ forms.classList.forEach((i: any) => {
|
|
|
+ if (i.value === firstStudent.currentClass) {
|
|
|
+ forms.currentClassText = i.text;
|
|
|
+ studentInfo.extra.currentClass = firstStudent.currentClass;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ studentInfo.extra.gender = firstStudent.gender;
|
|
|
+ forms.isRegister = 'update';
|
|
|
+ changeTipStatus(true, false);
|
|
|
+ } else {
|
|
|
+ forms.isRegister = 'create';
|
|
|
+ changeTipStatus(true, false);
|
|
|
+ studentInfo.extra.nickname = '';
|
|
|
+ studentInfo.extra.currentGradeNum = '';
|
|
|
+ studentInfo.extra.currentClass = '';
|
|
|
+ studentInfo.extra.gender = 1;
|
|
|
+ forms.currentClassText = '';
|
|
|
+ forms.gradeNumText = '';
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
);
|
|
|
}
|