fix page transition
This commit is contained in:
@@ -399,7 +399,10 @@ async function submit(): Promise<void> {
|
||||
emitListDataChanged(listDataEventKeys.productStockChanged);
|
||||
Message.success("批量入库已提交");
|
||||
productStockBatchStore.reset();
|
||||
await router.replace({ name: "ProductStockList" });
|
||||
await router.replace({
|
||||
name: "ProductStockRecordList",
|
||||
query: { returnTo: "ProductTab" }
|
||||
});
|
||||
} catch (error) {
|
||||
Message.error(getErrorMessage(error, "批量入库失败,请确认请求号后重试"));
|
||||
} finally {
|
||||
|
||||
@@ -174,6 +174,7 @@
|
||||
import { type DropdownValue } from "tdesign-mobile-vue";
|
||||
import { PassTimeLabel, Time } from "timi-web";
|
||||
import { UserAPI } from "timi-web-api";
|
||||
import { onBeforeRouteLeave } from "vue-router";
|
||||
import ProductAPI from "@/api/ProductAPI";
|
||||
import { useNavBarStore } from "@/store/navBarStore";
|
||||
import type { Product, ProductSku, StockOperationType, StockRecord, StockRecordDirection } from "@/types/Product";
|
||||
@@ -203,6 +204,7 @@ const isRefreshing = ref(false);
|
||||
const noMore = ref(false);
|
||||
const productId = computed(() => getQueryText("productId"));
|
||||
const skuId = computed(() => getQueryText("skuId"));
|
||||
const returnToProductTab = getQueryText("returnTo") === "ProductTab";
|
||||
const filteredProduct = ref<Product>();
|
||||
const filteredSku = ref<ProductSku>();
|
||||
const filteredSkuUnitId = ref("");
|
||||
@@ -484,6 +486,7 @@ function buildFilterQuery(transitionDepth = getQueryText("transitionDepth")): Re
|
||||
const query = {
|
||||
productId: productId.value,
|
||||
skuId: skuId.value,
|
||||
returnTo: returnToProductTab ? "ProductTab" : "",
|
||||
keyword: keyword.value.trim(),
|
||||
operationType: operationType.value === "ALL" ? "" : operationType.value,
|
||||
direction: direction.value === "ALL" ? "" : direction.value,
|
||||
@@ -539,6 +542,7 @@ async function refresh(): Promise<void> {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
navBarStore.setBackTo(returnToProductTab ? "/product" : undefined);
|
||||
navBarStore.clearRight();
|
||||
try {
|
||||
await Promise.all([loadSkuFilter(), reload()]);
|
||||
@@ -547,6 +551,8 @@ onMounted(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
onBeforeRouteLeave(() => navBarStore.setBackTo(undefined));
|
||||
|
||||
watch(keyword, () => {
|
||||
window.clearTimeout(keywordTimer);
|
||||
keywordTimer = window.setTimeout(async () => {
|
||||
@@ -559,6 +565,7 @@ watch(keyword, () => {
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
navBarStore.setBackTo(undefined);
|
||||
navBarStore.clearRight();
|
||||
window.clearTimeout(keywordTimer);
|
||||
requestToken += 1;
|
||||
|
||||
Reference in New Issue
Block a user