1edfaf64891742fdcc72470fab78edd9a584e35e..caae61dc1f477168b3c26404a86b33e3559dec50
2026-06-01 gaoluyang
新疆马铃薯 1.采购台账页面隐藏一些字段
caae61 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.库存管理绑定设备,添加查看数采功能
677a86 对比 | 目录
2026-06-01 gaoluyang
Merge remote-tracking branch 'origin/dev_新疆_大罗素马铃薯new' into dev_新疆_大罗素马铃薯new
5d8164 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.库存管理绑定设备,添加查看数采功能
ab8ff9 对比 | 目录
2026-06-01 huminmin
Merge branch 'dev_新疆_大罗素马铃薯new' of http://114.132.189.42:9002/r/product-inv...
6ee3cb 对比 | 目录
2026-06-01 huminmin
规章制度维护附件
53b206 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.发货台账展示出库批次
baa5da 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.规章制度不要使用范围了
c9678c 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.设备巡检查看附件只看生产异常的
951e12 对比 | 目录
2026-06-01 huminmin
Merge branch 'dev_新疆_大罗素马铃薯new' of http://114.132.189.42:9002/r/product-inv...
a563ea 对比 | 目录
2026-06-01 huminmin
采购审批增加仓库
a97e6a 对比 | 目录
2026-06-01 liding
feat(shipping): 1.发货的时候需要填出库批号,选入库批号 2.可以按批号,批量入库 3.销售退货将发货单号改成出库批号
fe4486 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.系统架构图修改 2.首页销售数据、采购数据卡片展示修改
057ec4 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.过程检验逻辑修改
3cc69e 对比 | 目录
2026-06-01 gaoluyang
Merge remote-tracking branch 'origin/dev_新疆_大罗素马铃薯new' into dev_新疆_大罗素马铃薯new
854500 对比 | 目录
2026-06-01 gaoluyang
新疆马铃薯 1.质量检验功能修改
0a3cd8 对比 | 目录
2026-06-01 huminmin
库存增加仓库
5f0ba4 对比 | 目录
已添加5个文件
已修改27个文件
3732 ■■■■ 文件已修改
src/api/inventoryManagement/stockInventory.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/rulesRegulationsManagement/index.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue 128 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/inspectionManagement/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/Record.vue 1051 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/BindDeviceDialog.vue 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/IotDataDialog.vue 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/New.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/Record.vue 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/Subtract.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue 456 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementLedger/index.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/quickCheckDia.vue 330 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/metricBinding/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/metricMaintenance/StandardFormDialog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/metricMaintenance/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/quickCheckDia.vue 327 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/index.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/quickCheckDia.vue 327 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/index.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/deliveryLedger/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemArchitecture/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockInventory.js
@@ -103,3 +103,20 @@
    });
};
// èŽ·å–ç‰©è”è®¾å¤‡å®žæ—¶æ•°é‡‡æ•°æ®
export const getIotRealtimeData = (id) => {
    return request({
        url: `/stockInventory/iotRealtime/${id}`,
        method: "get",
    });
};
// æ‰¹é‡èŽ·å–ç‰©è”è®¾å¤‡å®žæ—¶æ•°é‡‡æ•°æ®ï¼ˆPOST请求,传递设备ID数组)
export const batchGetIotRealtimeData = (deviceIds) => {
    return request({
        url: `/stockInventory/iotRealtime`,
        method: "post",
        data: deviceIds,
    });
};
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
@@ -126,9 +126,9 @@
          >
            <el-option
                v-for="person in employees"
                :key="person.id"
                :label="`${person.staffName}${person.postName ? ` (${person.postName})` : ''}`"
                :value="person.id"
                :key="person.userId"
                :label="`${person.nickName || person.userName}${person.dept?.deptName ? ` (${person.dept.deptName})` : ''}`"
                :value="person.userId"
            />
          </el-select>
        </el-form-item>
@@ -156,7 +156,7 @@
import {ElMessage} from 'element-plus'
import {Plus, Document, Promotion, Bell} from '@element-plus/icons-vue'
import {getRoomEnum, saveMeetingApplication} from '@/api/collaborativeApproval/meeting.js'
import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
// å½“前申请类型
const currentType = ref('department') // approval: å®¡æ‰¹æµç¨‹, department: éƒ¨é—¨çº§, notification: é€šçŸ¥å‘布
@@ -415,12 +415,8 @@
  getRoomEnum().then(res => {
    meetingRooms.value = res.data
  })
  staffOnJobListPage({
    current: -1,
    size: -1,
    staffState: 1
  }).then(res => {
    employees.value = res.data.records.sort((a, b) => (a.postName || '').localeCompare(b.postName || ''))
  userListNoPageByTenantId().then(res => {
    employees.value = res.data || []
  })
})
</script>
src/views/collaborativeApproval/rulesRegulationsManagement/index.vue
@@ -108,20 +108,20 @@
                          placeholder="选择生效时间"
                          style="width: 100%" />
        </el-form-item>
        <el-form-item label="适用范围"
                      prop="scope">
          <el-checkbox-group v-model="regulationForm.scope">
            <el-checkbox label="all">全体员工</el-checkbox>
            <el-checkbox label="manager">管理层</el-checkbox>
            <el-checkbox label="hr">人事部门</el-checkbox>
            <el-checkbox label="finance">财务部门</el-checkbox>
            <el-checkbox label="tech">技术部门</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="是否需要确认"
                      prop="requireConfirm">
          <el-switch v-model="regulationForm.requireConfirm" />
          <span class="ml-10">开启后员工需要阅读确认</span>
        </el-form-item>
        <el-form-item label="附件上传">
          <AttachmentUploadFile
              v-model:fileList="regulationForm.storageBlobDTOs"
              :limit="10"
              :fileSize="50"
              buttonText="点击上传附件"
          />
        </el-form-item>
      </el-form>
      <template #footer>
@@ -235,6 +235,7 @@
    addRuleFile,
  } from "@/api/collaborativeApproval/rulesRegulationsManagementFile.js";
  import PIMTable from "@/components/PIMTable/PIMTable.vue";
  import AttachmentUploadFile from "@/components/AttachmentUpload/file/index.vue";
  // å“åº”式数据
  const operationType = ref("add");
@@ -265,8 +266,8 @@
    status: "active",
    readCount: 0,
    effectiveTime: "",
    scope: [],
    requireConfirm: false,
    storageBlobDTOs: []
  });
  const readStatus = ref({
@@ -286,7 +287,7 @@
    effectiveTime: [
      { required: true, message: "请选择生效时间", trigger: "change" },
    ],
    scope: [{ required: true, message: "请选择适用范围", trigger: "change" }],
  };
  const regulationSearchForm = reactive({
@@ -442,8 +443,8 @@
      status: "active",
      readCount: 0,
      effectiveTime: "",
      scope: [],
      requireConfirm: false,
      storageBlobDTOs: []
    });
  };
src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue
@@ -3,77 +3,23 @@
    <el-dialog title="查看附件"
               v-model="dialogVisitable" width="800px" @close="cancel">
      <div class="upload-container">
        <!-- ç”Ÿäº§å‰ -->
        <!-- ç”Ÿäº§å¼‚常 -->
        <div class="form-container">
          <div class="title">生产前</div>
          <div class="title">生产异常</div>
          <!-- å›¾ç‰‡åˆ—表 -->
          <div style="display: flex; flex-wrap: wrap;">
            <img v-for="(item, index) in beforeProductionImgs" :key="index"
                 @click="showMedia(beforeProductionImgs, index, 'image')"
            <img v-for="(item, index) in productionAbnormalImgs" :key="index"
                 @click="showMedia(productionAbnormalImgs, index, 'image')"
                 :src="item" style="max-width: 100px; height: 100px; margin: 5px;" alt="">
          </div>
          <!-- è§†é¢‘列表 -->
          <div style="display: flex; flex-wrap: wrap;">
            <div
                v-for="(videoUrl, index) in beforeProductionVideos"
                v-for="(videoUrl, index) in productionAbnormalVideos"
                :key="index"
                @click="showMedia(beforeProductionVideos, index, 'video')"
                style="position: relative; margin: 10px; cursor: pointer;"
            >
              <div style="width: 160px; height: 90px; background-color: #333; display: flex; align-items: center; justify-content: center;">
                <img src="@/assets/images/video.png" alt="播放" style="width: 30px; height: 30px; opacity: 0.8;" />
              </div>
              <div style="text-align: center; font-size: 12px; color: #666;">点击播放</div>
            </div>
          </div>
        </div>
                <!-- ç”Ÿäº§ä¸­ -->
                <div class="form-container">
                    <div class="title">生产中</div>
                    <!-- å›¾ç‰‡åˆ—表 -->
                    <div style="display: flex; flex-wrap: wrap;">
                        <img v-for="(item, index) in productionIssuesImgs" :key="index"
                       @click="showMedia(productionIssuesImgs, index, 'image')"
                       :src="item" style="max-width: 100px; height: 100px; margin: 5px;" alt="">
                    </div>
                    <!-- è§†é¢‘列表 -->
                    <div style="display: flex; flex-wrap: wrap;">
                        <div
                            v-for="(videoUrl, index) in productionIssuesVideos"
                      :key="index"
                      @click="showMedia(productionIssuesVideos, index, 'video')"
                      style="position: relative; margin: 10px; cursor: pointer;"
                        >
                            <div style="width: 160px; height: 90px; background-color: #333; display: flex; align-items: center; justify-content: center;">
                                <img src="@/assets/images/video.png" alt="播放" style="width: 30px; height: 30px; opacity: 0.8;" />
                            </div>
                            <div style="text-align: center; font-size: 12px; color: #666;">点击播放</div>
                        </div>
                    </div>
                </div>
        <!-- ç”Ÿäº§åŽ -->
        <div class="form-container">
          <div class="title">生产后</div>
          <!-- å›¾ç‰‡åˆ—表 -->
          <div style="display: flex; flex-wrap: wrap;">
            <img v-for="(item, index) in afterProductionImgs" :key="index"
                 @click="showMedia(afterProductionImgs, index, 'image')"
                 :src="item" style="max-width: 100px; height: 100px; margin: 5px;" alt="">
          </div>
          <!-- è§†é¢‘列表 -->
          <div style="display: flex; flex-wrap: wrap;">
            <div
                v-for="(videoUrl, index) in afterProductionVideos"
                :key="index"
                @click="showMedia(afterProductionVideos, index, 'video')"
                @click="showMedia(productionAbnormalVideos, index, 'video')"
                style="position: relative; margin: 10px; cursor: pointer;"
            >
              <div style="width: 160px; height: 90px; background-color: #333; display: flex; align-items: center; justify-content: center;">
@@ -85,7 +31,7 @@
        </div>
      </div>
    </el-dialog>
    <!-- ç»Ÿä¸€åª’体查看器 -->
    <div v-if="isMediaViewerVisible" class="media-viewer-overlay" @click.self="closeMediaViewer">
      <div class="media-viewer-content" @click.stop>
@@ -97,7 +43,7 @@
            :index="currentMediaIndex"
            @hide="closeMediaViewer"
        ></vue-easy-lightbox>
        <!-- è§†é¢‘ -->
        <div v-else-if="mediaType === 'video'" style="position: relative;">
          <video
@@ -112,7 +58,7 @@
  </div>
</template>
<script setup>
import { ref } from 'vue';
import { ref, getCurrentInstance } from 'vue';
import VueEasyLightbox from 'vue-easy-lightbox';
const { proxy } = getCurrentInstance();
@@ -120,14 +66,10 @@
const dialogVisitable = ref(false);
// å›¾ç‰‡æ•°ç»„
const beforeProductionImgs = ref([]);
const afterProductionImgs = ref([]);
const productionIssuesImgs = ref([]);
const productionAbnormalImgs = ref([]);
// è§†é¢‘数组
const beforeProductionVideos = ref([]);
const afterProductionVideos = ref([]);
const productionIssuesVideos = ref([]);
const productionAbnormalVideos = ref([]);
// åª’体查看器状态
const isMediaViewerVisible = ref(false);
@@ -139,7 +81,7 @@
// å¤„理 URL:将 Windows è·¯å¾„转换为可访问的 URL
function processFileUrl(fileUrl) {
  if (!fileUrl) return '';
  // å¦‚æžœ URL æ˜¯ Windows è·¯å¾„格式(包含反斜杠),需要转换
  if (fileUrl && fileUrl.indexOf('\\') > -1) {
    // æŸ¥æ‰¾ uploads å…³é”®å­—的位置,从那里开始提取相对路径
@@ -155,7 +97,7 @@
      fileUrl = '/uploads/' + fileName;
    }
  }
  // ç¡®ä¿æ‰€æœ‰éž http å¼€å¤´çš„ URL éƒ½æ‹¼æŽ¥ baseUrl
  if (fileUrl && !fileUrl.startsWith('http')) {
    // ç¡®ä¿è·¯å¾„以 / å¼€å¤´
@@ -165,7 +107,7 @@
    // æ‹¼æŽ¥ baseUrl
    fileUrl = javaApi + fileUrl;
  }
  return fileUrl;
}
@@ -173,18 +115,18 @@
function processItems(items) {
  const images = [];
  const videos = [];
  // æ£€æŸ¥ items æ˜¯å¦å­˜åœ¨ä¸”为数组
  if (!items || !Array.isArray(items)) {
    return { images, videos };
  }
  items.forEach(item => {
    if (!item || !item.url) return;
    // å¤„理文件 URL
    const fileUrl = processFileUrl(item.url);
    // æ ¹æ®æ–‡ä»¶æ‰©å±•名判断是图片还是视频
    const urlLower = fileUrl.toLowerCase();
    if (urlLower.match(/\.(jpg|jpeg|png|gif|bmp|webp)$/)) {
@@ -200,27 +142,19 @@
      }
    }
  });
  return { images, videos };
}
// æ‰“开弹窗并加载数据
const openDialog = async (row) => {
  // ä½¿ç”¨æ­£ç¡®çš„字段名:commonFileListBefore, commonFileListAfter
  // productionIssues å¯èƒ½ä¸å­˜åœ¨ï¼Œä½¿ç”¨ç©ºæ•°ç»„
  const { images: beforeImgs, videos: beforeVids } = processItems(row.commonFileListBefore || []);
  const { images: afterImgs, videos: afterVids } = processItems(row.commonFileListAfter || []);
  const { images: issueImgs, videos: issueVids } = processItems(row.productionIssues || []);
  beforeProductionImgs.value = beforeImgs;
  beforeProductionVideos.value = beforeVids;
  afterProductionImgs.value = afterImgs;
  afterProductionVideos.value = afterVids;
  productionIssuesImgs.value = issueImgs;
  productionIssuesVideos.value = issueVids;
  // ä½¿ç”¨ commonFileListBeforeDTO æˆ– commonFileListBeforeVO å­—段
  const fileList = row.commonFileListBeforeDTO || row.commonFileListBeforeVO || [];
  const { images, videos } = processItems(fileList);
  productionAbnormalImgs.value = images;
  productionAbnormalVideos.value = videos;
  dialogVisitable.value = true;
};
@@ -254,7 +188,7 @@
  padding: 20px;
  border: 1px solid #dcdfe6;
  box-sizing: border-box;
  .form-container {
    flex: 1;
    width: 100%;
@@ -270,7 +204,7 @@
  padding-left: 10px;
  position: relative;
  margin: 6px 0;
  &::before {
    content: "";
    position: absolute;
@@ -301,4 +235,4 @@
  max-height: 90vh;
  overflow: hidden;
}
</style>
</style>
src/views/equipmentManagement/inspectionManagement/index.vue
@@ -81,7 +81,6 @@
          total,
          layout: 'total, sizes, prev, pager, next, jumper',
        }"
        :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }"
        @selection-change="handleSelectionChange"
        @pagination="handlePagination"
      >
src/views/index.vue
@@ -419,6 +419,8 @@
  monthSaleHaveMoney: 0,
  monthSaleMoney: 0,
  todayInventoryNum: 0,
  lastMonthSaleMoney: 0,
  lastMonthPurchaseMoney: 0,
});
const qualityStatisticsObject = ref({
@@ -701,15 +703,29 @@
  });
});
// è®¡ç®—环比增长率
const calculateGrowthRate = (current, last) => {
  const currentVal = parseFloat(current) || 0;
  const lastVal = parseFloat(last) || 0;
  if (lastVal === 0) return currentVal > 0 ? 100 : 0;
  return ((currentVal - lastVal) / lastVal * 100).toFixed(1);
};
const dashboardCards = computed(() => [
  {
    key: "sales",
    title: "销售数据",
    desc: "本月销售额(元)",
    value: formatNumber(businessInfo.value.monthSaleMoney),
    subLabel: "未开票金额",
    subValue: formatNumber(businessInfo.value.monthSaleHaveMoney),
    trend: `占比 ${ratioText(businessInfo.value.monthSaleHaveMoney, businessInfo.value.monthSaleMoney)}`,
    subLabel: "上月销售",
    subValue: formatNumber(businessInfo.value.lastMonthSaleMoney),
    trend: (() => {
      const rate = calculateGrowthRate(businessInfo.value.monthSaleMoney, businessInfo.value.lastMonthSaleMoney);
      const num = parseFloat(rate);
      if (num > 0) return `环比 â†‘ ${rate}%`;
      if (num < 0) return `环比 â†“ ${Math.abs(num)}%`;
      return "环比持平";
    })(),
    icon: DataLine,
    visible: visibleModules.value.sales,
  },
@@ -718,12 +734,15 @@
    title: "采购数据",
    desc: "本月采购额(元)",
    value: formatNumber(businessInfo.value.monthPurchaseMoney),
    subLabel: "待付款金额",
    subValue: formatNumber(businessInfo.value.monthPurchaseHaveMoney),
    trend: `占比 ${ratioText(
        businessInfo.value.monthPurchaseHaveMoney,
        businessInfo.value.monthPurchaseMoney
    )}`,
    subLabel: "上月采购",
    subValue: formatNumber(businessInfo.value.lastMonthPurchaseMoney),
    trend: (() => {
      const rate = calculateGrowthRate(businessInfo.value.monthPurchaseMoney, businessInfo.value.lastMonthPurchaseMoney);
      const num = parseFloat(rate);
      if (num > 0) return `环比 â†‘ ${rate}%`;
      if (num < 0) return `环比 â†“ ${Math.abs(num)}%`;
      return "环比持平";
    })(),
    icon: ShoppingCartFull,
    visible: visibleModules.value.procurement,
  },
src/views/inventoryManagement/dispatchLog/Record.vue
@@ -1,416 +1,411 @@
<template>
  <div>
    <div class="search_form"
         style="margin-bottom: 10px">
      <el-form ref="searchFormRef"
               :model="searchForm"
               class="demo-form-inline">
    <div class="search_form" style="margin-bottom: 10px">
      <el-form ref="searchFormRef" :model="searchForm" class="demo-form-inline">
        <el-row :gutter="20">
          <el-col :span="4">
            <el-form-item label="出库日期"
                          prop="timeStr">
              <el-date-picker v-model="searchForm.timeStr"
                              type="date"
                              placeholder="请选择日期"
                              value-format="YYYY-MM-DD"
                              format="YYYY-MM-DD"
                              clearable />
            <el-form-item label="出库日期" prop="timeStr">
              <el-date-picker
                v-model="searchForm.timeStr"
                type="date"
                placeholder="请选择日期"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="产品大类"
                          prop="productName">
              <el-input v-model="searchForm.productName"
                        style="width: 240px"
                        placeholder="请输入"
                        clearable />
            <el-form-item label="产品大类" prop="productName">
              <el-input
                v-model="searchForm.productName"
                style="width: 240px"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="规格型号"
                          prop="model">
              <el-input v-model="searchForm.model"
                        style="width: 240px"
                        placeholder="请输入"
                        clearable />
            <el-form-item label="规格型号" prop="model">
              <el-input
                v-model="searchForm.model"
                style="width: 240px"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="批号"
                          prop="batchNo">
              <el-input v-model="searchForm.batchNo"
                        style="width: 240px"
                        placeholder="请输入"
                        clearable />
            <el-form-item label="批号" prop="batchNo">
              <el-input
                v-model="searchForm.batchNo"
                style="width: 240px"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="来源"
                          prop="recordType">
              <el-select v-model="searchForm.recordType"
                         style="width: 240px"
                         placeholder="请选择"
                         clearable>
                <el-option v-for="item in stockRecordTypeOptions"
                           :key="item.value"
                           :label="item.label"
                           :value="item.value" />
            <el-form-item label="来源" prop="recordType">
              <el-select
                v-model="searchForm.recordType"
                style="width: 240px"
                placeholder="请选择"
                clearable
              >
                <el-option
                  v-for="item in stockRecordTypeOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <!-- æŒ‰é’® -->
          <el-col :span="4">
            <el-form-item>
              <el-button type="primary"
                         @click="getList">
                æœç´¢
              </el-button>
              <el-button @click="resetSearch">
                é‡ç½®
              </el-button>
              <el-button type="primary" @click="getList"> æœç´¢ </el-button>
              <el-button @click="resetSearch"> é‡ç½® </el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="actions">
      <el-button type="primary"
                 @click="handleBatchApprove">审批</el-button>
      <el-button type="primary" @click="handleBatchApprove">审批</el-button>
      <el-button @click="handleOut">导出</el-button>
      <el-button type="danger"
                 plain
                 @click="handleDelete">删除</el-button>
      <el-button type="primary"
                 plain
                 @click="handlePrint">打印</el-button>
      <el-button type="danger" plain @click="handleDelete">删除</el-button>
      <el-button type="primary" plain @click="handlePrint">打印</el-button>
    </div>
    <div class="table_list">
      <el-table :data="tableData"
                border
                v-loading="tableLoading"
                @selection-change="handleSelectionChange"
                :expand-row-keys="expandedRowKeys"
                :row-key="(row) => row.id"
                style="width: 100%"
                height="calc(100vh - 18.5em)">
        <el-table-column align="center"
                         type="selection"
                         width="55" />
        <el-table-column align="center"
                         label="序号"
                         type="index"
                         width="60" />
        <el-table-column label="出库批次"
                         prop="outboundBatches"
                         min-width="100"
                         show-overflow-tooltip />
        <el-table-column label="出库日期"
                         prop="createTime"
                         show-overflow-tooltip />
        <el-table-column label="产品大类"
                         prop="productName"
                         show-overflow-tooltip />
        <el-table-column label="规格型号"
                         prop="model"
                         show-overflow-tooltip />
        <el-table-column label="批号"
                         prop="batchNo"
                         show-overflow-tooltip />
        <el-table-column label="单位"
                         prop="unit"
                         show-overflow-tooltip />
        <el-table-column label="出库数量"
                         prop="stockOutNum"
                         show-overflow-tooltip />
        <el-table-column label="出库人"
                         prop="createBy"
                         show-overflow-tooltip />
        <el-table-column label="来源"
                         prop="recordType"
                         show-overflow-tooltip>
      <el-table
        :data="tableData"
        border
        v-loading="tableLoading"
        @selection-change="handleSelectionChange"
        :expand-row-keys="expandedRowKeys"
        :row-key="(row) => row.id"
        style="width: 100%"
        height="calc(100vh - 18.5em)"
      >
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column
          label="出库批次"
          prop="outboundBatches"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="出库日期"
          prop="updateTime"
          show-overflow-tooltip
        />
        <el-table-column
          label="产品大类"
          prop="productName"
          show-overflow-tooltip
        />
        <el-table-column label="规格型号" prop="model" show-overflow-tooltip />
        <el-table-column label="批号" prop="batchNo" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" show-overflow-tooltip />
        <el-table-column
          label="出库数量"
          prop="stockOutNum"
          show-overflow-tooltip
        />
        <el-table-column label="出库人" prop="createBy" show-overflow-tooltip />
        <el-table-column label="来源" prop="recordType" show-overflow-tooltip>
          <template #default="scope">
            {{ getRecordType(scope.row.recordType) }}
          </template>
        </el-table-column>
        <el-table-column label="审批状态"
                         prop="approvalStatus"
                         show-overflow-tooltip>
        <el-table-column
          label="审批状态"
          prop="approvalStatus"
          show-overflow-tooltip
        >
          <template #default="scope">
            <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)"
                    size="small">
            <el-tag
              :type="getApprovalStatusTagType(scope.row.approvalStatus)"
              size="small"
            >
              {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
            </el-tag>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0"
                  :total="total"
                  layout="total, sizes, prev, pager, next, jumper"
                  :page="page.current"
                  :limit="page.size"
                  @pagination="paginationChange" />
      <pagination
        v-show="total > 0"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        :page="page.current"
        :limit="page.size"
        @pagination="paginationChange"
      />
    </div>
  </div>
</template>
<script setup>
  import pagination from "@/components/PIMTable/Pagination.vue";
  import { ref } from "vue";
  import { ElMessageBox } from "element-plus";
  import useUserStore from "@/store/modules/user";
  import { getCurrentDate } from "@/utils/index.js";
  import {
    getStockOutPage,
    delPendingStockOut,
    batchApproveStockOutRecords,
  } from "@/api/inventoryManagement/stockOut.js";
  import {
    findAllQualifiedStockOutRecordTypeOptions,
    findAllUnQualifiedStockOutRecordTypeOptions,
  } from "@/api/basicData/enum.js";
import pagination from "@/components/PIMTable/Pagination.vue";
import { ref } from "vue";
import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user";
import { getCurrentDate } from "@/utils/index.js";
import {
  getStockOutPage,
  delPendingStockOut,
  batchApproveStockOutRecords,
} from "@/api/inventoryManagement/stockOut.js";
import {
  findAllQualifiedStockOutRecordTypeOptions,
  findAllUnQualifiedStockOutRecordTypeOptions,
} from "@/api/basicData/enum.js";
  const userStore = useUserStore();
  const { proxy } = getCurrentInstance();
  const tableData = ref([]);
  const selectedRows = ref([]);
  const tableLoading = ref(false);
  // æ¥æºç±»åž‹é€‰é¡¹
  const stockRecordTypeOptions = ref([]);
  const page = reactive({
    current: 1,
    size: 100,
  });
  const total = ref(0);
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
// æ¥æºç±»åž‹é€‰é¡¹
const stockRecordTypeOptions = ref([]);
const page = reactive({
  current: 1,
  size: 100,
});
const total = ref(0);
  const props = defineProps({
    type: {
      type: String,
      required: true,
      default: "0",
    },
    topParentProductId: {
      type: [String, Number],
      default: undefined,
    },
  });
const props = defineProps({
  type: {
    type: String,
    required: true,
    default: "0",
  },
  topParentProductId: {
    type: [String, Number],
    default: undefined,
  },
});
  // æ‰“印相关
  const printPreviewVisible = ref(false);
  const printData = ref([]);
// æ‰“印相关
const printPreviewVisible = ref(false);
const printData = ref([]);
  // ç”¨æˆ·ä¿¡æ¯è¡¨å•弹框数据
  const data = reactive({
    searchForm: {
      supplierName: "",
      timeStr: "",
      recordType: "",
    },
  });
  const { searchForm } = toRefs(data);
// ç”¨æˆ·ä¿¡æ¯è¡¨å•弹框数据
const data = reactive({
  searchForm: {
    supplierName: "",
    timeStr: "",
    recordType: "",
  },
});
const { searchForm } = toRefs(data);
  const searchFormRef = ref(null);
const searchFormRef = ref(null);
  const resetSearch = () => {
    searchFormRef.value?.resetFields();
    page.current = 1;
    getList();
  };
const resetSearch = () => {
  searchFormRef.value?.resetFields();
  page.current = 1;
  getList();
};
  const paginationChange = obj => {
    page.current = obj.page;
    page.size = obj.limit;
    getList();
  };
  const getList = () => {
    tableLoading.value = true;
    getStockOutPage({
      ...searchForm.value,
      ...page,
      topParentProductId: props.topParentProductId,
const paginationChange = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
};
const getList = () => {
  tableLoading.value = true;
  getStockOutPage({
    ...searchForm.value,
    ...page,
    topParentProductId: props.topParentProductId,
  })
    .then((res) => {
      tableLoading.value = false;
      tableData.value = res.data.records;
      tableData.value.map((item) => {
        item.children = [];
      });
      total.value = res.data.total;
    })
      .then(res => {
        tableLoading.value = false;
        tableData.value = res.data.records;
        tableData.value.map(item => {
          item.children = [];
        });
        total.value = res.data.total;
      })
      .catch(() => {
        tableLoading.value = false;
      });
  };
    .catch(() => {
      tableLoading.value = false;
    });
};
  const getRecordType = recordType => {
    return (
      stockRecordTypeOptions.value.find(item => item.value === recordType)
        ?.label || ""
    );
  };
const getRecordType = (recordType) => {
  return (
    stockRecordTypeOptions.value.find((item) => item.value === recordType)
      ?.label || ""
  );
};
  const approvalStatusLabelMap = {
    0: "待审批",
    1: "通过",
    2: "驳回",
    3: "待确认",
    pending: "待审批",
    approved: "通过",
    rejected: "驳回",
    PENDING: "待审批",
    APPROVED: "通过",
    REJECTED: "驳回",
  };
const approvalStatusLabelMap = {
  0: "待审批",
  1: "通过",
  2: "驳回",
  3: "待确认",
  pending: "待审批",
  approved: "通过",
  rejected: "驳回",
  PENDING: "待审批",
  APPROVED: "通过",
  REJECTED: "驳回",
};
  const getApprovalStatusLabel = status => {
    if (status === null || status === undefined || status === "") {
      return "待审批";
    }
    return approvalStatusLabelMap[status] || "待审批";
  };
const getApprovalStatusLabel = (status) => {
  if (status === null || status === undefined || status === "") {
    return "待审批";
  }
  return approvalStatusLabelMap[status] || "待审批";
};
  // é€šè¿‡/驳回固定色;其余(含待审批、空值、未映射但文案为待审批)统一用 warning é¢„警色
  const getApprovalStatusTagType = status => {
    if (
      status === 1 ||
      status === "1" ||
      status === "approved" ||
      status === "APPROVED"
    )
      return "success";
    if (
      status === 2 ||
      status === "2" ||
      status === "rejected" ||
      status === "REJECTED"
    )
      return "danger";
    return "warning";
  };
// é€šè¿‡/驳回固定色;其余(含待审批、空值、未映射但文案为待审批)统一用 warning é¢„警色
const getApprovalStatusTagType = (status) => {
  if (
    status === 1 ||
    status === "1" ||
    status === "approved" ||
    status === "APPROVED"
  )
    return "success";
  if (
    status === 2 ||
    status === "2" ||
    status === "rejected" ||
    status === "REJECTED"
  )
    return "danger";
  return "warning";
};
  // èŽ·å–æ¥æºç±»åž‹é€‰é¡¹
  const fetchStockRecordTypeOptions = () => {
    if (props.type === "0") {
      findAllQualifiedStockOutRecordTypeOptions().then(res => {
        stockRecordTypeOptions.value = res.data;
      });
      return;
    }
    findAllUnQualifiedStockOutRecordTypeOptions().then(res => {
// èŽ·å–æ¥æºç±»åž‹é€‰é¡¹
const fetchStockRecordTypeOptions = () => {
  if (props.type === "0") {
    findAllQualifiedStockOutRecordTypeOptions().then((res) => {
      stockRecordTypeOptions.value = res.data;
    });
  };
    return;
  }
  findAllUnQualifiedStockOutRecordTypeOptions().then((res) => {
    stockRecordTypeOptions.value = res.data;
  });
};
  // è¡¨æ ¼é€‰æ‹©æ•°æ®
  const handleSelectionChange = selection => {
    // è¿‡æ»¤æŽ‰å­æ•°æ®
    selectedRows.value = selection.filter(item => item.id);
    console.log("selection", selectedRows.value);
  };
  const expandedRowKeys = ref([]);
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
  // è¿‡æ»¤æŽ‰å­æ•°æ®
  selectedRows.value = selection.filter((item) => item.id);
  console.log("selection", selectedRows.value);
};
const expandedRowKeys = ref([]);
  const handleBatchApprove = () => {
    if (selectedRows.value.length === 0) {
      proxy.$modal.msgWarning("请选择数据");
      return;
    }
    const ids = selectedRows.value.map(item => item.id);
    ElMessageBox.confirm("请选择审批结果", "审批", {
      confirmButtonText: "通过",
      cancelButtonText: "驳回",
      type: "warning",
      distinguishCancelAndClose: true,
const handleBatchApprove = () => {
  if (selectedRows.value.length === 0) {
    proxy.$modal.msgWarning("请选择数据");
    return;
  }
  const ids = selectedRows.value.map((item) => item.id);
  ElMessageBox.confirm("请选择审批结果", "审批", {
    confirmButtonText: "通过",
    cancelButtonText: "驳回",
    type: "warning",
    distinguishCancelAndClose: true,
  })
    .then(() => {
      batchApproveStockOutRecords({ ids, approvalStatus: 1 })
        .then(() => {
          proxy.$modal.msgSuccess("审批通过成功");
          getList();
        })
        .catch(() => {
          proxy.$modal.msgError("审批通过失败");
        });
    })
      .then(() => {
        batchApproveStockOutRecords({ ids, approvalStatus: 1 })
    .catch((action) => {
      if (action === "cancel") {
        batchApproveStockOutRecords({ ids, approvalStatus: 2 })
          .then(() => {
            proxy.$modal.msgSuccess("审批通过成功");
            proxy.$modal.msgSuccess("审批驳回成功");
            getList();
          })
          .catch(() => {
            proxy.$modal.msgError("审批通过失败");
            proxy.$modal.msgError("审批驳回失败");
          });
      })
      .catch(action => {
        if (action === "cancel") {
          batchApproveStockOutRecords({ ids, approvalStatus: 2 })
            .then(() => {
              proxy.$modal.msgSuccess("审批驳回成功");
              getList();
            })
            .catch(() => {
              proxy.$modal.msgError("审批驳回失败");
            });
          return;
        }
        proxy.$modal.msg("已取消");
      });
  };
        return;
      }
      proxy.$modal.msg("已取消");
    });
};
  // å¯¼å‡º
  const handleOut = () => {
    ElMessageBox.confirm("是否确认导出?", "导出", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
// å¯¼å‡º
const handleOut = () => {
  ElMessageBox.confirm("是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      proxy.download(
        "/stockOutRecord/exportStockOutRecord",
        { type: props.type },
        props.type === "0" ? "合格出库台账.xlsx" : "不合格出库台账.xlsx"
      );
    })
      .then(() => {
        proxy.download(
          "/stockOutRecord/exportStockOutRecord",
          { type: props.type },
          props.type === "0" ? "合格出库台账.xlsx" : "不合格出库台账.xlsx"
        );
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
  };
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
  // åˆ é™¤
  const handleDelete = () => {
    let ids = [];
    if (selectedRows.value.length > 0) {
      ids = selectedRows.value.map(item => item.id);
    } else {
      proxy.$modal.msgWarning("请选择数据");
      return;
    }
    ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
// åˆ é™¤
const handleDelete = () => {
  let ids = [];
  if (selectedRows.value.length > 0) {
    ids = selectedRows.value.map((item) => item.id);
  } else {
    proxy.$modal.msgWarning("请选择数据");
    return;
  }
  ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      delPendingStockOut(ids).then((res) => {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      });
    })
      .then(() => {
        delPendingStockOut(ids).then(res => {
          proxy.$modal.msgSuccess("删除成功");
          getList();
        });
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
  };
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
  // æ‰“印功能
  const handlePrint = () => {
    if (selectedRows.value.length === 0) {
      proxy.$modal.msgWarning("请选择要打印的数据");
      return;
    }
    printData.value = [...selectedRows.value];
    console.log("打印数据:", printData.value);
    printPreviewVisible.value = true;
  };
// æ‰“印功能
const handlePrint = () => {
  if (selectedRows.value.length === 0) {
    proxy.$modal.msgWarning("请选择要打印的数据");
    return;
  }
  printData.value = [...selectedRows.value];
  console.log("打印数据:", printData.value);
  printPreviewVisible.value = true;
};
  // æ‰§è¡Œæ‰“印
  const executePrint = () => {
    console.log("开始执行打印,数据条数:", printData.value.length);
    console.log("打印数据:", printData.value);
// æ‰§è¡Œæ‰“印
const executePrint = () => {
  console.log("开始执行打印,数据条数:", printData.value.length);
  console.log("打印数据:", printData.value);
    // åˆ›å»ºä¸€ä¸ªæ–°çš„æ‰“印窗口
    const printWindow = window.open("", "_blank", "width=800,height=600");
  // åˆ›å»ºä¸€ä¸ªæ–°çš„æ‰“印窗口
  const printWindow = window.open("", "_blank", "width=800,height=600");
    // æž„建打印内容
    let printContent = `
  // æž„建打印内容
  let printContent = `
      <!DOCTYPE html>
      <html>
      <head>
@@ -545,9 +540,9 @@
      <body>
    `;
    // ä¸ºæ¯æ¡æ•°æ®ç”Ÿæˆæ‰“印页面
    printData.value.forEach((item, index) => {
      printContent += `
  // ä¸ºæ¯æ¡æ•°æ®ç”Ÿæˆæ‰“印页面
  printData.value.forEach((item, index) => {
    printContent += `
        <div class="print-page">
          <div class="delivery-note">
            <div class="header">
@@ -637,233 +632,233 @@
          </div>
        </div>
      `;
    });
  });
    printContent += `
  printContent += `
      </body>
      </html>
    `;
    // å†™å…¥å†…容到新窗口
    printWindow.document.write(printContent);
    printWindow.document.close();
  // å†™å…¥å†…容到新窗口
  printWindow.document.write(printContent);
  printWindow.document.close();
    // ç­‰å¾…内容加载完成后打印
    printWindow.onload = () => {
      setTimeout(() => {
        printWindow.print();
        printWindow.close();
        printPreviewVisible.value = false;
      }, 500);
    };
  // ç­‰å¾…内容加载完成后打印
  printWindow.onload = () => {
    setTimeout(() => {
      printWindow.print();
      printWindow.close();
      printPreviewVisible.value = false;
    }, 500);
  };
};
  // æ ¼å¼åŒ–日期
  const formatDate = dateString => {
    if (!dateString) return getCurrentDate();
    const date = new Date(dateString);
    const year = date.getFullYear();
    const month = String(date.getMonth() + 1).padStart(2, "0");
    const day = String(date.getDate()).padStart(2, "0");
    return `${year}/${month}/${day}`;
  };
// æ ¼å¼åŒ–日期
const formatDate = (dateString) => {
  if (!dateString) return getCurrentDate();
  const date = new Date(dateString);
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, "0");
  const day = String(date.getDate()).padStart(2, "0");
  return `${year}/${month}/${day}`;
};
  // æ ¼å¼åŒ–日期时间
  const formatDateTime = date => {
    const year = date.getFullYear();
    const month = String(date.getMonth() + 1).padStart(2, "0");
    const day = String(date.getDate()).padStart(2, "0");
    const hours = String(date.getHours()).padStart(2, "0");
    const minutes = String(date.getMinutes()).padStart(2, "0");
    const seconds = String(date.getSeconds()).padStart(2, "0");
    return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
  };
  onMounted(() => {
// æ ¼å¼åŒ–日期时间
const formatDateTime = (date) => {
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, "0");
  const day = String(date.getDate()).padStart(2, "0");
  const hours = String(date.getHours()).padStart(2, "0");
  const minutes = String(date.getMinutes()).padStart(2, "0");
  const seconds = String(date.getSeconds()).padStart(2, "0");
  return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
};
onMounted(() => {
  getList();
  fetchStockRecordTypeOptions();
});
watch(
  () => props.topParentProductId,
  () => {
    page.current = 1;
    getList();
    fetchStockRecordTypeOptions();
  });
  watch(
    () => props.topParentProductId,
    () => {
      page.current = 1;
      getList();
    }
  );
  }
);
</script>
<style scoped lang="scss">
  .print-preview-dialog {
    .el-dialog__body {
      padding: 0;
      max-height: 80vh;
      overflow-y: auto;
    }
.print-preview-dialog {
  .el-dialog__body {
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
  }
}
  .print-preview-container {
    .print-preview-header {
      padding: 15px;
      border-bottom: 1px solid #e4e7ed;
      text-align: center;
      .el-button {
        margin: 0 10px;
      }
    }
    .print-preview-content {
      padding: 20px;
      background-color: #f5f5f5;
      min-height: 400px;
    }
  }
  .print-page {
    width: 220mm;
    height: 90mm;
    padding: 10mm;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    box-sizing: border-box;
  }
  .delivery-note {
    width: 100%;
    height: 100%;
    font-family: "SimSun", serif;
    font-size: 10px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
  }
  .header {
.print-preview-container {
  .print-preview-header {
    padding: 15px;
    border-bottom: 1px solid #e4e7ed;
    text-align: center;
    margin-bottom: 8px;
    .company-name {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 4px;
    }
    .document-title {
      font-size: 16px;
      font-weight: bold;
    .el-button {
      margin: 0 10px;
    }
  }
  .info-section {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  .print-preview-content {
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 400px;
  }
}
    .info-row {
      line-height: 20px;
.print-page {
  width: 220mm;
  height: 90mm;
  padding: 10mm;
  margin: 0 auto;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  box-sizing: border-box;
}
.delivery-note {
  width: 100%;
  height: 100%;
  font-family: "SimSun", serif;
  font-size: 10px;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.header {
  text-align: center;
  margin-bottom: 8px;
  .company-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
  }
  .document-title {
    font-size: 16px;
    font-weight: bold;
  }
}
.info-section {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .info-row {
    line-height: 20px;
    .label {
      font-weight: bold;
      width: 60px;
      font-size: 14px;
    }
    .value {
      margin-right: 20px;
      min-width: 80px;
      font-size: 14px;
    }
  }
}
.table-section {
  margin-bottom: 4px;
  flex: 1;
  .product-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
    th,
    td {
      border: 1px solid #000;
      padding: 6px;
      text-align: center;
      font-size: 14px;
      line-height: 1.4;
    }
    th {
      font-weight: bold;
    }
    .total-label {
      text-align: right;
      font-weight: bold;
    }
    .total-value {
      font-weight: bold;
    }
  }
}
.footer-section {
  .footer-row {
    display: flex;
    margin-bottom: 3px;
    line-height: 20px;
    justify-content: space-between;
    .footer-item {
      display: flex;
      margin-right: 20px;
      .label {
        font-weight: bold;
        width: 60px;
        width: 80px;
        font-size: 14px;
      }
      .value {
        margin-right: 20px;
        min-width: 80px;
        font-size: 14px;
      }
    }
  }
  .table-section {
    margin-bottom: 4px;
    flex: 1;
    .product-table {
      width: 100%;
      border-collapse: collapse;
      border: 1px solid #000;
      th,
      td {
        border: 1px solid #000;
        padding: 6px;
        text-align: center;
        font-size: 14px;
        line-height: 1.4;
      }
      th {
        font-weight: bold;
      }
      .total-label {
        text-align: right;
        font-weight: bold;
      }
      .total-value {
        font-weight: bold;
      }
    }
  }
  .footer-section {
    .footer-row {
      display: flex;
      margin-bottom: 3px;
      line-height: 20px;
      justify-content: space-between;
      .footer-item {
        display: flex;
        margin-right: 20px;
        .label {
          font-weight: bold;
          width: 80px;
          font-size: 14px;
        }
        .value {
          min-width: 80px;
          font-size: 14px;
        }
        &.address-item {
          .address-value {
            min-width: 200px;
          }
      &.address-item {
        .address-value {
          min-width: 200px;
        }
      }
    }
  }
}
  @media print {
    .app-container {
      display: none;
    }
    .print-page {
      box-shadow: none;
      margin: 0;
      padding: 10mm;
      padding-left: 20mm;
      page-break-inside: avoid;
      page-break-after: always;
    }
    .print-page:last-child {
      page-break-after: avoid;
    }
@media print {
  .app-container {
    display: none;
  }
  .actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
  .print-page {
    box-shadow: none;
    margin: 0;
    padding: 10mm;
    padding-left: 20mm;
    page-break-inside: avoid;
    page-break-after: always;
  }
  .print-page:last-child {
    page-break-after: avoid;
  }
}
.actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
</style>
src/views/inventoryManagement/stockManagement/BindDeviceDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,153 @@
<template>
  <div>
    <el-dialog v-model="isShow"
               title="绑定物联设备"
               width="600"
               @close="closeModal">
      <el-form label-width="100px"
               :model="formState"
               ref="formRef">
        <el-form-item label="产品名称">
          <el-input v-model="props.record.productName" disabled />
        </el-form-item>
        <el-form-item label="规格型号">
          <el-input v-model="props.record.model" disabled />
        </el-form-item>
        <el-form-item label="批号">
          <el-input v-model="props.record.batchNo" disabled />
        </el-form-item>
        <el-form-item label="物联设备"
                      prop="deviceIds"
                      :rules="[
                        {
                          required: false,
                          message: '请选择物联设备',
                          trigger: 'change',
                        }
                      ]">
          <el-select v-model="formState.deviceIds"
                     multiple
                     filterable
                     placeholder="请选择物联设备"
                     style="width: 100%">
            <el-option v-for="item in deviceOptions"
                       :key="item.id"
                       :label="`${item.deviceName} (${item.deviceModel})`"
                       :value="item.id">
              <span style="float: left">{{ item.deviceName }}</span>
              <span style="float: right; color: #8492a6; font-size: 13px">{{ item.deviceModel }}</span>
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="handleSubmit" :loading="submitLoading">确认</el-button>
          <el-button @click="closeModal">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
  import { ref, computed, onMounted, getCurrentInstance } from "vue";
  import { getLedgerPage } from "@/api/equipmentManagement/ledger.js";
  import { createStockInventory } from "@/api/inventoryManagement/stockInventory.js";
  const props = defineProps({
    visible: {
      type: Boolean,
      required: true,
    },
    record: {
      type: Object,
      default: () => ({}),
    },
  });
  const emit = defineEmits(["update:visible", "completed"]);
  const { proxy } = getCurrentInstance();
  const isShow = computed({
    get() {
      return props.visible;
    },
    set(val) {
      emit("update:visible", val);
    },
  });
  const formRef = ref(null);
  const submitLoading = ref(false);
  const deviceOptions = ref([]);
  const formState = ref({
    deviceIds: [],
  });
  // èŽ·å–ç‰©è”è®¾å¤‡åˆ—è¡¨
  const getDeviceOptions = async () => {
    try {
      const res = await getLedgerPage({
        isIotDevice: 1,
        page: 1,
        size: 999,
      });
      if (res.data && res.data.records) {
        deviceOptions.value = res.data.records;
      }
    } catch (error) {
      console.error("获取物联设备列表失败:", error);
      proxy.$modal.msgError("获取物联设备列表失败");
    }
  };
  // åˆå§‹åŒ–已绑定设备
  const initSelectedDevices = () => {
    if (props.record.warehouse) {
      // warehouse å­—段存储的是逗号分隔的设备ID
      const deviceIds = props.record.warehouse.split(",").map(id => Number(id.trim())).filter(id => !isNaN(id));
      formState.value.deviceIds = deviceIds;
    }
  };
  const closeModal = () => {
    formState.value.deviceIds = [];
    isShow.value = false;
  };
  const handleSubmit = () => {
    formRef.value.validate(valid => {
      if (valid) {
        submitLoading.value = true;
        // å°†è®¾å¤‡ID数组转换为逗号分隔的字符串
        const warehouse = formState.value.deviceIds.join(",");
        // ä½¿ç”¨åº“存新增/编辑接口,warehouse å­—段传设备ID
        const submitData = {
          id: props.record.id,
          productModelId: props.record.productModelId,
          batchNo: props.record.batchNo,
          qualitity: props.record.qualitity,
          warehouse: warehouse,
        };
        createStockInventory(submitData)
          .then(res => {
            submitLoading.value = false;
            proxy.$modal.msgSuccess("绑定成功");
            closeModal();
            emit("completed");
          })
          .catch(() => {
            submitLoading.value = false;
          });
      }
    });
  };
  onMounted(() => {
    getDeviceOptions();
    initSelectedDevices();
  });
</script>
src/views/inventoryManagement/stockManagement/IotDataDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,360 @@
<template>
  <div>
    <el-dialog v-model="isShow"
               title="物联设备实时数采"
               width="800"
               @close="closeModal">
      <div v-if="loading" v-loading="loading" element-loading-text="加载中..." style="min-height: 200px;"></div>
      <div v-else-if="!hasDevices" class="empty-state">
        <el-empty description="暂无绑定的物联设备">
          <el-button type="primary" @click="closeModal">去绑定</el-button>
        </el-empty>
      </div>
      <div v-else>
        <div class="device-header">
          <div class="refresh-switch">
            <el-switch v-model="autoRefresh" active-text="自动刷新(30s)" />
          </div>
          <el-button type="primary" size="small" @click="fetchData" :loading="loading">
            <el-icon><Refresh /></el-icon>刷新
          </el-button>
        </div>
        <div class="devices-container">
          <el-card v-for="device in deviceData.devices" :key="device.deviceId" class="device-card">
            <template #header>
              <div class="device-header-info">
                <div class="device-title">
                  <span class="device-name">{{ device.deviceName }}</span>
                  <el-tag size="small" type="info">{{ device.deviceModel }}</el-tag>
                </div>
                <div class="device-status">
                  <span class="status-dot" :class="getStatusClass(device.status)"></span>
                  <span :class="getStatusTextClass(device.status)">{{ getStatusLabel(device.status) }}</span>
                </div>
              </div>
            </template>
            <div v-if="device.status === '在线'" class="device-data">
              <el-row :gutter="10">
                <el-col :span="8" v-if="device.temperature">
                  <div class="data-item">
                    <el-icon class="data-icon"><Sunny /></el-icon>
                    <div class="data-info">
                      <div class="data-label">温度</div>
                      <div class="data-value">{{ device.temperature }}</div>
                    </div>
                  </div>
                </el-col>
                <el-col :span="8" v-if="device.humidity">
                  <div class="data-item">
                    <el-icon class="data-icon"><Drizzling /></el-icon>
                    <div class="data-info">
                      <div class="data-label">湿度</div>
                      <div class="data-value">{{ device.humidity }}</div>
                    </div>
                  </div>
                </el-col>
                <el-col :span="8" v-if="device.co2">
                  <div class="data-item">
                    <el-icon class="data-icon"><WindPower /></el-icon>
                    <div class="data-info">
                      <div class="data-label">CO2</div>
                      <div class="data-value">{{ device.co2 }}</div>
                    </div>
                  </div>
                </el-col>
                <el-col :span="8" v-if="device.light">
                  <div class="data-item">
                    <el-icon class="data-icon"><Sunrise /></el-icon>
                    <div class="data-info">
                      <div class="data-label">光照</div>
                      <div class="data-value">{{ device.light }}</div>
                    </div>
                  </div>
                </el-col>
                <el-col :span="8" v-if="device.battery">
                  <div class="data-item">
                    <el-icon class="data-icon"><Lightning /></el-icon>
                    <div class="data-info">
                      <div class="data-label">电量</div>
                      <div class="data-value">{{ device.battery }}</div>
                    </div>
                  </div>
                </el-col>
              </el-row>
            </div>
            <div v-else class="device-offline">
              <el-alert :title="device.statusMessage || (device.status === 'error' ? '设备异常' : '设备离线')" :type="device.status === 'error' ? 'error' : 'warning'" :closable="false" show-icon />
            </div>
          </el-card>
        </div>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeModal">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
  import { ref, computed, onMounted, onUnmounted, watch } from "vue";
  import { batchGetIotRealtimeData } from "@/api/inventoryManagement/stockInventory.js";
  import { Refresh, Sunny, Drizzling, WindPower, Sunrise, Lightning } from "@element-plus/icons-vue";
  const props = defineProps({
    visible: {
      type: Boolean,
      required: true,
    },
    record: {
      type: Object,
      default: () => ({}),
    },
  });
  const emit = defineEmits(["update:visible"]);
  const isShow = computed({
    get() {
      return props.visible;
    },
    set(val) {
      emit("update:visible", val);
    },
  });
  const loading = ref(false);
  const deviceData = ref({
    inventoryId: null,
    iotDeviceIds: "",
    devices: [],
  });
  const autoRefresh = ref(false);
  let refreshTimer = null;
  const hasDevices = computed(() => {
    return deviceData.value.devices && deviceData.value.devices.length > 0;
  });
  const getStatusClass = (status) => {
    switch (status) {
      case "在线":
        return "status-online";
      case "offline":
        return "status-offline";
      case "error":
        return "status-error";
      default:
        return "status-offline";
    }
  };
  const getStatusTextClass = (status) => {
    switch (status) {
      case "在线":
        return "text-online";
      case "offline":
        return "text-offline";
      case "error":
        return "text-error";
      default:
        return "text-offline";
    }
  };
  const getStatusLabel = (status) => {
    switch (status) {
      case "在线":
        return "在线";
      case "offline":
        return "离线";
      case "error":
        return "异常";
      default:
        return "离线";
    }
  };
  const fetchData = async () => {
    const deviceIdsStr = props.record?.warehouse;
    console.log("fetchData called, warehouse:", deviceIdsStr);
    if (!deviceIdsStr) {
      console.warn("warehouse is empty, skip fetch");
      deviceData.value = { inventoryId: null, iotDeviceIds: "", devices: [] };
      return;
    }
    loading.value = true;
    try {
      const deviceIds = deviceIdsStr.split(",").map(id => id.trim()).filter(id => id);
      const res = await batchGetIotRealtimeData(deviceIds);
      if (res.code === 200 && res.data) {
        deviceData.value = res.data;
      } else {
        deviceData.value = { inventoryId: null, iotDeviceIds: deviceIdsStr, devices: [] };
      }
    } catch (error) {
      console.error("获取物联设备数据失败:", error);
    } finally {
      loading.value = false;
    }
  };
  const closeModal = () => {
    autoRefresh.value = false;
    isShow.value = false;
  };
  // ç›‘听弹窗显示状态,每次打开时获取数据
  watch(() => props.visible, (val) => {
    console.log("visible changed:", val, "record:", props.record);
    if (val) {
      fetchData();
    } else {
      // å…³é—­æ—¶åœæ­¢è‡ªåŠ¨åˆ·æ–°
      autoRefresh.value = false;
    }
  }, { immediate: true });
  // è‡ªåŠ¨åˆ·æ–°
  watch(autoRefresh, (val) => {
    if (val) {
      refreshTimer = setInterval(() => {
        fetchData();
      }, 30000);
    } else {
      if (refreshTimer) {
        clearInterval(refreshTimer);
        refreshTimer = null;
      }
    }
  });
  onUnmounted(() => {
    if (refreshTimer) {
      clearInterval(refreshTimer);
    }
  });
</script>
<style scoped>
  .empty-state {
    padding: 40px 0;
  }
  .device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  .refresh-switch {
    display: flex;
    align-items: center;
  }
  .devices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  .device-card {
    margin-bottom: 10px;
  }
  .device-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .device-title {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .device-name {
    font-weight: bold;
    font-size: 16px;
  }
  .device-status {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
  }
  .status-online {
    background-color: #67c23a;
  }
  .status-offline {
    background-color: #909399;
  }
  .status-error {
    background-color: #f56c6c;
  }
  .text-online {
    color: #67c23a;
  }
  .text-offline {
    color: #909399;
  }
  .text-error {
    color: #f56c6c;
  }
  .device-data {
    padding: 10px 0;
  }
  .data-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f5f7fa;
    border-radius: 4px;
    margin-bottom: 10px;
  }
  .data-icon {
    font-size: 24px;
    color: #409eff;
    margin-right: 10px;
  }
  .data-info {
    flex: 1;
  }
  .data-label {
    font-size: 12px;
    color: #909399;
    margin-bottom: 2px;
  }
  .data-value {
    font-size: 16px;
    font-weight: bold;
    color: #303133;
  }
  .device-offline {
    padding: 20px 0;
  }
</style>
src/views/inventoryManagement/stockManagement/New.vue
@@ -231,4 +231,4 @@
    handleSubmit,
    isShow,
  });
</script>
</script>
src/views/inventoryManagement/stockManagement/Record.vue
@@ -87,6 +87,14 @@
        <el-table-column label="批号"
                         prop="batchNo"
                         show-overflow-tooltip />
        <el-table-column label="物联设备"
                         prop="warehouse"
                         show-overflow-tooltip
                         min-width="150">
          <template #default="scope">
            {{ getDeviceNames(scope.row.warehouse) }}
          </template>
        </el-table-column>
        <el-table-column label="合格库存数量"
                         prop="qualifiedQuantity"
                         show-overflow-tooltip />
@@ -110,12 +118,18 @@
                         show-overflow-tooltip />
        <el-table-column fixed="right"
                         label="操作"
                         min-width="80"
                         width="210"
                         align="center">
          <template #default="scope">
            <el-button link
                       type="primary"
                       @click="showDetailModal(scope.row)">详情</el-button>
            <el-button link
                       type="success"
                       @click="showBindDeviceModal(scope.row)">绑定设备</el-button>
            <el-button link
                       type="info"
                       @click="showIotDataModal(scope.row)">查看数采</el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -153,6 +167,15 @@
                                     :operation-type="operationType"
                                     :type="record.stockType"
                                     @completed="handleQuery" />
    <!-- ç»‘定物联设备 -->
    <bind-device-dialog v-if="isShowBindDeviceModal"
                        v-model:visible="isShowBindDeviceModal"
                        :record="record"
                        @completed="handleQuery" />
    <!-- æŸ¥çœ‹ç‰©è”设备数采 -->
    <iot-data-dialog v-if="isShowIotDataModal"
                     v-model:visible="isShowIotDataModal"
                     :record="record" />
  </div>
</template>
@@ -161,6 +184,7 @@
  import { ref, reactive, toRefs, onMounted, getCurrentInstance } from "vue";
  import { ElMessage, ElMessageBox } from "element-plus";
  import { getStockInventoryListPageCombined } from "@/api/inventoryManagement/stockInventory.js";
  import { getLedgerPage } from "@/api/equipmentManagement/ledger.js";
  const props = defineProps({
    productId: {
      type: Number,
@@ -184,6 +208,12 @@
  const BatchNoQtyDetail = defineAsyncComponent(() =>
    import("@/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue")
  );
  const BindDeviceDialog = defineAsyncComponent(() =>
    import("@/views/inventoryManagement/stockManagement/BindDeviceDialog.vue")
  );
  const IotDataDialog = defineAsyncComponent(() =>
    import("@/views/inventoryManagement/stockManagement/IotDataDialog.vue")
  );
  const { proxy } = getCurrentInstance();
  const tableData = ref([]);
  const selectedRows = ref([]);
@@ -206,6 +236,12 @@
  const operationType = ref("frozen");
  // æ˜¯å¦æ˜¾ç¤ºå¯¼å…¥å¼¹æ¡†
  const isShowImportModal = ref(false);
  // æ˜¯å¦æ˜¾ç¤ºç»‘定设备弹框
  const isShowBindDeviceModal = ref(false);
  // æ˜¯å¦æ˜¾ç¤ºç‰©è”数采弹框
  const isShowIotDataModal = ref(false);
  // è®¾å¤‡åˆ—表(用于显示设备名称)
  const deviceList = ref([]);
  const data = reactive({
    searchForm: {
      productName: "",
@@ -305,6 +341,18 @@
    operationType.value = "thaw";
  };
  // ç‚¹å‡»ç»‘定设备
  const showBindDeviceModal = row => {
    record.value = row;
    isShowBindDeviceModal.value = true;
  };
  // ç‚¹å‡»æŸ¥çœ‹æ•°é‡‡
  const showIotDataModal = row => {
    record.value = row;
    isShowIotDataModal.value = true;
  };
  // è¡¨æ ¼é€‰æ‹©æ•°æ®
  const handleSelectionChange = selection => {
    // è¿‡æ»¤æŽ‰å­æ•°æ®
@@ -342,8 +390,38 @@
      });
  };
  // èŽ·å–è®¾å¤‡åˆ—è¡¨
  const getDeviceList = async () => {
    try {
      const res = await getLedgerPage({
        isIotDevice: 1,
        page: 1,
        size: 999,
      });
      if (res.data && res.data.records) {
        deviceList.value = res.data.records;
      }
    } catch (error) {
      console.error("获取设备列表失败:", error);
    }
  };
  // æ ¹æ®è®¾å¤‡ID获取设备名称
  const getDeviceNames = (warehouse) => {
    if (!warehouse) return "-";
    const deviceIds = warehouse.split(",").map(id => id.trim());
    const names = deviceIds
      .map(id => {
        const device = deviceList.value.find(d => String(d.id) === id);
        return device ? device.deviceName : id;
      })
      .filter(name => name);
    return names.length > 0 ? names.join(", ") : warehouse;
  };
  onMounted(() => {
    getList();
    getDeviceList();
  });
</script>
src/views/inventoryManagement/stockManagement/Subtract.vue
@@ -61,6 +61,16 @@
          <el-input-number v-model="formState.qualitity" :step="1" :min="1" :max="maxQuality" style="width: 100%" />
        </el-form-item>
        <el-form-item label="出库批次" prop="outboundBatches">
          <el-input
            v-model="formState.outboundBatches"
            placeholder="留空自动生成"
            maxlength="100"
            show-word-limit
          />
          <div class="form-tip">不填则自动生成,格式:CK年月日-序号</div>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="formState.remark" type="textarea" />
        </el-form-item>
@@ -134,6 +144,7 @@
  model: "",
  unit: "",
  qualitity: 0,
  outboundBatches: "",
  remark: '',
});
@@ -157,6 +168,7 @@
    productModelId: undefined,
    productName: "",
    productModelName: "",
    outboundBatches: "",
    description: '',
  };
  isShow.value = false;
@@ -216,4 +228,12 @@
  handleSubmit,
  isShow,
});
</script>
</script>
<style scoped>
.form-tip {
  font-size: 12px;
  color: #909399;
  margin-top: 4px;
}
</style>
src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
@@ -460,6 +460,7 @@
    purchaseContractNumber: row.purchaseContractNumber || "",
    quotationNo: row.quotationNo || "",
    shippingNo: row.shippingNo || "",
    warehouse: row.warehouse || "",
  };
}
@@ -473,12 +474,14 @@
}
/** ç»„装审批提交 DTO */
export function buildApproveInstanceDto(row, uiResult, comment) {
export function buildApproveInstanceDto(row, uiResult, comment, warehouse, extraData = {}) {
  const opinion = (comment || "").trim();
  return {
    id: row?.id,
    approveAction: mapApproveActionToApi(uiResult),
    approveComment: opinion || (uiResult === "approved" ? "同意" : ""),
    warehouse: warehouse || row?.warehouse || "",
    ...extraData,
  };
}
@@ -609,4 +612,4 @@
export function initTemplateAttachmentsFromSnapshot(templateSnapshot) {
  const list = templateSnapshot?.storageBlobDTOs;
  return list?.length ? JSON.parse(JSON.stringify(list)) : [];
}
}
src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue
@@ -3,32 +3,44 @@
  <div class="approve-detail-panel">
    <div class="detail-block">
      <div class="detail-block-title">基本信息</div>
      <el-descriptions :column="2"
                       border>
        <el-descriptions-item label="业务单号">{{ row.bizId || row.id || "—" }}</el-descriptions-item>
      <el-descriptions :column="2" border>
        <el-descriptions-item label="业务单号">{{
          row.bizId || row.id || "—"
        }}</el-descriptions-item>
        <el-descriptions-item label="审批状态">
          <el-tag :type="approvalStatusTagType(row.approvalStatus)"
                  size="small"
                  effect="plain">
          <el-tag
            :type="approvalStatusTagType(row.approvalStatus)"
            size="small"
            effect="plain"
          >
            {{ approvalStatusLabel(row.approvalStatus) }}
          </el-tag>
        </el-descriptions-item>
        <el-descriptions-item label="审批类型">
          <span class="approve-type-cell"
                :style="approvalTypeStyle(row.approvalType)">
          <span
            class="approve-type-cell"
            :style="approvalTypeStyle(row.approvalType)"
          >
            {{ approvalTypeLabel(row.approvalType) }}
          </span>
        </el-descriptions-item>
        <el-descriptions-item label="申请人编号">{{ row.applicantNo || "—" }}</el-descriptions-item>
        <el-descriptions-item label="申请人名称">{{ row.applicantName || "—" }}</el-descriptions-item>
        <el-descriptions-item label="申请摘要">{{ row.summary || "—" }}</el-descriptions-item>
        <el-descriptions-item v-if="row.rejectReason"
                              label="驳回原因"
                              :span="2">
        <el-descriptions-item label="申请人编号">{{
          row.applicantNo || "—"
        }}</el-descriptions-item>
        <el-descriptions-item label="申请人名称">{{
          row.applicantName || "—"
        }}</el-descriptions-item>
        <el-descriptions-item label="申请摘要">{{
          row.summary || "—"
        }}</el-descriptions-item>
        <el-descriptions-item
          v-if="row.rejectReason"
          label="驳回原因"
          :span="2"
        >
          <span class="reject-text">{{ row.rejectReason }}</span>
        </el-descriptions-item>
        <el-descriptions-item label="创建时间"
                              :span="2">
        <el-descriptions-item label="创建时间" :span="2">
          {{ formatDisplayTime(row.createTime) }}
        </el-descriptions-item>
      </el-descriptions>
@@ -36,141 +48,226 @@
    <div class="detail-block">
      <div class="detail-block-title">填报内容</div>
      <!-- é»˜è®¤è¡¨å•展示 -->
      <FormPayloadFields v-if="!isSpecialApprovalType"
                         :fields="formResolved.fields"
                         :form-payload="formResolved.formPayload"
                         readonly />
      <FormPayloadFields
        v-if="!isSpecialApprovalType"
        :fields="formResolved.fields"
        :form-payload="formResolved.formPayload"
        readonly
      />
      <!-- å‘货审批详情 -->
      <template v-else-if="row.businessType === 7">
        <div v-if="detailData.shippingInfo" class="shipment-detail">
          <el-divider content-position="left">发货详情</el-divider>
          <el-descriptions :column="2" border>
            <el-descriptions-item label="销售订单">{{ detailData.shippingInfo.salesContractNo || "--" }}</el-descriptions-item>
            <el-descriptions-item label="发货订单号">{{ detailData.shippingInfo.shippingNo || "--" }}</el-descriptions-item>
            <el-descriptions-item label="客户名称">{{ detailData.shippingInfo.customerName || "--" }}</el-descriptions-item>
            <el-descriptions-item label="发货类型">{{ detailData.shippingInfo.type || "--" }}</el-descriptions-item>
            <el-descriptions-item label="发货日期">{{ detailData.shippingInfo.shippingDateDate || "--" }}</el-descriptions-item>
            <el-descriptions-item label="审核状态">{{ detailData.shippingInfo.status || "--" }}</el-descriptions-item>
            <el-descriptions-item label="发货车牌号">{{ detailData.shippingInfo.shippingCarNumber || "--" }}</el-descriptions-item>
            <el-descriptions-item label="快递公司">{{ detailData.shippingInfo.expressCompany || "--" }}</el-descriptions-item>
            <el-descriptions-item label="快递单号" :span="2">{{ detailData.shippingInfo.expressNumber || "--" }}</el-descriptions-item>
            <el-descriptions-item label="销售订单">{{
              detailData.shippingInfo.salesContractNo || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="出库批号">{{
              detailData.shippingInfo.outboundBatches || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="客户名称">{{
              detailData.shippingInfo.customerName || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="发货类型">{{
              detailData.shippingInfo.type || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="发货日期">{{
              detailData.shippingInfo.shippingDateDate || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="审核状态">{{
              detailData.shippingInfo.status || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="发货车牌号">{{
              detailData.shippingInfo.shippingCarNumber || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="快递公司">{{
              detailData.shippingInfo.expressCompany || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="快递单号" :span="2">{{
              detailData.shippingInfo.expressNumber || "--"
            }}</el-descriptions-item>
          </el-descriptions>
          <div v-if="detailData.shippingProductDetailDtoList.length" style="margin-top: 20px;">
          <div
            v-if="detailData.shippingProductDetailDtoList.length"
            style="margin-top: 20px"
          >
            <h4>产品明细</h4>
            <el-table :data="detailData.shippingProductDetailDtoList"
                      border
                      size="small"
                      style="width: 100%">
              <el-table-column label="批号" prop="batchNo" min-width="160" show-overflow-tooltip />
              <el-table-column label="产品名称" prop="productName" min-width="160" show-overflow-tooltip />
              <el-table-column label="规格型号" prop="specificationModel" min-width="160" show-overflow-tooltip />
              <el-table-column label="发货数量" prop="deliveryQuantity" min-width="120" align="center" />
            <el-table
              :data="detailData.shippingProductDetailDtoList"
              border
              size="small"
              style="width: 100%"
            >
              <el-table-column
                label="批号"
                prop="batchNo"
                min-width="160"
                show-overflow-tooltip
              />
              <el-table-column
                label="产品名称"
                prop="productName"
                min-width="160"
                show-overflow-tooltip
              />
              <el-table-column
                label="规格型号"
                prop="specificationModel"
                min-width="160"
                show-overflow-tooltip
              />
              <el-table-column
                label="发货数量"
                prop="deliveryQuantity"
                min-width="120"
                align="center"
              />
            </el-table>
          </div>
        </div>
      </template>
      <!-- é‡‡è´­å®¡æ‰¹è¯¦æƒ… -->
      <template v-else-if="row.businessType === 5">
        <div v-if="detailData" class="procurement-detail">
          <el-divider content-position="left">采购详情</el-divider>
          <el-descriptions :column="2" border>
            <el-descriptions-item label="采购合同号">{{ detailData.purchaseContractNumber || "--" }}</el-descriptions-item>
            <el-descriptions-item label="供应商名称">{{ detailData.supplierName || "--" }}</el-descriptions-item>
            <el-descriptions-item label="项目名称">{{ detailData.projectName || "--" }}</el-descriptions-item>
            <el-descriptions-item label="销售合同号">{{ detailData.salesContractNo || "--" }}</el-descriptions-item>
            <el-descriptions-item label="签订日期">{{ detailData.executionDate || "--" }}</el-descriptions-item>
            <el-descriptions-item label="录入日期">{{ detailData.entryDate || "--" }}</el-descriptions-item>
            <el-descriptions-item label="付款方式">{{ detailData.paymentMethod || "--" }}</el-descriptions-item>
            <el-descriptions-item label="采购合同号">{{
              detailData.purchaseContractNumber || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="供应商名称">{{
              detailData.supplierName || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="项目名称">{{
              detailData.projectName || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="销售合同号">{{
              detailData.salesContractNo || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="签订日期">{{
              detailData.executionDate || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="录入日期">{{
              detailData.entryDate || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="付款方式">{{
              detailData.paymentMethod || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="合同金额" :span="2">
              <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">
              <span style="font-size: 18px; color: #e6a23c; font-weight: bold">
                Â¥{{ Number(detailData.contractAmount ?? 0).toFixed(2) }}
              </span>
            </el-descriptions-item>
          </el-descriptions>
          <div v-if="detailData.productData.length" style="margin-top: 20px;">
          <div v-if="detailData.productData.length" style="margin-top: 20px">
            <h4>产品明细</h4>
            <el-table :data="detailData.productData"
                      border
                      style="width: 100%">
            <el-table :data="detailData.productData" border style="width: 100%">
              <el-table-column prop="productCategory" label="产品名称" />
              <el-table-column prop="specificationModel" label="规格型号" />
              <el-table-column prop="unit" label="单位" />
              <el-table-column prop="quantity" label="数量" />
              <el-table-column prop="taxInclusiveUnitPrice" label="含税单价">
                <template #default="scope">Â¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template>
                <template #default="scope"
                  >Â¥{{
                    Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2)
                  }}</template
                >
              </el-table-column>
              <el-table-column prop="taxInclusiveTotalPrice" label="含税总价">
                <template #default="scope">Â¥{{ Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2) }}</template>
                <template #default="scope"
                  >Â¥{{
                    Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2)
                  }}</template
                >
              </el-table-column>
            </el-table>
          </div>
        </div>
      </template>
      <!-- æŠ¥ä»·å®¡æ‰¹è¯¦æƒ… -->
      <template v-else-if="row.businessType === 6">
        <div v-if="detailData" class="quotation-detail">
          <el-divider content-position="left">报价详情</el-divider>
          <el-descriptions :column="2" border>
            <el-descriptions-item label="报价单号">{{ detailData.quotationNo || "--" }}</el-descriptions-item>
            <el-descriptions-item label="客户名称">{{ detailData.customer || "--" }}</el-descriptions-item>
            <el-descriptions-item label="业务员">{{ detailData.salesperson || "--" }}</el-descriptions-item>
            <el-descriptions-item label="报价日期">{{ detailData.quotationDate || "--" }}</el-descriptions-item>
            <el-descriptions-item label="有效期至">{{ detailData.validDate || "--" }}</el-descriptions-item>
            <el-descriptions-item label="付款方式">{{ detailData.paymentMethod || "--" }}</el-descriptions-item>
            <el-descriptions-item label="报价单号">{{
              detailData.quotationNo || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="客户名称">{{
              detailData.customer || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="业务员">{{
              detailData.salesperson || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="报价日期">{{
              detailData.quotationDate || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="有效期至">{{
              detailData.validDate || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="付款方式">{{
              detailData.paymentMethod || "--"
            }}</el-descriptions-item>
            <el-descriptions-item label="报价总额" :span="2">
              <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">
              <span style="font-size: 18px; color: #e6a23c; font-weight: bold">
                Â¥{{ Number(detailData.totalAmount ?? 0).toFixed(2) }}
              </span>
            </el-descriptions-item>
          </el-descriptions>
          <div v-if="detailData.products?.length" style="margin-top: 20px;">
          <div v-if="detailData.products?.length" style="margin-top: 20px">
            <h4>产品明细</h4>
            <el-table :data="detailData.products"
                      border
                      style="width: 100%">
            <el-table :data="detailData.products" border style="width: 100%">
              <el-table-column prop="product" label="产品名称" />
              <el-table-column prop="specification" label="规格型号" />
              <el-table-column prop="unit" label="单位" />
              <el-table-column prop="unitPrice" label="单价">
                <template #default="scope">Â¥{{ Number(scope.row.unitPrice ?? 0).toFixed(2) }}</template>
                <template #default="scope"
                  >Â¥{{ Number(scope.row.unitPrice ?? 0).toFixed(2) }}</template
                >
              </el-table-column>
            </el-table>
          </div>
          <div v-if="detailData.remark" style="margin-top: 20px;">
          <div v-if="detailData.remark" style="margin-top: 20px">
            <h4>备注</h4>
            <p>{{ detailData.remark }}</p>
          </div>
        </div>
      </template>
    </div>
    <div v-if="attachmentList.length"
         class="detail-block">
    <div v-if="attachmentList.length" class="detail-block">
      <div class="detail-block-title">附件列表</div>
      <div class="attachment-list">
        <div v-for="file in attachmentList"
             :key="file.id"
             class="attachment-item">
        <div
          v-for="file in attachmentList"
          :key="file.id"
          class="attachment-item"
        >
          <el-icon class="file-icon">
            <Paperclip />
          </el-icon>
          <span class="file-name"
                :title="file.name || file.originalFilename">
          <span class="file-name" :title="file.name || file.originalFilename">
            {{ file.name || file.originalFilename }}
          </span>
          <div class="file-actions">
            <el-link v-if="file.previewURL || file.url"
                     type="primary"
                     :underline="false"
                     @click="openFile(file.previewURL || file.url)">预览</el-link>
            <el-divider v-if="(file.previewURL || file.url) && file.downloadURL"
                        direction="vertical" />
            <el-link v-if="file.downloadURL"
                     type="primary"
                     :underline="false"
                     @click="openFile(file.downloadURL)">下载</el-link>
            <el-link
              v-if="file.previewURL || file.url"
              type="primary"
              :underline="false"
              @click="openFile(file.previewURL || file.url)"
              >预览</el-link
            >
            <el-divider
              v-if="(file.previewURL || file.url) && file.downloadURL"
              direction="vertical"
            />
            <el-link
              v-if="file.downloadURL"
              type="primary"
              :underline="false"
              @click="openFile(file.downloadURL)"
              >下载</el-link
            >
          </div>
        </div>
      </div>
@@ -179,108 +276,107 @@
</template>
<script setup>
  import { computed } from "vue";
  import { Paperclip } from "@element-plus/icons-vue";
  import { formatDisplayTime } from "../../approve-template/approveTemplateConstants.js";
  import {
    approvalTypeLabel,
    approvalTypeStyle,
    approvalStatusLabel,
    approvalStatusTagType,
    resolveInstanceFormFields,
  } from "../approveListConstants.js";
  import FormPayloadFields from "./FormPayloadFields.vue";
import { computed } from "vue";
import { Paperclip } from "@element-plus/icons-vue";
import { formatDisplayTime } from "../../approve-template/approveTemplateConstants.js";
import {
  approvalTypeLabel,
  approvalTypeStyle,
  approvalStatusLabel,
  approvalStatusTagType,
  resolveInstanceFormFields,
} from "../approveListConstants.js";
import FormPayloadFields from "./FormPayloadFields.vue";
  const props = defineProps({
    row: { type: Object, default: () => ({}) },
    detailData: { type: Object, default: () => ({}) },
  });
const props = defineProps({
  row: { type: Object, default: () => ({}) },
  detailData: { type: Object, default: () => ({}) },
});
  const formResolved = computed(() => resolveInstanceFormFields(props.row));
const formResolved = computed(() => resolveInstanceFormFields(props.row));
// æ˜¯å¦ä¸ºç‰¹æ®Šå®¡æ‰¹ç±»åž‹ï¼ˆé‡‡è´­ã€å‘货、报价)
const isSpecialApprovalType = computed(() => {
  return [5, 7, 6].includes(props.row.businessType);
});
  // æ˜¯å¦ä¸ºç‰¹æ®Šå®¡æ‰¹ç±»åž‹ï¼ˆé‡‡è´­ã€å‘货、报价)
  const isSpecialApprovalType = computed(() => {
    return [5, 7, 6].includes(props.row.businessType);
  });
// è¯¦æƒ…数据(直接使用传入的 detail-data å‚数)
const detailData = computed(() => {
  return props.detailData || {};
});
  // è¯¦æƒ…数据(直接使用传入的 detail-data å‚数)
  const detailData = computed(() => {
    return props.detailData || {};
  });
const attachmentList = computed(() => {
  const list = props.row.storageBlobVOList || props.row.storageBlobDTOs || [];
  return Array.isArray(list) ? list : [];
});
  const attachmentList = computed(() => {
    const list = props.row.storageBlobVOList || props.row.storageBlobDTOs || [];
    return Array.isArray(list) ? list : [];
  });
  function openFile(url) {
    if (!url) return;
    window.open(url, "_blank");
  }
function openFile(url) {
  if (!url) return;
  window.open(url, "_blank");
}
</script>
<style scoped>
  .approve-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .detail-block-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--el-text-color-primary);
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 3px solid var(--el-color-primary);
    line-height: 1.4;
  }
  .approve-type-cell {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
  }
  .reject-text {
    color: var(--el-color-danger);
  }
.approve-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.detail-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--el-text-color-primary);
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--el-color-primary);
  line-height: 1.4;
}
.approve-type-cell {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.reject-text {
  color: var(--el-color-danger);
}
  .attachment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }
  .attachment-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--el-fill-color-light);
    border-radius: 6px;
    border: 1px solid var(--el-border-color-lighter);
    transition: all 0.3s;
  }
  .attachment-item:hover {
    border-color: var(--el-color-primary-light-5);
    background-color: var(--el-color-primary-light-9);
  }
  .file-icon {
    font-size: 18px;
    color: var(--el-text-color-secondary);
    margin-right: 10px;
  }
  .file-name {
    flex: 1;
    font-size: 13px;
    color: var(--el-text-color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
  }
  .file-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
</style>
.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.attachment-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--el-fill-color-light);
  border-radius: 6px;
  border: 1px solid var(--el-border-color-lighter);
  transition: all 0.3s;
}
.attachment-item:hover {
  border-color: var(--el-color-primary-light-5);
  background-color: var(--el-color-primary-light-9);
}
.file-icon {
  font-size: 18px;
  color: var(--el-text-color-secondary);
  margin-right: 10px;
}
.file-name {
  flex: 1;
  font-size: 13px;
  color: var(--el-text-color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
}
.file-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
</style>
src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
@@ -298,6 +298,20 @@
        <InstanceFlowDisplay :tasks="approveDialog.row?.tasks" :nodes="approveDialog.row?.flowNodes" />
      </div>
      <el-form label-width="100px" class="mt16">
        <el-form-item label="仓库" v-if="isPurchaseApproval">
          <el-select
            v-model="approveDialog.warehouse"
            placeholder="请选择仓库"
            clearable
          >
            <el-option
              v-for="item in warehouseOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="审批意见" required>
          <el-input
            v-model="approveOpinion"
@@ -335,7 +349,8 @@
<script setup>
import { Plus, RefreshRight } from "@element-plus/icons-vue";
import { ElMessage } from "element-plus";
import { computed, onMounted, ref } from "vue";
import { computed, onMounted, ref, reactive } from "vue";
import { getDicts } from "@/api/system/dict/data";
import { APPROVAL_MODULE_KEYS } from "../approve-shared/approvalModuleRegistry.js";
import FinReimburseApprovePanel from "../../ReimburseManage/shared/components/FinReimburseApprovePanel.vue";
import ApprovalTemplateFormSection from "../approve-shared/components/ApprovalTemplateFormSection.vue";
@@ -400,6 +415,25 @@
  openDetail,
  openApprove,
} = al;
// ä»“库选项
const warehouseOptions = ref([]);
// èŽ·å–ä»“åº“å­—å…¸æ•°æ®
const loadWarehouseOptions = async () => {
  const res = await getDicts("warehouse");
  if (res.code === 200) {
    warehouseOptions.value = res.data.map((item) => ({
      label: item.dictLabel,
      value: item.dictValue,
    }));
  }
};
// æ˜¯å¦ä¸ºé‡‡è´­å®¡æ‰¹
const isPurchaseApproval = computed(() => {
  return Number(approveDialog.row?.businessType) === 5;
});
const { flowUserOptions, loadFlowUsers } = useFlowUserOptions();
@@ -473,6 +507,7 @@
onMounted(() => {
  loadFlowUsers();
  loadSearchBusinessTypeOptions();
  loadWarehouseOptions();
  handleQuery();
});
</script>
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -82,7 +82,7 @@
  const detailRow = ref({});
  const detailData = ref({});
  const approveDialog = reactive({ visible: false, row: null });
  const approveDialog = reactive({ visible: false, row: null, warehouse: ''});
  const approveOpinion = ref("");
  const approveSubmitting = ref(false);
@@ -366,6 +366,7 @@
    }
    approveDialog.row = { ...row };
    approveOpinion.value = "";
    approveDialog.warehouse = row?.warehouse || '';
    const bizType = Number(row.businessType);
    // æŠ¥ä»·å®¡æ‰¹ï¼šç”¨å®¡æ‰¹äº‹ç”±å­—段承载的"报价单号"去查报价列表
    if (bizType === 6) {
@@ -642,7 +643,7 @@
    approveSubmitting.value = true;
    try {
      await approveApprovalInstance(
        buildApproveInstanceDto(row, result, approveOpinion.value)
        buildApproveInstanceDto(row, result, approveOpinion.value, approveDialog.warehouse)
      );
      reimburseDialog.visible = false;
      await fetchApprovalList();
@@ -664,8 +665,13 @@
    if (approveSubmitting.value) return { ok: false };
    approveSubmitting.value = true;
    try {
      // å‘货审批时传递出库批号
      const extraData = {};
      if (Number(row.businessType) === 7 && detailData.value?.shippingInfo?.outboundBatches) {
        extraData.outboundBatches = detailData.value.shippingInfo.outboundBatches;
      }
      await approveApprovalInstance(
        buildApproveInstanceDto(row, result, approveOpinion.value)
        buildApproveInstanceDto(row, result, approveOpinion.value, approveDialog.warehouse, extraData)
      );
      approveDialog.visible = false;
      await fetchApprovalList();
src/views/procurementManagement/procurementLedger/index.vue
@@ -228,17 +228,17 @@
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="入库状态"
                         prop="stockInStatus"
                         width="100"
                         show-overflow-tooltip>
          <template #default="scope">
            <el-tag :type="getStockInStatusType(scope.row.stockInStatus)"
                    size="small">
              {{ scope.row.stockInStatus || '--' }}
            </el-tag>
          </template>
        </el-table-column>
<!--        <el-table-column label="入库状态"-->
<!--                         prop="stockInStatus"-->
<!--                         width="100"-->
<!--                         show-overflow-tooltip>-->
<!--          <template #default="scope">-->
<!--            <el-tag :type="getStockInStatusType(scope.row.stockInStatus)"-->
<!--                    size="small">-->
<!--              {{ scope.row.stockInStatus || '&#45;&#45;' }}-->
<!--            </el-tag>-->
<!--          </template>-->
<!--        </el-table-column>-->
        <el-table-column label="签订日期"
                         prop="executionDate"
                         width="100"
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -190,7 +190,7 @@
import {userListNoPage} from "@/api/system/user.js";
import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
import {ledgerListNoPage} from "@/api/salesManagement/salesLedger.js";
import {ledgerListNoPage, productList} from "@/api/salesManagement/salesLedger.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -216,18 +216,18 @@
    salesContractNo: "",
  },
  rules: {
    checkTime: [{ required: true, message: "请输入", trigger: "blur" }],
    process: [{ required: true, message: "请输入", trigger: "blur" }],
    checkTime: [{ required: false, message: "请输入", trigger: "blur" }],
    process: [{ required: false, message: "请输入", trigger: "blur" }],
    checkName: [{ required: false, message: "请输入", trigger: "blur" }],
    productId: [{ required: true, message: "请输入", trigger: "blur" }],
    productModelId: [{ required: true, message: "请选择", trigger: "change" }],
    testStandardId: [{ required: false, message: "请选择指标", trigger: "change" }],
    unit: [{ required: false, message: "请输入", trigger: "blur" }],
    quantity: [{ required: true, message: "请输入", trigger: "blur" }],
    qualifiedQuantity: [{ required: true, message: "请输入", trigger: "blur" }],
    unqualifiedQuantity: [{ required: true, message: "请输入", trigger: "blur" }],
    quantity: [{ required: false, message: "请输入", trigger: "blur" }],
    qualifiedQuantity: [{ required: false, message: "请输入", trigger: "blur" }],
    unqualifiedQuantity: [{ required: false, message: "请输入", trigger: "blur" }],
    checkCompany: [{ required: false, message: "请输入", trigger: "blur" }],
    checkResult: [{ required: true, message: "请输入", trigger: "change" }],
    checkResult: [{ required: false, message: "请输入", trigger: "change" }],
  },
});
const { form, rules } = toRefs(data);
@@ -296,6 +296,30 @@
  form.value = {}
  testStandardOptions.value = [];
  tableData.value = [];
  // æ–°å¢žæ¨¡å¼ä¸‹ï¼Œé»˜è®¤è®¾ç½®äº§å“åç§°ä¸º"马铃薯雪花粉"(id=320)
  if (operationType.value === 'add') {
    const defaultProductId = 320;
    form.value.productId = defaultProductId;
    currentProductId.value = defaultProductId;
    form.value.productName = '马铃薯雪花粉';
    // åŠ è½½è§„æ ¼åž‹å·åˆ—è¡¨
    try {
      const modelRes = await modelList({ id: defaultProductId });
      modelOptions.value = modelRes || [];
      // é»˜è®¤é€‰ä¸­ç¬¬ä¸€ä¸ªè§„格型号
      if (modelOptions.value.length > 0) {
        const firstModel = modelOptions.value[0];
        form.value.productModelId = firstModel.id;
        form.value.model = firstModel.model || '';
        form.value.unit = firstModel.unit || '';
      }
      // åŠ è½½æŒ‡æ ‡é€‰é¡¹
      getList();
    } catch (e) {
      console.error('加载默认产品规格型号失败', e);
    }
  }
  if (operationType.value === 'edit' || operationType.value === 'view') {
    // å…ˆä¿å­˜ testStandardId,避免被清空
@@ -387,12 +411,25 @@
}
// é”€å”®è®¢å•选择变化处理
const handleSalesLedgerChange = (value) => {
const handleSalesLedgerChange = async (value) => {
  const selectedItem = salesLedgerOptions.value.find(item => item.id == value);
  if (selectedItem) {
    form.value.salesContractNo = selectedItem.salesContractNo || '';
    // æ ¹æ®é”€å”®è®¢å•ID查询产品信息,只赋值数量
    try {
      const res = await productList({ salesLedgerId: value, type: 1 });
      const productData = res.data && res.data.length > 0 ? res.data[0] : null;
      if (productData) {
        // åªè‡ªåŠ¨å¸¦å…¥æ•°é‡
        form.value.quantity = productData.quantity || 0;
      }
    } catch (e) {
      console.error('查询销售订单产品信息失败', e);
      proxy.$modal.msgError('查询销售订单产品信息失败');
    }
  } else {
    form.value.salesContractNo = '';
    form.value.quantity = undefined;
  }
}
src/views/qualityManagement/finalInspection/components/quickCheckDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,330 @@
<template>
  <div>
    <el-dialog
      v-model="dialogVisible"
      title="快速检验"
      width="70%"
      @close="closeDialog"
    >
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult" placeholder="请选择检测结果" style="width: 100%" @change="handleCheckResultChange">
                <el-option label="合格" value="合格" />
                <el-option label="不合格" value="不合格" />
                <el-option label="部分合格" value="部分合格" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指标选择:" prop="testStandardId">
              <el-select v-model="form.testStandardId" placeholder="请选择指标" style="width: 100%" @change="handleTestStandardChange">
                <el-option
                  v-for="item in testStandardOptions"
                  :key="item.id"
                  :label="item.standardName || item.standardNo"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <template v-if="form.checkResult">
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="数量:" prop="quantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入数量" clearable :precision="2" @change="handleQuantityChange"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测单位:" prop="checkCompany">
                <el-input v-model="form.checkCompany" placeholder="请输入检测单位" clearable/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="合格数量:" prop="qualifiedQuantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请输入合格数量" clearable :precision="2" @change="handleQualifiedQuantityChange"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="不合格数量:" prop="unqualifiedQuantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.unqualifiedQuantity" placeholder="请输入不合格数量" clearable :precision="2" @change="handleUnqualifiedQuantityChange"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="检验员:" prop="checkName">
                <el-select v-model="form.checkName" placeholder="请选择检验员" clearable style="width: 100%">
                  <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测日期:" prop="checkTime">
                <el-date-picker
                  v-model="form.checkTime"
                  type="date"
                  placeholder="请选择检测日期"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </template>
      </el-form>
      <PIMTable
        rowKey="id"
        :column="tableColumn"
        :tableData="tableData"
        :tableLoading="tableLoading"
        height="400"
      >
        <template #slot="{ row }">
          <el-input v-model="row.testValue" clearable/>
        </template>
      </PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button @click="closeDialog">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
import { userListNoPage } from "@/api/system/user.js";
import { batchQuickInspect } from "@/api/qualityManagement/rawMaterialInspection.js";
import { qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId } from "@/api/qualityManagement/metricMaintenance.js";
const { proxy } = getCurrentInstance();
const emit = defineEmits(['close', 'success']);
const dialogVisible = ref(false);
const userList = ref([]);
const selectedIds = ref([]);
const selectedRows = ref([]);
const testStandardOptions = ref([]);
const inspectType = ref(2); // å‡ºåŽ‚æ£€éªŒç±»åž‹
const data = reactive({
  form: {
    checkResult: '',
    testStandardId: '',
    quantity: undefined,
    qualifiedQuantity: undefined,
    unqualifiedQuantity: undefined,
    checkCompany: '',
    checkName: '',
    checkTime: '',
  },
  rules: {
    checkResult: [{ required: true, message: "请选择检测结果", trigger: "change" }],
    testStandardId: [{ required: true, message: "请选择指标", trigger: "change" }],
    quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
    qualifiedQuantity: [{ required: true, message: "请输入合格数量", trigger: "blur" }],
    unqualifiedQuantity: [{ required: true, message: "请输入不合格数量", trigger: "blur" }],
    checkCompany: [{ required: true, message: "请输入检测单位", trigger: "blur" }],
    checkName: [{ required: true, message: "请选择检验员", trigger: "change" }],
    checkTime: [{ required: true, message: "请选择检测日期", trigger: "change" }],
  },
});
const { form, rules } = toRefs(data);
const tableColumn = ref([
  {
    label: "指标",
    prop: "parameterItem",
  },
  {
    label: "单位",
    prop: "unit",
  },
  {
    label: "标准值",
    prop: "standardValue",
  },
  {
    label: "内控值",
    prop: "controlValue",
  },
  {
    label: "检验值",
    prop: "testValue",
    dataType: 'slot',
    slot: 'slot',
  },
]);
const tableData = ref([]);
const tableLoading = ref(false);
// æ‰“开弹框
const openDialog = async (ids, rows) => {
  selectedIds.value = ids;
  selectedRows.value = rows;
  dialogVisible.value = true;
  // è®¡ç®—选中行的总数量
  const totalQuantity = rows.reduce((sum, row) => sum + (Number(row.quantity) || 0), 0);
  // åŠ è½½ç”¨æˆ·åˆ—è¡¨
  const userListsRes = await userListNoPage();
  userList.value = userListsRes.data;
  // åŠ è½½æŒ‡æ ‡é€‰é¡¹ï¼ˆæ ¹æ®ç¬¬ä¸€ä¸ªé€‰ä¸­è¡Œçš„äº§å“ID)
  if (rows && rows.length > 0 && rows[0].productId) {
    const params = {
      productId: rows[0].productId,
      inspectType: 2
    };
    const res = await qualityInspectDetailByProductId(params);
    testStandardOptions.value = res.data || [];
  } else {
    testStandardOptions.value = [];
  }
  // é‡ç½®è¡¨å•
  form.value = {
    checkResult: '',
    testStandardId: '',
    quantity: totalQuantity,
    qualifiedQuantity: totalQuantity,
    unqualifiedQuantity: 0,
    checkCompany: '',
    checkName: '',
    checkTime: '',
  };
  tableData.value = [];
  await nextTick();
  proxy.$refs.formRef?.clearValidate();
};
// æŒ‡æ ‡é€‰æ‹©å˜åŒ–处理
const handleTestStandardChange = async (testStandardId) => {
  if (!testStandardId) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  try {
    const res = await getQualityTestStandardParamByTestStandardId(testStandardId);
    tableData.value = (res.data || []).map(item => ({
      ...item,
      id: null,
      testValue: ''
    }));
  } catch (error) {
    console.error('获取标准参数失败:', error);
    tableData.value = [];
  } finally {
    tableLoading.value = false;
  }
};
// æ£€æµ‹ç»“果变化处理
const handleCheckResultChange = (value) => {
  if (value === '合格') {
    // åˆæ ¼æ—¶ï¼Œåˆæ ¼æ•°é‡ç­‰äºŽæ•°é‡ï¼Œä¸åˆæ ¼æ•°é‡ä¸º0
    form.value.qualifiedQuantity = form.value.quantity || 0;
    form.value.unqualifiedQuantity = 0;
  } else if (value === '不合格') {
    // ä¸åˆæ ¼æ—¶ï¼Œåˆæ ¼æ•°é‡ä¸º0,不合格数量等于数量
    form.value.qualifiedQuantity = 0;
    form.value.unqualifiedQuantity = form.value.quantity || 0;
  }
};
// æ•°é‡å˜åŒ–处理
const handleQuantityChange = (value) => {
  if (form.value.checkResult === '合格') {
    form.value.qualifiedQuantity = value || 0;
    form.value.unqualifiedQuantity = 0;
  } else if (form.value.checkResult === '不合格') {
    form.value.qualifiedQuantity = 0;
    form.value.unqualifiedQuantity = value || 0;
  }
};
// åˆæ ¼æ•°é‡å˜åŒ–处理
const handleQualifiedQuantityChange = (value) => {
  const quantity = form.value.quantity || 0;
  if (value > quantity) {
    proxy.$modal.msgWarning("合格数量不能大于总数量");
    form.value.qualifiedQuantity = quantity;
    form.value.unqualifiedQuantity = 0;
  } else {
    form.value.unqualifiedQuantity = Number((quantity - value).toFixed(2));
  }
  updateCheckResult();
};
// ä¸åˆæ ¼æ•°é‡å˜åŒ–处理
const handleUnqualifiedQuantityChange = (value) => {
  const quantity = form.value.quantity || 0;
  if (value > quantity) {
    proxy.$modal.msgWarning("不合格数量不能大于总数量");
    form.value.unqualifiedQuantity = quantity;
    form.value.qualifiedQuantity = 0;
  } else {
    form.value.qualifiedQuantity = Number((quantity - value).toFixed(2));
  }
  updateCheckResult();
};
// æ ¹æ®åˆæ ¼/不合格数量更新检测结果
const updateCheckResult = () => {
  const qualified = form.value.qualifiedQuantity || 0;
  const unqualified = form.value.unqualifiedQuantity || 0;
  const quantity = form.value.quantity || 0;
  if (qualified === quantity && unqualified === 0) {
    form.value.checkResult = '合格';
  } else if (unqualified === quantity && qualified === 0) {
    form.value.checkResult = '不合格';
  } else if (qualified > 0 && unqualified > 0) {
    form.value.checkResult = '部分合格';
  }
};
// æäº¤è¡¨å•
const submitForm = () => {
  proxy.$refs.formRef.validate((valid) => {
    if (valid) {
      const data = {
        ids: selectedIds.value,
        inspectType: inspectType.value,
        ...form.value,
        paramList: tableData.value
      };
      batchQuickInspect(data).then(res => {
        proxy.$modal.msgSuccess(res.msg || "快速检验完成");
        emit('success');
        closeDialog();
      });
    }
  });
};
// å…³é—­å¼¹æ¡†
const closeDialog = () => {
  dialogVisible.value = false;
  emit('close');
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/finalInspection/index.vue
@@ -69,6 +69,9 @@
             @close="handleQuery"></FormDia>
    <files-dia ref="filesDia"
               @close="handleQuery"></files-dia>
    <QuickCheckDia ref="quickCheckDia"
                   @close="handleQuery"
                   @success="getList"></QuickCheckDia>
    <el-dialog v-model="dialogFormVisible"
               title="编辑检验员"
               width="30%"
@@ -115,6 +118,7 @@
  } from "vue";
  import InspectionFormDia from "@/views/qualityManagement/finalInspection/components/inspectionFormDia.vue";
  import FormDia from "@/views/qualityManagement/finalInspection/components/formDia.vue";
  import QuickCheckDia from "@/views/qualityManagement/finalInspection/components/quickCheckDia.vue";
  import { ElMessageBox } from "element-plus";
  import {
    downloadQualityInspect,
@@ -122,7 +126,6 @@
    qualityInspectListPage,
    qualityInspectUpdate,
    submitQualityInspect,
    batchQuickInspect,
  } from "@/api/qualityManagement/rawMaterialInspection.js";
  import FilesDia from "@/views/qualityManagement/finalInspection/components/filesDia.vue";
  import dayjs from "dayjs";
@@ -322,6 +325,7 @@
  const formDia = ref();
  const filesDia = ref();
  const inspectionFormDia = ref();
  const quickCheckDia = ref();
  const { proxy } = getCurrentInstance();
  const userStore = useUserStore();
  const userList = ref([]);
@@ -402,32 +406,8 @@
      return;
    }
    const totalCount = selectedRows.value.length;
    const submittedCount = totalCount - unSubmittedRows.length;
    let confirmMessage = `已选择 ${totalCount} æ¡æ£€éªŒå•`;
    if (submittedCount > 0) {
      confirmMessage += `(其中 ${submittedCount} æ¡å·²æäº¤ï¼Œå°†è‡ªåŠ¨è·³è¿‡ï¼‰`;
    }
    confirmMessage += `\n\n确认后将自动:\n· æ£€éªŒç»“果设为"合格"\n· åˆæ ¼æ•°é‡è®¾ä¸ºæ€»æ•°\n· ä¸åˆæ ¼æ•°é‡è®¾ä¸º 0\n· æäº¤å¹¶å…¥åº“`;
    ElMessageBox.confirm(confirmMessage, "快速检验", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
      dangerouslyUseHTMLString: false,
    })
      .then(() => {
        // è°ƒç”¨æ‰¹é‡å¿«é€Ÿæ£€éªŒæŽ¥å£
        const ids = unSubmittedRows.map(item => item.id);
        batchQuickInspect(ids).then(res => {
          proxy.$modal.msgSuccess(res.msg || "快速检验完成");
          getList();
        });
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
    const ids = unSubmittedRows.map(item => item.id);
    quickCheckDia.value?.openDialog(ids, unSubmittedRows);
  };
  // æ‰“开新增检验弹框
src/views/qualityManagement/metricBinding/index.vue
@@ -141,8 +141,8 @@
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="closeBindingDialog">取消</el-button>
          <el-button type="primary" @click="submitBinding">确定</el-button>
          <el-button @click="closeBindingDialog">取消</el-button>
        </span>
      </template>
    </el-dialog>
@@ -215,18 +215,6 @@
    formatData: (val) => {
      const map = { 0: '原材料检验', 1: '过程检验', 2: '出厂检验' }
      return map[val] || val
    }
  },
  {
    label: '工序',
    prop: 'processId',
    align: 'center',
    dataType: 'tag',
    formatData: (val) => {
      const target = processOptions.value.find(
        (item) => String(item.value) === String(val)
      )
      return target?.label || val
    }
  },
  {
src/views/qualityManagement/metricMaintenance/StandardFormDialog.vue
@@ -27,16 +27,6 @@
          <el-option label="出厂检验" value="2" />
        </el-select>
      </el-form-item>
      <el-form-item label="工序" prop="processId">
        <el-select v-model="form.processId" placeholder="请选择工序" style="width: 100%">
          <el-option
            v-for="item in processOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="状态" prop="state">
        <el-select v-model="form.state" placeholder="请选择状态" style="width: 100%">
          <el-option label="草稿" value="0" />
@@ -96,7 +86,7 @@
const formRef = ref(null)
const computedTitle = computed(() => {
  const computedTitle = computed(() => {
  if (props.operationType === 'edit') return '编辑检测标准'
  if (props.operationType === 'copy') return '复制检测标准'
  return '新增检测标准'
src/views/qualityManagement/metricMaintenance/index.vue
@@ -310,18 +310,6 @@
    }
  },
  {
    label: '工序',
    prop: 'processId',
    align: 'center',
    dataType: 'tag',
    formatData: (val) => {
      const target = processOptions.value.find(
        (item) => String(item.value) === String(val)
      )
      return target?.label || val
    }
  },
  {
    label: '状态',
    prop: 'state',
    headerSlot: 'stateHeader',
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -11,17 +11,18 @@
               ref="formRef">
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="工序:"
                          prop="process">
              <el-select v-model="form.process"
                         placeholder="请选择工序"
            <el-form-item label="采购合同号:"
                          prop="purchaseContractNo">
              <el-select v-model="form.purchaseContractNo"
                         placeholder="请选择"
                         clearable
                         :disabled="isViewMode || processQuantityDisabled"
                         filterable
                         :disabled="isViewMode"
                         style="width: 100%">
                <el-option v-for="item in processList"
                           :key="item.name"
                           :label="item.name"
                           :value="item.name" />
                <el-option v-for="item in purchaseContractList"
                           :key="item.id"
                           :label="item.purchaseContractNumber + ' - ' + item.supplierName"
                           :value="item.purchaseContractNumber" />
              </el-select>
            </el-form-item>
          </el-col>
@@ -216,7 +217,7 @@
    getCurrentInstance,
    nextTick,
  } from "vue";
  import { getOptions } from "@/api/procurementManagement/procurementLedger.js";
  import { getOptions, purchaseListPage } from "@/api/procurementManagement/procurementLedger.js";
  import { modelList, productTreeList } from "@/api/basicData/product.js";
  import {
    qualityInspectAdd,
@@ -228,7 +229,7 @@
  } from "@/api/qualityManagement/metricMaintenance.js";
  import { userListNoPage } from "@/api/system/user.js";
  import { qualityInspectParamInfo } from "@/api/qualityManagement/qualityInspectParam.js";
  import { list } from "@/api/productionManagement/productionProcess";
  import qualified from "@/views/inventoryManagement/stockManagement/Qualified.vue";
  const { proxy } = getCurrentInstance();
  const emit = defineEmits(["close"]);
@@ -238,7 +239,6 @@
  const data = reactive({
    form: {
      checkTime: "",
      process: "",
      checkName: "",
      productName: "",
      productId: "",
@@ -251,20 +251,21 @@
      unqualifiedQuantity: "",
      checkCompany: "",
      checkResult: "",
      purchaseContractNo: "",
    },
    rules: {
      checkTime: [{ required: true, message: "请输入", trigger: "blur" }],
      process: [{ required: true, message: "请选择工序", trigger: "change" }],
      checkTime: [{ required: false, message: "请输入", trigger: "blur" }],
      checkName: [{ required: false, message: "请输入", trigger: "blur" }],
      productId: [{ required: true, message: "请输入", trigger: "blur" }],
      productModelId: [{ required: true, message: "请选择", trigger: "change" }],
      testStandardId: [{ required: false, message: "请选择指标", trigger: "change" }],
      unit: [{ required: false, message: "请输入", trigger: "blur" }],
      quantity: [{ required: true, message: "请输入", trigger: "blur" }],
      qualifiedQuantity: [{ required: true, message: "请输入", trigger: "blur" }],
      unqualifiedQuantity: [{ required: true, message: "请输入", trigger: "blur" }],
      quantity: [{ required: false, message: "请输入", trigger: "blur" }],
      qualifiedQuantity: [{ required: false, message: "请输入", trigger: "blur" }],
      unqualifiedQuantity: [{ required: false, message: "请输入", trigger: "blur" }],
      checkCompany: [{ required: false, message: "请输入", trigger: "blur" }],
      checkResult: [{ required: true, message: "请输入", trigger: "change" }],
      purchaseContractNo: [{ required: false, message: "请选择", trigger: "change" }],
      checkResult: [{ required: false, message: "请输入", trigger: "change" }],
    },
  });
  const userList = ref([]);
@@ -276,9 +277,10 @@
    const v = form.value || {};
    return !!(v.productMainId != null || v.purchaseLedgerId != null);
  });
  const processList = ref([]); // å·¥åºä¸‹æ‹‰åˆ—表(工序名称 name)
  const supplierList = ref([]);
  const productOptions = ref([]);
  const purchaseContractList = ref([]); // é‡‡è´­åˆåŒå·åˆ—表
  const tableColumn = ref([
    {
      label: "指标",
@@ -315,20 +317,19 @@
    getOptions().then(res => {
      supplierList.value = res.data;
    });
    // åŠ è½½å·¥åºä¸‹æ‹‰åˆ—è¡¨
    try {
      const res = await list({ size: -1, current: -1 });
      processList.value = res.data.records || [];
    } catch (e) {
      console.error("加载工序列表失败", e);
      processList.value = [];
    }
    let userLists = await userListNoPage();
    userList.value = userLists.data;
    // å…ˆé‡ç½®è¡¨å•数据(保持字段完整,避免弹窗首次渲染时触发必填红框“闪一下”)
    // åŠ è½½é‡‡è´­åˆåŒå·åˆ—è¡¨
    try {
      const contractRes = await purchaseListPage({ pageNum: -1, pageSize: -1 });
      purchaseContractList.value = contractRes.data?.records || [];
    } catch (e) {
      console.error("加载采购合同号失败", e);
      purchaseContractList.value = [];
    }
    // å…ˆé‡ç½®è¡¨å•数据(保持字段完整,避免弹窗首次渲染时触发必填红框"闪一下")
    form.value = {
      checkTime: "",
      process: "",
      checkName: "",
      productName: "",
      productId: "",
@@ -339,6 +340,7 @@
      quantity: "",
      checkCompany: "",
      checkResult: "",
      purchaseContractNo: "",
    };
    testStandardOptions.value = [];
    tableData.value = [];
@@ -370,7 +372,6 @@
        let params = {
          productId: currentProductId.value,
          inspectType: 1,
          process: form.value.process || "",
        };
        qualityInspectDetailByProductId(params).then(res => {
          testStandardOptions.value = res.data || [];
@@ -518,9 +519,16 @@
          return;
        }
        // æ ¹æ®é‡‡è´­åˆåŒå·æŸ¥æ‰¾å¯¹åº”çš„ purchaseLedgerId
        const selectedContract = purchaseContractList.value.find(
          item => item.purchaseContractNumber === form.value.purchaseContractNo
        );
        const purchaseLedgerId = selectedContract ? selectedContract.id : null;
        const data = {
          ...form.value,
          process: processName, // ä¿ç•™ process å­—段以兼容后端
          purchaseLedgerId: purchaseLedgerId, // æäº¤ purchaseLedgerId
          qualityInspectParams: tableData.value,
        };
        if (operationType.value === "add") {
src/views/qualityManagement/processInspection/components/quickCheckDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,327 @@
<template>
  <div>
    <el-dialog
      v-model="dialogVisible"
      title="快速检验"
      width="70%"
      @close="closeDialog"
    >
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult" placeholder="请选择检测结果" style="width: 100%" @change="handleCheckResultChange">
                <el-option label="合格" value="合格" />
                <el-option label="不合格" value="不合格" />
                <el-option label="部分合格" value="部分合格" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指标选择:" prop="testStandardId">
              <el-select v-model="form.testStandardId" placeholder="请选择指标" style="width: 100%" @change="handleTestStandardChange">
                <el-option
                  v-for="item in testStandardOptions"
                  :key="item.id"
                  :label="item.standardName || item.standardNo"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <template v-if="form.checkResult">
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="数量:" prop="quantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入数量" clearable :precision="2" @change="handleQuantityChange"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测单位:" prop="checkCompany">
                <el-input v-model="form.checkCompany" placeholder="请输入检测单位" clearable/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="合格数量:" prop="qualifiedQuantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请输入合格数量" clearable :precision="2" @change="handleQualifiedQuantityChange"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="不合格数量:" prop="unqualifiedQuantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.unqualifiedQuantity" placeholder="请输入不合格数量" clearable :precision="2" @change="handleUnqualifiedQuantityChange"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="检验员:" prop="checkName">
                <el-select v-model="form.checkName" placeholder="请选择检验员" clearable style="width: 100%">
                  <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测日期:" prop="checkTime">
                <el-date-picker
                  v-model="form.checkTime"
                  type="date"
                  placeholder="请选择检测日期"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </template>
      </el-form>
      <PIMTable
        rowKey="id"
        :column="tableColumn"
        :tableData="tableData"
        :tableLoading="tableLoading"
        height="400"
      >
        <template #slot="{ row }">
          <el-input v-model="row.testValue" clearable/>
        </template>
      </PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button @click="closeDialog">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
import { userListNoPage } from "@/api/system/user.js";
import { batchQuickInspect } from "@/api/qualityManagement/rawMaterialInspection.js";
import { qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId } from "@/api/qualityManagement/metricMaintenance.js";
const { proxy } = getCurrentInstance();
const emit = defineEmits(['close', 'success']);
const dialogVisible = ref(false);
const userList = ref([]);
const selectedIds = ref([]);
const selectedRows = ref([]);
const testStandardOptions = ref([]);
const inspectType = ref(1); // è¿‡ç¨‹æ£€éªŒç±»åž‹
const data = reactive({
  form: {
    checkResult: '',
    testStandardId: '',
    quantity: undefined,
    qualifiedQuantity: undefined,
    unqualifiedQuantity: undefined,
    checkCompany: '',
    checkName: '',
    checkTime: '',
  },
  rules: {
    checkResult: [{ required: true, message: "请选择检测结果", trigger: "change" }],
    testStandardId: [{ required: true, message: "请选择指标", trigger: "change" }],
    quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
    qualifiedQuantity: [{ required: true, message: "请输入合格数量", trigger: "blur" }],
    unqualifiedQuantity: [{ required: true, message: "请输入不合格数量", trigger: "blur" }],
    checkCompany: [{ required: true, message: "请输入检测单位", trigger: "blur" }],
    checkName: [{ required: true, message: "请选择检验员", trigger: "change" }],
    checkTime: [{ required: true, message: "请选择检测日期", trigger: "change" }],
  },
});
const { form, rules } = toRefs(data);
const tableColumn = ref([
  {
    label: "指标",
    prop: "parameterItem",
  },
  {
    label: "单位",
    prop: "unit",
  },
  {
    label: "标准值",
    prop: "standardValue",
  },
  {
    label: "内控值",
    prop: "controlValue",
  },
  {
    label: "检验值",
    prop: "testValue",
    dataType: 'slot',
    slot: 'slot',
  },
]);
const tableData = ref([]);
const tableLoading = ref(false);
// æ‰“开弹框
const openDialog = async (ids, rows) => {
  selectedIds.value = ids;
  selectedRows.value = rows;
  dialogVisible.value = true;
  // åŠ è½½ç”¨æˆ·åˆ—è¡¨
  const userListsRes = await userListNoPage();
  userList.value = userListsRes.data;
  // åŠ è½½æŒ‡æ ‡é€‰é¡¹ï¼ˆæ ¹æ®ç¬¬ä¸€ä¸ªé€‰ä¸­è¡Œçš„äº§å“ID)
  if (rows && rows.length > 0 && rows[0].productId) {
    const params = {
      productId: rows[0].productId,
      inspectType: 1
    };
    const res = await qualityInspectDetailByProductId(params);
    testStandardOptions.value = res.data || [];
  } else {
    testStandardOptions.value = [];
  }
  // é‡ç½®è¡¨å•
  form.value = {
    checkResult: '',
    testStandardId: '',
    quantity: undefined,
    qualifiedQuantity: undefined,
    unqualifiedQuantity: undefined,
    checkCompany: '',
    checkName: '',
    checkTime: '',
  };
  tableData.value = [];
  await nextTick();
  proxy.$refs.formRef?.clearValidate();
};
// æŒ‡æ ‡é€‰æ‹©å˜åŒ–处理
const handleTestStandardChange = async (testStandardId) => {
  if (!testStandardId) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  try {
    const res = await getQualityTestStandardParamByTestStandardId(testStandardId);
    tableData.value = (res.data || []).map(item => ({
      ...item,
      id: null,
      testValue: ''
    }));
  } catch (error) {
    console.error('获取标准参数失败:', error);
    tableData.value = [];
  } finally {
    tableLoading.value = false;
  }
};
// æ£€æµ‹ç»“果变化处理
const handleCheckResultChange = (value) => {
  if (value === '合格') {
    // åˆæ ¼æ—¶ï¼Œåˆæ ¼æ•°é‡ç­‰äºŽæ•°é‡ï¼Œä¸åˆæ ¼æ•°é‡ä¸º0
    form.value.qualifiedQuantity = form.value.quantity || 0;
    form.value.unqualifiedQuantity = 0;
  } else if (value === '不合格') {
    // ä¸åˆæ ¼æ—¶ï¼Œåˆæ ¼æ•°é‡ä¸º0,不合格数量等于数量
    form.value.qualifiedQuantity = 0;
    form.value.unqualifiedQuantity = form.value.quantity || 0;
  }
};
// æ•°é‡å˜åŒ–处理
const handleQuantityChange = (value) => {
  if (form.value.checkResult === '合格') {
    form.value.qualifiedQuantity = value || 0;
    form.value.unqualifiedQuantity = 0;
  } else if (form.value.checkResult === '不合格') {
    form.value.qualifiedQuantity = 0;
    form.value.unqualifiedQuantity = value || 0;
  }
};
// åˆæ ¼æ•°é‡å˜åŒ–处理
const handleQualifiedQuantityChange = (value) => {
  const quantity = form.value.quantity || 0;
  if (value > quantity) {
    proxy.$modal.msgWarning("合格数量不能大于总数量");
    form.value.qualifiedQuantity = quantity;
    form.value.unqualifiedQuantity = 0;
  } else {
    form.value.unqualifiedQuantity = Number((quantity - value).toFixed(2));
  }
  updateCheckResult();
};
// ä¸åˆæ ¼æ•°é‡å˜åŒ–处理
const handleUnqualifiedQuantityChange = (value) => {
  const quantity = form.value.quantity || 0;
  if (value > quantity) {
    proxy.$modal.msgWarning("不合格数量不能大于总数量");
    form.value.unqualifiedQuantity = quantity;
    form.value.qualifiedQuantity = 0;
  } else {
    form.value.qualifiedQuantity = Number((quantity - value).toFixed(2));
  }
  updateCheckResult();
};
// æ ¹æ®åˆæ ¼/不合格数量更新检测结果
const updateCheckResult = () => {
  const qualified = form.value.qualifiedQuantity || 0;
  const unqualified = form.value.unqualifiedQuantity || 0;
  const quantity = form.value.quantity || 0;
  if (qualified === quantity && unqualified === 0) {
    form.value.checkResult = '合格';
  } else if (unqualified === quantity && qualified === 0) {
    form.value.checkResult = '不合格';
  } else if (qualified > 0 && unqualified > 0) {
    form.value.checkResult = '部分合格';
  }
};
// æäº¤è¡¨å•
const submitForm = () => {
  proxy.$refs.formRef.validate((valid) => {
    if (valid) {
      const data = {
        ids: selectedIds.value,
        inspectType: inspectType.value,
        ...form.value,
        paramList: tableData.value
      };
      batchQuickInspect(data).then(res => {
        proxy.$modal.msgSuccess(res.msg || "快速检验完成");
        emit('success');
        closeDialog();
      });
    }
  });
};
// å…³é—­å¼¹æ¡†
const closeDialog = () => {
  dialogVisible.value = false;
  emit('close');
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/processInspection/index.vue
@@ -2,13 +2,6 @@
  <div class="app-container">
    <div class="search_form mb20">
      <div>
        <span class="search_title">工序:</span>
        <el-input v-model="searchForm.process"
                  style="width: 240px"
                  placeholder="请输入工序搜索"
                  @change="handleQuery"
                  clearable
                  :prefix-icon="Search" />
        <span style="margin-left: 10px"
              class="search_title">检测日期:</span>
        <el-date-picker v-model="searchForm.entryDate"
@@ -18,14 +11,6 @@
                        placeholder="请选择"
                        clearable
                        @change="changeDaterange" />
        <span style="margin-left: 10px"
              class="search_title">生产工单号:</span>
        <el-input v-model="searchForm.workOrderNo"
                  style="width: 240px"
                  placeholder="请输入生产工单号搜索"
                  @change="handleQuery"
                  clearable
                  :prefix-icon="Search" />
        <el-button type="primary"
                   @click="handleQuery"
                   style="margin-left: 10px">搜索</el-button>
@@ -54,6 +39,9 @@
             @close="handleQuery"></FormDia>
    <files-dia ref="filesDia"
               @close="handleQuery"></files-dia>
    <QuickCheckDia ref="quickCheckDia"
                   @close="handleQuery"
                   @success="getList"></QuickCheckDia>
    <el-dialog v-model="dialogFormVisible"
               title="编辑检验员"
               width="30%"
@@ -100,6 +88,7 @@
  } from "vue";
  import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
  import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
  import QuickCheckDia from "@/views/qualityManagement/processInspection/components/quickCheckDia.vue";
  import { ElMessageBox } from "element-plus";
  import {
    downloadQualityInspect,
@@ -107,7 +96,6 @@
    qualityInspectListPage,
    qualityInspectUpdate,
    submitQualityInspect,
    batchQuickInspect,
  } from "@/api/qualityManagement/rawMaterialInspection.js";
  import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
  import dayjs from "dayjs";
@@ -116,7 +104,6 @@
  const data = reactive({
    searchForm: {
      process: "",
      entryDate: undefined, // å½•入日期
      workOrderNo: "",
      entryDateStart: undefined,
@@ -135,13 +122,13 @@
      width: 120,
    },
    {
      label: "工序",
      prop: "process",
      width: 230,
    },
    {
      label: "检验员",
      prop: "checkName",
    },
    {
      label: "采购合同号",
      prop: "purchaseContractNo",
            width: 150,
    },
    {
      label: "产品名称",
@@ -311,6 +298,7 @@
  const formDia = ref();
  const filesDia = ref();
  const inspectionFormDia = ref();
  const quickCheckDia = ref();
  const { proxy } = getCurrentInstance();
  const userStore = useUserStore();
  const changeDaterange = value => {
@@ -385,32 +373,8 @@
      return;
    }
    const totalCount = selectedRows.value.length;
    const submittedCount = totalCount - unSubmittedRows.length;
    let confirmMessage = `已选择 ${totalCount} æ¡æ£€éªŒå•`;
    if (submittedCount > 0) {
      confirmMessage += `(其中 ${submittedCount} æ¡å·²æäº¤ï¼Œå°†è‡ªåŠ¨è·³è¿‡ï¼‰`;
    }
    confirmMessage += `\n\n确认后将自动:\n· æ£€éªŒç»“果设为"合格"\n· åˆæ ¼æ•°é‡è®¾ä¸ºæ€»æ•°\n· ä¸åˆæ ¼æ•°é‡è®¾ä¸º 0\n· æäº¤å¹¶å…¥åº“`;
    ElMessageBox.confirm(confirmMessage, "快速检验", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
      dangerouslyUseHTMLString: false,
    })
      .then(() => {
        // è°ƒç”¨æ‰¹é‡å¿«é€Ÿæ£€éªŒæŽ¥å£
        const ids = unSubmittedRows.map(item => item.id);
        batchQuickInspect(ids).then(res => {
          proxy.$modal.msgSuccess(res.msg || "快速检验完成");
          getList();
        });
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
    const ids = unSubmittedRows.map(item => item.id);
    quickCheckDia.value?.openDialog(ids, unSubmittedRows);
  };
  // æ‰“开新增检验弹框
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -197,18 +197,18 @@
    checkResult: "",
  },
  rules: {
    checkTime: [{required: true, message: "请输入", trigger: "blur"},],
    checkTime: [{required: false, message: "请输入", trigger: "blur"},],
    supplier: [{required: true, message: "请输入", trigger: "blur"}],
    checkName: [{required: false, message: "请输入", trigger: "blur"}],
    productId: [{required: true, message: "请输入", trigger: "blur"}],
    productModelId: [{required: true, message: "请选择产品型号", trigger: "change"}],
    testStandardId: [{required: false, message: "请选择指标", trigger: "change"}],
    unit: [{required: false, message: "请输入", trigger: "blur"}],
    quantity: [{required: true, message: "请输入", trigger: "blur"}],
    qualifiedQuantity: [{required: true, message: "请输入", trigger: "blur"}],
    unqualifiedQuantity: [{required: true, message: "请输入", trigger: "blur"}],
    quantity: [{required: false, message: "请输入", trigger: "blur"}],
    qualifiedQuantity: [{required: false, message: "请输入", trigger: "blur"}],
    unqualifiedQuantity: [{required: false, message: "请输入", trigger: "blur"}],
    checkCompany: [{required: false, message: "请输入", trigger: "blur"}],
    checkResult: [{required: true, message: "请选择检测结果", trigger: "change"}],
    checkResult: [{required: false, message: "请选择检测结果", trigger: "change"}],
  },
});
const tableColumn = ref([
src/views/qualityManagement/rawMaterialInspection/components/quickCheckDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,327 @@
<template>
  <div>
    <el-dialog
      v-model="dialogVisible"
      title="快速检验"
      width="70%"
      @close="closeDialog"
    >
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult" placeholder="请选择检测结果" style="width: 100%" @change="handleCheckResultChange">
                <el-option label="合格" value="合格" />
                <el-option label="不合格" value="不合格" />
                <el-option label="部分合格" value="部分合格" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指标选择:" prop="testStandardId">
              <el-select v-model="form.testStandardId" placeholder="请选择指标" style="width: 100%" @change="handleTestStandardChange">
                <el-option
                  v-for="item in testStandardOptions"
                  :key="item.id"
                  :label="item.standardName || item.standardNo"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <template v-if="form.checkResult">
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="数量:" prop="quantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入数量" clearable :precision="2" @change="handleQuantityChange"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测单位:" prop="checkCompany">
                <el-input v-model="form.checkCompany" placeholder="请输入检测单位" clearable/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="合格数量:" prop="qualifiedQuantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请输入合格数量" clearable :precision="2" @change="handleQualifiedQuantityChange"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="不合格数量:" prop="unqualifiedQuantity">
                <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.unqualifiedQuantity" placeholder="请输入不合格数量" clearable :precision="2" @change="handleUnqualifiedQuantityChange"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <el-col :span="12">
              <el-form-item label="检验员:" prop="checkName">
                <el-select v-model="form.checkName" placeholder="请选择检验员" clearable style="width: 100%">
                  <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测日期:" prop="checkTime">
                <el-date-picker
                  v-model="form.checkTime"
                  type="date"
                  placeholder="请选择检测日期"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </template>
      </el-form>
      <PIMTable
        rowKey="id"
        :column="tableColumn"
        :tableData="tableData"
        :tableLoading="tableLoading"
        height="400"
      >
        <template #slot="{ row }">
          <el-input v-model="row.testValue" clearable/>
        </template>
      </PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button @click="closeDialog">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
import { userListNoPage } from "@/api/system/user.js";
import { batchQuickInspect } from "@/api/qualityManagement/rawMaterialInspection.js";
import { qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId } from "@/api/qualityManagement/metricMaintenance.js";
const { proxy } = getCurrentInstance();
const emit = defineEmits(['close', 'success']);
const dialogVisible = ref(false);
const userList = ref([]);
const selectedIds = ref([]);
const selectedRows = ref([]);
const testStandardOptions = ref([]);
const inspectType = ref(0); // åŽŸææ–™æ£€éªŒç±»åž‹
const data = reactive({
  form: {
    checkResult: '',
    testStandardId: '',
    quantity: undefined,
    qualifiedQuantity: undefined,
    unqualifiedQuantity: undefined,
    checkCompany: '',
    checkName: '',
    checkTime: '',
  },
  rules: {
    checkResult: [{ required: true, message: "请选择检测结果", trigger: "change" }],
    testStandardId: [{ required: true, message: "请选择指标", trigger: "change" }],
    quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
    qualifiedQuantity: [{ required: true, message: "请输入合格数量", trigger: "blur" }],
    unqualifiedQuantity: [{ required: true, message: "请输入不合格数量", trigger: "blur" }],
    checkCompany: [{ required: true, message: "请输入检测单位", trigger: "blur" }],
    checkName: [{ required: true, message: "请选择检验员", trigger: "change" }],
    checkTime: [{ required: true, message: "请选择检测日期", trigger: "change" }],
  },
});
const { form, rules } = toRefs(data);
const tableColumn = ref([
  {
    label: "指标",
    prop: "parameterItem",
  },
  {
    label: "单位",
    prop: "unit",
  },
  {
    label: "标准值",
    prop: "standardValue",
  },
  {
    label: "内控值",
    prop: "controlValue",
  },
  {
    label: "检验值",
    prop: "testValue",
    dataType: 'slot',
    slot: 'slot',
  },
]);
const tableData = ref([]);
const tableLoading = ref(false);
// æ‰“开弹框
const openDialog = async (ids, rows) => {
  selectedIds.value = ids;
  selectedRows.value = rows;
  dialogVisible.value = true;
  // åŠ è½½ç”¨æˆ·åˆ—è¡¨
  const userListsRes = await userListNoPage();
  userList.value = userListsRes.data;
  // åŠ è½½æŒ‡æ ‡é€‰é¡¹ï¼ˆæ ¹æ®ç¬¬ä¸€ä¸ªé€‰ä¸­è¡Œçš„äº§å“ID)
  if (rows && rows.length > 0 && rows[0].productId) {
    const params = {
      productId: rows[0].productId,
      inspectType: 0
    };
    const res = await qualityInspectDetailByProductId(params);
    testStandardOptions.value = res.data || [];
  } else {
    testStandardOptions.value = [];
  }
  // é‡ç½®è¡¨å•
  form.value = {
    checkResult: '',
    testStandardId: '',
    quantity: undefined,
    qualifiedQuantity: undefined,
    unqualifiedQuantity: undefined,
    checkCompany: '',
    checkName: '',
    checkTime: '',
  };
  tableData.value = [];
  await nextTick();
  proxy.$refs.formRef?.clearValidate();
};
// æŒ‡æ ‡é€‰æ‹©å˜åŒ–处理
const handleTestStandardChange = async (testStandardId) => {
  if (!testStandardId) {
    tableData.value = [];
    return;
  }
  tableLoading.value = true;
  try {
    const res = await getQualityTestStandardParamByTestStandardId(testStandardId);
    tableData.value = (res.data || []).map(item => ({
      ...item,
      id: null,
      testValue: ''
    }));
  } catch (error) {
    console.error('获取标准参数失败:', error);
    tableData.value = [];
  } finally {
    tableLoading.value = false;
  }
};
// æ£€æµ‹ç»“果变化处理
const handleCheckResultChange = (value) => {
  if (value === '合格') {
    // åˆæ ¼æ—¶ï¼Œåˆæ ¼æ•°é‡ç­‰äºŽæ•°é‡ï¼Œä¸åˆæ ¼æ•°é‡ä¸º0
    form.value.qualifiedQuantity = form.value.quantity || 0;
    form.value.unqualifiedQuantity = 0;
  } else if (value === '不合格') {
    // ä¸åˆæ ¼æ—¶ï¼Œåˆæ ¼æ•°é‡ä¸º0,不合格数量等于数量
    form.value.qualifiedQuantity = 0;
    form.value.unqualifiedQuantity = form.value.quantity || 0;
  }
};
// æ•°é‡å˜åŒ–处理
const handleQuantityChange = (value) => {
  if (form.value.checkResult === '合格') {
    form.value.qualifiedQuantity = value || 0;
    form.value.unqualifiedQuantity = 0;
  } else if (form.value.checkResult === '不合格') {
    form.value.qualifiedQuantity = 0;
    form.value.unqualifiedQuantity = value || 0;
  }
};
// åˆæ ¼æ•°é‡å˜åŒ–处理
const handleQualifiedQuantityChange = (value) => {
  const quantity = form.value.quantity || 0;
  if (value > quantity) {
    proxy.$modal.msgWarning("合格数量不能大于总数量");
    form.value.qualifiedQuantity = quantity;
    form.value.unqualifiedQuantity = 0;
  } else {
    form.value.unqualifiedQuantity = Number((quantity - value).toFixed(2));
  }
  updateCheckResult();
};
// ä¸åˆæ ¼æ•°é‡å˜åŒ–处理
const handleUnqualifiedQuantityChange = (value) => {
  const quantity = form.value.quantity || 0;
  if (value > quantity) {
    proxy.$modal.msgWarning("不合格数量不能大于总数量");
    form.value.unqualifiedQuantity = quantity;
    form.value.qualifiedQuantity = 0;
  } else {
    form.value.qualifiedQuantity = Number((quantity - value).toFixed(2));
  }
  updateCheckResult();
};
// æ ¹æ®åˆæ ¼/不合格数量更新检测结果
const updateCheckResult = () => {
  const qualified = form.value.qualifiedQuantity || 0;
  const unqualified = form.value.unqualifiedQuantity || 0;
  const quantity = form.value.quantity || 0;
  if (qualified === quantity && unqualified === 0) {
    form.value.checkResult = '合格';
  } else if (unqualified === quantity && qualified === 0) {
    form.value.checkResult = '不合格';
  } else if (qualified > 0 && unqualified > 0) {
    form.value.checkResult = '部分合格';
  }
};
// æäº¤è¡¨å•
const submitForm = () => {
  proxy.$refs.formRef.validate((valid) => {
    if (valid) {
      const data = {
        ids: selectedIds.value,
        inspectType: inspectType.value,
        ...form.value,
        paramList: tableData.value
      };
      batchQuickInspect(data).then(res => {
        proxy.$modal.msgSuccess(res.msg || "快速检验完成");
        emit('success');
        closeDialog();
      });
    }
  });
};
// å…³é—­å¼¹æ¡†
const closeDialog = () => {
  dialogVisible.value = false;
  emit('close');
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -55,6 +55,9 @@
             @close="handleQuery"></FormDia>
    <files-dia ref="filesDia"
               @close="handleQuery"></files-dia>
    <QuickCheckDia ref="quickCheckDia"
                   @close="handleQuery"
                   @success="getList"></QuickCheckDia>
    <el-dialog v-model="dialogFormVisible"
               title="编辑检验员"
               width="30%"
@@ -101,6 +104,7 @@
  } from "vue";
  import InspectionFormDia from "@/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue";
  import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue";
  import QuickCheckDia from "@/views/qualityManagement/rawMaterialInspection/components/quickCheckDia.vue";
  import { ElMessageBox } from "element-plus";
  import {
    downloadQualityInspect,
@@ -108,7 +112,6 @@
    qualityInspectListPage,
    qualityInspectUpdate,
    submitQualityInspect,
    batchQuickInspect,
  } from "@/api/qualityManagement/rawMaterialInspection.js";
  import FilesDia from "@/views/qualityManagement/rawMaterialInspection/components/filesDia.vue";
  import dayjs from "dayjs";
@@ -322,6 +325,7 @@
  const formDia = ref();
  const filesDia = ref();
  const inspectionFormDia = ref();
  const quickCheckDia = ref();
  const { proxy } = getCurrentInstance();
  const userStore = useUserStore();
  const changeDaterange = value => {
@@ -396,33 +400,8 @@
      return;
    }
    const totalCount = selectedRows.value.length;
    const unSubmittedCount = unSubmittedRows.length;
    const submittedCount = totalCount - unSubmittedCount;
    let confirmMessage = `已选择 ${totalCount} æ¡æ£€éªŒå•`;
    if (submittedCount > 0) {
      confirmMessage += `(其中 ${submittedCount} æ¡å·²æäº¤ï¼Œå°†è‡ªåŠ¨è·³è¿‡ï¼‰`;
    }
    confirmMessage += `\n\n确认后将自动:\n· æ£€éªŒç»“果设为"合格"\n· åˆæ ¼æ•°é‡è®¾ä¸ºæ€»æ•°\n· ä¸åˆæ ¼æ•°é‡è®¾ä¸º 0\n· æäº¤å¹¶å…¥åº“`;
    ElMessageBox.confirm(confirmMessage, "快速检验", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
      dangerouslyUseHTMLString: false,
    })
      .then(() => {
        // è°ƒç”¨æ‰¹é‡å¿«é€Ÿæ£€éªŒæŽ¥å£
        const ids = unSubmittedRows.map(item => item.id);
        batchQuickInspect(ids).then(res => {
          proxy.$modal.msgSuccess(res.msg || "快速检验完成");
          getList();
        });
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
    const ids = unSubmittedRows.map(item => item.id);
    quickCheckDia.value?.openDialog(ids, unSubmittedRows);
  };
  // æ‰“开附件弹框
  const openFilesFormDia = (type, row) => {
src/views/salesManagement/deliveryLedger/index.vue
@@ -82,6 +82,11 @@
          show-overflow-tooltip
        />
        <el-table-column
          label="出库批次"
          prop="outboundBatches"
          show-overflow-tooltip
        />
        <el-table-column
          label="发货时间"
          prop="shippingDate"
          show-overflow-tooltip
src/views/salesManagement/salesLedger/index.vue
@@ -1083,6 +1083,15 @@
              />
            </el-form-item>
          </el-col>
          <el-col :span="24" v-if="deliveryForm.type === '货车'">
            <el-form-item label="出库批号:" prop="outboundBatches">
              <el-input
                v-model="deliveryForm.outboundBatches"
                placeholder="请输入出库批号"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="24" v-else>
            <el-form-item label="快递公司:" prop="expressCompany">
              <el-input
@@ -1421,6 +1430,7 @@
    expressCompany: "",
    expressNumber: "",
    type: "货车", // è´§è½¦, å¿«é€’
    outboundBatches: "",
  },
  deliveryRules: {
    shippingCarNumber: [
@@ -2880,6 +2890,7 @@
    type: "货车",
    batchNo: [],
    batchNoList,
    outboundBatches: "",
  };
  deliveryFileList.value = [];
  deliveryFormVisible.value = true;
@@ -2923,6 +2934,10 @@
          deliveryForm.value.type === "货车"
            ? deliveryForm.value.shippingCarNumber
            : "",
        outboundBatches:
          deliveryForm.value.type === "货车"
            ? deliveryForm.value.outboundBatches
            : "",
        expressCompany:
          deliveryForm.value.type === "快递"
            ? deliveryForm.value.expressCompany
src/views/systemArchitecture/index.vue
@@ -107,6 +107,7 @@
        </div>
      </section>
      <!-- ç”Ÿäº§æ¨¡å—已隐藏
      <section class="section-card section-card--bottom">
        <article class="module-title module-title--produce">
          <div class="module-title__icon">
@@ -132,6 +133,7 @@
          </template>
        </div>
      </section>
      -->
      <section class="section-card section-card--bottom">
        <article class="module-title module-title--store">