fix ProductStockOperationPopup.vue style
This commit is contained in:
@@ -147,10 +147,25 @@ async function edit(): Promise<void> {
|
||||
|
||||
async function viewStock(): Promise<void> {
|
||||
if (product.value?.id) {
|
||||
await router.push(`/management/product-stocks/${product.value.id}`);
|
||||
await router.push({
|
||||
name: "ProductStockDetail",
|
||||
params: { productId: product.value.id },
|
||||
query: { 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);
|
||||
}
|
||||
|
||||
function disable(): void {
|
||||
const id = product.value?.id;
|
||||
if (!id) {
|
||||
|
||||
Reference in New Issue
Block a user