From 2de633725d5e5d843853240933f63220dc4e4cb2 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 03 十二月 2025 16:53:57 +0800
Subject: [PATCH] fix: 导体会存在每隔一段距离需要标记的情况,需要通知工人进行标记。

---
 src/pages/routingInspection/detail/indexJX.vue |   98 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 71 insertions(+), 27 deletions(-)

diff --git a/src/pages/routingInspection/detail/indexJX.vue b/src/pages/routingInspection/detail/indexJX.vue
index d2de1c8..03fc4a9 100644
--- a/src/pages/routingInspection/detail/indexJX.vue
+++ b/src/pages/routingInspection/detail/indexJX.vue
@@ -77,13 +77,23 @@
           {{ formatValue(recordData.fixedInfo?.tensionSetting, "N/m") }}
         </wd-form-item>
         <!-- 缁炲埗澶栧緞锛堝彲缂栬緫锛� -->
-        <wd-form-item label="缁炲悎澶栧緞" prop="twistedOuterDiameter" required>
+        <wd-form-item :label="getDiameterTypeLabel()" prop="twistedOuterDiameter" required>
           <template v-if="isEdit">
-            <wd-input
-              v-model="formData.twistedOuterDiameter"
-              placeholder="璇疯緭鍏ョ粸鍚堝寰勶紙mm锛�"
-              type="number"
-            />
+            <view style="display: flex; flex-direction: column; gap: 8px">
+              <wd-select-picker
+                v-model="formData.diameterType"
+                :columns="diameterTypeColumns"
+                type="radio"
+                placeholder="璇烽�夋嫨绫诲瀷"
+                :clearable="false"
+                @change="handleDiameterTypeChange"
+              />
+              <wd-input
+                v-model="formData.twistedOuterDiameter"
+                :placeholder="`璇疯緭鍏�${getDiameterTypeLabel()}`"
+                type="number"
+              />
+            </view>
           </template>
           <template v-else>
             {{ formatValue(formData.twistedOuterDiameter, "mm") }}
@@ -92,10 +102,10 @@
       </wd-col>
     </wd-row>
 
-    <!-- 鑷璁板綍璇︽儏妯″潡 -->
+    <!-- 宸ヨ壓璁板綍璇︽儏妯″潡 -->
     <wd-row>
       <view style="margin: 10rpx">
-        <text class="title">{{ "鑷璁板綍璇︽儏" }}</text>
+        <text class="title">{{ "宸ヨ壓璁板綍璇︽儏" }}</text>
       </view>
       <wd-col :span="24">
         <wd-form-item label="璁板綍浣嶇疆" prop="recordPosition">
@@ -318,6 +328,8 @@
       </div>
     </wd-popup>
     <wd-toast />
+    <!-- 鎵爜缁勪欢 -->
+    <Scan ref="scanRef" emit-name="scanJX" />
   </view>
 </template>
 
@@ -329,6 +341,7 @@
 import AttachmentUpload from "../upload.vue";
 import { useUserStore } from "@/store/modules/user";
 import { useScanCode } from "@/composables/useScanCode";
+import Scan from "@/components/scan/index.vue";
 
 const paramsType = ref("");
 const paramsId = ref("");
@@ -341,6 +354,7 @@
 const attachmentRef = ref<any>(null);
 const detailData = reactive<any>({});
 const detailDataLoaded = ref(false);
+const scanRef = ref(); // 鎵爜缁勪欢寮曠敤
 
 // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛淇℃伅
 const userStore = useUserStore();
@@ -356,6 +370,7 @@
 
 const formData = reactive({
   twistedOuterDiameter: "", // 缁炲埗澶栧緞
+  diameterType: "缁炲悎澶栧緞(mm)", // 澶栧緞绫诲瀷
   structureFormula: "", // 鎴愬搧缁撴瀯
   structureItems: [], // 缁撴瀯鏍囧噯鍊煎拰瀹炴祴
   inspectTwist: [], // 缁炵嚎宸ヨ壓璐ㄩ噺鎺у埗
@@ -385,12 +400,32 @@
   { label: "鍚�", value: "鍚�" },
 ];
 
+// 澶栧緞绫诲瀷閫夐」
+const diameterTypeColumns = [
+  { label: "缁炲悎澶栧緞(mm)", value: "缁炲悎澶栧緞(mm)" },
+  { label: "鎵囬珮/鎵囧", value: "鎵囬珮/鎵囧" },
+  { label: "T褰㈢瓑鏁堟埅闈�", value: "T褰㈢瓑鏁堟埅闈�" },
+];
+
+// 鑾峰彇澶栧緞绫诲瀷鏍囩
+const getDiameterTypeLabel = () => {
+  return formData.diameterType || "缁炲悎澶栧緞(mm)";
+};
+
+// 澶勭悊澶栧緞绫诲瀷鍙樺寲
+const handleDiameterTypeChange = () => {
+  // 绫诲瀷鍙樺寲鏃跺彲浠ユ竻绌鸿緭鍏ュ�兼垨淇濈暀锛屾牴鎹渶姹傚喅瀹�
+  // formData.twistedOuterDiameter = "";
+};
+
 const initFormData = () => {
   const structureResult = recordData.value.structureInfo?.structureRecordResult || {};
   const inspectionResult = recordData.value.inspectionResult || {};
 
   formData.twistedOuterDiameter =
     recordData.value.structureInfo.structureRecordResult.twistedOuterDiameter || "";
+  formData.diameterType =
+    recordData.value.structureInfo.structureRecordResult.diameterType || "缁炲悎澶栧緞(mm)";
   formData.structureFormula = structureResult.inspectStructure?.structureFormula || "";
   formData.isFully = inspectionResult.isFully || "";
   formData.conclusion = structureResult.conclusion || "";
@@ -464,8 +499,10 @@
 const saveList = async () => {
   // 1. 鍩虹瀛楁鏍¢獙
   if (!formData.structureFormula) return uni.showToast({ title: "鎴愬搧缁撴瀯涓哄繀濉」", icon: "none" });
-  if (!formData.twistedOuterDiameter)
-    return uni.showToast({ title: "缁炲埗澶栧緞涓哄繀濉」", icon: "none" });
+  if (!formData.twistedOuterDiameter) {
+    const label = getDiameterTypeLabel();
+    return uni.showToast({ title: `${label}涓哄繀濉」`, icon: "none" });
+  }
   if (!formData.productAppearance.length)
     return uni.showToast({ title: "浜у搧澶栬涓哄繀濉」", icon: "none" });
   if (!formData.conclusion) return uni.showToast({ title: "缁撹涓哄繀濉」", icon: "none" });
@@ -506,8 +543,11 @@
       id: paramsId.value,
       inspectionResult: {
         twistedOuterDiameter: formData.twistedOuterDiameter,
-        structureFormula: formData.structureFormula,
-        structureItems: formData.structureItems,
+        diameterType: formData.diameterType || "缁炲悎澶栧緞(mm)",
+        inspectStructure: {
+          structureFormula: formData.structureFormula,
+          structureItems: formData.structureItems,
+        },
         inspectTwist: formData.inspectTwist,
         productAppearance: formData.productAppearance,
         conclusion: formData.conclusion,
@@ -655,12 +695,16 @@
 };
 
 const openScan = () => {
-  console.log("indexJX - 鐐瑰嚮鎵爜鎸夐挳锛堝叏灞�鎵爜妯″紡锛屾棤闇�鎵嬪姩瑙﹀彂锛�");
-  // 鍏ㄥ眬鎵爜妯″紡涓嬶紝纭欢鎵爜浼氳嚜鍔ㄨЕ鍙戯紝鏃犻渶鎵嬪姩璋冪敤
-  uni.showToast({
-    title: "璇蜂娇鐢ㄦ壂鐮佹灙鎵弿",
-    icon: "none",
-  });
+  console.log("indexJX - 鐐瑰嚮鎵爜鎸夐挳锛岃Е鍙戞壂鐮�");
+  // 瑙﹀彂鎵爜
+  if (scanRef.value) {
+    scanRef.value.triggerScan();
+  } else {
+    uni.showToast({
+      title: "鎵爜缁勪欢鏈垵濮嬪寲",
+      icon: "none",
+    });
+  }
 };
 
 // 椤甸潰鏄剧ず鏃剁殑澶勭悊
@@ -675,15 +719,15 @@
   if (!cachedData || !cachedData.uid) {
     console.log("鈿狅笍 鏈娴嬪埌鎵爜缂撳瓨锛岀敤鎴烽渶瑕佹壂鎻忚澶囦簩缁寸爜");
     // 鍦ㄧ紪杈戞ā寮忎笅鎵嶆彁绀�
-    if (isEdit.value) {
-      setTimeout(() => {
-        uni.showToast({
-          title: "璇锋壂鎻忚澶囦簩缁寸爜鍚庡啀淇濆瓨",
-          icon: "none",
-          duration: 2000,
-        });
-      }, 500);
-    }
+    // if (isEdit.value) {
+    //   setTimeout(() => {
+    //     uni.showToast({
+    //       title: "璇锋壂鎻忚澶囦簩缁寸爜鍚庡啀淇濆瓨",
+    //       icon: "none",
+    //       duration: 2000,
+    //     });
+    //   }, 500);
+    // }
   }
 });
 </script>

--
Gitblit v1.9.3