From a9561a3189d50f0e33d693b5226ea56adda06a08 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 30 十月 2025 23:07:25 +0800
Subject: [PATCH] 巡检编辑和扫码
---
 src/pages/routingInspection/detail/indexLS.vue |  382 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 382 insertions(+), 0 deletions(-)
diff --git a/src/pages/routingInspection/detail/indexLS.vue b/src/pages/routingInspection/detail/indexLS.vue
new file mode 100644
index 0000000..ad3ccac
--- /dev/null
+++ b/src/pages/routingInspection/detail/indexLS.vue
@@ -0,0 +1,382 @@
+<template>
+  <view class="fixed-header">
+    <view class="header-container">
+      <wd-button
+        icon="file-add"
+        :round="false"
+        size="small"
+        custom-class="add_btn"
+        @click="editList"
+        v-if="!isEdit"
+      >
+        缂栬緫
+      </wd-button>
+      <wd-button
+        icon="close"
+        type="info"
+        :round="false"
+        size="small"
+        custom-class="add_btn"
+        @click="close"
+        v-if="isEdit"
+      >
+        鍙栨秷
+      </wd-button>
+      <wd-button
+        icon="check"
+        type="success"
+        :round="false"
+        size="small"
+        custom-class="add_btn"
+        @click="saveList"
+        v-if="isEdit"
+      >
+        淇濆瓨
+      </wd-button>
+      <view class="placeholder"></view>
+      <view class="scan-wrapper" @click="openScan">
+        <wd-icon name="scan" size="24px" color="#0D867F"></wd-icon>
+      </view>
+    </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="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-form-item label="鏈�澶х洿寰�" prop="maxDia">
+            {{ formatValue(detailData.inspectionResult?.maxDia, "mm") || "-" }}
+          </wd-form-item>
+          <wd-form-item label="鏈�灏忕洿寰�" prop="minDia">
+            {{ formatValue(detailData.inspectionResult?.minDia, "mm") || "-" }}
+          </wd-form-item>
+          <wd-form-item label="澶栬" prop="appearance">
+            {{ formatProductAppearance(detailData.inspectionResult?.appearance) || "-" }}
+          </wd-form-item>
+          <wd-form-item label="鍗风粫绱у瘑" prop="windingTightness">
+            {{ formatValue(detailData.inspectionResult?.windingTightness) }}
+          </wd-form-item>
+          <wd-form-item label="鎺掑垪鏁撮綈" prop="arrangementNeatness">
+            {{ formatValue(detailData.inspectionResult?.arrangementNeatness) }}
+          </wd-form-item>
+          <wd-form-item
+            label="澶栧眰閾濈嚎绂讳晶鏉胯竟缂樿窛绂�"
+            prop="aluminumWireDistance"
+            label-width="500rpx"
+          >
+            {{ formatValue(detailData.inspectionResult?.aluminumWireDistance, "mm") || "-" }}
+          </wd-form-item>
+          <wd-form-item label="鎴愬搧妯″悗鎺ュご鎯呭喌" prop="jointCondition" label-width="250rpx">
+            {{ formatValue(detailData.inspectionResult?.jointCondition) || "-" }}
+          </wd-form-item>
+          <wd-form-item label="缁撹" prop="conclusion">
+            {{ formatValue(detailData.inspectionResult?.conclusion) || "-" }}
+          </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="processInspectionUserName">
+            <wd-tag
+              custom-class="space"
+              :type="detailData.processInspectionResult?.isFully ? 'success' : 'danger'"
+            >
+              {{ detailData.processInspectionResult?.isFully ? "鏄�" : "鍚�" }}
+            </wd-tag>
+          </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-col>
+        </view>
+      </wd-row>
+    </div>
+    <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" />
+      </div>
+    </wd-popup>
+  </view>
+</template>
+
+<script setup lang="ts">
+import { onLoad } from "@dcloudio/uni-app";
+import RoutingInspectionApi from "@/api/routingInspection/routingInspection";
+
+const paramsId = ref("");
+const detailData = ref<any>({});
+const show = ref(false);
+const previewImageUrl = ref("");
+const isEdit = ref(false);
+
+// 鐘舵�佺被鍨嬫槧灏�
+const getStatusType = (status: number) => {
+  switch (status) {
+    case 0:
+      return "warning"; // 寰呭贰妫�
+    case 1:
+      return "danger"; // 宸查┏鍥�
+    case 2:
+      return "info"; // 寰呭鏍�
+    case 3:
+      return "success"; // 閫氳繃
+    default:
+      return "info";
+  }
+};
+
+// 鐘舵�佹枃鏈槧灏�
+const getStatusText = (status: number) => {
+  switch (status) {
+    case 0:
+      return "寰呭贰妫�";
+    case 1:
+      return "宸查┏鍥�";
+    case 2:
+      return "寰呭鏍�";
+    case 3:
+      return "閫氳繃";
+    default:
+      return "鏈煡";
+  }
+};
+
+// 鑾峰彇澶栬鏂囨湰
+const getAppearanceText = (appearance: string[]) => {
+  if (!appearance || appearance.length === 0) return "-";
+  return appearance.join("銆�");
+};
+
+// 鏍煎紡鍖栦骇鍝佸瑙傛樉绀�
+const formatProductAppearance = (productAppearance: string[]) => {
+  if (!productAppearance || productAppearance.length === 0) return "-";
+  return productAppearance.join("銆�");
+};
+
+// 鏍煎紡鍖栨暟鍊兼樉绀�
+const formatValue = (value: any, unit?: string) => {
+  if (value === null || value === undefined || value === "") return "-";
+  return unit ? `${value}${unit}` : value;
+};
+
+// 鏍煎紡鍖栨棩鏈熸樉绀�
+const formatDate = (date: string) => {
+  if (!date) return "-";
+  return new Date(date).toLocaleDateString("zh-CN", {
+    year: "numeric",
+    month: "2-digit",
+    day: "2-digit",
+  });
+};
+
+// 鏍煎紡鍖栫粨鏋勫�兼樉绀�
+const formatStructureValue = (value1: any, value2: any) => {
+  const val1 = value1 || "-";
+  const val2 = value2 ? `${value2}mm` : "-";
+  return { count: val1, diameter: val2 };
+};
+
+const getDetailData = async (id: string, deviceType: string) => {
+  try {
+    let response;
+    // 鑾峰彇鎷変笣鍗曚釜缁撴瀯
+    response = await RoutingInspectionApi.getDrawInspectInfoById({
+      id: id,
+    });
+    detailData.value = response.data;
+    console.log(detailData.value);
+  } catch (error) {
+    console.error("鑾峰彇璇︽儏澶辫触:", error);
+  }
+};
+
+onLoad((options: any) => {
+  paramsId.value = options.id;
+  getDetailData(options.id, options.deviceType);
+});
+
+const previewImage = (url: string) => {
+  previewImageUrl.value = url;
+  show.value = true;
+};
+
+const handleClose = () => {
+  show.value = false;
+};
+
+// 缂栬緫鍒楄〃
+const editList = () => {};
+
+// 鍏抽棴
+const close = () => {};
+
+// 淇濆瓨鍒楄〃
+const saveList = async () => {
+  // try {
+  //   let response;
+  //   // 淇濆瓨鍒楄〃
+  //   response = await RoutingInspectionApi.saveStrandedInspectionStructureInfo({
+  //     id: paramsId.value,
+  //     structureInfo: recordData.value.structureInfo,
+  //   });
+  //   if (response.code === 200) {
+  //     uni.showToast({
+  //       title: "淇濆瓨鎴愬姛",
+  //       icon: "success",
+  //     });
+  //     // 鍒锋柊璇︽儏鏁版嵁
+  //     getDetailData(paramsId.value, recordData.value.deviceType);
+  //   } else {
+  //     uni.showToast({
+  //       title: response.msg || "淇濆瓨澶辫触",
+  //       icon: "error",
+  //     });
+  //   }
+  // } catch (error) {
+  //   console.error("淇濆瓨鍒楄〃澶辫触:", error);
+  //   uni.showToast({
+  //     title: "淇濆瓨澶辫触",
+  //     icon: "error",
+  //   });
+  // }
+};
+</script>
+<style lang="scss" scoped>
+.list {
+  height: calc(100vh - 80px);
+  padding: 12px;
+  background: #f3f9f8;
+
+  :deep() {
+    .round {
+      border-radius: 4px;
+    }
+  }
+}
+
+.title {
+  position: relative;
+  margin-left: 10px;
+  font-size: 16px;
+  font-weight: 500;
+  color: #0d867f;
+}
+
+.title::after {
+  position: absolute;
+  content: "";
+  top: 4px;
+  left: -10px;
+  width: 4px;
+  height: 16px;
+  background: #0d867f;
+  border-radius: 2px;
+}
+
+.attachment-section {
+  width: 100%;
+}
+
+.attachment-grid {
+  display: flex;
+  flex-wrap: wrap;
+  /* 瓒呭嚭鑷姩鎹㈣ */
+  gap: 10px;
+  /* 鍥剧墖涔嬮棿鐨勯棿璺� */
+  padding: 10px 0;
+}
+
+.attachment-item {
+  width: calc(25% - 10px);
+  /* 姣忚4寮狅紝闂磋窛鐢眊ap鎺у埗锛岄渶璁$畻瀹藉害 */
+  box-sizing: border-box;
+}
+
+/* 閫傞厤灏忓睆骞曪紝鍙皟鏁存瘡琛屾暟閲忥紙濡傛瘡琛�2寮狅級 */
+@media (max-width: 768px) {
+  .attachment-item {
+    width: calc(25% - 10px);
+  }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3