Files
lilishop-ui/seller/src/views/appointment/onSiteSettings.vue
pikachu1995@126.com 1bad9a14db feat(appointment): 预约商品发布改为可视化配置,并接入表单设计器
商家端补齐预约规则、时段库存与系统表单设计;运营端增加预约工单与订单设置。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 17:06:16 +08:00

104 lines
3.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="search appointment-settings-page">
<el-card>
<el-tabs v-model="activeTab">
<el-tab-pane label="上门服务流程" name="flow">
<el-form v-loading="loading" :model="form" label-width="160px" style="max-width: 760px">
<el-form-item label="用户预约">
<el-switch v-model="form.userBooking" disabled />
</el-form-item>
<el-form-item label="接单">
<el-switch v-model="form.acceptOrder" />
</el-form-item>
<el-form-item label="上门打卡">
<el-switch v-model="form.onSiteCheckin" />
</el-form-item>
<el-form-item label="服务过程留凭">
<el-switch v-model="form.serviceEvidence" />
</el-form-item>
<el-form-item label="结束服务">
<el-switch v-model="form.endService" disabled />
</el-form-item>
<el-form-item label="客户改期审核">
<el-switch v-model="form.customerRescheduleAuditEnabled" />
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="服务区域" name="area">
<el-form v-loading="loading" :model="form" label-width="140px" style="max-width: 760px">
<el-form-item label="开启服务区域">
<el-switch v-model="form.serviceAreaEnabled" />
</el-form-item>
<el-form-item label="区域说明">
<el-input
v-model="form.serviceAreaGeo"
type="textarea"
:rows="4"
placeholder="地图选点数据JSON后端接入后替换为地图组件"
/>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
<div style="margin-top: 12px">
<el-button type="primary" :loading="saving" @click="handleSave">保存</el-button>
<el-button @click="loadData">刷新</el-button>
</div>
</el-card>
</div>
</template>
<script>
import { getOnSiteSettings, saveOnSiteSettings } from "@/api/appointment";
export default {
name: "appointmentOnSiteSettings",
data() {
return {
activeTab: "flow",
loading: false,
saving: false,
form: {
userBooking: true,
acceptOrder: true,
onSiteCheckin: true,
serviceEvidence: false,
endService: true,
customerRescheduleAuditEnabled: false,
serviceAreaEnabled: false,
serviceAreaGeo: "",
},
};
},
mounted() {
this.loadData();
},
methods: {
loadData() {
this.loading = true;
getOnSiteSettings()
.then((res) => {
if (res.success && res.result) {
this.form = { ...this.form, ...res.result };
}
})
.finally(() => {
this.loading = false;
});
},
handleSave() {
this.saving = true;
saveOnSiteSettings(this.form)
.then((res) => {
if (res.success) {
this.$message.success("保存成功");
}
})
.finally(() => {
this.saving = false;
});
},
},
};
</script>