buhuazhen
2026-05-09 8ef5afed625531bab0e544b853b9568509533c0e
feat(生产管理): 在多个页面表格和筛选器中添加车间字段

- 在工单编辑、工单管理、生产成本、生产报工和生产订单页面的表格列中添加车间显示
- 在生产订单页面添加车间筛选下拉框并调整状态选择器宽度
- 在生产追溯页面添加车间信息展示
- 新增车间数据获取逻辑以支持筛选功能
已修改6个文件
72 ■■■■■ 文件已修改
src/views/productionManagement/productionCosting/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/index.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionTraceability/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrderEdit/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrderManagement/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionCosting/index.vue
@@ -94,6 +94,11 @@
      prop: "schedulingUserName",
      minWidth: 100,
    },
    {
      label: "车间",
      prop: "workshopName",
      minWidth: 100,
    },
    // {
    //   label: "合同号",
    //   prop: "salesContractNo",
src/views/productionManagement/productionOrder/index.vue
@@ -30,7 +30,7 @@
        <el-form-item label="状态:">
          <el-select v-model="searchForm.status"
                     placeholder="请选择"
                     style="width: 160px;"
                     style="width: 100px;"
                     @change="handleQuery">
            <el-option label="待开始"
                       value="1" />
@@ -42,6 +42,19 @@
                       value="4" />
            <el-option label="已结束"
                       value="5" />
          </el-select>
        </el-form-item>
                <el-form-item label="车间:">
          <el-select v-model="searchForm.workshopId"
                     placeholder="请选择车间"
                     clearable
                     filterable
                     @change="handleQuery"
                     style="width: 160px">
            <el-option v-for="item in workshopOptions"
                       :key="item.id"
                       :label="item.name"
                       :value="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item>
@@ -226,6 +239,7 @@
  import { ElMessageBox } from "element-plus";
  import dayjs from "dayjs";
  import { useRouter } from "vue-router";
  import { workshopPage } from "@/api/basicData/workshop.js";
  import {
    productOrderListPage,
    listProcessRoute,
@@ -261,6 +275,7 @@
  const sourcePage = reactive({
    total: 0,
  });
  const workshopOptions = ref([]);
  const processColumnWidth = computed(() => {
    if (!tableData.value || tableData.value.length === 0) return "200px";
@@ -361,7 +376,7 @@
      width: 120,
    },
    {
      label: "车间名称",
      label: "车间",
      prop: "workshopName",
    },
    {
@@ -482,6 +497,7 @@
      productName: "",
      model: "",
      status: "",
      workshopName: ""
    },
  });
  const { searchForm } = toRefs(data);
@@ -519,6 +535,33 @@
      return "red";
    }
  };
  function parseWorkshopPagePayload(res) {
    const payload = res?.data;
    if (!payload) {
      return { records: [], total: 0 };
    }
    if (Array.isArray(payload)) {
      return { records: payload, total: payload.length };
    }
    const records = payload.records ?? payload.list ?? payload.rows ?? [];
    const total = Number(payload.total ?? payload.totalCount ?? 0);
    return { records: Array.isArray(records) ? records : [], total };
  }
  const fetchWorkshopOptions = () => {
    workshopPage({
      name: "",
      principal: "",
      contactPhone: "",
      current: 1,
      size: 999,
    }).then(res => {
      if (res.code === 200) {
        const { records } = parseWorkshopPagePayload(res);
        workshopOptions.value = records;
      }
    });
  };
  // 绑定工艺路线弹框
  const bindRouteDialogVisible = ref(false);
@@ -641,6 +684,7 @@
      productName: "",
      model: "",
      status: "",
      workshopName: "",
    };
    handleQuery();
  };
@@ -848,6 +892,7 @@
  onMounted(() => {
    getList();
    fetchWorkshopOptions();
  });
</script>
src/views/productionManagement/productionReporting/index.vue
@@ -226,13 +226,17 @@
      prop: "unit",
      width: 120,
    },
    {
      label: "创建时间",
      prop: "createTime",
      width: 120,
    },
    {
      label: "车间",
      prop: "workshopName",
      width: 120,
    },
    {
      dataType: "action",
      label: "操作",
      align: "center",
src/views/productionManagement/productionTraceability/index.vue
@@ -49,6 +49,8 @@
                         :status="rowData.productionOrderDto?.completionStatus >= 100 ? 'success' : ''"
                         style="width: 80%;" />
          </el-descriptions-item>
          <el-descriptions-item label="车间">{{rowData.productionOrderDto?.workshopName}}</el-descriptions-item>
        </el-descriptions>
      </div>
      <el-empty v-else
src/views/productionManagement/workOrderEdit/index.vue
@@ -209,6 +209,11 @@
      width: "180",
    },
    {
      label: "车间",
      prop: "workshopName",
      width: "180",
    },
    {
      label: "操作",
      width: "200",
      align: "center",
src/views/productionManagement/workOrderManagement/index.vue
@@ -345,6 +345,11 @@
      width: "140",
    },
    {
      label: "车间",
      prop: "workshopName",
      width: "140",
    },
    {
      label: "操作",
      width: "260",
      align: "center",