From f3cd8f9805aea1f99b9491af4496a81537c9a778 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 08 四月 2026 14:51:38 +0800
Subject: [PATCH] 质检模块跳转页面问题
---
src/pages/qualityManagement/materialInspection/add.vue | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/pages/qualityManagement/materialInspection/add.vue b/src/pages/qualityManagement/materialInspection/add.vue
index 0309813..63a94ef 100644
--- a/src/pages/qualityManagement/materialInspection/add.vue
+++ b/src/pages/qualityManagement/materialInspection/add.vue
@@ -309,7 +309,7 @@
<script setup>
import { ref, computed, onMounted, nextTick } from "vue";
- import { onShow } from "@dcloudio/uni-app";
+ import { onShow, onLoad } from "@dcloudio/uni-app";
import PageHeader from "@/components/PageHeader.vue";
import dayjs from "dayjs";
import { getOptions } from "@/api/procurementManagement/procurementLedger.js";
@@ -460,7 +460,7 @@
// 鏄惁涓虹紪杈戞ā寮�
const isEdit = computed(() => {
- const id = getPageId();
+ const id = optionsId.value;
return !!id;
});
@@ -469,13 +469,6 @@
const v = form.value || {};
return !!(v.productMainId != null || v.purchaseLedgerId != null);
});
-
- // 鑾峰彇椤甸潰ID
- const getPageId = () => {
- const pages = getCurrentPages();
- const currentPage = pages[pages.length - 1];
- return currentPage.options.id;
- };
// 杩斿洖涓婁竴椤�
const goBack = () => {
@@ -743,7 +736,7 @@
// 鍒濆鍖栬〃鍗�
const initForm = async () => {
- const id = getPageId();
+ const id = optionsId.value;
if (id) {
// 缂栬緫妯″紡锛屽姞杞芥暟鎹�
// 鍏堥噸缃〃鍗曟暟鎹�
@@ -896,6 +889,12 @@
onShow(() => {
initForm();
});
+
+ const optionsId = ref("");
+ onLoad(options => {
+ optionsId.value = options.id || "";
+ initForm();
+ });
</script>
<style scoped lang="scss">
--
Gitblit v1.9.3