zhangwencui
2026-06-23 ed7a42835a7aec7582d8a64ba7e3a3314fdc514e
src/views/productionManagement/productionOrder/index.vue
@@ -93,6 +93,7 @@
  viewGetByProductWordId,
  exportProductInventory
} from "@/api/productionManagement/productionOrder.js";
import { deepClone } from "@/utils/index.js"
import {listMain as getOrderProcessRouteMain} from "@/api/productionManagement/productProcessRoute.js";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import BindRouteDialog from "./BindRouteDialog.vue";
@@ -103,7 +104,6 @@
const router = useRouter();
const isShowNewModal = ref(false);
const MOCK_MODE = true;
const loading = ref(false)
const dialogVisible = ref(false)
@@ -111,7 +111,11 @@
const BindRouteDialogRef = ref(null)
const handleBindRouteSubmit = async (data) => {
  const res = await saveProductionProductInput(data)
  const payload = { ...(data || {}) }
  if (bindDialogType.value === "edit" && !payload.id) {
    payload.id = rowData.value?.printId || rowData.value?.id || null
  }
  const res = await saveProductionProductInput(payload)
  if (res.code === 200) {
    proxy.$modal.msgSuccess("绑定成功");
    bindRouteDialogVisible.value = false
@@ -229,9 +233,17 @@
      {
        name: "查看工艺路线",
        type: "text",
        showHide: row => row.printId,
        showHide: row => row.printId && Number(row?.hasProduct) > 0,
        clickFun: row => {
          openBindRouteDialog(row, "view");
        },
      },
      {
        name: "修改工艺路线",
        type: "text",
        showHide: row => row.printId && !(Number(row?.hasProduct) > 0),
        clickFun: row => {
          openBindRouteDialog(row, "edit");
        },
      },
      {
@@ -324,19 +336,27 @@
  bindRouteLoading.value = true;
  try {
    BindRouteDialogRef.value?.resetForm?.()
    if (type === "view") {
      bindDialogType.value = "detail"
    if (type === "view" || type === "edit") {
      bindDialogType.value = type === "view" ? "detail" : "edit"
      const res = await viewGetByProductWordId(row.id)
      if (res?.cuttingFileVo?.id == null) {
        res.cuttingFileVo = []
      const detail = res?.data || res || {}
      if (detail?.cuttingFileVo?.id == null) {
        detail.cuttingFileVo = []
      } else {
        res.cuttingFileVo = [res.cuttingFileVo]
        detail.cuttingFileVo = [detail.cuttingFileVo]
      }
      rowData.value = res?.data || res
      if (detail.productOrderId == null) {
        detail.productOrderId = row.id
      }
      if (type === "edit" && (detail.id == null || detail.id === "") && row?.printId) {
        detail.id = row.printId
      }
      rowData.value = detail
    } else {
      bindDialogType.value = "add"
      rowData.value = row
      rowData.value.finishedSize = row.specificationModel
      rowData.value = deepClone( row)
    }
    bindRouteDialogVisible.value = true;
  } catch (e) {