gaoluyang
2 天以前 36b909e117c3ccc22dd266a94479e2a02335d261
src/views/productionManagement/productionOrder/index.vue
@@ -83,7 +83,7 @@
    productOrderListPage,
    listProcessRoute,
    bindingRoute,
    listProcessBom, delProductOrder,
    listProcessBom, delProductOrder, startOrPause,
  } from "@/api/productionManagement/productionOrder.js";
  import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
  import {fileDel} from "@/api/financialManagement/revenueManagement.js";
@@ -158,8 +158,24 @@
      label: "操作",
      align: "center",
      fixed: "right",
      width: 200,
      width: 240,
      operation: [
        {
          name: "开始",
          type: "text",
          showHide: row => row.status === '待生产',
          clickFun: row => {
            handleStartOrPause(row);
          },
        },
        {
          name: "暂停",
          type: "text",
          showHide: row => row.status === '生产中',
          clickFun: row => {
            handleStartOrPause(row);
          },
        },
        {
          name: "工艺路线",
          type: "text",
@@ -176,7 +192,7 @@
          },
        },
        {
          name: "产品结构",
          name: "物料清单",
          type: "text",
          clickFun: row => {
            showProductStructure(row);
@@ -225,6 +241,8 @@
    if (row.isFh) return '';
    const diff = row.deliveryDaysDiff;
    if (diff === undefined || diff === null || diff === '' || diff < 0) return '';
    if (diff === 15) {
      return 'yellow';
    } else if (diff === 10) {
@@ -331,11 +349,12 @@
    const orderId = row.id;
    try {
      const res = await getOrderProcessRouteMain(orderId);
      const data = res.data || {};
      if (!data || !data.id) {
      const dataList = res.data || [];
      if (!dataList || dataList.length === 0 || !dataList[0].id) {
        proxy.$modal.msgWarning("未找到关联的工艺路线");
        return;
      }
      const data = dataList[0];
      router.push({
        path: "/productionManagement/processRouteItem",
        query: {
@@ -356,12 +375,37 @@
    }
  };
  const showProductStructure = row => {
  const handleStartOrPause = async (row) => {
    const operation = row.status === '待生产' ? 1 : 2;
    const operationText = operation === 1 ? "开始" : "暂停";
    try {
      await startOrPause({ id: row.id, operation });
      proxy.$modal.msgSuccess(`${operationText}成功`);
      getList();
    } catch (e) {
      console.error(`${operationText}失败:`, e);
      proxy.$modal.msgError(`${operationText}失败`);
    }
  };
  const showProductStructure = async row => {
    let bomNo = row.bomNo || "";
    if (!bomNo && row.id) {
      try {
        const res = await getOrderProcessRouteMain(row.id);
        const dataList = res.data || [];
        if (dataList && dataList.length > 0 && dataList[0].bomNo) {
          bomNo = dataList[0].bomNo;
        }
      } catch (e) {
        console.error("获取BOM编号失败:", e);
      }
    }
    router.push({
      path: "/productionManagement/productStructureDetail",
      query: {
        id: row.id,
        bomNo: row.bomNo || "",
        bomNo: bomNo,
        drawingNumber: row.drawingNumber || "",
        productName: row.productCategory || "",
        productModelName: row.specificationModel || "",
@@ -434,7 +478,7 @@
}
:deep(.red) {
  background-color: #f80202;
  background-color: #FFCCCC;
}
:deep(.purple){