|
@@ -14,6 +14,7 @@ import {
|
|
|
api_sysAreaQueryAllProvince
|
|
|
} from './api';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
+import MImgCode from '@/components/m-img-code';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'SchoolRegister',
|
|
@@ -45,7 +46,7 @@ export default defineComponent({
|
|
|
cityCode: '', // 所属城市
|
|
|
provinceCode: '', // 所属省份
|
|
|
schoolNature: 'PUBLIC' as 'PUBLIC' | 'PRIVATE' | string, // 学校性质
|
|
|
- schoolType: 'PRIMARY' as 'PRIMARY' | 'JUNIOR' | 'PRIMARY_JUNIOR' | string, // 学校类型
|
|
|
+ schoolType: 'PRIMARY_JUNIOR' as 'PRIMARY' | 'JUNIOR' | 'PRIMARY_JUNIOR' | string, // 学校类型
|
|
|
gradeYear: 'SIX_YEAR_SYSTEM' as
|
|
|
| 'FIVE_YEAR_SYSTEM'
|
|
|
| 'SIX_YEAR_SYSTEM'
|
|
@@ -65,7 +66,8 @@ export default defineComponent({
|
|
|
showArea: false,
|
|
|
success: false,
|
|
|
areaList: {} as any,
|
|
|
- sendMsg: '发送验证码'
|
|
|
+ sendMsg: '发送验证码',
|
|
|
+ imgCodeStatus: false
|
|
|
});
|
|
|
const formateArea = (area: any[]) => {
|
|
|
const province_list: { [_: string]: string } = {};
|
|
@@ -131,7 +133,6 @@ export default defineComponent({
|
|
|
const handleSubmit = async () => {
|
|
|
const res = await api_schoolAdd({ ...forms });
|
|
|
if (res?.code === 200) {
|
|
|
- showToast('提交成功');
|
|
|
data.success = true;
|
|
|
}
|
|
|
};
|
|
@@ -160,6 +161,7 @@ export default defineComponent({
|
|
|
placeholder="请输入学校全称"
|
|
|
inputAlign="right"
|
|
|
v-model={forms.name}
|
|
|
+ maxlength={20}
|
|
|
rules={[{ required: true, message: '请输入学校全称' }]}
|
|
|
/>
|
|
|
<Field
|
|
@@ -196,27 +198,6 @@ export default defineComponent({
|
|
|
}}
|
|
|
</Field>
|
|
|
|
|
|
- <Field center border label="学校类型" labelWidth="70px">
|
|
|
- {{
|
|
|
- input: () => (
|
|
|
- <>
|
|
|
- {formOptions.types.map(item => {
|
|
|
- return (
|
|
|
- <Button
|
|
|
- class={styles.radio}
|
|
|
- size="small"
|
|
|
- color={
|
|
|
- item.value === forms.schoolType ? '#198CFE' : ''
|
|
|
- }
|
|
|
- onClick={() => (forms.schoolType = item.value)}>
|
|
|
- {item.label}
|
|
|
- </Button>
|
|
|
- );
|
|
|
- })}
|
|
|
- </>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Field>
|
|
|
<Field center border label="学年制">
|
|
|
{{
|
|
|
input: () => (
|
|
@@ -317,8 +298,8 @@ export default defineComponent({
|
|
|
}}
|
|
|
</Field>
|
|
|
<Field
|
|
|
+ class={styles.codeWrap}
|
|
|
border
|
|
|
- center
|
|
|
name="code"
|
|
|
label="验证码"
|
|
|
placeholder="请输入验证码"
|
|
@@ -331,7 +312,21 @@ export default defineComponent({
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
color="#198CFE"
|
|
|
- onClick={() => onSendSms()}>
|
|
|
+ onClick={() => {
|
|
|
+ if (!forms.educationalAdministrationPhone) {
|
|
|
+ showToast('请输入负责人手机号码');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ !/^1[3456789]\d{9}$/.test(
|
|
|
+ forms.educationalAdministrationPhone
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ showToast('手机号码格式不正确');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ data.imgCodeStatus = true;
|
|
|
+ }}>
|
|
|
{data.sendMsg}
|
|
|
</Button>
|
|
|
)
|
|
@@ -381,6 +376,17 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
</Popup>
|
|
|
+
|
|
|
+ {data.imgCodeStatus ? (
|
|
|
+ <MImgCode
|
|
|
+ v-model:value={data.imgCodeStatus}
|
|
|
+ phone={forms.educationalAdministrationPhone}
|
|
|
+ onClose={() => {
|
|
|
+ data.imgCodeStatus = false;
|
|
|
+ }}
|
|
|
+ onSendCode={onSendSms}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|