|
|
@@ -53,7 +53,12 @@
|
|
|
:error-message="totalSalesAmountMsg"
|
|
|
label="门店24年总进货额(含所有品牌品类)" />
|
|
|
<van-field v-model="detail.performanceRatio" type="number" label="门店立邦业绩占比(%)" />
|
|
|
- <van-field v-model="detail.mainBrand" autosize type="textarea" :error-message="mainBrandMsg" label="门店主营TOP3品牌" />
|
|
|
+ <van-field
|
|
|
+ v-model="detail.mainBrand"
|
|
|
+ autosize
|
|
|
+ type="textarea"
|
|
|
+ :error-message="mainBrandMsg"
|
|
|
+ label="门店主营TOP3品牌" />
|
|
|
<van-field label="是否有工地资源(支持工地配送,承接工地双包等)">
|
|
|
<template #input>
|
|
|
<van-radio-group
|
|
|
@@ -272,53 +277,55 @@ export default {
|
|
|
// this.detail.ownerBirthday = this.parseTime(time, '{y}-{m}-{d}');
|
|
|
this.datetimeShowPicker = false;
|
|
|
},
|
|
|
- isValidOwnerName(){
|
|
|
+ isValidOwnerName() {
|
|
|
this.ownerNameMsg = '';
|
|
|
let ownerName = this.detail.ownerName;
|
|
|
- if(ownerName.length < 2){
|
|
|
+ if (ownerName.length < 2) {
|
|
|
this.ownerNameMsg = '最短字数2';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
- if(ownerName.length > 20){
|
|
|
+ if (ownerName.length > 20) {
|
|
|
this.ownerNameMsg = '最长字数20';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
const chineseChars = ownerName.match(/[\u4e00-\u9fa5]/g) || [];
|
|
|
if (chineseChars.length < 1) {
|
|
|
this.ownerNameMsg = '至少一个汉字';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
if (/[^a-zA-Z0-9\u4e00-\u9fa5]/.test(ownerName)) {
|
|
|
this.ownerNameMsg = '不可输入特殊符号';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
-
|
|
|
+ return false;
|
|
|
},
|
|
|
- isValidTotalSalesAmount(){
|
|
|
+ isValidTotalSalesAmount() {
|
|
|
this.totalSalesAmountMsg = '';
|
|
|
let totalSalesAmount = this.detail.totalSalesAmount;
|
|
|
const value = parseFloat(totalSalesAmount);
|
|
|
if (isNaN(value)) {
|
|
|
this.totalSalesAmountMsg = '请输入数字';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
if (value < 1) {
|
|
|
this.totalSalesAmountMsg = '最小值1';
|
|
|
- return;
|
|
|
- }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
if (value > 1000) {
|
|
|
this.totalSalesAmountMsg = '最大值1000';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
+ return false;
|
|
|
},
|
|
|
- isValidMainBrand(){
|
|
|
+ isValidMainBrand() {
|
|
|
this.mainBrandMsg = '';
|
|
|
let mainBrand = this.detail.mainBrand;
|
|
|
const chineseChars = mainBrand.match(/[\u4e00-\u9fa5]/g) || [];
|
|
|
if (chineseChars.length < 1) {
|
|
|
this.mainBrandMsg = '至少一个汉字';
|
|
|
- return;
|
|
|
+ return true;
|
|
|
}
|
|
|
+ return false;
|
|
|
},
|
|
|
// 保存
|
|
|
confirmShare() {
|
|
|
@@ -332,6 +339,9 @@ export default {
|
|
|
this.$toast('请验证手机号');
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.isValidOwnerName()) return;
|
|
|
+ if (this.isValidTotalSalesAmount()) return;
|
|
|
+ if (this.isValidMainBrand()) return;
|
|
|
if (this.detail.emergencyContactMobile != '') {
|
|
|
if (!/^1[123456789]\d{9}$/.test(this.detail.emergencyContactMobile)) {
|
|
|
this.$toast('紧急联系人电话格式错误');
|