From 883ab99ab021be1adc6dc5689368f899ea436e54 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 31 十月 2025 20:01:57 +0800
Subject: [PATCH] 完成

---
 src/pages/routingInspection/detail/indexLS.vue |  591 +++++++++++++++++++++++++---------------------------------
 1 files changed, 257 insertions(+), 334 deletions(-)

diff --git a/src/pages/routingInspection/detail/indexLS.vue b/src/pages/routingInspection/detail/indexLS.vue
index 07bfd70..f0f4a6b 100644
--- a/src/pages/routingInspection/detail/indexLS.vue
+++ b/src/pages/routingInspection/detail/indexLS.vue
@@ -40,287 +40,254 @@
     </view>
   </view>
   <view class="list">
-    <div class="inspection-report">
-      <!-- 鍩烘湰淇℃伅妯″潡 -->
-      <wd-row>
-        <view style="margin: 10rpx">
-          <text class="title">{{ "鍩烘湰淇℃伅" }}</text>
-        </view>
-        <wd-col :span="24">
-          <wd-form-item label="鏃ユ湡" prop="recordDate">
-            {{ formatDate(detailData.fixedInfo?.recordDate) }}
-          </wd-form-item>
-          <wd-form-item label="鏈哄彴" prop="deviceModel">
-            {{ formatValue(detailData.fixedInfo?.deviceModel) }}
-          </wd-form-item>
-          <wd-form-item label="鐝" prop="workShift">
-            {{ formatValue(detailData.fixedInfo?.workShift) }}
-          </wd-form-item>
-          <wd-form-item label="鐝粍" prop="teamName">
-            {{ formatValue(detailData.fixedInfo?.teamName) }}
-          </wd-form-item>
-          <wd-form-item label="鍗曚笣瑙勬牸" prop="model">
-            {{ formatValue(detailData.fixedInfo?.model) }}
-          </wd-form-item>
-          <wd-form-item label="鐢熶骇杞存暟" prop="outputNumber">
-            {{ formatValue(detailData.fixedInfo?.outputNumber, "杞�") }}
-          </wd-form-item>
-          <wd-form-item label="鍨嬪彿" prop="poleModel">
-            {{ formatValue(detailData.fixedInfo?.poleModel) }}
-          </wd-form-item>
-          <wd-form-item label="鎵规" prop="poleNumber">
-            {{ formatValue(detailData.fixedInfo?.poleNumber) }}
-          </wd-form-item>
-          <wd-form-item label="璁板綍浜�" prop="createUserName">
-            {{ formatValue(detailData.fixedInfo?.createUserName) }}
-          </wd-form-item>
-          <wd-form-item label="棣栨鐩樺彿" prop="firstNo">
-            {{ formatValue(detailData.fixedInfo?.firstNo) }}
-          </wd-form-item>
-        </wd-col>
-      </wd-row>
+    <!-- 鍩烘湰淇℃伅妯″潡 -->
+    <wd-row>
+      <view style="margin: 10rpx">
+        <text class="title">{{ "鍩烘湰淇℃伅" }}</text>
+      </view>
+      <wd-col :span="24">
+        <wd-form-item label="鏃ユ湡" prop="recordDate">
+          {{ formatDate(detailData.fixedInfo?.recordDate) }}
+        </wd-form-item>
+        <wd-form-item label="鏈哄彴" prop="deviceModel">
+          {{ formatValue(detailData.fixedInfo?.deviceModel) }}
+        </wd-form-item>
+        <wd-form-item label="鐝" prop="workShift">
+          {{ formatValue(detailData.fixedInfo?.workShift) }}
+        </wd-form-item>
+        <wd-form-item label="鐝粍" prop="teamName">
+          {{ formatValue(detailData.fixedInfo?.teamName) }}
+        </wd-form-item>
+        <wd-form-item label="鍗曚笣瑙勬牸" prop="model">
+          {{ formatValue(detailData.fixedInfo?.model) }}
+        </wd-form-item>
+        <wd-form-item label="鐢熶骇杞存暟" prop="outputNumber">
+          {{ formatValue(detailData.fixedInfo?.outputNumber, "杞�") }}
+        </wd-form-item>
+        <wd-form-item label="鍨嬪彿" prop="poleModel">
+          {{ formatValue(detailData.fixedInfo?.poleModel) }}
+        </wd-form-item>
+        <wd-form-item label="鎵规" prop="poleNumber">
+          {{ formatValue(detailData.fixedInfo?.poleNumber) }}
+        </wd-form-item>
+        <wd-form-item label="璁板綍浜�" prop="createUserName">
+          {{ formatValue(detailData.fixedInfo?.createUserName) }}
+        </wd-form-item>
+        <wd-form-item label="棣栨鐩樺彿" prop="firstNo">
+          {{ formatValue(detailData.fixedInfo?.firstNo) }}
+        </wd-form-item>
+      </wd-col>
+    </wd-row>
 
-      <!-- 鑷璁板綍璇︽儏妯″潡 -->
-      <wd-row>
-        <view style="margin: 10rpx">
-          <text class="title">{{ "鑷璁板綍璇︽儏" }}</text>
-        </view>
-        <wd-col :span="24">
-          <wd-form-item label="宸℃鍛�" prop="processInspectionUserName">
-            {{ detailData.processInspectionUserName || "-" }}
-          </wd-form-item>
-          <wd-form-item label="鐘舵��" prop="status">
-            <wd-tag custom-class="space" :type="getStatusType(detailData.status)">
-              {{ getStatusText(detailData.status) }}
-            </wd-tag>
-          </wd-form-item>
-        </wd-col>
-      </wd-row>
+    <!-- 鑷璁板綍璇︽儏妯″潡 -->
+    <wd-row>
+      <view style="margin: 10rpx">
+        <text class="title">{{ "鑷璁板綍璇︽儏" }}</text>
+      </view>
+      <wd-col :span="24">
+        <wd-form-item label="宸℃鍛�" prop="processInspectionUserName">
+          {{ detailData.processInspectionUserName || "-" }}
+        </wd-form-item>
+        <wd-form-item label="鐘舵��" prop="status">
+          <wd-tag custom-class="space" :type="getStatusType(detailData.status)">
+            {{ getStatusText(detailData.status) }}
+          </wd-tag>
+        </wd-form-item>
+      </wd-col>
+    </wd-row>
 
-      <!-- 妫�楠岀粨鏋� -->
-      <wd-row>
-        <view style="margin: 10rpx">
-          <text class="title">{{ "妫�楠岀粨鏋�" }}</text>
-        </view>
-        <wd-col :span="24">
-          <wd-form-item label="鍗曚笣鐩村緞" prop="dia">
-            {{ formatValue(detailData.inspectionResult?.dia, "mm") || "-" }}
-          </wd-form-item>
+    <!-- 妫�楠岀粨鏋� -->
+    <wd-row>
+      <view style="margin: 10rpx">
+        <text class="title">{{ "妫�楠岀粨鏋�" }}</text>
+      </view>
+      <wd-col :span="24">
+        <wd-form-item label="鍗曚笣鐩村緞" prop="dia">
+          {{ formatValue(detailData.inspectionResult?.dia, "mm") || "-" }}
+        </wd-form-item>
 
-          <wd-form-item label="鏈�澶х洿寰�" prop="maxDia" required>
-            <template v-if="isEdit">
-              <wd-input v-model="formData.maxDia" placeholder="璇疯緭鍏ユ渶澶х洿寰�(mm)" type="number" />
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.maxDia, "mm") || "-" }}
-            </template>
-          </wd-form-item>
+        <wd-form-item label="鏈�澶х洿寰�" prop="maxDia" required>
+          <template v-if="isEdit">
+            <wd-input v-model="formData.maxDia" placeholder="璇疯緭鍏ユ渶澶х洿寰�(mm)" type="number" />
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.maxDia, "mm") || "-" }}
+          </template>
+        </wd-form-item>
 
-          <wd-form-item label="鏈�灏忕洿寰�" prop="minDia" required>
-            <template v-if="isEdit">
-              <wd-input v-model="formData.minDia" placeholder="璇疯緭鍏ユ渶灏忕洿寰�(mm)" type="number" />
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.minDia, "mm") || "-" }}
-            </template>
-          </wd-form-item>
+        <wd-form-item label="鏈�灏忕洿寰�" prop="minDia" required>
+          <template v-if="isEdit">
+            <wd-input v-model="formData.minDia" placeholder="璇疯緭鍏ユ渶灏忕洿寰�(mm)" type="number" />
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.minDia, "mm") || "-" }}
+          </template>
+        </wd-form-item>
 
-          <wd-form-item label="澶栬" prop="appearance" required>
-            <template v-if="isEdit">
-              <wd-checkbox-group
-                v-model="formData.appearance"
-                inline
-                v-for="(opt, idx) in appearanceOptions"
-                :key="idx"
-                style="text-align: justify"
-              >
-                <wd-checkbox :modelValue="opt.value" style="width: 100px">
-                  {{ opt.label }}
-                </wd-checkbox>
-              </wd-checkbox-group>
-            </template>
-            <template v-else>
-              {{
-                formatProductAppearance(detailData.inspectionResult?.appearance).join("銆�") || "-"
-              }}
-            </template>
-          </wd-form-item>
-
-          <wd-form-item label="鍗风粫绱у瘑" prop="windingTightness" required>
-            <template v-if="isEdit">
-              <wd-radio-group
-                v-model="formData.windingTightness"
-                inline
-                class="conclusion-radio-group"
-              >
-                <wd-radio
-                  v-for="(opt, idx) in sampleCompleteOptions"
-                  :key="idx"
-                  :value="opt.value"
-                  shape="dot"
-                >
-                  {{ opt.label }}
-                </wd-radio>
-              </wd-radio-group>
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.windingTightness) }}
-            </template>
-          </wd-form-item>
-
-          <wd-form-item label="鎺掑垪鏁撮綈" prop="arrangementNeatness" required>
-            <template v-if="isEdit">
-              <wd-radio-group
-                v-model="formData.arrangementNeatness"
-                inline
-                class="conclusion-radio-group"
-              >
-                <wd-radio
-                  v-for="(opt, idx) in sampleCompleteOptions"
-                  :key="idx"
-                  :value="opt.value"
-                  shape="dot"
-                >
-                  {{ opt.label }}
-                </wd-radio>
-              </wd-radio-group>
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.arrangementNeatness) }}
-            </template>
-          </wd-form-item>
-
-          <wd-form-item
-            label="澶栧眰閾濈嚎绂讳晶鏉胯竟缂樿窛绂�"
-            prop="aluminumWireDistance"
-            label-width="360rpx"
-            required
-          >
-            <template v-if="isEdit">
-              <wd-input
-                v-model="formData.aluminumWireDistance"
-                placeholder="璇疯緭鍏ヨ窛绂�(mm)"
-                type="number"
-              />
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.aluminumWireDistance, "mm") || "-" }}
-            </template>
-          </wd-form-item>
-
-          <wd-form-item
-            label="鎴愬搧妯″悗鎺ュご鎯呭喌"
-            prop="jointCondition"
-            label-width="280rpx"
-            required
-          >
-            <template v-if="isEdit">
-              <wd-radio-group
-                v-model="formData.jointCondition"
-                inline
-                class="conclusion-radio-group"
-              >
-                <wd-radio
-                  v-for="(opt, idx) in jointConditionOptions"
-                  :key="idx"
-                  :value="opt.value"
-                  shape="dot"
-                >
-                  {{ opt.label }}
-                </wd-radio>
-              </wd-radio-group>
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.jointCondition) || "-" }}
-            </template>
-          </wd-form-item>
-
-          <wd-form-item label="缁撹" prop="conclusion" required>
-            <template v-if="isEdit">
-              <wd-radio-group v-model="formData.conclusion" inline class="conclusion-radio-group">
-                <wd-radio
-                  v-for="(opt, idx) in conclusionOptions"
-                  :key="idx"
-                  :value="opt.value"
-                  shape="dot"
-                >
-                  {{ opt.label }}
-                </wd-radio>
-              </wd-radio-group>
-            </template>
-            <template v-else>
-              {{ formatValue(detailData.inspectionResult?.conclusion) || "-" }}
-            </template>
-          </wd-form-item>
-        </wd-col>
-      </wd-row>
-
-      <!-- 宸℃缁撴灉 -->
-      <wd-row v-if="detailData.processInspectionResult?.isFully">
-        <view style="margin: 10rpx">
-          <text class="title">{{ "宸℃缁撴灉" }}</text>
-        </view>
-        <wd-col :span="24">
-          <wd-form-item label="閾濇潌鍓嶃�佷腑銆佸熬鏍峰搧鏄惁榻愬叏" prop="isFully" required>
-            <template v-if="isEdit">
-              <wd-radio-group v-model="formData.isFully" inline class="conclusion-radio-group">
-                <wd-radio
-                  v-for="(opt, idx) in sampleCompleteOptions"
-                  :key="idx"
-                  :value="opt.value"
-                  shape="dot"
-                >
-                  {{ opt.label }}
-                </wd-radio>
-              </wd-radio-group>
-            </template>
-            <template v-else>
-              <wd-tag
-                custom-class="space"
-                :type="detailData.processInspectionResult?.isFully ? 'success' : 'danger'"
-              >
-                {{ detailData.processInspectionResult?.isFully ? "鏄�" : "鍚�" }}
-              </wd-tag>
-            </template>
-          </wd-form-item>
-        </wd-col>
-      </wd-row>
-
-      <!-- 闄勪欢妯″潡 -->
-      <wd-row class="attachment-section" v-if="detailData.files && detailData.files.length > 0">
-        <view style="margin: 10rpx">
-          <text class="title">{{ "闄勪欢" }}</text>
-        </view>
-        <view class="attachment-grid">
-          <wd-col v-for="(file, index) in detailData.files" :key="index" class="attachment-item">
-            <wd-img :width="80" :height="80" :src="file.url" @click="previewImage(file.url)">
-              <template #error><view class="error-wrap">鍔犺浇澶辫触</view></template>
-              <template #loading>
-                <view class="loading-wrap"><wd-loading /></view>
-              </template>
-            </wd-img>
-            <!-- <wd-icon
-              v-if="isEdit"
-              name="close-circle"
-              class="delete-icon"
-              @click.stop="deleteFile(index)"
-            ></wd-icon> -->
-          </wd-col>
-          <wd-col v-if="isEdit" class="attachment-item upload-btn">
-            <wd-upload
-              :multiple="true"
-              :max-count="5"
-              :before-upload="beforeUpload"
-              @success="handleUploadSuccess"
-              @fail="handleUploadFail"
-              accept="all"
+        <wd-form-item label="澶栬" prop="appearance" required>
+          <template v-if="isEdit">
+            <wd-checkbox-group
+              v-model="formData.appearance"
+              inline
+              v-for="(opt, idx) in appearanceOptions"
+              :key="idx"
+              style="text-align: justify"
             >
-              <view class="upload-icon">+</view>
-            </wd-upload>
-          </wd-col>
-        </view>
-      </wd-row>
-    </div>
+              <wd-checkbox :modelValue="opt.value" style="width: 100px">
+                {{ opt.label }}
+              </wd-checkbox>
+            </wd-checkbox-group>
+          </template>
+          <template v-else>
+            {{ formatProductAppearance(formData.appearance) }}
+          </template>
+        </wd-form-item>
+
+        <wd-form-item label="鍗风粫绱у瘑" prop="windingTightness" required>
+          <template v-if="isEdit">
+            <wd-radio-group
+              v-model="formData.windingTightness"
+              inline
+              class="conclusion-radio-group"
+            >
+              <wd-radio
+                v-for="(opt, idx) in sampleCompleteOptions"
+                :key="idx"
+                :value="opt.value"
+                shape="dot"
+              >
+                {{ opt.label }}
+              </wd-radio>
+            </wd-radio-group>
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.windingTightness) }}
+          </template>
+        </wd-form-item>
+
+        <wd-form-item label="鎺掑垪鏁撮綈" prop="arrangementNeatness" required>
+          <template v-if="isEdit">
+            <wd-radio-group
+              v-model="formData.arrangementNeatness"
+              inline
+              class="conclusion-radio-group"
+            >
+              <wd-radio
+                v-for="(opt, idx) in sampleCompleteOptions"
+                :key="idx"
+                :value="opt.value"
+                shape="dot"
+              >
+                {{ opt.label }}
+              </wd-radio>
+            </wd-radio-group>
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.arrangementNeatness) }}
+          </template>
+        </wd-form-item>
+
+        <wd-form-item
+          label="澶栧眰閾濈嚎绂讳晶鏉胯竟缂樿窛绂�"
+          prop="aluminumWireDistance"
+          label-width="360rpx"
+          required
+        >
+          <template v-if="isEdit">
+            <wd-input
+              v-model="formData.aluminumWireDistance"
+              placeholder="璇疯緭鍏ヨ窛绂�(mm)"
+              type="number"
+            />
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.aluminumWireDistance, "mm") || "-" }}
+          </template>
+        </wd-form-item>
+
+        <wd-form-item label="鎴愬搧妯″悗鎺ュご鎯呭喌" prop="jointCondition" label-width="280rpx" required>
+          <template v-if="isEdit">
+            <wd-radio-group v-model="formData.jointCondition" inline class="conclusion-radio-group">
+              <wd-radio
+                v-for="(opt, idx) in jointConditionOptions"
+                :key="idx"
+                :value="opt.value"
+                shape="dot"
+              >
+                {{ opt.label }}
+              </wd-radio>
+            </wd-radio-group>
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.jointCondition) || "-" }}
+          </template>
+        </wd-form-item>
+
+        <wd-form-item label="缁撹" prop="conclusion" required>
+          <template v-if="isEdit">
+            <wd-radio-group v-model="formData.conclusion" inline class="conclusion-radio-group">
+              <wd-radio
+                v-for="(opt, idx) in conclusionOptions"
+                :key="idx"
+                :value="opt.value"
+                shape="dot"
+              >
+                {{ opt.label }}
+              </wd-radio>
+            </wd-radio-group>
+          </template>
+          <template v-else>
+            {{ formatValue(detailData.inspectionResult?.conclusion) || "-" }}
+          </template>
+        </wd-form-item>
+      </wd-col>
+    </wd-row>
+
+    <!-- 宸℃缁撴灉 -->
+    <wd-row v-if="detailData.processInspectionResult?.isFully">
+      <view style="margin: 10rpx">
+        <text class="title">{{ "宸℃缁撴灉" }}</text>
+      </view>
+      <wd-col :span="24">
+        <wd-form-item label="閾濇潌鍓嶃�佷腑銆佸熬鏍峰搧鏄惁榻愬叏" prop="isFully" required>
+          <template v-if="isEdit">
+            <wd-radio-group v-model="formData.isFully" inline class="conclusion-radio-group">
+              <wd-radio
+                v-for="(opt, idx) in sampleCompleteOptions"
+                :key="idx"
+                :value="opt.value"
+                shape="dot"
+              >
+                {{ opt.label }}
+              </wd-radio>
+            </wd-radio-group>
+          </template>
+          <template v-else>
+            <wd-tag
+              custom-class="space"
+              :type="detailData.processInspectionResult?.isFully ? 'success' : 'danger'"
+            >
+              {{ detailData.processInspectionResult?.isFully ? "鏄�" : "鍚�" }}
+            </wd-tag>
+          </template>
+        </wd-form-item>
+      </wd-col>
+    </wd-row>
+
+    <!-- 闄勪欢妯″潡 -->
+    <wd-row class="attachment-section" v-if="detailData.files && detailData.files.length > 0">
+      <view style="margin: 10rpx">
+        <text class="title">{{ "闄勪欢" }}</text>
+      </view>
+      <wd-col :span="24">
+        <AttachmentUpload
+          :detailData="detailData"
+          :isEdit="isEdit"
+          :deviceType="paramsType"
+          ref="attachmentRef"
+        />
+      </wd-col>
+    </wd-row>
     <wd-popup v-model="show" custom-style="border-radius:32rpx;" @close="handleClose">
       <div class="image-preview">
         <img :src="previewImageUrl" alt="棰勮鍥剧墖" style="width: 100%; height: auto" />
@@ -337,8 +304,11 @@
 import RoutingInspectionApi from "@/api/routingInspection/routingInspection";
 import Scan from "@/components/scan/index.vue";
 import { useToast } from "wot-design-uni";
+import AttachmentUpload from "../upload.vue";
+
 // 鏍稿績鐘舵��
 const paramsId = ref("");
+const paramsType = ref("");
 const detailData = ref<any>({});
 const show = ref(false);
 const previewImageUrl = ref("");
@@ -347,13 +317,14 @@
 const deviceUid = ref("");
 const scanRef = ref();
 const toast = useToast();
+const attachmentRef = ref<any>(null);
 
 // 琛ㄥ崟鏁版嵁
 const formData = reactive({
   dia: "",
   maxDia: "",
   minDia: "",
-  appearance: "",
+  appearance: [],
   windingTightness: "",
   arrangementNeatness: "",
   aluminumWireDistance: "",
@@ -413,8 +384,8 @@
 };
 
 // 鏍煎紡鍖栧伐鍏�
-const formatProductAppearance = (productAppearance: string) => {
-  return !productAppearance ? "-" : productAppearance;
+const formatProductAppearance = (productAppearance: string[]) => {
+  return !productAppearance.length ? "-" : productAppearance.join("銆�");
 };
 
 const formatValue = (value: any, unit?: string) => {
@@ -438,7 +409,7 @@
   formData.dia = inspectionResult.dia || "";
   formData.maxDia = inspectionResult.maxDia || "";
   formData.minDia = inspectionResult.minDia || "";
-  formData.appearance = inspectionResult.appearance || "";
+  formData.appearance = inspectionResult.appearance || [];
   formData.windingTightness = inspectionResult.windingTightness || "";
   formData.arrangementNeatness = inspectionResult.arrangementNeatness || "";
   formData.aluminumWireDistance = inspectionResult.aluminumWireDistance || "";
@@ -462,6 +433,7 @@
 // 椤甸潰鍔犺浇
 onLoad((options: any) => {
   paramsId.value = options.id;
+  paramsType.value = options.deviceType;
   getDetailData(options.id, options.deviceType);
 });
 
@@ -482,7 +454,7 @@
   // 鏍¢獙
   if (!formData.maxDia) return uni.showToast({ title: "鏈�澶х洿寰勪负蹇呭~椤�", icon: "none" });
   if (!formData.minDia) return uni.showToast({ title: "鏈�灏忕洿寰勪负蹇呭~椤�", icon: "none" });
-  if (!formData.appearance) return uni.showToast({ title: "澶栬涓哄繀濉」", icon: "none" });
+  if (!formData.appearance.length) return uni.showToast({ title: "澶栬涓哄繀濉」", icon: "none" });
   if (!formData.windingTightness) return uni.showToast({ title: "鍗风粫绱у瘑涓哄繀濉」", icon: "none" });
   if (!formData.arrangementNeatness)
     return uni.showToast({ title: "鎺掑垪鏁撮綈涓哄繀濉」", icon: "none" });
@@ -493,6 +465,9 @@
   if (!formData.conclusion) return uni.showToast({ title: "缁撹涓哄繀濉」", icon: "none" });
   if (!formData.isFully) return uni.showToast({ title: "閾濇潌鏍峰搧鏄惁榻愬叏涓哄繀濉」", icon: "none" });
   if (!deviceUid.value) return uni.showToast({ title: "璇锋壂鎻忎簩缁寸爜", icon: "none" });
+  const { newFiles } = attachmentRef.value.getSubmitFiles();
+  console.log("newFiles", newFiles);
+  const allFileIds = [...newFiles];
   // 鎻愪氦
   try {
     const res = await RoutingInspectionApi.drawPatrolCheckInspection({
@@ -510,12 +485,12 @@
         conclusion: formData.conclusion,
       },
       inspectionResult: { isFully: formData.isFully },
-      processInspectionAttachmentList: tempFiles.value.map((f) => f.url),
+      processInspectionAttachmentList: allFileIds,
     });
     if (res.code === 200) {
       uni.showToast({ title: "淇濆瓨鎴愬姛", icon: "success" });
       isEdit.value = false;
-      getDetailData(paramsId.value, detailData.value.deviceType);
+      getDetailData(paramsId.value, paramsType.value);
     } else {
       uni.showModal({ title: res.msg || "淇濆瓨澶辫触", icon: "error" });
     }
@@ -523,56 +498,6 @@
     console.error("淇濆瓨澶辫触:", e);
     uni.showModal({ title: e.message || "淇濆瓨澶辫触", icon: "error" });
   }
-};
-
-// 闄勪欢涓婁紶鏍¢獙
-const beforeUpload = (file: any) => {
-  const maxSize = 2 * 1024 * 1024;
-  if (file.size > maxSize) {
-    uni.showToast({ title: "鍥剧墖澶у皬涓嶈兘瓒呰繃2M", icon: "none" });
-    return false;
-  }
-  return true;
-};
-
-// 闄勪欢涓婁紶鎴愬姛
-const handleUploadSuccess = (res: any) => {
-  if (Array.isArray(res)) {
-    tempFiles.value = [
-      ...tempFiles.value,
-      ...res.map((file) => ({
-        ...file,
-        id: `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
-      })),
-    ];
-  } else {
-    tempFiles.value.push({
-      ...res,
-      id: `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
-    });
-  }
-};
-
-// 闄勪欢涓婁紶澶辫触
-const handleUploadFail = (err: any) => {
-  uni.showToast({ title: "闄勪欢涓婁紶澶辫触", icon: "error" });
-};
-
-// 鍒犻櫎闄勪欢
-const deleteFile = (index: number) => {
-  if (index >= detailData.value.files.length) {
-    tempFiles.value = tempFiles.value.filter(
-      (_, idx) => idx !== index - detailData.value.files.length
-    );
-  } else {
-    detailData.value.files = detailData.value.files.filter((_, idx) => idx !== index);
-  }
-};
-
-// 鍥剧墖棰勮
-const previewImage = (url: string) => {
-  previewImageUrl.value = url;
-  show.value = true;
 };
 
 const handleClose = () => {
@@ -583,12 +508,10 @@
   scanRef.value.triggerScan();
 };
 const getScanCode = (params: any) => {
-  console.log("瀹屾暣鍙傛暟锛�", params);
   let codeObj = {};
   try {
     codeObj = JSON.parse(params.code);
   } catch (err) {
-    console.error("JSON瑙f瀽澶辫触锛�", err);
     toast.error("鎵爜鏁版嵁寮傚父");
     return; // 瑙f瀽澶辫触鐩存帴杩斿洖锛岄伩鍏嶅悗缁敊璇�
   }

--
Gitblit v1.9.3