src/pages/routingInspection/detail/indexLS.vue
@@ -82,10 +82,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="processInspectionUserName">
@@ -248,12 +248,17 @@
    </wd-row>
    <!-- 巡检结果 -->
    <wd-row v-if="detailData.processInspectionResult?.isFully">
    <wd-row>
      <view style="margin: 10rpx">
        <text class="title">{{ "巡检结果" }}</text>
      </view>
      <wd-col :span="24">
        <wd-form-item label="铝杆前、中、尾样品是否齐全" prop="isFully" required>
        <wd-form-item
          label="铝杆前、中、尾样品是否齐全"
          prop="isFully"
          required
          label-width="420rpx"
        >
          <template v-if="isEdit">
            <wd-radio-group v-model="formData.isFully" inline class="conclusion-radio-group">
              <wd-radio
@@ -279,7 +284,7 @@
    </wd-row>
    <!-- 附件模块 -->
    <wd-row class="attachment-section" v-if="detailData.files && detailData.files.length > 0">
    <wd-row class="attachment-section">
      <view style="margin: 10rpx">
        <text class="title">{{ "附件" }}</text>
      </view>
@@ -298,6 +303,8 @@
      </div>
    </wd-popup>
    <wd-toast />
    <!-- 扫码组件 -->
    <Scan ref="scanRef" emit-name="scanLS" />
  </view>
</template>
@@ -309,6 +316,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 paramsId = ref("");
@@ -320,6 +328,7 @@
const tempFiles = ref<any[]>([]);
const toast = useToast();
const attachmentRef = ref<any>(null);
const scanRef = ref(); // 扫码组件引用
// 获取当前登录用户信息
const userStore = useUserStore();
@@ -546,7 +555,7 @@
    const res = await RoutingInspectionApi.drawPatrolCheckInspection({
      deviceUid: deviceUid.value,
      id: paramsId.value,
      result: {
      inspectionResult: {
        dia: formData.dia,
        maxDia: formData.maxDia,
        minDia: formData.minDia,
@@ -557,7 +566,7 @@
        jointCondition: formData.jointCondition,
        conclusion: formData.conclusion,
      },
      inspectionResult: { isFully: formData.isFully },
      result: { isFully: formData.isFully },
      processInspectionAttachmentList: allFileIds,
    });
    if (res.code === 200) {
@@ -589,12 +598,16 @@
};
const openScan = () => {
  console.log("indexLS - 点击扫码按钮(全局扫码模式,无需手动触发)");
  // 全局扫码模式下,硬件扫码会自动触发,无需手动调用
  uni.showToast({
    title: "请使用扫码枪扫描",
    icon: "none",
  });
  console.log("indexLS - 点击扫码按钮,触发扫码");
  // 触发扫码
  if (scanRef.value) {
    scanRef.value.triggerScan();
  } else {
    uni.showToast({
      title: "扫码组件未初始化",
      icon: "none",
    });
  }
};
// 页面显示时的处理
@@ -610,13 +623,13 @@
    console.log("⚠️ 未检测到扫码缓存,用户需要扫描设备二维码");
    // 在编辑模式下才提示
    if (isEdit.value) {
      setTimeout(() => {
        uni.showToast({
          title: "请扫描设备二维码后再保存",
          icon: "none",
          duration: 2000,
        });
      }, 500);
      // setTimeout(() => {
      //   uni.showToast({
      //     title: "请扫描设备二维码后再保存",
      //     icon: "none",
      //     duration: 2000,
      //   });
      // }, 500);
    }
  }
});