zhang_nuo
3 天以前 e94dceef0ae4eb9dca0964d93ed35772a594416e
feat(workOrder): 新增生产状态和领料状态展示

- 在工单管理表格中新增生产状态列,根据领料情况和完成数
量动态展示"未领料/待生产/生产中/已生产"状态,并匹配对
应标签颜色,提升工单进度可视化
- 新增领料状态列,通过标签直观展示工单是否已领料,便于快
速区分工单所处阶段
- 涉及文件:src/views/productionManagement/workOrderManag
ement/index.vue
已修改1个文件
39 ■■■■■ 文件已修改
src/views/productionManagement/workOrderManagement/index.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrderManagement/index.vue
@@ -33,10 +33,22 @@
                :page="page"
                :tableLoading="tableLoading"
                @pagination="pagination">
        <template #productionStatus="{ row }">
          <el-tag :type="getProductionStatusType(row)"
                  size="small">
            {{ getProductionStatusText(row) }}
          </el-tag>
        </template>
        <template #completionStatus="{ row }">
          <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
                       :color="progressColor(toProgressPercentage(row?.completionStatus))"
                       :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
        </template>
        <template #picked="{ row }">
          <el-tag :type="row.picked ? 'success' : 'info'"
                  size="small">
            {{ row.picked ? "已领料" : "未领料" }}
          </el-tag>
        </template>
      </PIMTable>
    </div>
@@ -332,6 +344,13 @@
      width: "140",
    },
    {
      label: "生产状态",
      prop: "productionStatus",
      dataType: "slot",
      slot: "productionStatus",
      width: "100",
    },
    {
      label: "完成进度",
      prop: "completionStatus",
      dataType: "slot",
@@ -525,6 +544,26 @@
    },
  });
  const { searchForm } = toRefs(data);
  // 生产状态文字:未领料 → 待生产 → 生产中 → 已生产
  const getProductionStatusText = row => {
    const percent = toProgressPercentage(row?.completionStatus);
    if (percent >= 100) return "已生产";
    if (!row?.picked) return "未领料";
    const completeQty = Number(row?.completeQuantity) || 0;
    if (completeQty > 0) return "生产中";
    return "待生产";
  };
  // 生产状态标签颜色
  const getProductionStatusType = row => {
    const percent = toProgressPercentage(row?.completionStatus);
    if (percent >= 100) return "success";
    if (!row?.picked) return "info";
    const completeQty = Number(row?.completeQuantity) || 0;
    if (completeQty > 0) return "warning";
    return "primary";
  };
  const toProgressPercentage = val => {
    const n = Number(val);
    if (!Number.isFinite(n)) return 0;