| | |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <MaterialLedgerDialog v-model="materialDialogVisible" |
| | | <!-- 领料/补料/领料详情功能已隐藏 --> |
| | | <!-- <MaterialLedgerDialog v-model="materialDialogVisible" |
| | | :order-row="currentMaterialOrder" |
| | | @saved="getList" /> |
| | | <MaterialDetailDialog v-model="materialDetailDialogVisible" |
| | |
| | | @confirmed="getList" /> |
| | | <MaterialSupplementDialog v-model="materialSupplementDialogVisible" |
| | | :order-row="currentMaterialSupplementOrder" |
| | | @saved="getList" /> |
| | | @saved="getList" /> --> |
| | | <new-product-order v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | @completed="handleQuery" /> |
| | | <!-- 打印领料单组件 --> |
| | | <div class="print-requisition-wrapper"> |
| | | <!-- 打印领料单功能已隐藏 --> |
| | | <!-- <div class="print-requisition-wrapper"> |
| | | <PrintMaterialRequisition ref="printRef" |
| | | :order-row="printOrderRow" |
| | | :material-list="printMaterialList" /> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js"; |
| | | import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | | import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue"; |
| | | import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue"; |
| | | import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue"; |
| | | // 领料/补料/领料详情/打印领料单功能已隐藏 |
| | | // import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | | // import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue"; |
| | | // import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue"; |
| | | // import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { listPage } from "@/api/productionManagement/processRoute.js"; |
| | | import { |
| | | listMaterialPickingDetail, |
| | | listMaterialPickingBom, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | // 领料功能已隐藏 |
| | | // import { |
| | | // listMaterialPickingDetail, |
| | | // listMaterialPickingBom, |
| | | // } from "@/api/productionManagement/productionOrder.js"; |
| | | const NewProductOrder = defineAsyncComponent(() => |
| | | import("@/views/productionManagement/productionOrder/New.vue") |
| | | ); |
| | |
| | | showSourceData(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "领料", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | openMaterialDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "补料", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | openMaterialSupplementDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "领料详情", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | clickFun: row => { |
| | | openMaterialDetailDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "打印领料单", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | handlePrint(row); |
| | | }, |
| | | }, |
| | | // 领料/补料/领料详情/打印领料单功能已隐藏 |
| | | // { |
| | | // name: "领料", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // showHide: row => !row.endOrder && !row.returned, |
| | | // clickFun: row => { |
| | | // openMaterialDialog(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "补料", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // showHide: row => !row.endOrder && !row.returned, |
| | | // clickFun: row => { |
| | | // openMaterialSupplementDialog(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "领料详情", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // clickFun: row => { |
| | | // openMaterialDetailDialog(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "打印领料单", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // showHide: row => !row.endOrder, |
| | | // clickFun: row => { |
| | | // handlePrint(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "生产追溯", |
| | | type: "text", |
| | |
| | | if (!Number.isFinite(n)) return 0; |
| | | if (n <= 0) return 0; |
| | | if (n >= 100) return 100; |
| | | return Math.round(n); |
| | | return parseFloat(n.toFixed(2)); |
| | | }; |
| | | |
| | | // 30/50/80/100 分段颜色:红/橙/蓝/绿 |
| | |
| | | orderId: null, |
| | | routeId: null, |
| | | }); |
| | | const materialDialogVisible = ref(false); |
| | | const currentMaterialOrder = ref(null); |
| | | const materialDetailDialogVisible = ref(false); |
| | | const currentMaterialDetailOrder = ref(null); |
| | | const materialSupplementDialogVisible = ref(false); |
| | | const currentMaterialSupplementOrder = ref(null); |
| | | // 领料/补料/领料详情功能已隐藏 |
| | | // const materialDialogVisible = ref(false); |
| | | // const currentMaterialOrder = ref(null); |
| | | // const materialDetailDialogVisible = ref(false); |
| | | // const currentMaterialDetailOrder = ref(null); |
| | | // const materialSupplementDialogVisible = ref(false); |
| | | // const currentMaterialSupplementOrder = ref(null); |
| | | |
| | | // 打印相关 |
| | | const printOrderRow = ref(null); |
| | | const printMaterialList = ref([]); |
| | | const handlePrint = async row => { |
| | | printOrderRow.value = row; |
| | | proxy.$modal.loading("正在获取领料数据..."); |
| | | try { |
| | | printMaterialList.value = []; |
| | | const detailRes = await listMaterialPickingDetail(row.id); |
| | | const detailList = Array.isArray(detailRes?.data) |
| | | ? detailRes.data |
| | | : detailRes?.data?.records || []; |
| | | |
| | | if (detailList.length > 0) { |
| | | printMaterialList.value = detailList; |
| | | } |
| | | |
| | | if (printMaterialList.value.length === 0) { |
| | | proxy.$modal.msgWarning("暂无领料数据"); |
| | | return; |
| | | } |
| | | |
| | | // 等待 DOM 更新后执行打印 |
| | | proxy.$nextTick(() => { |
| | | setTimeout(() => { |
| | | window.print(); |
| | | }, 800); |
| | | }); |
| | | } catch (e) { |
| | | console.error("获取领料数据失败:", e); |
| | | proxy.$modal.msgError("获取领料数据失败"); |
| | | } finally { |
| | | proxy.$modal.closeLoading(); |
| | | } |
| | | }; |
| | | // 打印领料单功能已隐藏 |
| | | // const printOrderRow = ref(null); |
| | | // const printMaterialList = ref([]); |
| | | // const handlePrint = async row => { |
| | | // printOrderRow.value = row; |
| | | // proxy.$modal.loading("正在获取领料数据..."); |
| | | // try { |
| | | // printMaterialList.value = []; |
| | | // const detailRes = await listMaterialPickingDetail(row.id); |
| | | // const detailList = Array.isArray(detailRes?.data) |
| | | // ? detailRes.data |
| | | // : detailRes?.data?.records || []; |
| | | // |
| | | // if (detailList.length > 0) { |
| | | // printMaterialList.value = detailList; |
| | | // } |
| | | // |
| | | // if (printMaterialList.value.length === 0) { |
| | | // proxy.$modal.msgWarning("暂无领料数据"); |
| | | // return; |
| | | // } |
| | | // |
| | | // proxy.$nextTick(() => { |
| | | // setTimeout(() => { |
| | | // window.print(); |
| | | // }, 800); |
| | | // }); |
| | | // } catch (e) { |
| | | // console.error("获取领料数据失败:", e); |
| | | // proxy.$modal.msgError("获取领料数据失败"); |
| | | // } finally { |
| | | // proxy.$modal.closeLoading(); |
| | | // } |
| | | // }; |
| | | |
| | | const openBindRouteDialog = async (row, type) => { |
| | | bindForm.orderId = row.id; |
| | | bindForm.routeId = type === "add" ? null : row.processRouteCode; |
| | | bindForm.routeId = type === "add" ? null : row.technologyRoutingId; |
| | | bindRouteDialogVisible.value = true; |
| | | routeOptions.value = []; |
| | | if (!row.productModelId) { |
| | |
| | | } |
| | | }; |
| | | |
| | | const openMaterialDialog = row => { |
| | | currentMaterialOrder.value = row; |
| | | materialDialogVisible.value = true; |
| | | }; |
| | | // 领料/补料/领料详情功能已隐藏 |
| | | // const openMaterialDialog = row => { |
| | | // currentMaterialOrder.value = row; |
| | | // materialDialogVisible.value = true; |
| | | // }; |
| | | |
| | | const openMaterialDetailDialog = async row => { |
| | | currentMaterialDetailOrder.value = row; |
| | | materialDetailDialogVisible.value = true; |
| | | }; |
| | | // const openMaterialDetailDialog = async row => { |
| | | // currentMaterialDetailOrder.value = row; |
| | | // materialDetailDialogVisible.value = true; |
| | | // }; |
| | | |
| | | const openMaterialSupplementDialog = row => { |
| | | currentMaterialSupplementOrder.value = row; |
| | | materialSupplementDialogVisible.value = true; |
| | | }; |
| | | // const openMaterialSupplementDialog = row => { |
| | | // currentMaterialSupplementOrder.value = row; |
| | | // materialSupplementDialogVisible.value = true; |
| | | // }; |
| | | |
| | | const handleReset = () => { |
| | | searchForm.value = { |
| | |
| | | bomNo: row.bomNo || "", |
| | | description: data.description || "", |
| | | quantity: row.quantity || 0, |
| | | technologyRoutingId: data.technologyRoutingId, |
| | | orderId, |
| | | type: "order", |
| | | editable: !row.endOrder, |
| | |
| | | }) |
| | | .then(() => { |
| | | proxy.download( |
| | | "/productOrder/export", |
| | | "/productionOrder/export", |
| | | { ...searchForm.value }, |
| | | "生产订单.xlsx" |
| | | "生产订单数据.xlsx" |
| | | ); |
| | | }) |
| | | .catch(() => { |