Compare commits
6
Commits
d036d756f4
...
13a1160ad2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13a1160ad2 | ||
|
|
10a77a9d1b | ||
|
|
569848b97e | ||
|
|
4c8dadc7bc | ||
|
|
1c2cd2506b | ||
|
|
3d1c030a6f |
@@ -9,6 +9,8 @@ export type CustomerPage = Page<Customer> & {
|
||||
keyword?: string;
|
||||
storeId?: string;
|
||||
tagIdList?: string[];
|
||||
beginCreatedAt?: number;
|
||||
endCreatedAt?: number;
|
||||
};
|
||||
|
||||
async function list(page: CustomerPage): Promise<PageResult<Customer>> {
|
||||
@@ -19,6 +21,8 @@ async function list(page: CustomerPage): Promise<PageResult<Customer>> {
|
||||
keyword: page.keyword || page.likesExample?.code || page.likesExample?.name || page.likesExample?.telephone,
|
||||
storeId: page.storeId || req.equalsExample?.storeId,
|
||||
tagIdList: page.tagIdList || [],
|
||||
beginCreatedAt: page.beginCreatedAt,
|
||||
endCreatedAt: page.endCreatedAt,
|
||||
orderMap: page.orderMap || {}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { axios } from "timi-web-api";
|
||||
import { axios } from "timi-web-api/api/BaseAPI";
|
||||
import type { Page, PageResult } from "timi-web-api";
|
||||
import type { Store, StoreBusinessDay } from "@/types/Store";
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import AppNavBar from "@/components/navbar/index.vue";
|
||||
import PageTransition from "@/components/PageTransition.vue";
|
||||
import { useTabBarStore } from "@/store/tabBarStore";
|
||||
import { permissionCodes } from "@/utils/permission";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import { useUserStore } from "timi-web-api/store";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
+12
-9
@@ -4,18 +4,20 @@ import router from "@/router";
|
||||
import Root from "@/Root.vue";
|
||||
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
||||
|
||||
import "tdesign-mobile-vue/es/style/index.css";
|
||||
import "timi-web/style.css";
|
||||
import "timi-tdesign-mobile/style.css";
|
||||
import "vue-virtual-scroller/dist/vue-virtual-scroller.css";
|
||||
import "@/assets/styles/tdesign-custom.css";
|
||||
import "@/assets/styles/global.less";
|
||||
import TimiWebUI from "timi-web";
|
||||
import { configureUserStore, Network, useUserStore, VCan, VRole } from "timi-web-api";
|
||||
import { configureUserStore, useUserStore } from "timi-web-api/store";
|
||||
import Network from "timi-web-api/utils/Network";
|
||||
import { VCan, VRole } from "timi-web-api/utils/directives/Access";
|
||||
import type { ApiResponse } from "timi-web-api";
|
||||
import { Message } from "@/utils/message";
|
||||
import vEntranceTransition from "@/directives/entranceTransition";
|
||||
|
||||
import "vue-virtual-scroller/dist/vue-virtual-scroller.css";
|
||||
import "tdesign-mobile-vue/es/style/index.css";
|
||||
import "timi-web/style.css";
|
||||
import "timi-tdesign-mobile/style.css";
|
||||
import "@/assets/styles/tdesign-custom.css";
|
||||
import "@/assets/styles/global.less";
|
||||
|
||||
export const pinia = createPinia();
|
||||
const apiBaseURL = import.meta.env.VITE_API_BASE_URL as string | undefined;
|
||||
|
||||
@@ -47,7 +49,6 @@ Network.setGlobalRequestInterceptor((config: any) => {
|
||||
async function bootstrap(): Promise<void> {
|
||||
const app = createApp(Root);
|
||||
app.use(pinia);
|
||||
app.use(TimiWebUI);
|
||||
app.directive("can", VCan);
|
||||
app.directive("role", VRole);
|
||||
app.directive("entrance-transition", vEntranceTransition);
|
||||
@@ -64,6 +65,8 @@ async function bootstrap(): Promise<void> {
|
||||
});
|
||||
|
||||
app.use(router);
|
||||
await router.isReady();
|
||||
await import("timi-tdesign-mobile");
|
||||
app.mount("#root");
|
||||
}
|
||||
|
||||
|
||||
@@ -21,19 +21,19 @@
|
||||
</t-button>
|
||||
</template>
|
||||
</t-input>
|
||||
<t-button
|
||||
v-if="canReadTag"
|
||||
class="tag-filter"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="tagSelectorVisible = true"
|
||||
>
|
||||
<template #icon>
|
||||
<t-icon name="tag" />
|
||||
</template>
|
||||
<span v-text="tagFilterText" />
|
||||
</t-button>
|
||||
<t-dropdown-menu ref="filterMenu" class="menus">
|
||||
<t-dropdown-item
|
||||
v-model="dateFilterType"
|
||||
:label="dateFilterLabel"
|
||||
:options="dateOptions"
|
||||
@change="selectDateFilter"
|
||||
/>
|
||||
<t-dropdown-item
|
||||
v-if="canReadTag"
|
||||
:label="tagFilterText"
|
||||
@open="handleTagFilterOpen"
|
||||
/>
|
||||
</t-dropdown-menu>
|
||||
</div>
|
||||
<div v-if="scannerVisible" class="scanner-wrapper">
|
||||
<code-scanner
|
||||
@@ -54,6 +54,20 @@
|
||||
/>
|
||||
<t-button size="extra-small" variant="text" @click="clearTagFilter">清空</t-button>
|
||||
</div>
|
||||
<t-cell-group v-if="dateFilterType !== 'all'" class="date-summary" theme="card">
|
||||
<t-cell
|
||||
title="开始时间"
|
||||
:note="dateRange[0] || '-'"
|
||||
arrow
|
||||
@click="openStartTime"
|
||||
/>
|
||||
<t-cell
|
||||
title="结束时间"
|
||||
:note="dateRange[1] || '-'"
|
||||
arrow
|
||||
@click="openEndTime"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-pull-down-refresh
|
||||
class="list-wrapper fix-last-cell-line"
|
||||
v-model="isRefreshing"
|
||||
@@ -106,9 +120,34 @@
|
||||
/>
|
||||
</div>
|
||||
<nav-bar-action-menu v-if="canShowActionMenu" :actions="actionList" />
|
||||
<t-popup v-model="startVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="startVisible"
|
||||
v-model="startDraft"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
:mode="['date', 'minute']"
|
||||
title="开始时间"
|
||||
:default-value="startDraft"
|
||||
@cancel="cancelStartTime"
|
||||
@confirm="confirmStartTime"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="endVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="endVisible"
|
||||
v-model="endDraft"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
:mode="['date', 'minute']"
|
||||
title="结束时间"
|
||||
:default-value="endDraft"
|
||||
@cancel="cancelEndTime"
|
||||
@confirm="confirmEndTime"
|
||||
/>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { DropdownValue } from "tdesign-mobile-vue";
|
||||
import { Message } from "@/utils/message";
|
||||
import { Time, Toolkit, WebToolkit } from "timi-web";
|
||||
import { type Page, type PageResult, useUserStore } from "timi-web-api";
|
||||
@@ -128,6 +167,8 @@ defineOptions({
|
||||
name: "CustomerList"
|
||||
});
|
||||
|
||||
type DateFilterType = "today" | "yesterday" | "lastWeek" | "thisMonth" | "lastMonth" | "all" | "custom";
|
||||
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const currentStoreStore = useCurrentStoreStore();
|
||||
@@ -148,6 +189,23 @@ const canShowActionMenu = computed(() => canCreateCustomer.value || canExportCus
|
||||
const scannerVisible = ref(false);
|
||||
const scanStatus = ref("点击扫码开始识别");
|
||||
let latestDecodedText = "";
|
||||
const dateOptions: Array<{ label: string; value: DateFilterType }> = [
|
||||
{ label: "全部", value: "all" },
|
||||
{ label: "今天", value: "today" },
|
||||
{ label: "昨天", value: "yesterday" },
|
||||
{ label: "上周", value: "lastWeek" },
|
||||
{ label: "本月", value: "thisMonth" },
|
||||
{ label: "上个月", value: "lastMonth" },
|
||||
{ label: "自定义范围", value: "custom" }
|
||||
];
|
||||
const dateFilterType = ref<DateFilterType>("all");
|
||||
const dateRange = ref<[string, string]>(buildPresetRange("all"));
|
||||
const startDraft = ref("");
|
||||
const endDraft = ref("");
|
||||
const startVisible = ref(false);
|
||||
const endVisible = ref(false);
|
||||
const filterMenu = ref<{ toggle?: (index?: number) => void }>();
|
||||
const dateFilterLabel = computed(() => `录入时间:${dateOptions.find(item => item.value === dateFilterType.value)?.label || "全部"}`);
|
||||
|
||||
async function toggleScanner(): Promise<void> {
|
||||
scannerVisible.value = !scannerVisible.value;
|
||||
@@ -205,6 +263,65 @@ const actionList = computed<NavBarAction[]>(() => {
|
||||
return list;
|
||||
});
|
||||
|
||||
// ---------- 录入时间筛选 ----------
|
||||
|
||||
async function selectDateFilter(value: DropdownValue): Promise<void> {
|
||||
if (Array.isArray(value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
dateFilterType.value = String(value) as DateFilterType;
|
||||
if (dateFilterType.value !== "custom") {
|
||||
dateRange.value = buildPresetRange(dateFilterType.value);
|
||||
await refresh();
|
||||
}
|
||||
}
|
||||
|
||||
function openStartTime(): void {
|
||||
startDraft.value = dateRange.value[0] || `${Time.formatDate(new Date())} 00:00`;
|
||||
startVisible.value = true;
|
||||
}
|
||||
|
||||
function openEndTime(): void {
|
||||
endDraft.value = dateRange.value[1] || `${Time.formatDate(new Date())} 23:59`;
|
||||
endVisible.value = true;
|
||||
}
|
||||
|
||||
function cancelStartTime(): void {
|
||||
startVisible.value = false;
|
||||
startDraft.value = dateRange.value[0];
|
||||
}
|
||||
|
||||
function cancelEndTime(): void {
|
||||
endVisible.value = false;
|
||||
endDraft.value = dateRange.value[1];
|
||||
}
|
||||
|
||||
async function confirmStartTime(value?: string | number): Promise<void> {
|
||||
startVisible.value = false;
|
||||
dateRange.value = [String(value || startDraft.value), dateRange.value[1]];
|
||||
await confirmCustomRange();
|
||||
}
|
||||
|
||||
async function confirmEndTime(value?: string | number): Promise<void> {
|
||||
endVisible.value = false;
|
||||
dateRange.value = [dateRange.value[0], String(value || endDraft.value)];
|
||||
await confirmCustomRange();
|
||||
}
|
||||
|
||||
async function confirmCustomRange(): Promise<void> {
|
||||
if (dateRange.value[0] && dateRange.value[1] && dateRange.value[1] < dateRange.value[0]) {
|
||||
dateRange.value = [dateRange.value[1], dateRange.value[0]];
|
||||
}
|
||||
dateFilterType.value = "custom";
|
||||
await refresh();
|
||||
}
|
||||
|
||||
function handleTagFilterOpen(): void {
|
||||
tagSelectorVisible.value = true;
|
||||
filterMenu.value?.toggle?.();
|
||||
}
|
||||
|
||||
// ---------- 标签筛选 ----------
|
||||
|
||||
const selectedTagList = ref<Tag[]>([]);
|
||||
@@ -244,11 +361,14 @@ const page = reactive<Page<Customer>>({
|
||||
});
|
||||
|
||||
const fetch = Toolkit.debounce(async () => {
|
||||
const [beginCreatedAt, endCreatedAt] = buildCreatedAtRange();
|
||||
const result = await CustomerAPI.list({
|
||||
...page,
|
||||
keyword: keyword.value,
|
||||
storeId: currentStoreStore.currentStoreId,
|
||||
tagIdList: selectedTagIdList.value
|
||||
tagIdList: selectedTagIdList.value,
|
||||
beginCreatedAt,
|
||||
endCreatedAt
|
||||
});
|
||||
pageResult.total = result.total;
|
||||
pageResult.list = pageResult.list.concat(result.list);
|
||||
@@ -360,6 +480,65 @@ async function doExport(): Promise<void> {
|
||||
isExporting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function buildCreatedAtRange(): [number | undefined, number | undefined] {
|
||||
if (dateFilterType.value === "all") {
|
||||
return [undefined, undefined];
|
||||
}
|
||||
|
||||
return [
|
||||
dateRange.value[0] ? Time.toTimestamp(parseDateTime(dateRange.value[0], false)) : undefined,
|
||||
dateRange.value[1] ? Time.toTimestamp(parseDateTime(dateRange.value[1], true)) : undefined
|
||||
];
|
||||
}
|
||||
|
||||
function buildPresetRange(type: Exclude<DateFilterType, "custom">): [string, string] {
|
||||
if (type === "all") {
|
||||
return ["", ""];
|
||||
}
|
||||
if (type === "lastWeek") {
|
||||
const current = new Date();
|
||||
current.setHours(0, 0, 0, 0);
|
||||
const day = current.getDay() || 7;
|
||||
const thisWeekMonday = new Date(current);
|
||||
thisWeekMonday.setDate(current.getDate() - day + 1);
|
||||
const lastWeekMonday = new Date(thisWeekMonday);
|
||||
lastWeekMonday.setDate(thisWeekMonday.getDate() - 7);
|
||||
const lastWeekSunday = new Date(thisWeekMonday);
|
||||
lastWeekSunday.setDate(thisWeekMonday.getDate() - 1);
|
||||
return [`${Time.formatDate(lastWeekMonday)} 00:00`, `${Time.formatDate(lastWeekSunday)} 23:59`];
|
||||
}
|
||||
if (type === "thisMonth") {
|
||||
const current = new Date();
|
||||
const begin = new Date(current.getFullYear(), current.getMonth(), 1);
|
||||
return [`${Time.formatDate(begin)} 00:00`, `${Time.formatDate(current)} 23:59`];
|
||||
}
|
||||
if (type === "lastMonth") {
|
||||
const current = new Date();
|
||||
const begin = new Date(current.getFullYear(), current.getMonth() - 1, 1);
|
||||
const end = new Date(current.getFullYear(), current.getMonth(), 0);
|
||||
return [`${Time.formatDate(begin)} 00:00`, `${Time.formatDate(end)} 23:59`];
|
||||
}
|
||||
|
||||
const offsetMap: Record<Exclude<DateFilterType, "all" | "custom" | "lastWeek" | "thisMonth" | "lastMonth">, number> = {
|
||||
today: 0,
|
||||
yesterday: 1
|
||||
};
|
||||
const date = new Date();
|
||||
date.setHours(0, 0, 0, 0);
|
||||
date.setDate(date.getDate() - offsetMap[type]);
|
||||
return [`${Time.formatDate(date)} 00:00`, `${Time.formatDate(date)} 23:59`];
|
||||
}
|
||||
|
||||
function parseDateTime(value: string, isEnd: boolean): Date {
|
||||
if (!value) {
|
||||
return isEnd ? new Date() : new Date(0);
|
||||
}
|
||||
const [dateText, timeText = isEnd ? "23:59" : "00:00"] = value.split(" ");
|
||||
const [year, month, day] = dateText.split("-").map(Number);
|
||||
const [hour, minute] = timeText.split(":").map(Number);
|
||||
return new Date(year, month - 1, day, hour || 0, minute || 0, isEnd ? 59 : 0, 0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@@ -367,33 +546,38 @@ async function doExport(): Promise<void> {
|
||||
padding: var(--app-nav-height) 0 1rem 0;
|
||||
|
||||
.filter {
|
||||
gap: .5rem;
|
||||
top: var(--app-nav-height);
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
padding: .5rem;
|
||||
display: flex;
|
||||
padding: .75rem 1rem;
|
||||
position: sticky;
|
||||
background: #f5f5f8;
|
||||
box-shadow: var(--td-shadow-1);
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
.search {
|
||||
--td-button-border-radius: .875rem;
|
||||
--td-button-border-radius: .75rem;
|
||||
--td-input-vertical-padding: .25rem 1rem;
|
||||
|
||||
width: 100%;
|
||||
border: 1px solid var(--td-component-border);
|
||||
border: 1px solid rgba(148, 163, 184, .28);
|
||||
z-index: 2;
|
||||
background: #f8fbff;
|
||||
padding-right: .3rem;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.tag-filter {
|
||||
--td-button-border-radius: 1rem;
|
||||
.menus {
|
||||
--td-spacer-1: 6px;
|
||||
|
||||
flex: 0 0 auto;
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1rem;
|
||||
padding-top: .8rem;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(148, 163, 184, .18);
|
||||
border-radius: 0 0 1rem 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,14 +615,19 @@ async function doExport(): Promise<void> {
|
||||
:global(html.theme-dark) {
|
||||
.customer-list {
|
||||
|
||||
.filter-bar {
|
||||
.filter {
|
||||
background: #10161f;
|
||||
|
||||
.text-input {
|
||||
.search {
|
||||
color: #e2e8f0;
|
||||
background: rgba(15, 23, 42, .72);
|
||||
border-color: rgba(148, 163, 184, .16);
|
||||
}
|
||||
|
||||
.menus {
|
||||
background: #172033;
|
||||
border-color: rgba(148, 163, 184, .16);
|
||||
}
|
||||
}
|
||||
|
||||
.items {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div v-can="permissionCodes.eventRecord.read" class="registration-record-list">
|
||||
<div class="search-bar">
|
||||
<div class="search-status">
|
||||
<div class="search-date">
|
||||
<t-input
|
||||
v-model.trim="keyword"
|
||||
class="search-input"
|
||||
@@ -750,7 +750,7 @@ onUnmounted(() => {
|
||||
box-shadow: var(--td-shadow-1);
|
||||
flex-direction: column;
|
||||
|
||||
.search-status {
|
||||
.search-date {
|
||||
display: flex;
|
||||
|
||||
.search-input {
|
||||
|
||||
@@ -159,7 +159,7 @@ const sourceItems = computed<GaoSalesOrderItem[]>(() => (order.value?.itemList |
|
||||
&& 0 < comparePackageQuantity(item.availableBaseQuantity ?? "0", "0")));
|
||||
const unitPickerOptions = computed(() => {
|
||||
const item = sourceItems.value.find(value => value.id === unitPickerSourceItemId.value);
|
||||
return item ? getSellableUnitList(item).map(unit => ({ label: unit.name, value: unit.id || "" })) : [];
|
||||
return item ? getFulfillmentUnitList(item).map(unit => ({ label: unit.name, value: unit.id || "" })) : [];
|
||||
});
|
||||
const canFulfillByPayment = computed(() => order.value?.paymentStatus === "PAID" || userStore.hasRoles(gaoRoleCodes.storeManager));
|
||||
|
||||
@@ -191,8 +191,8 @@ async function loadFulfillmentSkuList(): Promise<void> {
|
||||
if (!item.id || fulfillmentUnitMap[item.id]) {
|
||||
continue;
|
||||
}
|
||||
const originalUnit = getSellableUnitList(item).find(unit => unit.id === item.skuUnitId);
|
||||
const defaultUnit = getFulfillmentUnitForAvailableQuantity(item, originalUnit || getSellableUnitList(item)[0]);
|
||||
const originalUnit = getFulfillmentUnitList(item).find(unit => unit.id === item.skuUnitId);
|
||||
const defaultUnit = getFulfillmentUnitForAvailableQuantity(item, originalUnit || getFulfillmentUnitList(item)[0]);
|
||||
if (defaultUnit?.id) {
|
||||
fulfillmentUnitMap[item.id] = defaultUnit.id;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ function getBaseUnitName(item: GaoSalesOrderItem): string {
|
||||
}
|
||||
|
||||
function getBaseUnit(item: GaoSalesOrderItem): ProductSkuUnit | undefined {
|
||||
return getSellableUnitList(item).find(unit => unit.isBase);
|
||||
return getFulfillmentUnitList(item).find(unit => unit.isBase);
|
||||
}
|
||||
|
||||
function shouldDowngradeUnit(item: GaoSalesOrderItem, unit?: ProductSkuUnit): boolean {
|
||||
@@ -254,12 +254,25 @@ function fillAllQuantity(item: GaoSalesOrderItem): void {
|
||||
quantityMap[item.id] = quantity;
|
||||
}
|
||||
|
||||
function getSellableUnitList(item: GaoSalesOrderItem): ProductSkuUnit[] {
|
||||
return (item.skuId ? fulfillmentSkuMap[item.skuId]?.unitList : [])?.filter(unit => unit.allowSale !== false && !!unit.id) || [];
|
||||
function getFulfillmentUnitList(item: GaoSalesOrderItem): ProductSkuUnit[] {
|
||||
const unitList = (item.skuId ? fulfillmentSkuMap[item.skuId]?.unitList : [])?.filter(unit => !!unit.id) || [];
|
||||
if (!item.skuUnitId) {
|
||||
return unitList;
|
||||
}
|
||||
const originalUnit: ProductSkuUnit = {
|
||||
...(unitList.find(unit => unit.id === item.skuUnitId) || {}),
|
||||
id: item.skuUnitId,
|
||||
skuId: item.skuId,
|
||||
name: item.unitSnapshot || "成交单位",
|
||||
baseQuantityPerUnit: item.baseQuantityPerUnitSnapshot ?? "1",
|
||||
allowPurchase: false,
|
||||
allowSale: false
|
||||
};
|
||||
return [originalUnit, ...unitList.filter(unit => unit.id !== item.skuUnitId)];
|
||||
}
|
||||
|
||||
function getFulfillmentUnit(item: GaoSalesOrderItem): ProductSkuUnit | undefined {
|
||||
return getSellableUnitList(item).find(unit => unit.id === fulfillmentUnitMap[item.id || ""]);
|
||||
return getFulfillmentUnitList(item).find(unit => unit.id === fulfillmentUnitMap[item.id || ""]);
|
||||
}
|
||||
|
||||
function setFulfillmentUnit(item: GaoSalesOrderItem, unit: ProductSkuUnit): void {
|
||||
@@ -282,19 +295,19 @@ function openUnitPicker(item: GaoSalesOrderItem): void {
|
||||
if (!item.id) {
|
||||
return;
|
||||
}
|
||||
if (!getSellableUnitList(item).length) {
|
||||
Message.warning("当前 SKU 没有可用于履约的销售单位");
|
||||
if (!getFulfillmentUnitList(item).length) {
|
||||
Message.warning("当前 SKU 没有可用于履约的单位");
|
||||
return;
|
||||
}
|
||||
unitPickerSourceItemId.value = item.id;
|
||||
unitPickerDraft.value = [fulfillmentUnitMap[item.id] || getSellableUnitList(item)[0]?.id || ""];
|
||||
unitPickerDraft.value = [fulfillmentUnitMap[item.id] || getFulfillmentUnitList(item)[0]?.id || ""];
|
||||
unitPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmUnitPicker(value: Array<string | number>): void {
|
||||
const skuUnitId = String(value[0] || "");
|
||||
const item = sourceItems.value.find(sourceItem => sourceItem.id === unitPickerSourceItemId.value);
|
||||
const selectedUnit = item ? getSellableUnitList(item).find(unit => unit.id === skuUnitId) : undefined;
|
||||
const selectedUnit = item ? getFulfillmentUnitList(item).find(unit => unit.id === skuUnitId) : undefined;
|
||||
const fulfillmentUnit = item ? getFulfillmentUnitForAvailableQuantity(item, selectedUnit) : selectedUnit;
|
||||
if (item?.id && fulfillmentUnit?.id) {
|
||||
setFulfillmentUnit(item, fulfillmentUnit);
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
</t-cell>
|
||||
<t-cell title="当前 SKU" :note="`${form.skuList.length} 个`" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="form.skuList.length" theme="card" class="sku-list">
|
||||
<t-cell-group v-if="form.skuList.length" theme="card" class="sku-list fix-last-cell-line">
|
||||
<product-sku-editor
|
||||
v-for="(sku, skuIndex) in form.skuList"
|
||||
:key="sku.clientKey"
|
||||
@@ -418,11 +418,19 @@ function closeBatchUnitEditor(): void {
|
||||
|
||||
function applyBatchUnitTemplate(): void {
|
||||
const templateList = batchUnitList.value;
|
||||
for (const sku of form.skuList) {
|
||||
const templateNameSet = new Set(templateList.map(unit => unit.name.trim()));
|
||||
if (sku.unitList.some(unit => !!unit.id && !templateNameSet.has(unit.name.trim()))) {
|
||||
Message.warning("统一配置不能删除或重命名已保存单位,请在 SKU 明细中停售");
|
||||
return;
|
||||
}
|
||||
}
|
||||
form.skuList.forEach(sku => {
|
||||
const oldUnitList = sku.unitList;
|
||||
const oldUnitMap = new Map(oldUnitList.filter(unit => !!unit.id).map(unit => [unit.name.trim(), unit]));
|
||||
sku.unitList = templateList.map((unit, unitIndex) => ({
|
||||
...unit,
|
||||
id: oldUnitList[unitIndex]?.id,
|
||||
id: oldUnitMap.get(unit.name.trim())?.id,
|
||||
skuId: sku.id,
|
||||
clientKey: window.crypto.randomUUID(),
|
||||
sort: unitIndex
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<t-swipe-cell class="sku-cell">
|
||||
<t-swipe-cell class="sku-cell item">
|
||||
<t-cell role="button" tabindex="0" arrow @click="openEditor">
|
||||
<template #title>
|
||||
<div class="title">
|
||||
@@ -41,8 +41,8 @@
|
||||
</template>
|
||||
</t-cell>
|
||||
<template #right>
|
||||
<t-button class="delete-action" theme="danger" @click.stop="requestRemove">
|
||||
删除
|
||||
<t-button class="delete-action swipe-cell-button" theme="danger" @click.stop="requestRemove">
|
||||
停用
|
||||
</t-button>
|
||||
</template>
|
||||
</t-swipe-cell>
|
||||
@@ -99,7 +99,7 @@
|
||||
<t-form-item v-if="sku.stockEnabled" label="最低库存" help="基础单位数量,最多三位小数">
|
||||
<t-input v-model.trim="sku.minStockQuantityText" type="number" align="right" borderless placeholder="0" />
|
||||
</t-form-item>
|
||||
<t-form-item label="明细状态" content-align="right">
|
||||
<t-form-item label="启用" content-align="right">
|
||||
<t-switch :model-value="sku.status === 'ACTIVE'" size="small" @change="setSkuStatus" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
|
||||
@@ -28,7 +28,15 @@
|
||||
<div v-for="(unit, unitIndex) in sku.unitList" :key="unit.clientKey" class="unit-card">
|
||||
<div class="unit-card-header">
|
||||
<strong v-text="`单位 ${unitIndex + 1}`" />
|
||||
<t-button v-if="1 < sku.unitList.length" theme="danger" variant="text" size="extra-small" content="删除" @click="removeUnit(unitIndex)" />
|
||||
<t-button
|
||||
v-if="1 < sku.unitList.length"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
:content="unit.id ? '停售' : '删除'"
|
||||
:disabled="!!unit.id && unit.allowSale === false && unit.allowPurchase === false"
|
||||
@click="removeUnit(unitIndex)"
|
||||
/>
|
||||
</div>
|
||||
<t-form class="unit-form" label-align="left" label-width="6rem">
|
||||
<t-form-item label="单位名称" required-mark>
|
||||
@@ -134,6 +142,13 @@ function removeUnit(index: number): void {
|
||||
Message.warning("每个 SKU 至少需要一个单位");
|
||||
return;
|
||||
}
|
||||
const unit = sku.value.unitList[index];
|
||||
if (unit?.id) {
|
||||
unit.allowSale = false;
|
||||
unit.allowPurchase = false;
|
||||
Message.success("单位已停售并禁止采购,历史订单仍可履约");
|
||||
return;
|
||||
}
|
||||
const wasBase = sku.value.unitList[index]?.isBase;
|
||||
sku.value.unitList.splice(index, 1);
|
||||
if (wasBase && sku.value.unitList[0]) {
|
||||
|
||||
@@ -526,11 +526,13 @@ onMounted(async () => {
|
||||
flex-direction: column;
|
||||
|
||||
.keyword {
|
||||
--td-input-vertical-padding: 8px 14px;
|
||||
--td-button-border-radius: .75rem;
|
||||
--td-input-vertical-padding: .25rem 1rem;
|
||||
|
||||
border: 1px solid var(--td-component-border);
|
||||
z-index: 1;
|
||||
background: var(--td-bg-color-container);
|
||||
padding-right: .3rem;
|
||||
border-radius: 1rem;
|
||||
|
||||
.actions {
|
||||
@@ -552,20 +554,6 @@ onMounted(async () => {
|
||||
background: #fff;
|
||||
border: 1px solid rgba(148, 163, 184, .18);
|
||||
border-radius: 0 0 1rem 1rem;
|
||||
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.t-dropdown-menu__item) {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
:deep(.t-dropdown-menu__title) {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,18 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Time } from "timi-web";
|
||||
import type { EChartsOption } from "echarts";
|
||||
import type { DefaultLabelFormatterCallbackParams, EChartsOption } from "echarts";
|
||||
import StoreChartAPI from "@/api/StoreChartAPI";
|
||||
import ChartRangeSlider from "@/components/ChartRangeSlider.vue";
|
||||
import type { CustomerDailyStatView } from "@/types/Customer";
|
||||
import type { CustomerDailyStatCustomerView, CustomerDailyStatView } from "@/types/Customer";
|
||||
import { buildStoreBaseChartOption, useStoreChart, useStoreChartWindow } from "@/pages/store/component/useStoreChart";
|
||||
|
||||
const props = defineProps<{
|
||||
dateTextList: string[];
|
||||
}>();
|
||||
|
||||
const MAX_TOOLTIP_CUSTOMER_COUNT = 24;
|
||||
|
||||
// ---------- 图表数据 ----------
|
||||
|
||||
const statList = ref<CustomerDailyStatView[]>([]);
|
||||
@@ -43,6 +45,13 @@ const {
|
||||
} = useStoreChartWindow(dateTextList);
|
||||
const chartOption = computed<EChartsOption>(() => ({
|
||||
...buildStoreBaseChartOption(visibleDateTextList.value),
|
||||
grid: {
|
||||
top: 48,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
containLabel: true
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
@@ -74,6 +83,7 @@ const chartOption = computed<EChartsOption>(() => ({
|
||||
type: "line",
|
||||
yAxisIndex: 0,
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: visibleDateTextList.value.map(dateText => getDailyStat(dateText)?.totalCustomerCount || 0)
|
||||
},
|
||||
{
|
||||
@@ -82,7 +92,12 @@ const chartOption = computed<EChartsOption>(() => ({
|
||||
yAxisIndex: 1,
|
||||
data: visibleDateTextList.value.map(dateText => getDailyStat(dateText)?.newCustomerCount || 0)
|
||||
}
|
||||
]
|
||||
],
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
formatter: params => formatGrowthTooltip(params),
|
||||
extraCssText: "max-width: min(19rem, calc(100vw - 2rem));"
|
||||
}
|
||||
}));
|
||||
|
||||
const { chartElement } = useStoreChart(chartOption);
|
||||
@@ -115,6 +130,45 @@ function getDailyStat(dateText: string): CustomerDailyStatView | undefined {
|
||||
return statList.value.find(item => item.dateValue === dateValue);
|
||||
}
|
||||
|
||||
function formatGrowthTooltip(params: DefaultLabelFormatterCallbackParams | DefaultLabelFormatterCallbackParams[]): string {
|
||||
const firstParam = Array.isArray(params) ? params[0] : params;
|
||||
const dateText = visibleDateTextList.value[firstParam?.dataIndex ?? -1];
|
||||
const stat = dateText ? getDailyStat(dateText) : undefined;
|
||||
if (!dateText || !stat) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const customerList = stat.customerList || [];
|
||||
const visibleCustomerList = customerList.slice(0, MAX_TOOLTIP_CUSTOMER_COUNT);
|
||||
const customerHTML = visibleCustomerList.length
|
||||
? visibleCustomerList.map(formatCustomerTooltipItem).join("")
|
||||
: "";
|
||||
const hiddenCustomerCount = Math.max(0, customerList.length - visibleCustomerList.length);
|
||||
const hiddenCustomerHTML = hiddenCustomerCount
|
||||
? `<div style="color:#94a3b8;margin-top:4px;">还有 ${hiddenCustomerCount} 人未显示</div>`
|
||||
: "";
|
||||
return [
|
||||
`<div style="font-weight:700;margin-bottom:6px;">${escapeTooltipHTML(dateText)}</div>`,
|
||||
`<div>客户总量:${stat.totalCustomerCount || 0} 人</div>`,
|
||||
`<div>新客户量:${stat.newCustomerCount || 0} 人</div>`,
|
||||
`<div style="display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 10px;margin-top:6px;">${customerHTML}${hiddenCustomerHTML}</div>`
|
||||
].join("");
|
||||
}
|
||||
|
||||
function formatCustomerTooltipItem(customer: CustomerDailyStatCustomerView): string {
|
||||
return `<div style="line-height:1.6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${escapeTooltipHTML(customer.name || "未命名客户")}</div>`;
|
||||
}
|
||||
|
||||
function escapeTooltipHTML(value: string): string {
|
||||
return value.replace(/[&<>"']/g, character => ({
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
"\"": """,
|
||||
"'": "'"
|
||||
}[character] || character));
|
||||
}
|
||||
|
||||
// ---------- 日期 ----------
|
||||
|
||||
function getDateStart(dateText: string): Date {
|
||||
@@ -137,7 +191,7 @@ function getDateEnd(dateText: string): Date {
|
||||
|
||||
h2 {
|
||||
color: #0f172a;
|
||||
margin: 0 0 .875rem 0;
|
||||
margin: 0 0 .5rem 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ export function buildStoreBaseChartOption(dateTextList: string[]): EChartsOption
|
||||
return {
|
||||
color: ["#2563eb", "#0f766e", "#d97706", "#db2777", "#7c3aed"],
|
||||
grid: {
|
||||
top: 48,
|
||||
left: 12,
|
||||
right: 12,
|
||||
bottom: 12,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
|
||||
+4
-7
@@ -1,8 +1,5 @@
|
||||
import { createRouter, createWebHistory, type RouteLocationNormalized } from "vue-router";
|
||||
import RootLayout from "@/layout/RootLayout.vue";
|
||||
import MainLayout from "@/layout/MainLayout.vue";
|
||||
import Login from "@/pages/user/LoginIndex.vue";
|
||||
import InviteRegister from "@/pages/user/InviteRegister.vue";
|
||||
import chartRoutes from "@/router/routes/chartRoutes";
|
||||
import customerRoutes from "@/router/routes/customerRoutes";
|
||||
import { managementAccountRoutes, managementSettingRoutes, storeRoutes } from "@/router/routes/managementRoutes";
|
||||
@@ -19,7 +16,7 @@ import fulfillmentRoutes from "@/router/routes/fulfillmentRoutes";
|
||||
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
||||
import { useGlobalUIStore } from "@/store/globalUI";
|
||||
import { gaoRoleCodes } from "@/utils/permission";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import { useUserStore } from "timi-web-api/store";
|
||||
|
||||
const detailRoutes = [
|
||||
...customerRoutes,
|
||||
@@ -62,7 +59,7 @@ const router = createRouter({
|
||||
{
|
||||
path: "login",
|
||||
name: "Login",
|
||||
component: Login,
|
||||
component: () => import("@/pages/user/LoginIndex.vue"),
|
||||
meta: {
|
||||
depth: 1,
|
||||
navBarVisible: false,
|
||||
@@ -74,7 +71,7 @@ const router = createRouter({
|
||||
{
|
||||
path: "gao/invite/register",
|
||||
name: "InviteRegister",
|
||||
component: InviteRegister,
|
||||
component: () => import("@/pages/user/InviteRegister.vue"),
|
||||
meta: {
|
||||
depth: 1,
|
||||
navBarVisible: false,
|
||||
@@ -85,7 +82,7 @@ const router = createRouter({
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
component: MainLayout,
|
||||
component: () => import("@/layout/MainLayout.vue"),
|
||||
meta: {
|
||||
depth: 1,
|
||||
navBarVisible: false,
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import QuickSignInPage from "@/pages/home/QuickSignInPage.vue";
|
||||
import EventRecordEdit from "@/pages/event/EventRecordEdit.vue";
|
||||
import CustomerList from "@/pages/customer/CustomerList.vue";
|
||||
import CustomerInviteRank from "@/pages/customer/CustomerInviteRank.vue";
|
||||
import CustomerInviteRelation from "@/pages/customer/CustomerInviteRelation.vue";
|
||||
import CustomerDetail from "@/pages/customer/CustomerDetail.vue";
|
||||
import CustomerInviteeList from "@/pages/customer/CustomerInviteeList.vue";
|
||||
import CustomerEdit from "@/pages/customer/CustomerEdit.vue";
|
||||
|
||||
const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/customer/quick-sign-in",
|
||||
name: "QuickSignInPage",
|
||||
component: QuickSignInPage,
|
||||
component: () => import("@/pages/home/QuickSignInPage.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -26,7 +18,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/customer/registration",
|
||||
name: "CustomerEventRecordCreate",
|
||||
component: EventRecordEdit,
|
||||
component: () => import("@/pages/event/EventRecordEdit.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -40,7 +32,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customers",
|
||||
name: "CustomerList",
|
||||
component: CustomerList,
|
||||
component: () => import("@/pages/customer/CustomerList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -54,7 +46,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customer-invite-rank",
|
||||
name: "CustomerInviteRank",
|
||||
component: CustomerInviteRank,
|
||||
component: () => import("@/pages/customer/CustomerInviteRank.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -68,7 +60,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customer-invite-relation",
|
||||
name: "CustomerInviteRelation",
|
||||
component: CustomerInviteRelation,
|
||||
component: () => import("@/pages/customer/CustomerInviteRelation.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -82,7 +74,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customers/create",
|
||||
name: "CustomerCreate",
|
||||
component: CustomerEdit,
|
||||
component: () => import("@/pages/customer/CustomerEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -96,7 +88,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customers/:id",
|
||||
name: "CustomerDetail",
|
||||
component: CustomerDetail,
|
||||
component: () => import("@/pages/customer/CustomerDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -110,7 +102,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customers/:id/invitees",
|
||||
name: "CustomerInviteeList",
|
||||
component: CustomerInviteeList,
|
||||
component: () => import("@/pages/customer/CustomerInviteeList.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -124,7 +116,7 @@ const customerRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/customers/:id/edit",
|
||||
name: "CustomerEdit",
|
||||
component: CustomerEdit,
|
||||
component: () => import("@/pages/customer/CustomerEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import OrderFulfillmentList from "@/pages/fulfillment/OrderFulfillmentList.vue";
|
||||
import OrderFulfillmentCreate from "@/pages/fulfillment/OrderFulfillmentCreate.vue";
|
||||
import OrderFulfillmentDetail from "@/pages/fulfillment/OrderFulfillmentDetail.vue";
|
||||
|
||||
function meta(title: string, depth = 3): RouteRecordRaw["meta"] {
|
||||
return { depth, navBarVisible: true, navBarCanBack: true, navBarTitle: title, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" };
|
||||
}
|
||||
|
||||
export default [
|
||||
{ path: "/management/order-fulfillments", name: "OrderFulfillmentList", component: OrderFulfillmentList, meta: meta("统一履约") },
|
||||
{ path: "/management/order-fulfillments/create", name: "OrderFulfillmentCreate", component: OrderFulfillmentCreate, meta: meta("创建履约单", 4) },
|
||||
{ path: "/management/order-fulfillments/:id", name: "OrderFulfillmentDetail", component: OrderFulfillmentDetail, meta: meta("履约单详情", 4) }
|
||||
{ path: "/management/order-fulfillments", name: "OrderFulfillmentList", component: () => import("@/pages/fulfillment/OrderFulfillmentList.vue"), meta: meta("统一履约") },
|
||||
{ path: "/management/order-fulfillments/create", name: "OrderFulfillmentCreate", component: () => import("@/pages/fulfillment/OrderFulfillmentCreate.vue"), meta: meta("创建履约单", 4) },
|
||||
{ path: "/management/order-fulfillments/:id", name: "OrderFulfillmentDetail", component: () => import("@/pages/fulfillment/OrderFulfillmentDetail.vue"), meta: meta("履约单详情", 4) }
|
||||
] as RouteRecordRaw[];
|
||||
|
||||
@@ -1,28 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import About from "@/pages/setting/About.vue";
|
||||
import Agreement from "@/pages/setting/Agreement.vue";
|
||||
import AppSettings from "@/pages/setting/AppSettings.vue";
|
||||
import NotifyList from "@/pages/notify/NotifyList.vue";
|
||||
import NotifyCreate from "@/pages/notify/NotifyCreate.vue";
|
||||
import NotifyDetail from "@/pages/notify/NotifyDetail.vue";
|
||||
import NotifyRecipientList from "@/pages/notify/NotifyRecipientList.vue";
|
||||
import UserProfile from "@/pages/user/UserProfile.vue";
|
||||
import UserPassword from "@/pages/user/UserPassword.vue";
|
||||
import CustomerQrCode from "@/pages/customer/CustomerQrCode.vue";
|
||||
import StoreBusinessDayCalendar from "@/pages/store/StoreBusinessDayCalendar.vue";
|
||||
import StoreEdit from "@/pages/store/StoreEdit.vue";
|
||||
import StoreList from "@/pages/store/StoreList.vue";
|
||||
import StoreSort from "@/pages/store/StoreSort.vue";
|
||||
import StoreDiaryDetail from "@/pages/store/StoreDiaryDetail.vue";
|
||||
import StoreDiaryEdit from "@/pages/store/StoreDiaryEdit.vue";
|
||||
import StoreDiaryList from "@/pages/store/StoreDiaryList.vue";
|
||||
import TagList from "@/pages/tag/TagList.vue";
|
||||
|
||||
export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/stores",
|
||||
name: "StoreList",
|
||||
component: StoreList,
|
||||
component: () => import("@/pages/store/StoreList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -36,7 +18,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/stores/create",
|
||||
name: "StoreCreate",
|
||||
component: StoreEdit,
|
||||
component: () => import("@/pages/store/StoreEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -50,7 +32,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/stores/sort",
|
||||
name: "StoreSort",
|
||||
component: StoreSort,
|
||||
component: () => import("@/pages/store/StoreSort.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -64,7 +46,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/stores/:id",
|
||||
name: "StoreEdit",
|
||||
component: StoreEdit,
|
||||
component: () => import("@/pages/store/StoreEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -78,7 +60,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/stores/:id/business-days",
|
||||
name: "StoreBusinessDayCalendar",
|
||||
component: StoreBusinessDayCalendar,
|
||||
component: () => import("@/pages/store/StoreBusinessDayCalendar.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -92,7 +74,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/store-diaries",
|
||||
name: "StoreDiaryList",
|
||||
component: StoreDiaryList,
|
||||
component: () => import("@/pages/store/StoreDiaryList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -106,7 +88,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/store-diaries/create",
|
||||
name: "StoreDiaryCreate",
|
||||
component: StoreDiaryEdit,
|
||||
component: () => import("@/pages/store/StoreDiaryEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -120,7 +102,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/store-diaries/:id",
|
||||
name: "StoreDiaryDetail",
|
||||
component: StoreDiaryDetail,
|
||||
component: () => import("@/pages/store/StoreDiaryDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -134,7 +116,7 @@ export const storeRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/store-diaries/:id/edit",
|
||||
name: "StoreDiaryEdit",
|
||||
component: StoreDiaryEdit,
|
||||
component: () => import("@/pages/store/StoreDiaryEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -151,7 +133,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/about",
|
||||
name: "About",
|
||||
component: About,
|
||||
component: () => import("@/pages/setting/About.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -165,7 +147,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/about/service-agreement/:id",
|
||||
name: "ServiceAgreement",
|
||||
component: Agreement,
|
||||
component: () => import("@/pages/setting/Agreement.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -179,7 +161,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/about/privacy-agreement/:id",
|
||||
name: "PrivacyAgreement",
|
||||
component: Agreement,
|
||||
component: () => import("@/pages/setting/Agreement.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -193,7 +175,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/about/open-source-agreement/:id",
|
||||
name: "OpenSourceAgreement",
|
||||
component: Agreement,
|
||||
component: () => import("@/pages/setting/Agreement.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -207,7 +189,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/settings",
|
||||
name: "AppSettings",
|
||||
component: AppSettings,
|
||||
component: () => import("@/pages/setting/AppSettings.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -221,7 +203,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/notifications",
|
||||
name: "NotifyList",
|
||||
component: NotifyList,
|
||||
component: () => import("@/pages/notify/NotifyList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -235,7 +217,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/notifications/create",
|
||||
name: "NotifyCreate",
|
||||
component: NotifyCreate,
|
||||
component: () => import("@/pages/notify/NotifyCreate.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -249,7 +231,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/notifications/:id",
|
||||
name: "NotifyDetail",
|
||||
component: NotifyDetail,
|
||||
component: () => import("@/pages/notify/NotifyDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -263,7 +245,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/notifications/:id/recipients",
|
||||
name: "NotifyRecipientList",
|
||||
component: NotifyRecipientList,
|
||||
component: () => import("@/pages/notify/NotifyRecipientList.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -277,7 +259,7 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/tags",
|
||||
name: "TagList",
|
||||
component: TagList,
|
||||
component: () => import("@/pages/tag/TagList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -294,7 +276,7 @@ export const managementAccountRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/profile",
|
||||
name: "UserProfile",
|
||||
component: UserProfile,
|
||||
component: () => import("@/pages/user/UserProfile.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -308,7 +290,7 @@ export const managementAccountRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/profile/password",
|
||||
name: "UserPassword",
|
||||
component: UserPassword,
|
||||
component: () => import("@/pages/user/UserPassword.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -322,7 +304,7 @@ export const managementAccountRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/qr-code",
|
||||
name: "CustomerQrCode",
|
||||
component: CustomerQrCode,
|
||||
component: () => import("@/pages/customer/CustomerQrCode.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import UserNotifyDetail from "@/pages/notify/UserNotifyDetail.vue";
|
||||
import UserNotifyList from "@/pages/notify/UserNotifyList.vue";
|
||||
|
||||
const notifyRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/notify",
|
||||
name: "UserNotifyList",
|
||||
component: UserNotifyList,
|
||||
component: () => import("@/pages/notify/UserNotifyList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -20,7 +18,7 @@ const notifyRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/notify/:id",
|
||||
name: "UserNotifyDetail",
|
||||
component: UserNotifyDetail,
|
||||
component: () => import("@/pages/notify/UserNotifyDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import PackageConfigList from "@/pages/package/PackageConfigList.vue";
|
||||
import PackageConfigEdit from "@/pages/package/PackageConfigEdit.vue";
|
||||
import PackageConfigDetail from "@/pages/package/PackageConfigDetail.vue";
|
||||
import PackagePurchase from "@/pages/package/PackagePurchase.vue";
|
||||
|
||||
function pageMeta(title: string, depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
|
||||
return { depth, navBarVisible: true, navBarCanBack: true, navBarTitle: title, tabBarVisible: false, bodyBackground: background, darkBodyBackground: "#10161f" };
|
||||
}
|
||||
|
||||
export default [
|
||||
{ path: "/management/package-configs", name: "PackageConfigList", component: PackageConfigList, meta: pageMeta("套餐配置") },
|
||||
{ path: "/management/package-configs/create", name: "PackageConfigCreate", component: PackageConfigEdit, meta: pageMeta("新增套餐配置", 4) },
|
||||
{ path: "/management/package-configs/:id", name: "PackageConfigDetail", component: PackageConfigDetail, meta: pageMeta("套餐配置详情", 4) },
|
||||
{ path: "/management/package-configs/:id/edit", name: "PackageConfigEdit", component: PackageConfigEdit, meta: pageMeta("编辑套餐配置", 5) },
|
||||
{ path: "/management/package-configs/:id/purchase", name: "PackagePurchase", component: PackagePurchase, meta: pageMeta("购买套餐", 5) },
|
||||
{ path: "/management/customer-packages/create", name: "CustomerPackageCreate", component: PackagePurchase, meta: pageMeta("创建客户套餐", 4) }
|
||||
{ path: "/management/package-configs", name: "PackageConfigList", component: () => import("@/pages/package/PackageConfigList.vue"), meta: pageMeta("套餐配置") },
|
||||
{ path: "/management/package-configs/create", name: "PackageConfigCreate", component: () => import("@/pages/package/PackageConfigEdit.vue"), meta: pageMeta("新增套餐配置", 4) },
|
||||
{ path: "/management/package-configs/:id", name: "PackageConfigDetail", component: () => import("@/pages/package/PackageConfigDetail.vue"), meta: pageMeta("套餐配置详情", 4) },
|
||||
{ path: "/management/package-configs/:id/edit", name: "PackageConfigEdit", component: () => import("@/pages/package/PackageConfigEdit.vue"), meta: pageMeta("编辑套餐配置", 5) },
|
||||
{ path: "/management/package-configs/:id/purchase", name: "PackagePurchase", component: () => import("@/pages/package/PackagePurchase.vue"), meta: pageMeta("购买套餐", 5) },
|
||||
{ path: "/management/customer-packages/create", name: "CustomerPackageCreate", component: () => import("@/pages/package/PackagePurchase.vue"), meta: pageMeta("创建客户套餐", 4) }
|
||||
] as RouteRecordRaw[];
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import PermissionSettings from "@/pages/permission/PermissionSettings.vue";
|
||||
import RoleList from "@/pages/permission/RoleList.vue";
|
||||
import RoleEdit from "@/pages/permission/RoleEdit.vue";
|
||||
import PermissionList from "@/pages/permission/PermissionList.vue";
|
||||
import RolePermissionAssign from "@/pages/permission/RolePermissionAssign.vue";
|
||||
import RoleDelegationPermissionAssign from "@/pages/permission/RoleDelegationPermissionAssign.vue";
|
||||
import UserRoleAssign from "@/pages/user/UserRoleAssign.vue";
|
||||
|
||||
const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions",
|
||||
name: "PermissionSettings",
|
||||
component: PermissionSettings,
|
||||
component: () => import("@/pages/permission/PermissionSettings.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -25,7 +18,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/roles",
|
||||
name: "RoleList",
|
||||
component: RoleList,
|
||||
component: () => import("@/pages/permission/RoleList.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -39,7 +32,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/roles/create",
|
||||
name: "RoleCreate",
|
||||
component: RoleEdit,
|
||||
component: () => import("@/pages/permission/RoleEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -53,7 +46,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/roles/:id",
|
||||
name: "RoleEdit",
|
||||
component: RoleEdit,
|
||||
component: () => import("@/pages/permission/RoleEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -67,7 +60,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/roles/:id/assign/p",
|
||||
name: "RolePermissionAssignFromRole",
|
||||
component: RolePermissionAssign,
|
||||
component: () => import("@/pages/permission/RolePermissionAssign.vue"),
|
||||
meta: {
|
||||
depth: 6,
|
||||
navBarVisible: true,
|
||||
@@ -81,7 +74,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/roles/:id/assign/d",
|
||||
name: "RoleDelegationPermissionAssignFromRole",
|
||||
component: RoleDelegationPermissionAssign,
|
||||
component: () => import("@/pages/permission/RoleDelegationPermissionAssign.vue"),
|
||||
meta: {
|
||||
depth: 6,
|
||||
navBarVisible: true,
|
||||
@@ -95,7 +88,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/items",
|
||||
name: "PermissionList",
|
||||
component: PermissionList,
|
||||
component: () => import("@/pages/permission/PermissionList.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -113,7 +106,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/assign/p",
|
||||
name: "RolePermissionAssign",
|
||||
component: RolePermissionAssign,
|
||||
component: () => import("@/pages/permission/RolePermissionAssign.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -127,7 +120,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/assign/d",
|
||||
name: "RoleDelegationPermissionAssign",
|
||||
component: RoleDelegationPermissionAssign,
|
||||
component: () => import("@/pages/permission/RoleDelegationPermissionAssign.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -141,7 +134,7 @@ const permissionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/permissions/user-roles",
|
||||
name: "UserRoleAssign",
|
||||
component: UserRoleAssign,
|
||||
component: () => import("@/pages/user/UserRoleAssign.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import PointAccountDetail from "@/pages/point/PointAccountDetail.vue";
|
||||
import PointAccountList from "@/pages/point/PointAccountList.vue";
|
||||
import PointAdjust from "@/pages/point/PointAdjust.vue";
|
||||
import PointLedgerDetail from "@/pages/point/PointLedgerDetail.vue";
|
||||
import PointLedgerList from "@/pages/point/PointLedgerList.vue";
|
||||
import PointRuleDetail from "@/pages/point/PointRuleDetail.vue";
|
||||
import PointRuleEdit from "@/pages/point/PointRuleEdit.vue";
|
||||
import PointRuleList from "@/pages/point/PointRuleList.vue";
|
||||
import PointRuleSort from "@/pages/point/PointRuleSort.vue";
|
||||
|
||||
const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/account",
|
||||
name: "PointAccountList",
|
||||
component: PointAccountList,
|
||||
component: () => import("@/pages/point/PointAccountList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -27,7 +18,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/account/:id",
|
||||
name: "PointAccountDetail",
|
||||
component: PointAccountDetail,
|
||||
component: () => import("@/pages/point/PointAccountDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -41,7 +32,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/rules/sort",
|
||||
name: "PointRuleSort",
|
||||
component: PointRuleSort,
|
||||
component: () => import("@/pages/point/PointRuleSort.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -55,7 +46,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/ledger",
|
||||
name: "PointLedgerList",
|
||||
component: PointLedgerList,
|
||||
component: () => import("@/pages/point/PointLedgerList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -69,7 +60,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/ledger/:id",
|
||||
name: "PointLedgerDetail",
|
||||
component: PointLedgerDetail,
|
||||
component: () => import("@/pages/point/PointLedgerDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -83,7 +74,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/adjust",
|
||||
name: "PointAdjust",
|
||||
component: PointAdjust,
|
||||
component: () => import("@/pages/point/PointAdjust.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -97,7 +88,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/rules",
|
||||
name: "PointRuleList",
|
||||
component: PointRuleList,
|
||||
component: () => import("@/pages/point/PointRuleList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -111,7 +102,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/rules/create",
|
||||
name: "PointRuleCreate",
|
||||
component: PointRuleEdit,
|
||||
component: () => import("@/pages/point/PointRuleEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -125,7 +116,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/rules/:id",
|
||||
name: "PointRuleDetail",
|
||||
component: PointRuleDetail,
|
||||
component: () => import("@/pages/point/PointRuleDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -139,7 +130,7 @@ const pointRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/points/rules/:id/edit",
|
||||
name: "PointRuleEdit",
|
||||
component: PointRuleEdit,
|
||||
component: () => import("@/pages/point/PointRuleEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import ProductCategoryList from "@/pages/product/ProductCategoryList.vue";
|
||||
import ProductCategoryRank from "@/pages/product/ProductCategoryRank.vue";
|
||||
import ProductDetail from "@/pages/product/ProductDetail.vue";
|
||||
import ProductEdit from "@/pages/product/ProductEdit.vue";
|
||||
import ProductList from "@/pages/product/ProductList.vue";
|
||||
import ProductStockDetail from "@/pages/product/ProductStockDetail.vue";
|
||||
import ProductStockList from "@/pages/product/ProductStockList.vue";
|
||||
import ProductStockSkuList from "@/pages/product/ProductStockSkuList.vue";
|
||||
import ProductStockRecordDetail from "@/pages/product/ProductStockRecordDetail.vue";
|
||||
import ProductStockRecordList from "@/pages/product/ProductStockRecordList.vue";
|
||||
|
||||
function pageMeta(title: string, depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
|
||||
return {
|
||||
@@ -26,67 +16,67 @@ const productRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/product-categories",
|
||||
name: "ProductCategoryList",
|
||||
component: ProductCategoryList,
|
||||
component: () => import("@/pages/product/ProductCategoryList.vue"),
|
||||
meta: pageMeta("产品分类")
|
||||
},
|
||||
{
|
||||
path: "/management/product-categories/rank",
|
||||
name: "ProductCategoryRank",
|
||||
component: ProductCategoryRank,
|
||||
component: () => import("@/pages/product/ProductCategoryRank.vue"),
|
||||
meta: pageMeta("产品分类排序", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/products",
|
||||
name: "ProductList",
|
||||
component: ProductList,
|
||||
component: () => import("@/pages/product/ProductList.vue"),
|
||||
meta: pageMeta("产品库")
|
||||
},
|
||||
{
|
||||
path: "/management/products/create",
|
||||
name: "ProductCreate",
|
||||
component: ProductEdit,
|
||||
component: () => import("@/pages/product/ProductEdit.vue"),
|
||||
meta: pageMeta("新增产品", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/products/:id",
|
||||
name: "ProductDetail",
|
||||
component: ProductDetail,
|
||||
component: () => import("@/pages/product/ProductDetail.vue"),
|
||||
meta: pageMeta("产品详情", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/products/:id/edit",
|
||||
name: "ProductEdit",
|
||||
component: ProductEdit,
|
||||
component: () => import("@/pages/product/ProductEdit.vue"),
|
||||
meta: pageMeta("编辑产品", 5)
|
||||
},
|
||||
{
|
||||
path: "/management/product-stocks",
|
||||
name: "ProductStockList",
|
||||
component: ProductStockList,
|
||||
component: () => import("@/pages/product/ProductStockList.vue"),
|
||||
meta: pageMeta("选择产品")
|
||||
},
|
||||
{
|
||||
path: "/management/product-stocks/:productId/skus",
|
||||
name: "ProductStockSkuList",
|
||||
component: ProductStockSkuList,
|
||||
component: () => import("@/pages/product/ProductStockSkuList.vue"),
|
||||
meta: pageMeta("选择 SKU", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/product-stock-records",
|
||||
name: "ProductStockRecordList",
|
||||
component: ProductStockRecordList,
|
||||
component: () => import("@/pages/product/ProductStockRecordList.vue"),
|
||||
meta: pageMeta("库存流水")
|
||||
},
|
||||
{
|
||||
path: "/management/product-stock-records/:id",
|
||||
name: "ProductStockRecordDetail",
|
||||
component: ProductStockRecordDetail,
|
||||
component: () => import("@/pages/product/ProductStockRecordDetail.vue"),
|
||||
meta: pageMeta("库存流水详情", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/product-stocks/:skuId",
|
||||
name: "ProductStockDetail",
|
||||
component: ProductStockDetail,
|
||||
component: () => import("@/pages/product/ProductStockDetail.vue"),
|
||||
meta: pageMeta("库存详情", 5)
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import EventDetail from "@/pages/event/EventDetail.vue";
|
||||
import EventEdit from "@/pages/event/EventEdit.vue";
|
||||
import eventList from "@/pages/event/EventList.vue";
|
||||
import EventSort from "@/pages/event/EventSort.vue";
|
||||
import EventRecordDetail from "@/pages/event/EventRecordDetail.vue";
|
||||
import EventRecordEdit from "@/pages/event/EventRecordEdit.vue";
|
||||
import EventRecordList from "@/pages/event/EventRecordList.vue";
|
||||
import EventRecordRank from "@/pages/event/EventRecordRank.vue";
|
||||
|
||||
const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-events",
|
||||
name: "eventList",
|
||||
component: eventList,
|
||||
component: () => import("@/pages/event/EventList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -26,7 +18,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-events/sort",
|
||||
name: "EventSort",
|
||||
component: EventSort,
|
||||
component: () => import("@/pages/event/EventSort.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -40,7 +32,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-events/create",
|
||||
name: "EventCreate",
|
||||
component: EventEdit,
|
||||
component: () => import("@/pages/event/EventEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -54,7 +46,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-events/:id",
|
||||
name: "EventDetail",
|
||||
component: EventDetail,
|
||||
component: () => import("@/pages/event/EventDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -68,7 +60,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-events/:id/edit",
|
||||
name: "EventEdit",
|
||||
component: EventEdit,
|
||||
component: () => import("@/pages/event/EventEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -82,7 +74,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-event-records",
|
||||
name: "EventRecordList",
|
||||
component: EventRecordList,
|
||||
component: () => import("@/pages/event/EventRecordList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -96,7 +88,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-event-record-rank",
|
||||
name: "EventRecordRank",
|
||||
component: EventRecordRank,
|
||||
component: () => import("@/pages/event/EventRecordRank.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -110,7 +102,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-event-records/create",
|
||||
name: "EventRecordCreate",
|
||||
component: EventRecordEdit,
|
||||
component: () => import("@/pages/event/EventRecordEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -124,7 +116,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-event-records/:id",
|
||||
name: "EventRecordDetail",
|
||||
component: EventRecordDetail,
|
||||
component: () => import("@/pages/event/EventRecordDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -138,7 +130,7 @@ const registrationRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/registration-event-records/:id/edit",
|
||||
name: "EventRecordEdit",
|
||||
component: EventRecordEdit,
|
||||
component: () => import("@/pages/event/EventRecordEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,70 +1,59 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import SalesOrderList from "@/pages/salesOrder/SalesOrderList.vue";
|
||||
import SalesOrderCreate from "@/pages/salesOrder/SalesOrderCreate.vue";
|
||||
import SalesOrderDetail from "@/pages/salesOrder/SalesOrderDetail.vue";
|
||||
import SalesOrderPayment from "@/pages/salesOrder/SalesOrderPayment.vue";
|
||||
import SalesOrderRefund from "@/pages/salesOrder/SalesOrderRefund.vue";
|
||||
import SalesOrderNoRefund from "@/pages/salesOrder/SalesOrderNoRefund.vue";
|
||||
import SalesOrderCancel from "@/pages/salesOrder/SalesOrderCancel.vue";
|
||||
import FundRecordList from "@/pages/salesOrder/FundRecordList.vue";
|
||||
import FundRecordDetail from "@/pages/salesOrder/FundRecordDetail.vue";
|
||||
import FundRecordRevoke from "@/pages/salesOrder/FundRecordRevoke.vue";
|
||||
import ConsumptionRecordList from "@/pages/salesOrder/ConsumptionRecordList.vue";
|
||||
|
||||
function meta(title: string, depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
|
||||
return { depth, navBarVisible: true, navBarCanBack: true, navBarTitle: title, tabBarVisible: false, bodyBackground: background, darkBodyBackground: "#10161f" };
|
||||
}
|
||||
|
||||
export default [
|
||||
{ path: "/management/sales-orders", name: "SalesOrderList", component: SalesOrderList, meta: meta("销售订单") },
|
||||
{ path: "/management/consumption-records", name: "ConsumptionRecordList", component: ConsumptionRecordList, meta: meta("消费记录") },
|
||||
{ path: "/management/sales-orders", name: "SalesOrderList", component: () => import("@/pages/salesOrder/SalesOrderList.vue"), meta: meta("销售订单") },
|
||||
{ path: "/management/consumption-records", name: "ConsumptionRecordList", component: () => import("@/pages/salesOrder/ConsumptionRecordList.vue"), meta: meta("消费记录") },
|
||||
{
|
||||
path: "/management/sales-orders/create",
|
||||
name: "SalesOrderCreate",
|
||||
component: SalesOrderCreate,
|
||||
component: () => import("@/pages/salesOrder/SalesOrderCreate.vue"),
|
||||
meta: meta("直接产品下单", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/sales-orders/:id",
|
||||
name: "SalesOrderDetail",
|
||||
component: SalesOrderDetail,
|
||||
component: () => import("@/pages/salesOrder/SalesOrderDetail.vue"),
|
||||
meta: meta("销售订单详情", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/sales-orders/:id/payment",
|
||||
name: "SalesOrderPayment",
|
||||
component: SalesOrderPayment,
|
||||
component: () => import("@/pages/salesOrder/SalesOrderPayment.vue"),
|
||||
meta: meta("登记收款", 5)
|
||||
},
|
||||
{
|
||||
path: "/management/sales-orders/:id/refund",
|
||||
name: "SalesOrderRefund",
|
||||
component: SalesOrderRefund,
|
||||
component: () => import("@/pages/salesOrder/SalesOrderRefund.vue"),
|
||||
meta: meta("登记退款", 5)
|
||||
},
|
||||
{
|
||||
path: "/management/sales-orders/:id/no-refund",
|
||||
name: "SalesOrderNoRefund",
|
||||
component: SalesOrderNoRefund,
|
||||
component: () => import("@/pages/salesOrder/SalesOrderNoRefund.vue"),
|
||||
meta: meta("确认无需退款", 5)
|
||||
},
|
||||
{
|
||||
path: "/management/sales-orders/:id/cancel",
|
||||
name: "SalesOrderCancel",
|
||||
component: SalesOrderCancel,
|
||||
component: () => import("@/pages/salesOrder/SalesOrderCancel.vue"),
|
||||
meta: meta("取消销售订单", 5)
|
||||
},
|
||||
{ path: "/management/fund-records", name: "FundRecordList", component: FundRecordList, meta: meta("资金流水") },
|
||||
{ path: "/management/fund-records", name: "FundRecordList", component: () => import("@/pages/salesOrder/FundRecordList.vue"), meta: meta("资金流水") },
|
||||
{
|
||||
path: "/management/fund-records/:id",
|
||||
name: "FundRecordDetail",
|
||||
component: FundRecordDetail,
|
||||
component: () => import("@/pages/salesOrder/FundRecordDetail.vue"),
|
||||
meta: meta("资金记录详情", 4)
|
||||
},
|
||||
{
|
||||
path: "/management/fund-records/:id/revoke",
|
||||
name: "FundRecordRevoke",
|
||||
component: FundRecordRevoke,
|
||||
component: () => import("@/pages/salesOrder/FundRecordRevoke.vue"),
|
||||
meta: meta("资金冲正", 5)
|
||||
}
|
||||
] as RouteRecordRaw[];
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import HomeTab from "@/pages/tabs/HomeTab.vue";
|
||||
import ProductTab from "@/pages/tabs/ProductTab.vue";
|
||||
import SettingTab from "@/pages/tabs/SettingTab.vue";
|
||||
import StoreTab from "@/pages/tabs/StoreTab.vue";
|
||||
|
||||
const tabRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/customers",
|
||||
name: "HomeTab",
|
||||
component: HomeTab,
|
||||
component: () => import("@/pages/tabs/HomeTab.vue"),
|
||||
meta: {
|
||||
depth: 2,
|
||||
navBarVisible: true,
|
||||
@@ -22,7 +18,7 @@ const tabRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/store",
|
||||
name: "StoreTab",
|
||||
component: StoreTab,
|
||||
component: () => import("@/pages/tabs/StoreTab.vue"),
|
||||
meta: {
|
||||
depth: 2,
|
||||
navBarVisible: true,
|
||||
@@ -36,7 +32,7 @@ const tabRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/product",
|
||||
name: "ProductTab",
|
||||
component: ProductTab,
|
||||
component: () => import("@/pages/tabs/ProductTab.vue"),
|
||||
meta: {
|
||||
depth: 2,
|
||||
navBarVisible: true,
|
||||
@@ -50,7 +46,7 @@ const tabRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management",
|
||||
name: "SettingTab",
|
||||
component: SettingTab,
|
||||
component: () => import("@/pages/tabs/SettingTab.vue"),
|
||||
meta: {
|
||||
depth: 2,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import UserList from "@/pages/user/UserList.vue";
|
||||
import UserDetail from "@/pages/user/UserDetail.vue";
|
||||
import UserEdit from "@/pages/user/UserEdit.vue";
|
||||
import UserRoleAssign from "@/pages/user/UserRoleAssign.vue";
|
||||
import UserInvitePoster from "@/pages/user/UserInvitePoster.vue";
|
||||
|
||||
const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/users/invite/poster",
|
||||
name: "UserInvitePoster",
|
||||
component: UserInvitePoster,
|
||||
component: () => import("@/pages/user/UserInvitePoster.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -23,7 +18,7 @@ const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/users",
|
||||
name: "UserList",
|
||||
component: UserList,
|
||||
component: () => import("@/pages/user/UserList.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
navBarVisible: true,
|
||||
@@ -37,7 +32,7 @@ const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/users/create",
|
||||
name: "UserCreatePage",
|
||||
component: UserEdit,
|
||||
component: () => import("@/pages/user/UserEdit.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -51,7 +46,7 @@ const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/users/:id",
|
||||
name: "UserDetail",
|
||||
component: UserDetail,
|
||||
component: () => import("@/pages/user/UserDetail.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
navBarVisible: true,
|
||||
@@ -65,7 +60,7 @@ const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/users/:id/edit",
|
||||
name: "UserEdit",
|
||||
component: UserEdit,
|
||||
component: () => import("@/pages/user/UserEdit.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
@@ -79,7 +74,7 @@ const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/users/:id/roles",
|
||||
name: "UserRoleAssignFromUser",
|
||||
component: UserRoleAssign,
|
||||
component: () => import("@/pages/user/UserRoleAssign.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
navBarVisible: true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Message } from "@/utils/message";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import { useUserStore } from "timi-web-api/store";
|
||||
import StoreAPI from "@/api/StoreAPI";
|
||||
import type { Store } from "@/types/Store";
|
||||
import { gaoRoleCodes, gaoStoreScopePermissionCodes } from "@/utils/permission";
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { defineStore } from "pinia";
|
||||
import {
|
||||
PermissionAPI,
|
||||
RoleAPI,
|
||||
type ModuleCode,
|
||||
type PermissionPayload,
|
||||
type Role as UserRole
|
||||
} from "timi-web-api";
|
||||
import { PermissionAPI } from "timi-web-api/api/PermissionAPI";
|
||||
import { RoleAPI } from "timi-web-api/api/RoleAPI";
|
||||
import type { ModuleCode, PermissionPayload, Role as UserRole } from "timi-web-api/types";
|
||||
import type {
|
||||
Permission,
|
||||
PermissionDraft,
|
||||
|
||||
@@ -57,6 +57,11 @@ export type CustomerDailyStatView = {
|
||||
dateValue?: number;
|
||||
newCustomerCount?: number;
|
||||
totalCustomerCount?: number;
|
||||
customerList?: CustomerDailyStatCustomerView[];
|
||||
};
|
||||
|
||||
export type CustomerDailyStatCustomerView = {
|
||||
name?: string;
|
||||
};
|
||||
|
||||
export type CustomerGenderStatView = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MessagePlugin as TDesignMessage } from "tdesign-mobile-vue";
|
||||
import { MessagePlugin as TDesignMessage } from "tdesign-mobile-vue/es/message";
|
||||
import type { MessagePluginOptions } from "tdesign-mobile-vue/es/message/message";
|
||||
|
||||
/** Message 支持的调用参数。 */
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import type { StoreBusinessDayStatus, StoreStatus } from "@/types/Store";
|
||||
import { permissionCodes } from "@/utils/permission";
|
||||
import { type Page, useUserStore } from "timi-web-api";
|
||||
import type { Page } from "timi-web-api/types";
|
||||
import { useUserStore } from "timi-web-api/store";
|
||||
|
||||
export const currentStoreIdStorageKey = "gao-customer-h5:current-store-id";
|
||||
export const loginStoreIdStorageKey = "gao-customer-h5:login-store-id";
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 客户端实际使用的 timi-web 能力出口。
|
||||
*
|
||||
* 不从 timi-web 根入口导入,避免把编辑器、弹窗和未使用组件带入公共包。
|
||||
*/
|
||||
export { default as Captcha } from "../../../timi-web/src/components/captcha";
|
||||
export { default as ContactNumber } from "../../../timi-web/src/components/contact-number";
|
||||
export { default as Copyright } from "../../../timi-web/src/components/copyright";
|
||||
export { default as MarkdownEditor } from "../../../timi-web/src/components/markdown-editor";
|
||||
export { default as MarkdownView } from "../../../timi-web/src/components/markdown-view";
|
||||
export { default as PassTimeLabel } from "../../../timi-web/src/components/passtime-label";
|
||||
|
||||
export { default as Cooker } from "../../../timi-web/src/utils/Cooker";
|
||||
export { default as Storage } from "../../../timi-web/src/utils/Storage";
|
||||
export { default as WebToolkit } from "../../../timi-web/src/utils/WebToolkit";
|
||||
|
||||
export { Text, Time, Toolkit } from "../../../timi-ts/src/index";
|
||||
+10
-1
@@ -6,11 +6,12 @@ import Components from "unplugin-vue-components/vite";
|
||||
import { TDesignResolver } from "unplugin-vue-components/resolvers";
|
||||
|
||||
const localTimiWebRoot = fileURLToPath(new URL("../timi-web", import.meta.url));
|
||||
const localTimiWebModule = fileURLToPath(new URL("../timi-web/dist/timi-web.mjs", import.meta.url));
|
||||
const localTimiWebModule = fileURLToPath(new URL("./src/utils/timiWeb.ts", import.meta.url));
|
||||
const localTimiWebStyle = fileURLToPath(new URL("../timi-web/dist/timi-web.css", import.meta.url));
|
||||
const localTimiWebEditor = fileURLToPath(new URL("../timi-web/src/editor/index.ts", import.meta.url));
|
||||
const localTimiWebApiRoot = fileURLToPath(new URL("../timi-web-api", import.meta.url));
|
||||
const localTimiWebApiModule = fileURLToPath(new URL("../timi-web-api/dist/index.js", import.meta.url));
|
||||
const localTimiTsModule = fileURLToPath(new URL("../timi-ts/src/index.ts", import.meta.url));
|
||||
const localTimiTDesignMobileRoot = fileURLToPath(new URL("../timi-tdesign-mobile", import.meta.url));
|
||||
const localTimiTDesignMobileModule = fileURLToPath(new URL("../timi-tdesign-mobile/src/index.ts", import.meta.url));
|
||||
const localTimiTDesignMobileStyle = fileURLToPath(new URL("../timi-tdesign-mobile/dist/timi-tdesign-mobile.css", import.meta.url));
|
||||
@@ -52,6 +53,14 @@ export default defineConfig(({ mode }) => {
|
||||
find: /^timi-web-api\//,
|
||||
replacement: `${localTimiWebApiRoot}/dist/`
|
||||
},
|
||||
...(useLocalTimiWeb
|
||||
? [
|
||||
{
|
||||
find: /^timi-ts$/,
|
||||
replacement: localTimiTsModule
|
||||
}
|
||||
]
|
||||
: []),
|
||||
...(useLocalTimiTDesignMobile
|
||||
? [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user