Compare commits

3 Commits

Author SHA1 Message Date
fde16ed45c 服务商人员,电话格式验证规则同步系统后台 2026-01-22 18:09:58 +08:00
516841b000 二手拖车车源发布成功后关闭弹窗 2026-01-22 18:09:57 +08:00
4434ef0a58 省市修改 2026-01-19 17:26:08 +08:00
3 changed files with 33 additions and 8 deletions

View File

@@ -1147,8 +1147,8 @@ export default {
{label: '服务车辆', prop: 'vehicleName'},
{label: '服务完成状况', prop: 'orderStatusString'},
{label: '案件完成时间', prop: 'finishTime'},
{label: '省(B)', prop: 'bProvince'},
{label: '市(B)', prop: 'bCity'},
{label: '省(B)', prop: 'bprovince'},
{label: '市(B)', prop: 'bcity'},
{label: '区(B)', prop: 'area'},
]
} else if (this.active === 6) {//投诉明细

View File

@@ -121,7 +121,7 @@ export default {
let flag=this.validatePhone(val)
// console.log('flag',flag)
if(!flag){
this.$toast('手机号格式不正确')
this.$toast('电话号码格式不正确')
}
},
validatePhone(val) {
@@ -129,13 +129,22 @@ export default {
if(!val){
return true
}
const purePhone = val
// 情况111位且1开头 → 合法
if (/^1[0-9]{10}$/.test(purePhone)) {
const purePhone = String(val).trim()
const mobileReg = /^1[3-9]\d{9}$/ // 大陆手机号正则表达式
const hkMobileReg = /^[569]\d{3}[\s-]?\d{4}$/ // 香港手机号正则表达式,允许使用空格或 "-" 分隔
const macauMobileReg = /^6\d{3}[\s-]?\d{4}$/ // 澳门手机号正则表达式,允许使用空格或 "-" 分隔
const telReg = /^(0\d{2,3})([\s-])?\d{7,8}$/ // 大陆座机号正则表达式,允许区号和座机号用空格或 "-" 分开
const hkTelReg = /^\(?\d{2,4}\)?[\s-]?\d{4}[\s-]?\d{4}$/ // 香港座机号正则表达式,允许使用空格或 "-" 分隔
const macauTelReg = /^\(?\d{2,4}\)?[\s-]?\d{4}[\s-]?\d{4}$/ // 澳门座机号正则表达式,允许使用空格或 "-" 分隔
const phone400Reg = /^400[\s-]?\d{3}[\s-]?\d{4}$/ // 以 "400" 开头的号码正则表达式,允许使用空格或 "-" 分隔
// 情况112位且首位是0、第二位是1 → 去0后按大陆手机号校验
if (/^01[0-9]{10}$/.test(purePhone)) {
return true
}
// 情况212位且首位是0、第二位是1 → 去0后合法
if (/^01[0-9]{10}$/.test(purePhone)) {
// 匹配任意一种格式即为合法
if (mobileReg.test(purePhone) || hkMobileReg.test(purePhone) || macauMobileReg.test(purePhone) ||
telReg.test(purePhone) || hkTelReg.test(purePhone) || macauTelReg.test(purePhone) ||
phone400Reg.test(purePhone)) {
return true
}
// 其他情况 → 不合法
@@ -226,6 +235,7 @@ export default {
console.log('phone1Flag',phone1Flag)
console.log('phone2Flag',phone2Flag)
if(!phone1Flag || !phone2Flag){
this.$toast('电话号码格式不正确')
return
}
await submitConfirm({supplierId:this.supplierId,infos:this.personList})

View File

@@ -478,6 +478,21 @@ export default {
otherPhoto:this.otherImgSrc?.join(',')
})
this.clearStorageFormInfo()
if(res.code == 200 && !res.msg){
this.$toast('发布成功')
if(this.isWebFunc()){
setTimeout(()=>{
this.closeParentDialog()
},1000)
}else{
setTimeout(()=>{
this.$router.push({ name: "mineRelease"})
sessionStorage.setItem('mineActiveTab',String(1) )
},1000)
}
}else{
this.$toast(res.msg)
}
console.log("车源发布publishCarInfo",res)
} catch (e){
console.log('e',e)