update permission and product
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar placeholder"
|
||||
class="avatar fallback"
|
||||
v-text="(item.name || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar placeholder"
|
||||
class="avatar fallback"
|
||||
v-text="(item.product?.name || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
@@ -92,7 +92,7 @@ const isNoMore = ref(false);
|
||||
let keywordTimer: number | undefined;
|
||||
let requestToken = 0;
|
||||
|
||||
const emptyText = computed(() => isLoading.value ? "正在加载库存" : keyword.value ? "未找到匹配库存" : "暂无库存记录");
|
||||
const emptyText = computed(() => isLoading.value ? "正在加载库存" : keyword.value ? "未找到匹配产品" : "暂无启用库存管理的产品");
|
||||
|
||||
async function fetch(reset = false): Promise<void> {
|
||||
if (!reset && (isLoading.value || isNoMore.value)) {
|
||||
|
||||
@@ -204,10 +204,25 @@ function openManualRevoke(): void {
|
||||
|
||||
async function openRelatedRecord(id?: string): Promise<void> {
|
||||
if (id) {
|
||||
await router.push({ name: "ProductStockRecordDetail", params: { id } });
|
||||
await router.push({
|
||||
name: "ProductStockRecordDetail",
|
||||
params: { 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);
|
||||
}
|
||||
|
||||
async function submitManualRevoke(): Promise<void> {
|
||||
if (!canManualRevoke.value || !record.value?.id || isOperating.value) {
|
||||
return;
|
||||
|
||||
@@ -123,10 +123,25 @@ function getDeltaClass(value?: number | string): string {
|
||||
|
||||
async function toDetail(record: StockRecord): Promise<void> {
|
||||
if (record.id) {
|
||||
await router.push({ name: "ProductStockRecordDetail", params: { id: record.id } });
|
||||
await router.push({
|
||||
name: "ProductStockRecordDetail",
|
||||
params: { id: record.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);
|
||||
}
|
||||
|
||||
async function loadMore(force = false): Promise<void> {
|
||||
if (!force && (loading.value || noMore.value)) {
|
||||
return;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar placeholder"
|
||||
class="avatar fallback"
|
||||
v-text="(props.product.name || props.product.code || '产').slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user