| | |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <el-dialog v-model="bindRouteDialogVisible" |
| | | <!-- 工艺路线绑定弹窗暂时注释 --> |
| | | <!-- <el-dialog v-model="bindRouteDialogVisible" |
| | | title="绑定工艺路线" |
| | | width="500px"> |
| | | <el-form label-width="90px"> |
| | |
| | | <el-button @click="bindRouteDialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </el-dialog> --> |
| | | |
| | | <new-product-order v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | |
| | | 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")); |
| | |
| | | prop: "specificationModel", |
| | | width: '120px', |
| | | }, |
| | | { |
| | | label: "工艺路线编号", |
| | | prop: "processRouteCode", |
| | | width: '200px', |
| | | }, |
| | | // { |
| | | // label: "工艺路线编号", |
| | | // prop: "processRouteCode", |
| | | // width: '200px', |
| | | // }, |
| | | { |
| | | label: "需求数量", |
| | | prop: "quantity", |
| | |
| | | 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); |
| | |
| | | } |
| | | }; |
| | | |
| | | // 绑定工艺路线弹框 |
| | | 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; |
| | | // } |
| | | // }; |
| | | |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | |
| | | }); |
| | | }; |
| | | |
| | | 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({ |
| | |
| | | :deep(.purple){ |
| | | background-color: #F4DEFA; |
| | | } |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | </style> |