diff --git a/src/api/CustomerAPI.ts b/src/api/CustomerAPI.ts index 55700a7..b895d30 100644 --- a/src/api/CustomerAPI.ts +++ b/src/api/CustomerAPI.ts @@ -1,10 +1,11 @@ import { axios, type Page, type PageResult } from "timi-web"; import type { Customer, CustomerDailyStatView, CustomerGenderStatView, CustomerTrendStatReq } from "@/types/Customer"; +import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store"; const BASE_URI = "/gao/customer"; async function list(page: Page): Promise> { - return await axios.post(`${BASE_URI}/list`, page); + return await axios.post(`${BASE_URI}/list`, withCurrentStorePage(page)); } async function detail(id: string): Promise { @@ -14,11 +15,11 @@ async function detail(id: string): Promise { } async function create(customer: Customer): Promise { - return await axios.post(`${BASE_URI}/create`, customer); + return await axios.post(`${BASE_URI}/create`, withCurrentStoreId(customer)); } async function update(page: Customer): Promise { - return await axios.post(`${BASE_URI}/update`, page); + return await axios.post(`${BASE_URI}/update`, withCurrentStoreId(page)); } async function remove(id: string): Promise { @@ -35,18 +36,24 @@ async function findById(id: string): Promise { async function findByCode(code: string): Promise { return await axios.post(`${BASE_URI}/find/code`, null, { - params: { code } + params: { + storeId: getCurrentStoreId(), + code + } }); } async function findByName(name: string): Promise { return await axios.post(`${BASE_URI}/find/name`, null, { - params: { name } - }) + params: { + storeId: getCurrentStoreId(), + name + } + }); } async function exportXSSF(page: Page): Promise { - return await axios.post(`${BASE_URI}/export`, page, { + return await axios.post(`${BASE_URI}/export`, withCurrentStorePage(page), { responseType: "blob" }); } @@ -73,11 +80,13 @@ async function deleteInvite(customerId: string): Promise { } async function dailyStat(req: CustomerTrendStatReq): Promise { - return await axios.post(`${BASE_URI}/state/daily`, req); + return await axios.post(`${BASE_URI}/state/daily`, withCurrentStoreId(req)); } async function genderStat(): Promise { - return await axios.post(`${BASE_URI}/state/gender`); + return await axios.post(`${BASE_URI}/state/gender`, undefined, { + params: { storeId: getCurrentStoreId() } + }); } export default { @@ -96,4 +105,3 @@ export default { dailyStat, genderStat }; - diff --git a/src/api/EventAPI.ts b/src/api/EventAPI.ts index a6b61e8..1a23ab9 100644 --- a/src/api/EventAPI.ts +++ b/src/api/EventAPI.ts @@ -1,14 +1,17 @@ import { axios, type Page, type PageResult } from "timi-web"; import type { EventItem } from "@/types/EventItem"; +import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store"; const BASE_URI = "/gao/event"; async function list(req: Page): Promise> { - return await axios.post(`${BASE_URI}/list`, req); + return await axios.post(`${BASE_URI}/list`, withCurrentStorePage(req)); } async function listValid(): Promise { - return await axios.post(`${BASE_URI}/list/valid`); + return await axios.post(`${BASE_URI}/list/valid`, undefined, { + params: { storeId: getCurrentStoreId() } + }); } async function detail(id: string): Promise { @@ -18,11 +21,11 @@ async function detail(id: string): Promise { } async function create(event: EventItem): Promise { - return await axios.post(`${BASE_URI}/create`, event); + return await axios.post(`${BASE_URI}/create`, withCurrentStoreId(event)); } async function update(event: EventItem): Promise { - return await axios.post(`${BASE_URI}/update`, event); + return await axios.post(`${BASE_URI}/update`, withCurrentStoreId(event)); } async function sort(idList: string[]): Promise { diff --git a/src/api/EventRecordAPI.ts b/src/api/EventRecordAPI.ts index d641c17..8888e0d 100644 --- a/src/api/EventRecordAPI.ts +++ b/src/api/EventRecordAPI.ts @@ -1,11 +1,12 @@ import { axios, type PageResult } from "timi-web"; import type { CustomerEventRankView, EventRecord, EventRecordPage, EventRecordRankPage } from "@/types/EventRecord"; import type { Customer } from "@/types/Customer.ts"; +import { withCurrentStoreId } from "@/utils/store"; const BASE_URI = "/gao/event/record"; async function list(page: EventRecordPage): Promise> { - return await axios.post(`${BASE_URI}/list`, page); + return await axios.post(`${BASE_URI}/list`, withCurrentStoreId(page)); } async function detail(id: string): Promise { @@ -15,19 +16,19 @@ async function detail(id: string): Promise { } async function create(record: EventRecord): Promise { - await axios.post(`${BASE_URI}/create`, record); + await axios.post(`${BASE_URI}/create`, withCurrentStoreId(record)); } async function createBatch(recordList: EventRecord[]): Promise { - await axios.post(`${BASE_URI}/create/batch`, recordList); + await axios.post(`${BASE_URI}/create/batch`, recordList.map(record => withCurrentStoreId(record))); } async function createWithCustomer(customer: Customer): Promise { - await axios.post(`${BASE_URI}/create/customer`, customer); + await axios.post(`${BASE_URI}/create/customer`, withCurrentStoreId(customer)); } async function update(record: EventRecord): Promise { - await axios.post(`${BASE_URI}/update`, record); + await axios.post(`${BASE_URI}/update`, withCurrentStoreId(record)); } async function remove(id: string): Promise { @@ -37,11 +38,11 @@ async function remove(id: string): Promise { } async function eventRank(page: EventRecordRankPage): Promise { - return await axios.post(`${BASE_URI}/rank`, page); + return await axios.post(`${BASE_URI}/rank`, withCurrentStoreId(page)); } async function exportXSSF(page: EventRecordPage): Promise { - return await axios.post(`${BASE_URI}/export`, page, { + return await axios.post(`${BASE_URI}/export`, withCurrentStoreId(page), { responseType: "blob" }); } @@ -57,4 +58,3 @@ export default { remove, eventRank }; - diff --git a/src/api/ManagedUserAPI.ts b/src/api/ManagedUserAPI.ts index c41cf60..441bfef 100644 --- a/src/api/ManagedUserAPI.ts +++ b/src/api/ManagedUserAPI.ts @@ -1,10 +1,11 @@ import { axios, type Page, type PageResult, type Role } from "timi-web"; import type { ManagedUser } from "@/types/ManagedUser"; +import { withCurrentStoreId, withCurrentStorePage } from "@/utils/store"; const BASE_URI = "/gao/user"; async function list(page: Page): Promise> { - return await axios.post(`${BASE_URI}/list`, page); + return await axios.post(`${BASE_URI}/list`, withCurrentStorePage(page)); } async function detail(id: string): Promise { @@ -14,11 +15,11 @@ async function detail(id: string): Promise { } async function create(user: ManagedUser): Promise { - return await axios.post(`${BASE_URI}/create`, user); + return await axios.post(`${BASE_URI}/create`, withCurrentStoreId(user)); } async function update(user: ManagedUser): Promise { - return await axios.post(`${BASE_URI}/update`, user); + return await axios.post(`${BASE_URI}/update`, withCurrentStoreId(user)); } async function remove(id: string): Promise { diff --git a/src/api/StoreAPI.ts b/src/api/StoreAPI.ts new file mode 100644 index 0000000..28e6801 --- /dev/null +++ b/src/api/StoreAPI.ts @@ -0,0 +1,85 @@ +import { axios, type Page, type PageResult } from "timi-web"; +import type { Store, StoreBusinessDay } from "@/types/Store"; + +const STORE_BASE_URI = "/gao/store"; +const BUSINESS_DAY_BASE_URI = "/gao/store/business/day"; + +async function list(page: Page): Promise> { + return await axios.post(`${STORE_BASE_URI}/list`, page); +} + +async function detail(id: string): Promise { + return await axios.post(`${STORE_BASE_URI}/detail`, undefined, { + params: { id } + }); +} + +async function create(store: Store): Promise { + return await axios.post(`${STORE_BASE_URI}/create`, store); +} + +async function update(store: Store): Promise { + await axios.post(`${STORE_BASE_URI}/update`, store); +} + +async function remove(id: string): Promise { + await axios.post(`${STORE_BASE_URI}/delete`, undefined, { + params: { id } + }); +} + +async function exportXSSF(page: Page): Promise { + return await axios.post(`${STORE_BASE_URI}/export`, page, { + responseType: "blob" + }); +} + +async function businessDayList(page: Page): Promise> { + return await axios.post(`${BUSINESS_DAY_BASE_URI}/list`, page); +} + +async function businessDayCalendar(storeId: string, beginDateValue: number, endDateValue: number): Promise { + return await axios.post(`${BUSINESS_DAY_BASE_URI}/calendar`, undefined, { + params: { + storeId, + beginDateValue, + endDateValue + } + }); +} + +async function businessDayDetail(id: string): Promise { + return await axios.post(`${BUSINESS_DAY_BASE_URI}/detail`, undefined, { + params: { id } + }); +} + +async function createBusinessDay(day: StoreBusinessDay): Promise { + return await axios.post(`${BUSINESS_DAY_BASE_URI}/create`, day); +} + +async function updateBusinessDay(day: StoreBusinessDay): Promise { + await axios.post(`${BUSINESS_DAY_BASE_URI}/update`, day); +} + +async function removeBusinessDay(id: string): Promise { + await axios.post(`${BUSINESS_DAY_BASE_URI}/delete`, undefined, { + params: { id } + }); +} + +export default { + list, + detail, + create, + update, + remove, + exportXSSF, + businessDayList, + businessDayCalendar, + businessDayDetail, + createBusinessDay, + updateBusinessDay, + removeBusinessDay +}; + diff --git a/src/pages/customer/QuickSignInPage.vue b/src/pages/customer/QuickSignInPage.vue index ef10daf..b119331 100644 --- a/src/pages/customer/QuickSignInPage.vue +++ b/src/pages/customer/QuickSignInPage.vue @@ -190,7 +190,7 @@ async function doSubmit(): Promise { customerId: customer.id, eventId: selectedEventId.value, remark: "客户快速扫码登记" - }) + }); scanStatus.value = `登记成功:${customer.name || customer.code || scanCode.value}。`; scanCode.value = ""; matchedCustomer.value = undefined; @@ -362,4 +362,3 @@ async function doSubmit(): Promise { } } - diff --git a/src/pages/management/CustomerList.vue b/src/pages/management/CustomerList.vue index 3e1fa95..b664530 100644 --- a/src/pages/management/CustomerList.vue +++ b/src/pages/management/CustomerList.vue @@ -124,7 +124,7 @@ const fetch = Toolkit.debounce(async () => { likesExample: { code: keyword.value, name: keyword.value, - telephone: keyword.value, + telephone: keyword.value } }); pageResult.total = result.total; @@ -336,4 +336,3 @@ async function doExport(): Promise { } } - diff --git a/src/pages/management/StoreBusinessDayList.vue b/src/pages/management/StoreBusinessDayList.vue new file mode 100644 index 0000000..75baa05 --- /dev/null +++ b/src/pages/management/StoreBusinessDayList.vue @@ -0,0 +1,406 @@ + + + + + + diff --git a/src/pages/management/StoreEdit.vue b/src/pages/management/StoreEdit.vue new file mode 100644 index 0000000..618d756 --- /dev/null +++ b/src/pages/management/StoreEdit.vue @@ -0,0 +1,257 @@ + + + + + + diff --git a/src/pages/management/StoreList.vue b/src/pages/management/StoreList.vue new file mode 100644 index 0000000..7f6f110 --- /dev/null +++ b/src/pages/management/StoreList.vue @@ -0,0 +1,211 @@ + + + + + + diff --git a/src/pages/tabs/ManagementTab.vue b/src/pages/tabs/ManagementTab.vue index 78e1d3c..7c9c422 100644 --- a/src/pages/tabs/ManagementTab.vue +++ b/src/pages/tabs/ManagementTab.vue @@ -22,6 +22,20 @@ + + + + + 技术支持:夜雨

Copyright © 2026 imyeyu.com

+ + +