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
+13 -1
View File
@@ -292,11 +292,23 @@ async function toLedger(): Promise<void> {
query: {
customerId: selectedCustomerId.value,
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> {
if (!selectedCustomerId.value) {
return;