重构生产报表表:注释掉未使用的字段,更新详细数据获取逻辑,并增强以选定工单号为依据的导出功能。
已修改1个文件
72 ■■■■■ 文件已修改
src/views/productionManagement/productionReporting/index.vue 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/index.vue
@@ -181,26 +181,26 @@
      prop: "userName",
      width: 120,
    },
    {
      label: "工序",
      prop: "process",
      width: 120,
    },
    {
      label: "工单编号",
      prop: "workOrderNo",
      width: 140,
    },
    {
      label: "销售合同号",
      prop: "salesContractNo",
      width: 140,
    },
    {
      label: "生产订单号",
      prop: "productOrderNpsNo",
      width: 140,
    },
    // {
    //   label: "工序",
    //   prop: "process",
    //   width: 120,
    // },
    // {
    //   label: "工单编号",
    //   prop: "workOrderNo",
    //   width: 140,
    // },
    // {
    //   label: "销售合同号",
    //   prop: "salesContractNo",
    //   width: 140,
    // },
    // {
    //   label: "生产订单号",
    //   prop: "productOrderNpsNo",
    //   width: 140,
    // },
    {
      label: "产品名称",
      prop: "productName",
@@ -212,6 +212,11 @@
      width: 160,
    },
    {
      label: "单位",
      prop: "unit",
      width: 100,
    },
    {
      label: "合格",
      prop: "quantity",
      width: 100,
@@ -221,11 +226,7 @@
      prop: "scrapQty",
      width: 100,
    },
    {
      label: "单位",
      prop: "unit",
      width: 100,
    },
    {
      label: "工序标准工时(小时)",
      prop: "processStandardHours",
@@ -346,10 +347,10 @@
    getDetailList();
  };
  const getDetailList = () => {
    if (!currentDetailRow.value?.id) return;
    if (!currentDetailRow.value?.workOrderId) return;
    detailLoading.value = true;
    productionProductMainListPageDetail({
      id: currentDetailRow.value.id,
      workOrderId: currentDetailRow.value.workOrderId,
      current: detailPage.current,
      size: detailPage.size,
    })
@@ -395,13 +396,26 @@
  // 导出
  const handleOut = () => {
    ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    const workOrderIds = [...new Set(
      (selectedRows.value || [])
        .map(item => item.workOrderId)
        .filter(item => item !== undefined && item !== null && item !== "")
    )];
    const exportParams = {
      ...searchForm.value,
      ...(workOrderIds.length ? { workOrderIds } : {}),
    };
    ElMessageBox.confirm("将导出当前查询结果,勾选数据时仅导出选中内容,是否继续?", "导出", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        proxy.download("/productionProductMain/export", {}, "生产报工.xlsx");
        proxy.download(
          "/productionProductMain/exportDetail",
          exportParams,
          "生产报工.xlsx"
        );
      })
      .catch(() => {
        proxy.$modal.msg("已取消");