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/finalInspection/add.vue |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/pages/qualityManagement/finalInspection/add.vue b/src/pages/qualityManagement/finalInspection/add.vue
index a56b388..9b605c7 100644
--- a/src/pages/qualityManagement/finalInspection/add.vue
+++ b/src/pages/qualityManagement/finalInspection/add.vue
@@ -302,7 +302,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";
@@ -454,7 +454,7 @@
 
   // 鏄惁涓虹紪杈戞ā寮�
   const isEdit = computed(() => {
-    const id = getPageId();
+    const id = optionsId.value;
     return !!id;
   });
 
@@ -463,13 +463,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 = () => {
@@ -737,7 +730,7 @@
 
   // 鍒濆鍖栬〃鍗�
   const initForm = async () => {
-    const id = getPageId();
+    const id = optionsId.value;
     if (id) {
       // 缂栬緫妯″紡锛屽姞杞芥暟鎹�
       // 鍏堥噸缃〃鍗曟暟鎹�
@@ -890,6 +883,12 @@
   onShow(() => {
     initForm();
   });
+
+  const optionsId = ref("");
+  onLoad(options => {
+    optionsId.value = options.id || "";
+    getDetail();
+  });
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3