yyb
17 小时以前 0a142e41b072d72538091f2c7557872e5f930e37
src/views/productionManagement/productionOrder/index.vue
@@ -65,7 +65,8 @@
        </template>
      </PIMTable>
    </div>
    <el-dialog v-model="bindRouteDialogVisible"
    <!-- 工艺路线绑定弹窗暂时注释 -->
    <!-- <el-dialog v-model="bindRouteDialogVisible"
               title="绑定工艺路线"
               width="500px">
      <el-form label-width="90px">
@@ -89,7 +90,7 @@
          <el-button @click="bindRouteDialogVisible = false">取 消</el-button>
        </span>
      </template>
    </el-dialog>
    </el-dialog> -->
    <new-product-order v-if="isShowNewModal"
                         v-model:visible="isShowNewModal"
@@ -104,11 +105,8 @@
  import { useRouter } from "vue-router";
  import {
    productOrderListPage,
    listProcessRoute,
    bindingRoute,
    listProcessBom, delProductOrder,
  } from "@/api/productionManagement/productionOrder.js";
  import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
  import {fileDel} from "@/api/financialManagement/revenueManagement.js";
  import PIMTable from "@/components/PIMTable/PIMTable.vue";
  const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
@@ -144,11 +142,11 @@
      prop: "specificationModel",
      width: '120px',
    },
    {
      label: "工艺路线编号",
      prop: "processRouteCode",
      width: '200px',
    },
    // {
    //   label: "工艺路线编号",
    //   prop: "processRouteCode",
    //   width: '200px',
    // },
    {
      label: "需求数量",
      prop: "quantity",
@@ -182,37 +180,37 @@
      formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
      width: 120,
    },
    {
      dataType: "action",
      label: "操作",
      align: "center",
      fixed: "right",
      width: 200,
      operation: [
        {
          name: "工艺路线",
          type: "text",
          clickFun: row => {
            showRouteItemModal(row);
          },
        },
        {
          name: "绑定工艺路线",
          type: "text",
          showHide: row => !row.processRouteCode,
          clickFun: row => {
            openBindRouteDialog(row);
          },
        },
        {
          name: "产品结构",
          type: "text",
          clickFun: row => {
            showProductStructure(row);
          },
        },
      ],
    },
   // {
   //   dataType: "action",
   //   label: "操作",
   //   align: "center",
   //   fixed: "right",
   //   width: 200,
   //   operation: [
        // {
        //   name: "工艺路线",
        //   type: "text",
        //   clickFun: row => {
        //     showRouteItemModal(row);
        //   },
        // },
        // {
        //   name: "绑定工艺路线",
        //   type: "text",
        //   showHide: row => !row.processRouteCode,
        //   clickFun: row => {
        //     openBindRouteDialog(row);
        //   },
        // },
        // {
        //   name: "产品结构",
        //   type: "text",
        //   clickFun: row => {
        //     showProductStructure(row);
        //   },
        // },
      //],
    //},
  ]);
  const tableData = ref([]);
  const tableLoading = ref(false);
@@ -268,59 +266,59 @@
    }
  };
  // 绑定工艺路线弹框
  const bindRouteDialogVisible = ref(false);
  const bindRouteLoading = ref(false);
  const bindRouteSaving = ref(false);
  const routeOptions = ref([]);
  const bindForm = reactive({
    orderId: null,
    routeId: null,
  });
  // 工艺路线绑定功能暂时注释
  // const bindRouteDialogVisible = ref(false);
  // const bindRouteLoading = ref(false);
  // const bindRouteSaving = ref(false);
  // const routeOptions = ref([]);
  // const bindForm = reactive({
  //   orderId: null,
  //   routeId: null,
  // });
  const openBindRouteDialog = async row => {
    bindForm.orderId = row.id;
    bindForm.routeId = null;
    bindRouteDialogVisible.value = true;
    routeOptions.value = [];
    if (!row.productModelId) {
      proxy.$modal.msgWarning("当前订单缺少产品型号,无法查询工艺路线");
      bindRouteDialogVisible.value = false;
      return;
    }
    bindRouteLoading.value = true;
    try {
      const res = await listProcessRoute({ productModelId: row.productModelId });
      routeOptions.value = res.data || [];
    } catch (e) {
      console.error("获取工艺路线列表失败:", e);
      proxy.$modal.msgError("获取工艺路线列表失败");
    } finally {
      bindRouteLoading.value = false;
    }
  };
  // const openBindRouteDialog = async row => {
  //   bindForm.orderId = row.id;
  //   bindForm.routeId = null;
  //   bindRouteDialogVisible.value = true;
  //   routeOptions.value = [];
  //   if (!row.productModelId) {
  //     proxy.$modal.msgWarning("当前订单缺少产品型号,无法查询工艺路线");
  //     bindRouteDialogVisible.value = false;
  //     return;
  //   }
  //   bindRouteLoading.value = true;
  //   try {
  //     const res = await listProcessRoute({ productModelId: row.productModelId });
  //     routeOptions.value = res.data || [];
  //   } catch (e) {
  //     console.error("获取工艺路线列表失败:", e);
  //     proxy.$modal.msgError("获取工艺路线列表失败");
  //   } finally {
  //     bindRouteLoading.value = false;
  //   }
  // };
  const handleBindRouteConfirm = async () => {
    if (!bindForm.routeId) {
      proxy.$modal.msgWarning("请选择工艺路线");
      return;
    }
    bindRouteSaving.value = true;
    try {
      await bindingRoute({
        id: bindForm.orderId,
        routeId: bindForm.routeId,
      });
      proxy.$modal.msgSuccess("绑定成功");
      bindRouteDialogVisible.value = false;
      getList();
    } catch (e) {
      console.error("绑定工艺路线失败:", e);
      proxy.$modal.msgError("绑定工艺路线失败");
    } finally {
      bindRouteSaving.value = false;
    }
  };
  // const handleBindRouteConfirm = async () => {
  //   if (!bindForm.routeId) {
  //     proxy.$modal.msgWarning("请选择工艺路线");
  //     return;
  //   }
  //   bindRouteSaving.value = true;
  //   try {
  //     await bindingRoute({
  //       id: bindForm.orderId,
  //       routeId: bindForm.routeId,
  //     });
  //     proxy.$modal.msgSuccess("绑定成功");
  //     bindRouteDialogVisible.value = false;
  //     getList();
  //   } catch (e) {
  //     console.error("绑定工艺路线失败:", e);
  //     proxy.$modal.msgError("绑定工艺路线失败");
  //   } finally {
  //     bindRouteSaving.value = false;
  //   }
  // };
  // 查询列表
  /** 搜索按钮操作 */
@@ -359,33 +357,34 @@
      });
  };
  const showRouteItemModal = async row => {
    const orderId = row.id;
    try {
      const res = await getOrderProcessRouteMain(orderId);
      const data = res.data || {};
      if (!data || !data.id) {
        proxy.$modal.msgWarning("未找到关联的工艺路线");
        return;
      }
      router.push({
        path: "/productionManagement/processRouteItem",
        query: {
          id: data.id,
          processRouteCode: data.processRouteCode || "",
          productName: data.productName || "",
          model: data.model || "",
          bomNo: data.bomNo || "",
          description: data.description || "",
          orderId,
          type: "order",
        },
      });
    } catch (e) {
      console.error("获取工艺路线主信息失败:", e);
      proxy.$modal.msgError("获取工艺路线信息失败");
    }
  };
  // 工艺路线详情入口暂时注释
  // const showRouteItemModal = async row => {
  //   const orderId = row.id;
  //   try {
  //     const res = await getOrderProcessRouteMain(orderId);
  //     const data = res.data || {};
  //     if (!data || !data.id) {
  //       proxy.$modal.msgWarning("未找到关联的工艺路线");
  //       return;
  //     }
  //     router.push({
  //       path: "/productionManagement/processRouteItem",
  //       query: {
  //         id: data.id,
  //         processRouteCode: data.processRouteCode || "",
  //         productName: data.productName || "",
  //         model: data.model || "",
  //         bomNo: data.bomNo || "",
  //         description: data.description || "",
  //         orderId,
  //         type: "order",
  //       },
  //     });
  //   } catch (e) {
  //     console.error("获取工艺路线主信息失败:", e);
  //     proxy.$modal.msgError("获取工艺路线信息失败");
  //   }
  // };
  const showProductStructure = row => {
    router.push({
@@ -470,4 +469,7 @@
:deep(.purple){
  background-color: #F4DEFA;
}
.table_list {
   margin-top: unset;
}
</style>