|
|
@@ -52,7 +52,11 @@
|
|
|
type="number"
|
|
|
:error-message="totalSalesAmountMsg"
|
|
|
label="门店24年总进货额(含所有品牌品类)" />
|
|
|
- <van-field v-model="detail.performanceRatio" type="number" label="门店立邦业绩占比(%)" />
|
|
|
+ <van-field
|
|
|
+ v-model="detail.performanceRatio"
|
|
|
+ type="number"
|
|
|
+ :error-message="performanceRatioMsg"
|
|
|
+ label="门店立邦业绩占比(%)" />
|
|
|
<van-field
|
|
|
v-model="detail.mainBrand"
|
|
|
autosize
|
|
|
@@ -137,6 +141,7 @@ export default {
|
|
|
return {
|
|
|
ownerNameMsg: '',
|
|
|
totalSalesAmountMsg: '',
|
|
|
+ performanceRatioMsg: '',
|
|
|
mainBrandMsg: '',
|
|
|
detail: null,
|
|
|
time: null, //计时
|
|
|
@@ -317,6 +322,24 @@ export default {
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
+ isPerformanceRatio() {
|
|
|
+ this.performanceRatioMsg = '';
|
|
|
+ let performanceRatio = this.detail.performanceRatio;
|
|
|
+ const value = parseFloat(performanceRatio);
|
|
|
+ if (isNaN(value)) {
|
|
|
+ this.performanceRatioMsg = '请输入数字';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (value < 1) {
|
|
|
+ this.performanceRatioMsg = '最小值1';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (value > 100) {
|
|
|
+ this.performanceRatioMsg = '最大值100';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
isValidMainBrand() {
|
|
|
this.mainBrandMsg = '';
|
|
|
let mainBrand = this.detail.mainBrand;
|
|
|
@@ -341,6 +364,7 @@ export default {
|
|
|
}
|
|
|
if (this.isValidOwnerName()) return;
|
|
|
if (this.isValidTotalSalesAmount()) return;
|
|
|
+ if (this.isPerformanceRatio()) return;
|
|
|
if (this.isValidMainBrand()) return;
|
|
|
if (this.detail.emergencyContactMobile != '') {
|
|
|
if (!/^1[123456789]\d{9}$/.test(this.detail.emergencyContactMobile)) {
|