From f7f25f593a731ea71e307257f5cec3ba562dacda Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 04 十二月 2025 11:10:39 +0800
Subject: [PATCH] fix: 杆领用,型号选择下拉框

---
 src/pages/production/detail/twistDetail.vue |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/pages/production/detail/twistDetail.vue b/src/pages/production/detail/twistDetail.vue
index b63840d..cfb6e49 100644
--- a/src/pages/production/detail/twistDetail.vue
+++ b/src/pages/production/detail/twistDetail.vue
@@ -9,6 +9,7 @@
         totalAmount: 'totalAmount',
         amount: 'amount',
         unAmount: 'unAmount',
+        segmentLengthNote: 'segmentLengthNote',
       }"
     />
     <view class="mx-3">
@@ -41,7 +42,7 @@
 import { onLoad } from "@dcloudio/uni-app";
 import ProductCard from "@/components/product_card/index.vue";
 import TwistApi from "@/api/product/twist";
-import { getPrepareId, setPrepareId } from "@/utils/cache";
+import { getPrepareId, setPrepareId, clearPrepareId } from "@/utils/cache";
 import HomeApi from "@/api/home";
 
 const paramsId = ref();
@@ -52,18 +53,22 @@
   totalAmount: undefined,
   amount: undefined,
   unAmount: undefined,
+  segmentLengthNote: undefined,
 });
+const detailData = ref<any>({});
 
 const getDetailData = async (id: string) => {
   const { data } = await TwistApi.getTwistDetailById({
     id: id,
   });
+  detailData.value = data;
   cardData.deviceModel = data.deviceModel;
   cardData.model = data.model;
   cardData.systemNo = data.systemNo;
   cardData.totalAmount = data.totalLength;
   cardData.amount = data.length;
   cardData.unAmount = data.unLength;
+  cardData.segmentLengthNote = data.segmentLengthNote;
 };
 
 // 鑾峰彇骞剁紦瀛樼敓浜у噯澶嘔D
@@ -72,14 +77,30 @@
     const { data } = await HomeApi.getIndex();
     if (data && data.prepareId) {
       setPrepareId(data.prepareId);
+    } else {
+      // 濡傛灉娌℃湁 prepareId锛屾竻绌虹紦瀛�
+      clearPrepareId();
     }
   } catch (error) {
     console.error("鑾峰彇鐢熶骇鍑嗗ID澶辫触:", error);
+    // 鑾峰彇澶辫触鏃朵篃娓呯┖缂撳瓨
+    clearPrepareId();
   }
 };
 
 // 澶勭悊鎶ュ伐鐐瑰嚮
-const handleReportClick = () => {
+const handleReportClick = async () => {
+  // 鍏堣姹傞獙璇佸彉鏇存帴鍙�
+  try {
+    const { code } = await TwistApi.verifyChanges({ projectId: detailData.value.projectId });
+    if (code !== 200) {
+      return;
+    }
+  } catch (error) {
+    console.error("楠岃瘉鍙樻洿澶辫触:", error);
+    return;
+  }
+
   const prepareId = getPrepareId();
   console.log("缁炵嚎琛ㄦ牸鎶ュ伐妫�鏌� - prepareId鍊�:", prepareId);
 

--
Gitblit v1.9.3