Commit f34ea87d by 匡雅琴

驻店电话校验规则修改,主营品牌交互修改

1 parent a58b2bff
......@@ -276,15 +276,15 @@ export default {
}, 100)
return
}
if (this.accountAddForm.residentPhone && !util.checkPhone(this.accountAddForm.residentPhone)) {
this.$message.error('请输入正确的驻店电话')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName('phone-input')
isError[0].querySelector('input').focus()
}, 100)
return
}
// if (this.accountAddForm.residentPhone && !util.checkPhone(this.accountAddForm.residentPhone)) {
// this.$message.error('请输入正确的驻店电话')
// document.querySelector('#app').scrollTop = 0
// setTimeout(() => {
// var isError = document.getElementsByClassName('phone-input')
// isError[0].querySelector('input').focus()
// }, 100)
// return
// }
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0]
......@@ -401,6 +401,7 @@ export default {
this.findMerchantDetail()
this.getCarbrandTree()
this.findAllDictData('business_type')
// this.$refs.baseInfoForm.brandList()
}
}
</script>
......
......@@ -74,8 +74,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="驻店电话">
<el-input maxlength="11" size="small" class="phone-input" v-model="accountAddForm.residentPhone" placeholder="请输入驻店电话"></el-input>
<el-form-item label="驻店电话" prop="residentPhone">
<el-input maxlength="13" size="small" class="phone-input" v-model="accountAddForm.residentPhone" placeholder="请输入驻店电话"></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -179,6 +179,18 @@ export default {
callback()
}
}
const validatePhoneTwo = (rule, value, callback) => {
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/
if (value == '' || value == undefined || value == null) {
callback()
} else {
if (!reg.test(value) && value != '') {
callback(new Error('请输入正确的电话号码或者固话号码'))
} else {
callback()
}
}
}
return {
imgIndex: '',
filterText: '',
......@@ -193,7 +205,8 @@ export default {
merchantLegalPersonPhone: [
{ required: true, message: '请输入联系电话', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' }
]
],
residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }]
},
brandListTree: [],
provinceCode: '',
......@@ -209,12 +222,15 @@ export default {
}
},
methods: {
checkBrandList(chant) {
let merchantBrandMain = chant.filter(item => item)
this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
checkBrandList() {
// let merchantBrandMain = chant.filter(item => item)
// this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
console.log(this.accountAddForm.merchantBrandMain)
console.log(222222222)
if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = []
}
this.brandList()
// this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain)
},
checkBusinessType(type) {
......@@ -251,7 +267,7 @@ export default {
// 点击主营品牌
clickBrand(val) {
if (!this.isFirstBrand) {
this.brandList()
// this.brandList()
this.isFirstBrand = true
}
},
......
......@@ -292,15 +292,15 @@ export default {
}, 100)
return
}
if (this.accountAddForm.residentPhone && !util.checkPhone(this.accountAddForm.residentPhone)) {
this.$message.error('请输入正确的驻店电话')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName('phone-input')
isError[0].querySelector('input').focus()
}, 100)
return
}
// if (this.accountAddForm.residentPhone && !util.checkPhone(this.accountAddForm.residentPhone)) {
// this.$message.error('请输入正确的驻店电话')
// document.querySelector('#app').scrollTop = 0
// setTimeout(() => {
// var isError = document.getElementsByClassName('phone-input')
// isError[0].querySelector('input').focus()
// }, 100)
// return
// }
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0]
......@@ -432,8 +432,13 @@ export default {
})
// 省市回显
this.$refs.baseInfoForm.init(this.accountAddForm.provinceName, this.accountAddForm.cityName)
merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',')
this.$refs.baseInfoForm.checkBrandList(merchantBrandMain)
if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = []
} else {
this.accountAddForm.merchantBrandMain = this.accountAddForm.merchantBrandMain.replaceAll(';', ',').split(',')
}
// merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',')
this.$refs.baseInfoForm.brandList()
this.$refs.baseInfoForm.checkBusinessType(businessType)
this.$nextTick(() => {
this.$refs.baseInfoForm.$refs.baseForm.validate()
......
......@@ -10,7 +10,7 @@
<div class="main-information">
<div class="information-title">修改企业信息</div>
<div class="information-form-box">
<el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px">
<el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px" :rules="baseFormRules">
<el-form-item size="small" label="商户地址" class="map-row">
<Province ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity"></Province>
<el-input class="input-width" v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input>
......@@ -24,8 +24,8 @@
<el-form-item size="small" label="营业时间" class="time-row">
<el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</el-form-item>
<el-form-item size="small" label="驻店电话" style="position: relative">
<el-input v-model="infoForm.residentPhone" class="phone-input" maxlength="11" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<el-form-item size="small" label="驻店电话" style="position: relative" prop="residentPhone">
<el-input v-model="infoForm.residentPhone" class="phone-input" maxlength="13" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<div @click="showTelDia" class="show-address">显示位置</div>
</el-form-item>
<el-form-item size="small" label="主营品牌" style="height: 500px">
......@@ -63,6 +63,18 @@ export default {
TelPosition
},
data() {
const validatePhoneTwo = (rule, value, callback) => {
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/
if (value == '' || value == undefined || value == null) {
callback()
} else {
if (!reg.test(value) && value != '') {
callback(new Error('请输入正确的电话号码或者固话号码'))
} else {
callback()
}
}
}
return {
subdistrict: 2,
checkedAll: false,
......@@ -80,13 +92,14 @@ export default {
},
businessType: [],
brandListTree: [],
isFirstBrand: false
isFirstBrand: false,
baseFormRules: {
residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }]
}
}
},
mounted() {
// this.brandList()
this.getUserInfo()
// this.$refs.provinceForm.mapInit()
},
methods: {
async brandList() {
......@@ -139,6 +152,7 @@ export default {
} else {
this.infoForm.merchantBrandMain = this.infoForm.merchantBrandMain.replaceAll(';', ',').split(',')
}
this.brandList()
if (merchantBrandName) {
const brandName = merchantBrandName.split(',').map((item, index) => {
return { label: item, id: index }
......@@ -149,7 +163,7 @@ export default {
// 点击主营品牌
clickBrand(val) {
if (!this.isFirstBrand) {
this.brandList()
// this.brandList()
this.isFirstBrand = true
}
},
......@@ -218,15 +232,15 @@ export default {
},
handleSave() {
const params = this.infoForm
if (this.infoForm.residentPhone && !util.checkPhone(this.infoForm.residentPhone)) {
this.$message.error('请输入正确的驻店电话')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName('phone-input')
isError[0].querySelector('input').focus()
}, 100)
return
}
// if (this.infoForm.residentPhone && !util.validatePhoneTwo(this.infoForm.residentPhone)) {
// this.$message.error('请输入正确的驻店电话')
// document.querySelector('#app').scrollTop = 0
// setTimeout(() => {
// var isError = document.getElementsByClassName('phone-input')
// isError[0].querySelector('input').focus()
// }, 100)
// return
// }
params.merchantBrandMain = ''
// 获取省市信息
const { provinceName, provinceCode, cityName, cityCode } = this.$refs.provinceForm.provinceForm
......
......@@ -11,9 +11,12 @@
</div>
<div class="follow-form" :style="{ 'min-height': formHeight + 'px' }">
<GLCombiForm ref="showSearch" :formObj="searchForm" :rowNumber="1" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="follow-btn">
<GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" plain @click="openDrawer">跟进专员</GLButton>
<!-- <el-button size="small" icon="el-icon-plus" type="primary" plain @click="openDrawer">跟进专员</el-button> -->
<div class="table-header">
<div class="header-text">跟进专员列表</div>
<div class="table-btn">
<GLButton fn="新增" size="small" type="primary" plain @click="openDrawer">跟进专员</GLButton>
<!-- <el-button size="small" type="primary" plain @click="openDrawer">跟进专员</el-button> -->
</div>
</div>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!