优化新版数据统计页面,优化销量统计
This commit is contained in:
@@ -160,9 +160,10 @@
|
||||
<el-switch v-model="form.isOrderFence" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<div class="tips" style="font-size: 14px;color: #999;">开启后,用户只能在店铺附近xx公里内点餐</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<div class="center" v-if="form.isOrderFence == 1">
|
||||
<el-input v-model="form.orderFenceDistance" placeholder="请输入"
|
||||
@input="e => form.orderFenceDistance = filterNumberInput(e)" style="width: 250px;" :cus>
|
||||
@input="e => form.orderFenceDistance = filterNumberInput(e)" style="width: 250px;"
|
||||
input-style="text-align: center;">
|
||||
<template #prepend>限制:</template>
|
||||
<template #append>公里</template>
|
||||
</el-input>
|
||||
@@ -260,7 +261,7 @@ export default {
|
||||
trigger: "blur",
|
||||
validator: (rule, value, callback) => {
|
||||
if (this.form.isOrderFence === 1 && (!this.form.orderFenceDistance || this.form.orderFenceDistance <= 0)) {
|
||||
callback(new Error("请输入限制米数"));
|
||||
callback(new Error("请输入限制公里数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
@@ -391,29 +392,34 @@ export default {
|
||||
// 保存
|
||||
submitHandle() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
this.formLoading = true;
|
||||
if (this.startTime && this.endTime) {
|
||||
this.form.businessTime = `${this.startTime}-${this.endTime}`;
|
||||
}
|
||||
|
||||
const data = { ...this.form }
|
||||
|
||||
if (this.form.isOrderFence == 1) {
|
||||
this.form.orderFenceDistance = this.form.orderFenceDistance * 1000
|
||||
data.orderFenceDistance = this.form.orderFenceDistance * 1000
|
||||
}
|
||||
const res = await ShopApi.edit({
|
||||
...this.form,
|
||||
|
||||
await ShopApi.edit({
|
||||
...data,
|
||||
eatModel: this.form.eatModel.join(","),
|
||||
});
|
||||
|
||||
ElMessage.success({
|
||||
title: "成功",
|
||||
message: "提交成功",
|
||||
});
|
||||
setTimeout(() => {
|
||||
// location.reload();
|
||||
}, 1000);
|
||||
} catch (error) { }
|
||||
this.formLoading = false;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.formLoading = false;
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user