|
@@ -138,14 +138,28 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="联系人手机号" prop="phone"
|
|
|
+ :error="errorPhone"
|
|
|
:rules="[{ required: true, message: '请输入联系人手机号', trigger: 'blur' },
|
|
|
- { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }]">
|
|
|
+ { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' },
|
|
|
+ { validator: validatePhone, trigger: 'blur'}]">
|
|
|
+ <template #label>
|
|
|
+ 联系人手机号
|
|
|
+ <el-tooltip placement="top" popper-class="mTooltip">
|
|
|
+ <div slot="content">
|
|
|
+ 该手机号为机构管理员登录账号
|
|
|
+ </div>
|
|
|
+ <i class="el-icon-question micon el-tooltip"
|
|
|
+ style="font-size: 18px; color: #F56C6C"
|
|
|
+ v-permission="'export/teacherSalary'"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
<el-input
|
|
|
v-model.trim="form.phone"
|
|
|
:max="11"
|
|
|
:disabled="isDisabled"
|
|
|
type="number"
|
|
|
oninput="if(value.length > 11)value=value.slice(0, 11)"
|
|
|
+ @blur="checkPhone"
|
|
|
style="width: 187px"
|
|
|
placeholder="请输入联系人手机号"
|
|
|
></el-input>
|
|
@@ -175,11 +189,13 @@
|
|
|
|
|
|
<script>
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
+import { checkStudentPhone } from "../api";
|
|
|
import {
|
|
|
areaQueryChild,
|
|
|
getParentArea,
|
|
|
} from "@/api/specialSetting";
|
|
|
import ThemePicker from '@/components/ThemePicker'
|
|
|
+import { setTheme } from '@/utils/setTheme'
|
|
|
export default {
|
|
|
props: ['type', 'data', 'tenantInfo'],
|
|
|
components: { ThemePicker },
|
|
@@ -225,6 +241,7 @@ export default {
|
|
|
theme: 'adenGreen',
|
|
|
themeColor: '#00A79D'
|
|
|
},
|
|
|
+ errorPhone: null, // 手机号存在错误信息
|
|
|
payState: null,
|
|
|
imageWidthM: 72,
|
|
|
imageHeightM: 72,
|
|
@@ -283,14 +300,41 @@ export default {
|
|
|
item.selected = true
|
|
|
this.form.theme = item.value
|
|
|
this.form.themeColor = item.color
|
|
|
+
|
|
|
+ let baseTenantId = sessionStorage.getItem('baseTenantId')
|
|
|
+ if(baseTenantId > 0) {
|
|
|
+ setTheme({
|
|
|
+ themeColor: item.color,
|
|
|
+ theme: item.value,
|
|
|
+ saveTheme: false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
onSubmit() {
|
|
|
let state = false
|
|
|
this.$refs.form.validate(_ => {
|
|
|
+ console.log(_)
|
|
|
state = _
|
|
|
})
|
|
|
return state
|
|
|
},
|
|
|
+ async checkPhone() {
|
|
|
+ const phone = this.form.phone
|
|
|
+ try {
|
|
|
+ const regu = /^1[3456789]\d{9}$/;
|
|
|
+ console.log(phone, regu)
|
|
|
+ const re = new RegExp(regu);
|
|
|
+ if (re.test(phone)) {
|
|
|
+ let res = await checkStudentPhone({ mobile: phone })
|
|
|
+ console.log(res)
|
|
|
+ if(res.data?.id) {
|
|
|
+ this.errorPhone = '输入手机号已存在'
|
|
|
+ } else {
|
|
|
+ this.errorPhone = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch(e) {}
|
|
|
+ },
|
|
|
onChangeProvince(val) {
|
|
|
this.form.city = null;
|
|
|
this.getAreaList(val);
|
|
@@ -374,6 +418,13 @@ export default {
|
|
|
);
|
|
|
return isImage && isLt2M && isSize;
|
|
|
},
|
|
|
+ validatePhone (rule, value, callback) {
|
|
|
+ if (this.errorPhone) {
|
|
|
+ callback(new Error('输入手机号已存在'));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -404,8 +455,8 @@ export default {
|
|
|
display: block;
|
|
|
}
|
|
|
.themeColor-block {
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
border-radius: 2px;
|
|
|
display: inline-block;
|
|
|
cursor: pointer;
|
|
@@ -415,11 +466,11 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- height: 21px;
|
|
|
+ height: 31px;
|
|
|
color: white;
|
|
|
}
|
|
|
}
|
|
|
.themeColor-block + .themeColor-block {
|
|
|
- margin-left: 8px;
|
|
|
+ margin-left: 12px;
|
|
|
}
|
|
|
</style>
|