调整收费套餐页面

This commit is contained in:
邱贞招 2024-12-03 10:04:11 +08:00
parent a65e254c17
commit 105269a62e
2 changed files with 67 additions and 67 deletions

View File

@ -5,7 +5,7 @@ NODE_ENV = production
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
# VUE_APP_BASE_API = 'https://dche.ccttiot.com/prod-api' VUE_APP_BASE_API = 'https://dche.ccttiot.com/prod-api'
VUE_APP_BASE_API = 'https://che.chuangtewl.com/prod-api' # VUE_APP_BASE_API = 'https://che.chuangtewl.com/prod-api'
# 共享电动车管理系统/测试环境 # 共享电动车管理系统/测试环境
# VUE_APP_BASE_API = 'https://dianche.chuantewulian.cn/stage-api' # VUE_APP_BASE_API = 'https://dianche.chuantewulian.cn/stage-api'

View File

@ -538,89 +538,89 @@ export default {
} }
}, },
validateMore() { validateMore() {
if(this.form.ridingRule === '1'){ if(this.form.ridingRule == 2) {
return true const { start, end, eachUnit, fee } = this.more;
} //
const { start, end, eachUnit, fee } = this.more;
//
if (start === '' || end === '') {
this.$modal.msgError('区间计费:大于分钟数不能为空');
return false;
}
//
if (eachUnit === '') {
this.$modal.msgError('区间计费:大于每分钟数不能为空');
return false;
}
if (fee === '') {
this.$modal.msgError('区间计费:大于分钟之后的金额不能为空');
return false;
}
//
if (isNaN(Number(start)) || isNaN(Number(end))) {
this.$modal.msgError('区间计费:大于分钟数必须是数值');
return false;
}
//
if (isNaN(Number(eachUnit))) {
this.$modal.msgError('区间计费:大于每分钟数必须是数值');
return false;
}
if (isNaN(Number(fee))) {
this.$modal.msgError('区间计费:大于分钟之后的金额必须是数值');
return false;
}
return true; //
},
validateRules() {
if(this.form.ridingRule === '1'){
console.log(111111111111)
return true
}
for (let i = 0; i < this.rule.length; i++) {
const { start, end, eachUnit, fee } = this.rule[i];
if (start === '' || end === '') { if (start === '' || end === '') {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的开始或结束值不能为空`); this.$modal.msgError('区间计费:大于分钟数不能为空');
return false; return false;
} }
//
if (eachUnit === '') { if (eachUnit === '') {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的分钟数不能为空`); this.$modal.msgError('区间计费:大于每分钟数不能为空');
return false; return false;
} }
if (fee === '') { if (fee === '') {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的金额不能为空`); this.$modal.msgError('区间计费:大于分钟之后的金额不能为空');
return false; return false;
} }
// //
if (isNaN(Number(start)) || isNaN(Number(end))) { if (isNaN(Number(start)) || isNaN(Number(end))) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的开始和结束值必须是数值`); this.$modal.msgError('区间计费:大于分钟数必须是数值');
return false; return false;
} }
//
if (isNaN(Number(eachUnit))) { if (isNaN(Number(eachUnit))) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的分钟数必须是数值`); this.$modal.msgError('区间计费:大于每分钟数必须是数值');
return false; return false;
} }
if (isNaN(Number(fee))) { if (isNaN(Number(fee))) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的金额必须是数值`); this.$modal.msgError('区间计费:大于分钟之后的金额必须是数值');
return false;
}
if (parseFloat(start) >= parseFloat(end)) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的结束值必须小于开始值`);
return false; return false;
} }
return true; //
}
return true;
},
validateRules() {
if(this.form.ridingRule == 2 && this.rule.length > 0){
for (let i = 0; i < this.rule.length; i++) {
const { start, end, eachUnit, fee } = this.rule[i];
if (start === '' || end === '') {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的开始或结束值不能为空`);
return false;
}
if (eachUnit === '') {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的分钟数不能为空`);
return false;
}
if (fee === '') {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的金额不能为空`);
return false;
}
//
if (isNaN(Number(start)) || isNaN(Number(end))) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的开始和结束值必须是数值`);
return false;
}
if (isNaN(Number(eachUnit))) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的分钟数必须是数值`);
return false;
}
if (isNaN(Number(fee))) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的金额必须是数值`);
return false;
}
if (parseFloat(start) >= parseFloat(end)) {
this.$modal.msgError(`区间计费:第 ${i + 1} 区间的结束值必须小于开始值`);
return false;
}
}
return true; //
}else {
return true; //
} }
return true; //
}, },
addInterval() { addInterval() {
// this.rule.push({ start: '', end: '', eachUnit: '', fee: '' }); // this.rule.push({ start: '', end: '', eachUnit: '', fee: '' });
@ -739,13 +739,13 @@ export default {
}); });
}, },
submitForm() { submitForm() {
if(!this.validateRules()){
return
}
if (!this.validateMore()) {
return; //
}
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if(!this.validateRules()){
return
}
if (!this.validateMore()) {
return; //
}
if (valid) { if (valid) {
// //
if (!/^\d+$/.test(this.startingTime)) { if (!/^\d+$/.test(this.startingTime)) {
@ -757,7 +757,7 @@ export default {
return; return;
} }
// this.form.rule.push(this.more) // this.form.rule.push(this.more)
console.log(this.form,'mmmmmmmmmmmmm'); console.log(JSON.stringify(this.form),'mmmmmmmmmmmmm');
let data = { ...this.form }; // 使 this.form let data = { ...this.form }; // 使 this.form