fix customer detail to point account transition

This commit is contained in:
Timi
2026-08-13 14:46:29 +08:00
parent 71d6340669
commit fa1f5f1f2d
2 changed files with 18 additions and 2 deletions
+5 -1
View File
@@ -408,7 +408,11 @@ async function toPointAccount(): Promise<void> {
} }
await router.push({ await router.push({
name: "PointAccount", name: "PointAccount",
query: { customerId: customer.value.id, storeId: customer.value.storeId || "" } query: {
customerId: customer.value.id,
storeId: customer.value.storeId || "",
transitionDepth: String(Number(route.meta.depth ?? 0) + 1)
}
}); });
} }
+13 -1
View File
@@ -292,11 +292,23 @@ async function toLedger(): Promise<void> {
query: { query: {
customerId: selectedCustomerId.value, customerId: selectedCustomerId.value,
accountId: account.value?.id || "", accountId: account.value?.id || "",
storeId: selectedStoreId.value storeId: selectedStoreId.value,
transitionDepth: String(getCurrentRouteDepth() + 1)
} }
}); });
} }
function getCurrentRouteDepth(): number {
const transitionDepth = Array.isArray(route.query.transitionDepth)
? route.query.transitionDepth[0]
: route.query.transitionDepth;
const depth = Number(transitionDepth);
if (transitionDepth && Number.isInteger(depth) && 0 <= depth && depth <= 20) {
return depth;
}
return Number(route.meta.depth ?? 0);
}
async function toAdjust(): Promise<void> { async function toAdjust(): Promise<void> {
if (!selectedCustomerId.value) { if (!selectedCustomerId.value) {
return; return;