fix customer detail to point account transition
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user