zhangwencui
13 小时以前 1273cbc1079a978ad30b607411823d53014f02d1
一些修改
已修改3个文件
124 ■■■■ 文件已修改
src/views/productionManagement/productionReporting/detailDialog.vue 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/reportingDialog.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/detailDialog.vue
@@ -11,14 +11,14 @@
        <el-descriptions :column="3"
                         border>
          <el-descriptions-item label="生产订单号">{{ detailData.npsNo || '-' }}</el-descriptions-item>
          <el-descriptions-item label="班组">{{ detailData.schedule || '-' }}</el-descriptions-item>
          <el-descriptions-item label="班组"><el-tag :type="detailData.schedule == '白班' ? 'primary' : 'warning'">{{ detailData.schedule || '-' }}</el-tag></el-descriptions-item>
          <el-descriptions-item label="岗位人员">{{ detailData.postName || '-' }}</el-descriptions-item>
          <el-descriptions-item label="产品编码">{{ detailData.materialCode || '-' }}</el-descriptions-item>
          <el-descriptions-item label="产品名称">{{ detailData.productName || '-' }}</el-descriptions-item>
          <el-descriptions-item label="规格">{{ detailData.model || '-' }}</el-descriptions-item>
          <el-descriptions-item label="合格数量">{{ detailData.qualifiedQuantity || 0 }} 方</el-descriptions-item>
          <el-descriptions-item label="不合格数量">{{ detailData.unqualifiedQuantity || 0 }} 方</el-descriptions-item>
          <el-descriptions-item label="总数量">{{ detailData.quantity || 0 }} 方</el-descriptions-item>
          <el-descriptions-item label="合格数量"><span class="num2">{{ detailData.qualifiedQuantity || 0 }}</span> <span class="unit">方</span></el-descriptions-item>
          <el-descriptions-item label="不合格数量"><span class="num3">{{ detailData.unqualifiedQuantity || 0 }}</span> <span class="unit">方</span></el-descriptions-item>
          <el-descriptions-item label="总数量"><span class="num1">{{ detailData.quantity || 0 }}</span> <span class="unit">方</span></el-descriptions-item>
          <el-descriptions-item label="报工时间">{{ formatTime(detailData.reportingTime) }}</el-descriptions-item>
          <el-descriptions-item label="创建时间">{{ formatTime(detailData.createTime) }}</el-descriptions-item>
          <el-descriptions-item label="更新时间">{{ formatTime(detailData.updateTime) }}</el-descriptions-item>
@@ -32,10 +32,10 @@
             :key="process.id"
             class="process-item">
          <div class="process-header">
            <h4 class="process-title">工序 {{ index + 1 }}</h4>
            <h4 class="process-title">{{ process.processName || '-' }}</h4>
            <div class="process-info">
              <span class="process-label">岗位人员:{{ process.postName || '-' }}</span>
              <span class="process-label">工序ID:{{ process.processId || '-' }}</span>
              <span class="process-label">工序ID:{{ process.processNo || '-' }}</span>
            </div>
          </div>
          <!-- 工序基本信息 -->
@@ -53,15 +53,18 @@
            <!-- BOM信息 -->
            <div class="param-section"
                 v-if="getBomList(process.productionProductRouteItemParamDtoList).length > 0">
              <h5 class="param-title">BOM信息</h5>
              <h5 class="param-title">投入品信息</h5>
              <el-table :data="getBomList(process.productionProductRouteItemParamDtoList)"
                        style="width: 100%"
                        size="small">
                <el-table-column prop="paramName"
                                 label="参数名称"
                                 label="产品名称"
                                 min-width="120"></el-table-column>
                <el-table-column prop="model"
                                 label="规格型号"
                                 min-width="120"></el-table-column>
                <el-table-column prop="productValue"
                                 label="产品值"
                                 label="投入量"
                                 min-width="100"></el-table-column>
                <el-table-column prop="unit"
                                 label="单位"
@@ -71,12 +74,12 @@
            <!-- 参数信息 -->
            <div class="param-section"
                 v-if="getParamList(process.productionProductRouteItemParamDtoList).length > 0">
              <h5 class="param-title">参数信息</h5>
              <h5 class="param-title">生产记录</h5>
              <div v-for="(group, sort) in getParamGroups(process.productionProductRouteItemParamDtoList)"
                   :key="sort"
                   class="param-group">
                <div class="group-header">
                  <span class="group-title">参数组 {{ sort }}</span>
                  <span class="group-title">生产记录组 {{ sort }}</span>
                </div>
                <div class="param-grid">
                  <div v-for="param in group"
@@ -99,11 +102,17 @@
              <div v-for="file in process.fileList"
                   :key="file.id"
                   class="file-item">
                <img v-if="file.fileUrl"
                     :src="baseUrl + file.fileUrl"
                     :alt="file.fileName"
                     class="file-image"
                     @click="handleFilePreview(file)" />
                <el-image style="width: 100px; height: 100px"
                          v-if="file.fileUrl"
                          :src="baseUrl + file.fileUrl"
                          :zoom-rate="1.2"
                          :max-scale="7"
                          :alt="file.fileName"
                          :min-scale="0.2"
                          :preview-src-list="formatFileList(process.fileList)"
                          show-progress
                          :initial-index="4"
                          fit="cover" />
                <div class="file-info">
                  <span class="file-name">{{ file.fileName || '-' }}</span>
                </div>
@@ -156,15 +165,18 @@
  const formatFileList = fileList => {
    return fileList.map(file => ({
      name: file.fileName,
      url: file.fileUrl,
      url: baseUrl + file.fileUrl,
      size: file.fileSize,
    }));
  };
  // 处理文件预览
  const handleFilePreview = file => {
    // 这里可以实现文件预览逻辑
    console.log("预览文件:", file);
    if (file.fileUrl) {
      window.open(baseUrl + file.fileUrl, "_blank");
    } else {
      console.log("文件没有URL,无法预览");
    }
  };
  // 获取BOM列表
@@ -339,12 +351,25 @@
  }
  .file-image {
    width: 80px;
    height: 80px;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 8px;
  }
  :deep(.el-image) {
    border-radius: 4px;
    overflow: hidden;
  }
  :deep(.el-image__inner) {
    transition: transform 0.3s ease;
  }
  .file-item:hover :deep(.el-image__inner) {
    transform: scale(1.05);
  }
  .file-info {
@@ -372,6 +397,22 @@
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
  }
  .num1 {
    color: #1107cc;
    font-weight: 600;
  }
  .num2 {
    color: #0fcf25;
    font-weight: 600;
  }
  .num3 {
    color: #d31818;
    font-weight: 600;
  }
  .unit {
    font-size: 12px;
    color: #5d5a66;
  }
  .group-title {
    font-size: 14px;
src/views/productionManagement/productionReporting/index.vue
@@ -89,9 +89,12 @@
  const tableColumn = ref([
    {
      label: "报工编号",
      prop: "productNo",
    },
    {
      label: "生产订单号",
      prop: "npsNo",
      width: "150px",
    },
    {
      label: "班组",
@@ -105,20 +108,25 @@
    {
      label: "产品编码",
      prop: "materialCode",
      width: "150px",
    },
    {
      label: "产品名称",
      prop: "productName",
      width: "150px",
    },
    {
      label: "规格",
      prop: "productModelName",
      width: "150px",
      className: "productModelName-cell",
    },
    {
      label: "强度",
      prop: "strength",
      dataType: "tag",
      formatType: params => {
        return params == "A3.5" ? "primary" : "warning";
      },
    },
    {
      label: "产出方量",
      prop: "totalQuantity",
      width: "100px",
src/views/productionManagement/productionReporting/reportingDialog.vue
@@ -305,10 +305,10 @@
                                    :label="`${item.productName} ${item.model}`"
                                    class="form-item">
                        <div class="consumable-input-group">
                          <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId]"
                          <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.productModelId]"
                                           :min="0"
                                           :model-value="getConsumableValue(parseInt(activeProcessId), item.bomId)"
                                           @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId] = val"
                                           :model-value="getConsumableValue(parseInt(activeProcessId), item.productModelId)"
                                           @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.productModelId] = val"
                                           class="consumable-input" />
                          <span class="consumable-unit">{{ item.unit }}</span>
                        </div>
@@ -812,12 +812,12 @@
  };
  // 获取消耗品数量,默认为0
  const getConsumableValue = (processId, bomId) => {
  const getConsumableValue = (processId, productModelId) => {
    const processInfo = getProcessInfo(processId);
    if (!processInfo.consumables[bomId]) {
      processInfo.consumables[bomId] = 0;
    if (!processInfo.consumables[productModelId]) {
      processInfo.consumables[productModelId] = 0;
    }
    return processInfo.consumables[bomId];
    return processInfo.consumables[productModelId];
  };
  // 处理文件预览
@@ -980,10 +980,15 @@
            if (editProcess.productionProductRouteItemParamDtoList) {
              editProcess.productionProductRouteItemParamDtoList.forEach(
                param => {
                  // console.log(form.processStructures[processId], "========");
                  if (param.bomId) {
                    // 使用bomId作为key,因为getProcessStructures返回的item.id是bomId
                    processInfo.consumables[param.bomId] =
                      param.productValue || 0;
                    form.processStructures[processId].forEach(item => {
                      if (item.productModelId == param.productId) {
                        processInfo.consumables[param.productId] =
                          param.productValue || 0;
                      }
                    });
                  }
                }
              );
@@ -1091,7 +1096,7 @@
            structures.forEach(structure => {
              const consumableValue = getConsumableValue(
                process.processId,
                structure.bomId
                structure.productModelId
              );
              if (consumableValue > 0) {
                productionProductRouteItemParamDtoList.push({