From 74e6e4431b82fcd30e31f59b91bcdf2c8a5cf3f8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 09 四月 2026 13:12:51 +0800
Subject: [PATCH] 升级app 1.部署修改
---
src/pages/qualityManagement/materialInspection/detail.vue | 121 ++--------------------------------------
1 files changed, 7 insertions(+), 114 deletions(-)
diff --git a/src/pages/qualityManagement/materialInspection/detail.vue b/src/pages/qualityManagement/materialInspection/detail.vue
index 7bd3443..e45b9c0 100644
--- a/src/pages/qualityManagement/materialInspection/detail.vue
+++ b/src/pages/qualityManagement/materialInspection/detail.vue
@@ -131,7 +131,7 @@
<script setup>
import { ref, onMounted } 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 { qualityInspectParamInfo } from "@/api/qualityManagement/materialInspection.js";
@@ -204,16 +204,9 @@
}, 1500);
};
- // 鑾峰彇椤甸潰ID
- const getPageId = () => {
- const pages = getCurrentPages();
- const currentPage = pages[pages.length - 1];
- return currentPage.options.id;
- };
-
// 鑾峰彇璇︽儏鏁版嵁
const getDetail = () => {
- const id = getPageId();
+ const id = optionsId.value;
if (!id) {
showToast("鍙傛暟閿欒");
return;
@@ -235,31 +228,6 @@
) {
// 濡傛灉鎺ュ彛娌℃湁杩斿洖鏁版嵁锛屼娇鐢ㄦ湰鍦板瓨鍌ㄤ腑鐨勬暟鎹�
inspectionItems.value = detailDataFromStorage.qualityInspectParams;
- } else {
- // 妯℃嫙妫�楠岄」鐩�
- inspectionItems.value = [
- {
- parameterItem: "鍘氬害",
- unit: "mm",
- standardValue: "2.0 卤 0.1",
- controlValue: "2.0 卤 0.05",
- testValue: "2.05",
- },
- {
- parameterItem: "纭害",
- unit: "HB",
- standardValue: "鈮� 200",
- controlValue: "鈮� 210",
- testValue: "220",
- },
- {
- parameterItem: "琛ㄩ潰璐ㄩ噺",
- unit: "",
- standardValue: "鏃犲垝鐥曘�佹棤閿堣殌",
- controlValue: "鏃犲垝鐥曘�佹棤閿堣殌",
- testValue: "鍚堟牸",
- },
- ];
}
})
.catch(error => {
@@ -272,90 +240,10 @@
inspectionItems.value = detailDataFromStorage.qualityInspectParams;
}
});
- } else {
- // 妯℃嫙鏁版嵁
- detailData.value = {
- id: id,
- checkTime: "2026-03-03",
- purchaseContractNo: "PO20260303001",
- supplier: "涓婃捣閲戝睘鏉愭枡鏈夐檺鍏徃",
- checkName: "寮犱笁",
- productName: "涓嶉攬閽㈡澘鏉�",
- model: "304",
- unit: "kg",
- quantity: 1000,
- checkCompany: "绗笁鏂规娴嬫満鏋�",
- checkResult: "鍚堟牸",
- inspectState: true,
- };
-
- // 妯℃嫙妫�楠岄」鐩�
- inspectionItems.value = [
- {
- parameterItem: "鍘氬害",
- unit: "mm",
- standardValue: "2.0 卤 0.1",
- controlValue: "2.0 卤 0.05",
- testValue: "2.05",
- },
- {
- parameterItem: "纭害",
- unit: "HB",
- standardValue: "鈮� 200",
- controlValue: "鈮� 210",
- testValue: "220",
- },
- {
- parameterItem: "琛ㄩ潰璐ㄩ噺",
- unit: "",
- standardValue: "鏃犲垝鐥曘�佹棤閿堣殌",
- controlValue: "鏃犲垝鐥曘�佹棤閿堣殌",
- testValue: "鍚堟牸",
- },
- ];
}
} catch (error) {
console.error("鍔犺浇璇︽儏鏁版嵁澶辫触:", error);
showToast("鍔犺浇璇︽儏鏁版嵁澶辫触锛岃閲嶈瘯");
- // 鍔犺浇澶辫触鏃朵娇鐢ㄦā鎷熸暟鎹�
- detailData.value = {
- id: id,
- checkTime: "2026-03-03",
- purchaseContractNo: "PO20260303001",
- supplier: "涓婃捣閲戝睘鏉愭枡鏈夐檺鍏徃",
- checkName: "寮犱笁",
- productName: "涓嶉攬閽㈡澘鏉�",
- model: "304",
- unit: "kg",
- quantity: 1000,
- checkCompany: "绗笁鏂规娴嬫満鏋�",
- checkResult: "鍚堟牸",
- inspectState: true,
- };
-
- inspectionItems.value = [
- {
- parameterItem: "鍘氬害",
- unit: "mm",
- standardValue: "2.0 卤 0.1",
- controlValue: "2.0 卤 0.05",
- testValue: "2.05",
- },
- {
- parameterItem: "纭害",
- unit: "HB",
- standardValue: "鈮� 200",
- controlValue: "鈮� 210",
- testValue: "220",
- },
- {
- parameterItem: "琛ㄩ潰璐ㄩ噺",
- unit: "",
- standardValue: "鏃犲垝鐥曘�佹棤閿堣殌",
- controlValue: "鏃犲垝鐥曘�佹棤閿堣殌",
- testValue: "鍚堟牸",
- },
- ];
}
};
@@ -366,6 +254,11 @@
onMounted(() => {
getDetail();
});
+ const optionsId = ref("");
+ onLoad(options => {
+ optionsId.value = options.id || "";
+ getDetail();
+ });
</script>
<style scoped lang="scss">
--
Gitblit v1.9.3