|
|
@@ -444,30 +444,34 @@
|
|
|
})
|
|
|
},
|
|
|
onSubmit(data) {
|
|
|
- for (let key in data) {
|
|
|
- if (message[key] && !data[key]) {
|
|
|
- this.$toast(message[key]);
|
|
|
- this.$refs.form.scrollToField(key)
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if (!isMobile(data.phone)) {
|
|
|
- this.$toast.fail('手机号格式错误');
|
|
|
- this.$refs.form.scrollToField('phone')
|
|
|
- return
|
|
|
- }
|
|
|
- if (data.contact_number && !isMobile(data.contact_number) && !isPhone(data.contact_number)) {
|
|
|
- this.$toast.fail('紧急联系人电话号码格式错误');
|
|
|
- this.$refs.form.scrollToField('contact_number')
|
|
|
- return
|
|
|
- }
|
|
|
- if (data.idcardNumber.length !== 15 && data.idcardNumber.length !== 18) {
|
|
|
- this.$toast.fail('身份证格式错误');
|
|
|
- this.$refs.form.scrollToField('idcardNumber')
|
|
|
- return
|
|
|
- }
|
|
|
if (!this.loading) {
|
|
|
this.loading = true
|
|
|
+ for (let key in data) {
|
|
|
+ if (message[key] && !data[key]) {
|
|
|
+ this.$toast(message[key]);
|
|
|
+ this.$refs.form.scrollToField(key)
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isMobile(data.phone)) {
|
|
|
+ this.$toast.fail('手机号格式错误');
|
|
|
+ this.$refs.form.scrollToField('phone')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (data.contact_number && !isMobile(data.contact_number) && !isPhone(data.contact_number)) {
|
|
|
+ this.$toast.fail('紧急联系人电话号码格式错误');
|
|
|
+ this.$refs.form.scrollToField('contact_number')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (data.idcardNumber.length !== 15 && data.idcardNumber.length !== 18) {
|
|
|
+ this.$toast.fail('身份证格式错误');
|
|
|
+ this.$refs.form.scrollToField('idcardNumber')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
const query = {}
|
|
|
query.id = this.id
|
|
|
query.user_token = this.user_token;
|
|
|
@@ -489,17 +493,21 @@
|
|
|
}
|
|
|
postAction(hpInterviewRegister, query).then(() => {
|
|
|
this.$toast.success({
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 1200,
|
|
|
message: '提交成功',
|
|
|
onClose: () => {
|
|
|
if (miniProgram) {
|
|
|
wx.miniProgram.switchTab({
|
|
|
url: '/pages/index/index'
|
|
|
})
|
|
|
- this.loading = false
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.$toast.fail({icon: 'close', message: '请勿重复点击'})
|
|
|
}
|
|
|
},
|
|
|
showLocation(data) {
|