yyb
5 天以前 a9561a3189d50f0e33d693b5226ea56adda06a08
巡检编辑和扫码
已修改4个文件
462 ■■■■ 文件已修改
src/pages/routingInspection/detail/indexJX.vue 306 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/routingInspection/detail/indexLS.vue 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/routingInspection/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/routingInspection/product_card/index.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/routingInspection/detail/indexJX.vue
@@ -1,104 +1,208 @@
<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(recordData.fixedInfo?.recordDate)}}</wd-form-item>
                    <wd-form-item label="班次"
                        prop="workShift">{{formatValue(recordData.fixedInfo?.workShift)}}</wd-form-item>
                    <wd-form-item label="型号规格" prop="model">{{ formatValue(recordData.fixedInfo?.model)}}</wd-form-item>
                    <wd-form-item label="成品线盘号"
                        prop="systemNo">{{ formatValue(recordData.fixedInfo?.systemNo)}}</wd-form-item>
                    <wd-form-item label="记录人"
                        prop="createUserName">{{ formatValue(recordData.fixedInfo?.createUserName) }}</wd-form-item>
                    <wd-form-item label="机台"
                        prop="deviceModel">{{ formatValue(recordData.fixedInfo?.deviceModel)}}</wd-form-item>
                    <wd-form-item label="产品类别"
                        prop="productType">{{ formatValue(recordData.fixedInfo?.productType)}}</wd-form-item>
                    <wd-form-item label="生产长度"
                        prop="actuallyLength">{{ formatValue(recordData.fixedInfo?.actuallyLength, "m")}}</wd-form-item>
                    <wd-form-item label="张力设置"
                        prop="twistTension">{{ formatValue(recordData.fixedInfo?.twistTension, "N/m") }}</wd-form-item>
                    <wd-form-item label="绞制外径"
                        prop="twistDiameter">{{ formatValue(recordData.inspectionResult?.twistDiameter, "mm") }}</wd-form-item>
        <wd-form-item label="日期" prop="recordDate">
          {{ formatDate(recordData.fixedInfo?.recordDate) }}
        </wd-form-item>
        <wd-form-item label="班次" prop="workShift">
          {{ formatValue(recordData.fixedInfo?.workShift) }}
        </wd-form-item>
        <wd-form-item label="型号规格" prop="model">
          {{ formatValue(recordData.fixedInfo?.model) }}
        </wd-form-item>
        <wd-form-item label="成品线盘号" prop="systemNo">
          {{ formatValue(recordData.fixedInfo?.systemNo) }}
        </wd-form-item>
        <wd-form-item label="记录人" prop="createUserName">
          {{ formatValue(recordData.fixedInfo?.createUserName) }}
        </wd-form-item>
        <wd-form-item label="机台" prop="deviceModel">
          {{ formatValue(recordData.fixedInfo?.deviceModel) }}
        </wd-form-item>
        <wd-form-item label="产品类别" prop="productType">
          {{ formatValue(recordData.fixedInfo?.productType) }}
        </wd-form-item>
        <wd-form-item label="生产长度" prop="actuallyLength">
          {{ formatValue(recordData.fixedInfo?.actuallyLength, "m") }}
        </wd-form-item>
        <wd-form-item label="张力设置" prop="twistTension">
          {{ formatValue(recordData.fixedInfo?.twistTension, "N/m") }}
        </wd-form-item>
        <wd-form-item label="绞制外径" prop="twistDiameter">
          {{ formatValue(recordData.inspectionResult?.twistDiameter, "mm") }}
        </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="recordPosition">{{ recordData.structureInfo?.recordPosition || "-" }}</wd-form-item>
                    <wd-form-item label="记录人"
                        prop="createUserName">{{ recordData.structureInfo?.createUserName || "-"}}</wd-form-item>
        <wd-form-item label="记录位置" prop="recordPosition">
          {{ recordData.structureInfo?.recordPosition || "-" }}
        </wd-form-item>
        <wd-form-item label="记录人" prop="createUserName">
          {{ recordData.structureInfo?.createUserName || "-" }}
        </wd-form-item>
                    <wd-form-item label="状态" prop="status">
                        <wd-tag custom-class="space"
                            :type="getStatusType(recordData.structureInfo?.status)">{{ getStatusText(recordData.structureInfo?.status) }}</wd-tag>
          <wd-tag custom-class="space" :type="getStatusType(recordData.structureInfo?.status)">
            {{ getStatusText(recordData.structureInfo?.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="inspectStructure">{{recordData.structureInfo.structureRecordResult.inspectStructure.structureFormula || "-"}}</wd-form-item>
        <wd-form-item label="成品结构" prop="inspectStructure">
          {{
            recordData.structureInfo.structureRecordResult.inspectStructure.structureFormula || "-"
          }}
        </wd-form-item>
                </wd-col>
            </wd-row>
            <wd-row v-if="recordData.structureInfo.structureRecordResult.inspectStructure.structureItems">
      <view style="margin: 10rpx">
                <text class="title">{{ "结构标准值和实测" }}</text>
                <wd-col :span="24"
                    v-for="(item, index) in recordData.structureInfo.structureRecordResult.inspectStructure.structureItems"
                    :key="index" style="padding-bottom: 10px;">
                    <wd-form-item :label="formatValue(item.structureName)" label-width="400rpx"
                        style="color: red;"></wd-form-item>
                    <wd-form-item label="标准值" prop="structureValue">{{formatValue(item.structureValue)}}</wd-form-item>
                    <wd-form-item label="实测根数"
                        prop="actualValue1">{{formatValue(item.actualValue1, "根")}}</wd-form-item>
                    <wd-form-item label="实测直径"
                        prop="actualValue2">{{formatValue(item.actualValue2, "mm")}}</wd-form-item>
      </view>
      <wd-col
        :span="24"
        v-for="(item, index) in recordData.structureInfo.structureRecordResult.inspectStructure
          .structureItems"
        :key="index"
        style="padding-bottom: 10px"
      >
        <wd-form-item
          :label="formatValue(item.structureName)"
          label-width="400rpx"
          style="color: red"
        ></wd-form-item>
        <wd-form-item label="标准值" prop="structureValue">
          {{ formatValue(item.structureValue) }}
        </wd-form-item>
        <wd-form-item label="实测根数" prop="actualValue1">
          {{ formatValue(item.actualValue1, "根") }}
        </wd-form-item>
        <wd-form-item label="实测直径" prop="actualValue2">
          {{ formatValue(item.actualValue2, "mm") }}
        </wd-form-item>
                </wd-col>
            </wd-row>
            <!-- 绞线工艺质量控制模块 -->
            <wd-row v-if="recordData.structureInfo?.structureRecordResult?.inspectTwist">
      <view style="margin: 10rpx">
                <text class="title">{{ "绞线工艺质量控制" }}</text>
                <wd-col :span="24" v-for="(item, index) in recordData.structureInfo.structureRecordResult.inspectTwist"
                    :key="index" style="padding-bottom: 10px;">
                    <wd-form-item :label="formatValue(item.twistName)" label-width="400rpx"
                        style="color: red;"></wd-form-item>
                    <wd-form-item label="绞向" prop="direction">{{ formatValue(item.direction) }}</wd-form-item>
      </view>
      <wd-col
        :span="24"
        v-for="(item, index) in recordData.structureInfo.structureRecordResult.inspectTwist"
        :key="index"
        style="padding-bottom: 10px"
      >
        <wd-form-item
          :label="formatValue(item.twistName)"
          label-width="400rpx"
          style="color: red"
        ></wd-form-item>
        <wd-form-item label="绞向" prop="direction">
          {{ formatValue(item.direction) }}
        </wd-form-item>
                    <wd-form-item label="节距" prop="pitch">{{ formatValue(item.pitch, "mm") }}</wd-form-item>
                    <wd-form-item label="节径比" prop="pitchRatio">{{ formatValue(item.pitchRatio) }}</wd-form-item>
        <wd-form-item label="节径比" prop="pitchRatio">
          {{ formatValue(item.pitchRatio) }}
        </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="conclusion">{{formatValue(recordData.structureInfo.structureRecordResult.conclusion)}}</wd-form-item>
                    <wd-form-item label="产品外观"
                        prop="productAppearance">{{formatProductAppearance(recordData.structureInfo.structureRecordResult.productAppearance)}}</wd-form-item>
        <wd-form-item label="结论" prop="conclusion">
          {{ formatValue(recordData.structureInfo.structureRecordResult.conclusion) }}
        </wd-form-item>
        <wd-form-item label="产品外观" prop="productAppearance">
          {{
            formatProductAppearance(
              recordData.structureInfo.structureRecordResult.productAppearance
            )
          }}
        </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="sampleComplete">{{formatValue(recordData.inspectionResult?.sampleComplete)}}</wd-form-item>
        <wd-form-item label="样品是否齐全" prop="sampleComplete">
          {{ formatValue(recordData.inspectionResult?.sampleComplete) }}
        </wd-form-item>
                </wd-col>
            </wd-row>
            <!-- 附件模块 -->
            <wd-row class="attachment-section">
      <view style="margin: 10rpx">
                <text class="title">{{ "附件" }}</text>
      </view>
                <!-- 用 flex 容器包裹图片列,实现自动换行 -->
                <view class="attachment-grid">
                    <wd-col v-for="(file, index) in recordData.structureInfo.files" :key="index"
                        class="attachment-item">
        <wd-col
          v-for="(file, index) in recordData.structureInfo.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>
@@ -112,7 +216,6 @@
                    </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" />
@@ -129,6 +232,7 @@
    const recordData = ref<any>({});
    const show = ref(false);
const previewImageUrl = ref("");
const isEdit = ref(false);
  
    // 状态类型映射
    const getStatusType = (status : number) => {
@@ -186,7 +290,7 @@
        return new Date(date).toLocaleDateString("zh-CN", {
            year: "numeric",
            month: "2-digit",
            day: "2-digit"
    day: "2-digit",
        });
    };
@@ -224,18 +328,96 @@
    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;
.placeholder {
  flex: 1;
}
.fixed-header {
  position: fixed;
  top: 44;
  left: 0;
  right: 0;
        background: #f3f9f8;
  z-index: 999;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 60px;
  box-sizing: border-box;
  overflow: visible;
}
        :deep() {
            .round {
                border-radius: 4px;
.header-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
            }
.search-wrapper {
  flex: 1;
  min-width: 0;
        }
:deep(.search-wrapper .wd-search) {
  width: 100% !important;
  min-width: 0 !important;
}
.scan-wrapper {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
}
.list {
  padding: 12px;
  padding-top: 84px;
  background: #f3f9f8;
  min-height: 100vh;
  box-sizing: border-box;
    }
    .title {
@@ -264,19 +446,15 @@
    .attachment-grid {
        display: flex;
        flex-wrap: wrap;
        /* 超出自动换行 */
        gap: 10px;
        /* 图片之间的间距 */
        padding: 10px 0;
    }
    .attachment-item {
        width: calc(25% - 10px);
        /* 每行4张,间距由gap控制,需计算宽度 */
        box-sizing: border-box;
    }
    /* 适配小屏幕,可调整每行数量(如每行2张) */
    @media (max-width: 768px) {
        .attachment-item {
            width: calc(25% - 10px);
src/pages/routingInspection/detail/indexLS.vue
@@ -1,9 +1,51 @@
<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) }}
@@ -40,7 +82,9 @@
      </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 || "-" }}
@@ -54,7 +98,9 @@
      </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") || "-" }}
@@ -91,7 +137,9 @@
      </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
@@ -105,7 +153,9 @@
      </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)">
@@ -138,6 +188,7 @@
const detailData = ref<any>({});
const show = ref(false);
const previewImageUrl = ref("");
const isEdit = ref(false);
// 状态类型映射
const getStatusType = (status: number) => {
@@ -233,6 +284,43 @@
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 {
src/pages/routingInspection/index.vue
@@ -10,17 +10,14 @@
        </view>
      </wd-col>
    </wd-row>
    <wd-tabs v-model="tab" auto-line-width slidable="always" map-num>
    <wd-tabs v-model="tab" auto-line-width slidable="always" :map-num="patrolList.length">
      <wd-tab 
        v-for="(item, index) in patrolList" 
        :key="index"
        :title="`${item.deviceModel}(待检查${item.pendingNum}条)`"
        class="tab_bg"
      >
        <ProductList
          :api="RoutingInspectionApi.getInspectListByPatrol"
          :ProList="item"
        />
        <ProductList :api="RoutingInspectionApi.getInspectListByPatrol" :ProList="item" />
      </wd-tab>
    </wd-tabs>
    <Scan ref="scanRef" emitName="scan" />
@@ -43,7 +40,6 @@
const toast = useToast();
const tab = ref<number>(0);
const patrolList = ref<any[]>([]);// 巡检设备列表数据
const handlePatrolData = (index: number, count: number) => {
  // 可以在这里更新特定巡检设备的待检查数量
@@ -74,9 +70,9 @@
        type: "巡检",
        data: {
          total: 0,
          records: []
        }
      }
          records: [],
        },
      },
    };
  };
};
src/pages/routingInspection/product_card/index.vue
@@ -83,7 +83,6 @@
                    </text>
                </view>
            </wd-col>
        </wd-row>
        <wd-row class="my-2">
            <wd-col :span="12">
@@ -123,25 +122,55 @@
            </wd-col>
            <wd-col :span="8">
                <view class="flex">
                    <wd-button v-if="data[map.status] == 1" size="small" type="primary" @click.stop="showRejectPopup = true"
                        style="margin-left: auto;">
          <wd-button
            v-if="data[map.status] == 1"
            size="small"
            type="primary"
            @click.stop="showRejectPopup = true"
            style="margin-left: auto"
          >
                        查看驳回信息
                    </wd-button>
                </view>
            </wd-col>
        </wd-row>
    </wd-card>
<wd-popup v-model="showRejectPopup" title="驳回信息" custom-style="border-radius:32rpx;height: 500rpx;width: 600rpx;">
  <wd-card v-for="(item, index) in data.rejectList" :key="index"
  <wd-popup
    v-model="showRejectPopup"
    title="驳回信息"
    custom-style="border-radius:32rpx;height: 800rpx;width: 600rpx;"
  >
    <wd-card
      v-for="(item, index) in data.rejectList"
      :key="index"
           :class="index % 2 === 0 ? 'reject-card-bg-1' : 'reject-card-bg-2'"
           style="margin-bottom: 15px; padding: 10px; border-radius: 8px;">
      style="margin-bottom: 8px; padding: 10px; border-radius: 8px"
    >
    <view class="content">
      <view>
        <view style="display: flex; justify-content: space-between; align-items: center; color: rgba(0,0,0,0.85); font-size: 14px; margin-bottom: 8px;">
          <view
            style="
              display: flex;
              justify-content: space-between;
              align-items: center;
              color: rgba(0, 0, 0, 0.85);
              font-size: 14px;
              margin-bottom: 8px;
            "
          >
          <view>{{ item.rejectPerson }}</view>
          <view>{{ item.rejectTime }}</view>
        </view>
        <view style="color: rgba(0,0,0,0.85); font-size: 14px; word-break: break-word; overflow-wrap: break-word; max-width: 100%; padding: 5px 0;">
          <view
            style="
              color: rgba(0, 0, 0, 0.85);
              font-size: 14px;
              word-break: break-word;
              overflow-wrap: break-word;
              max-width: 100%;
              padding: 5px 0;
            "
          >
          {{ item.rejectReason.reason }}
        </view>
      </view>
@@ -152,7 +181,7 @@
<script setup lang="ts">
import { ref } from "vue";
const emit = defineEmits(['click']);
const emit = defineEmits(["click"]);
    defineProps({
        data: {
            type: Object,
@@ -163,9 +192,9 @@
            default: () => { },
        },
    });
const showRejectPopup = ref<boolean>(false)
const showRejectPopup = ref<boolean>(false);
const handleCardClick = () => {
  emit('click');
  emit("click");
};
</script>
@@ -187,7 +216,8 @@
  .page-class {
    :deep() {
      .custom-shadow {
        box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
      box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%),
        0 1px 5px 0 rgb(0 0 0 / 12%);
      }
    }
  }