Commit 219d39a7 by 匡雅琴

驻店电话校验规则

1 parent 7e10ee0d
...@@ -285,6 +285,17 @@ export default { ...@@ -285,6 +285,17 @@ export default {
// }, 100) // }, 100)
// return // return
// } // }
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/
if (this.accountAddForm.residentPhone) {
const result = reg.test(this.accountAddForm.residentPhone)
if (!result) {
this.$message({
message: '请输入正确的驻店信息',
type: 'warning'
})
return false
}
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm) let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
if (params.bussinessTime) { if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0] params.bussinessBegintime = params.bussinessTime[0]
......
...@@ -301,6 +301,17 @@ export default { ...@@ -301,6 +301,17 @@ export default {
// }, 100) // }, 100)
// return // return
// } // }
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/
if (this.accountAddForm.residentPhone) {
const result = reg.test(this.accountAddForm.residentPhone)
if (!result) {
this.$message({
message: '请输入正确的驻店信息',
type: 'warning'
})
return false
}
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm) let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
if (params.bussinessTime) { if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0] params.bussinessBegintime = params.bussinessTime[0]
......
...@@ -87,6 +87,7 @@ export default { ...@@ -87,6 +87,7 @@ export default {
bussinessTime: [], bussinessTime: [],
provinceName: '', provinceName: '',
provinceCode: '', provinceCode: '',
residentPhone: '',
cityName: '', cityName: '',
cityCode: '' cityCode: ''
}, },
...@@ -226,15 +227,17 @@ export default { ...@@ -226,15 +227,17 @@ export default {
}, },
handleSave() { handleSave() {
const params = this.infoForm const params = this.infoForm
// if (this.infoForm.residentPhone && !util.validatePhoneTwo(this.infoForm.residentPhone)) { const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/
// this.$message.error('请输入正确的驻店电话') if (params.residentPhone) {
// document.querySelector('#app').scrollTop = 0 const result = reg.test(params.residentPhone)
// setTimeout(() => { if (!result) {
// var isError = document.getElementsByClassName('phone-input') this.$message({
// isError[0].querySelector('input').focus() message: '请输入正确的驻店信息',
// }, 100) type: 'warning'
// return })
// } return false
}
}
params.merchantBrandMain = '' params.merchantBrandMain = ''
// 获取省市信息 // 获取省市信息
const { provinceName, provinceCode, cityName, cityCode } = this.$refs.provinceForm.provinceForm const { provinceName, provinceCode, cityName, cityCode } = this.$refs.provinceForm.provinceForm
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!