huminmin
2026-05-28 8ef070c84a703c4a8b838bf9320d68d00a7d6dca
src/views/productionManagement/productionOrder/index.vue
@@ -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,15 +336,24 @@
  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 = deepClone( row)