gaoluyang
2026-06-16 e65bfa1d46d255f307eaa057665f01c8bde0e122
src/views/productionManagement/productionOrder/index.vue
@@ -192,7 +192,8 @@
        </div>
      </div>
    </el-dialog>
    <MaterialLedgerDialog v-model="materialDialogVisible"
    <!-- 领料/补料/领料详情功能已隐藏 -->
    <!-- <MaterialLedgerDialog v-model="materialDialogVisible"
                          :order-row="currentMaterialOrder"
                          @saved="getList" />
    <MaterialDetailDialog v-model="materialDetailDialogVisible"
@@ -200,16 +201,16 @@
                          @confirmed="getList" />
    <MaterialSupplementDialog v-model="materialSupplementDialogVisible"
                              :order-row="currentMaterialSupplementOrder"
                              @saved="getList" />
                              @saved="getList" /> -->
    <new-product-order v-if="isShowNewModal"
                       v-model:visible="isShowNewModal"
                       @completed="handleQuery" />
    <!-- 打印领料单组件 -->
    <div class="print-requisition-wrapper">
    <!-- 打印领料单功能已隐藏 -->
    <!-- <div class="print-requisition-wrapper">
      <PrintMaterialRequisition ref="printRef"
                                :order-row="printOrderRow"
                                :material-list="printMaterialList" />
    </div>
    </div> -->
  </div>
</template>
@@ -237,16 +238,18 @@
  } from "@/api/productionManagement/productionOrder.js";
  import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js";
  import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
  import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
  import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue";
  import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue";
  import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue";
  // 领料/补料/领料详情/打印领料单功能已隐藏
  // import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
  // import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue";
  // import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue";
  // import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue";
  import PIMTable from "@/components/PIMTable/PIMTable.vue";
  import { listPage } from "@/api/productionManagement/processRoute.js";
  import {
    listMaterialPickingDetail,
    listMaterialPickingBom,
  } from "@/api/productionManagement/productionOrder.js";
  // 领料功能已隐藏
  // import {
  //   listMaterialPickingDetail,
  //   listMaterialPickingBom,
  // } from "@/api/productionManagement/productionOrder.js";
  const NewProductOrder = defineAsyncComponent(() =>
    import("@/views/productionManagement/productionOrder/New.vue")
  );
@@ -398,41 +401,42 @@
            showSourceData(row);
          },
        },
        {
          name: "领料",
          type: "text",
          color: "#5EC7AB",
          showHide: row => !row.endOrder && !row.returned,
          clickFun: row => {
            openMaterialDialog(row);
          },
        },
        {
          name: "补料",
          type: "text",
          color: "#5EC7AB",
          showHide: row => !row.endOrder && !row.returned,
          clickFun: row => {
            openMaterialSupplementDialog(row);
          },
        },
        {
          name: "领料详情",
          type: "text",
          color: "#5EC7AB",
          clickFun: row => {
            openMaterialDetailDialog(row);
          },
        },
        {
          name: "打印领料单",
          type: "text",
          color: "#5EC7AB",
          showHide: row => !row.endOrder,
          clickFun: row => {
            handlePrint(row);
          },
        },
        // 领料/补料/领料详情/打印领料单功能已隐藏
        // {
        //   name: "领料",
        //   type: "text",
        //   color: "#5EC7AB",
        //   showHide: row => !row.endOrder && !row.returned,
        //   clickFun: row => {
        //     openMaterialDialog(row);
        //   },
        // },
        // {
        //   name: "补料",
        //   type: "text",
        //   color: "#5EC7AB",
        //   showHide: row => !row.endOrder && !row.returned,
        //   clickFun: row => {
        //     openMaterialSupplementDialog(row);
        //   },
        // },
        // {
        //   name: "领料详情",
        //   type: "text",
        //   color: "#5EC7AB",
        //   clickFun: row => {
        //     openMaterialDetailDialog(row);
        //   },
        // },
        // {
        //   name: "打印领料单",
        //   type: "text",
        //   color: "#5EC7AB",
        //   showHide: row => !row.endOrder,
        //   clickFun: row => {
        //     handlePrint(row);
        //   },
        // },
        {
          name: "生产追溯",
          type: "text",
@@ -487,7 +491,7 @@
    if (!Number.isFinite(n)) return 0;
    if (n <= 0) return 0;
    if (n >= 100) return 100;
    return Math.round(n);
    return parseFloat(n.toFixed(2));
  };
  // 30/50/80/100 分段颜色:红/橙/蓝/绿
@@ -525,48 +529,48 @@
    orderId: null,
    routeId: null,
  });
  const materialDialogVisible = ref(false);
  const currentMaterialOrder = ref(null);
  const materialDetailDialogVisible = ref(false);
  const currentMaterialDetailOrder = ref(null);
  const materialSupplementDialogVisible = ref(false);
  const currentMaterialSupplementOrder = ref(null);
  // 领料/补料/领料详情功能已隐藏
  // const materialDialogVisible = ref(false);
  // const currentMaterialOrder = ref(null);
  // const materialDetailDialogVisible = ref(false);
  // const currentMaterialDetailOrder = ref(null);
  // const materialSupplementDialogVisible = ref(false);
  // const currentMaterialSupplementOrder = ref(null);
  // 打印相关
  const printOrderRow = ref(null);
  const printMaterialList = ref([]);
  const handlePrint = async row => {
    printOrderRow.value = row;
    proxy.$modal.loading("正在获取领料数据...");
    try {
      printMaterialList.value = [];
      const detailRes = await listMaterialPickingDetail(row.id);
      const detailList = Array.isArray(detailRes?.data)
        ? detailRes.data
        : detailRes?.data?.records || [];
      if (detailList.length > 0) {
        printMaterialList.value = detailList;
      }
      if (printMaterialList.value.length === 0) {
        proxy.$modal.msgWarning("暂无领料数据");
        return;
      }
      // 等待 DOM 更新后执行打印
      proxy.$nextTick(() => {
        setTimeout(() => {
          window.print();
        }, 800);
      });
    } catch (e) {
      console.error("获取领料数据失败:", e);
      proxy.$modal.msgError("获取领料数据失败");
    } finally {
      proxy.$modal.closeLoading();
    }
  };
  // 打印领料单功能已隐藏
  // const printOrderRow = ref(null);
  // const printMaterialList = ref([]);
  // const handlePrint = async row => {
  //   printOrderRow.value = row;
  //   proxy.$modal.loading("正在获取领料数据...");
  //   try {
  //     printMaterialList.value = [];
  //     const detailRes = await listMaterialPickingDetail(row.id);
  //     const detailList = Array.isArray(detailRes?.data)
  //       ? detailRes.data
  //       : detailRes?.data?.records || [];
  //
  //     if (detailList.length > 0) {
  //       printMaterialList.value = detailList;
  //     }
  //
  //     if (printMaterialList.value.length === 0) {
  //       proxy.$modal.msgWarning("暂无领料数据");
  //       return;
  //     }
  //
  //     proxy.$nextTick(() => {
  //       setTimeout(() => {
  //         window.print();
  //       }, 800);
  //     });
  //   } catch (e) {
  //     console.error("获取领料数据失败:", e);
  //     proxy.$modal.msgError("获取领料数据失败");
  //   } finally {
  //     proxy.$modal.closeLoading();
  //   }
  // };
  const openBindRouteDialog = async (row, type) => {
    bindForm.orderId = row.id;
@@ -612,20 +616,21 @@
    }
  };
  const openMaterialDialog = row => {
    currentMaterialOrder.value = row;
    materialDialogVisible.value = true;
  };
  // 领料/补料/领料详情功能已隐藏
  // const openMaterialDialog = row => {
  //   currentMaterialOrder.value = row;
  //   materialDialogVisible.value = true;
  // };
  const openMaterialDetailDialog = async row => {
    currentMaterialDetailOrder.value = row;
    materialDetailDialogVisible.value = true;
  };
  // const openMaterialDetailDialog = async row => {
  //   currentMaterialDetailOrder.value = row;
  //   materialDetailDialogVisible.value = true;
  // };
  const openMaterialSupplementDialog = row => {
    currentMaterialSupplementOrder.value = row;
    materialSupplementDialogVisible.value = true;
  };
  // const openMaterialSupplementDialog = row => {
  //   currentMaterialSupplementOrder.value = row;
  //   materialSupplementDialogVisible.value = true;
  // };
  const handleReset = () => {
    searchForm.value = {
@@ -676,7 +681,6 @@
            try {
              const workOrderRes = await productWorkOrderPage({
                npsNo: item.npsNo,
                isProduction: 1,
                size: 100,
              });
              const workOrders = workOrderRes.data.records || [];
@@ -724,6 +728,7 @@
          bomNo: row.bomNo || "",
          description: data.description || "",
          quantity: row.quantity || 0,
          technologyRoutingId: data.technologyRoutingId,
          orderId,
          type: "order",
          editable: !row.endOrder,