| | |
| | | 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 |
| | |
| | | { |
| | | 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"); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | 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) |