Commit 2f359b85 by lixiaomin

修改店铺最远距离

parent f3069ff7
......@@ -27,16 +27,25 @@
<el-form-item label="详细地址" prop="address">
<el-input v-model="form.address" placeholder="请输入详细地址" />
</el-form-item>
<el-form-item label="营业时间" prop="time">
<el-time-picker
is-range
v-model="form.time"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" format="HH:mm" value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="营业时间" prop="time">
<el-time-picker
is-range
v-model="form.time"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" format="HH:mm" value-format="HH:mm">
</el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最远下单距离">
<el-input v-model="form.distanceLimit" placeholder="请输入最远下单距离单位:km"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
......@@ -109,6 +118,13 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
var regular=/(^[+]{0,1}([0-9]+)$)|(^[+]{0,1}([0-9]+)[\.]{1,3}[0-9]{1,3}$)/;
if(this.form.distanceLimit!="" && this.form.distanceLimit!=null){
if(!regular.test(this.form.distanceLimit)){
this.$message.error("最远下单距离最多输入3位小数");
return;
}
}
const { time, province, ...surplus } = this.form
surplus.startTime = time[0]
surplus.endTime = time[1]
......@@ -150,7 +166,8 @@ export default {
city: null,
zone: null,
state: null,
time: null
time: null,
distanceLimit:null,
};
this.resetForm("form");
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment