| | |
| | | productOrderListPage, |
| | | listProcessRoute, |
| | | bindingRoute, |
| | | listProcessBom, delProductOrder, |
| | | listProcessBom, delProductOrder, startOrPause, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import {fileDel} from "@/api/financialManagement/revenueManagement.js"; |
| | |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 200, |
| | | width: 240, |
| | | operation: [ |
| | | { |
| | | name: "开始", |
| | | type: "text", |
| | | showHide: row => row.status === '待生产', |
| | | clickFun: row => { |
| | | handleStartOrPause(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "暂停", |
| | | type: "text", |
| | | showHide: row => row.status === '生产中', |
| | | clickFun: row => { |
| | | handleStartOrPause(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "工艺路线", |
| | | type: "text", |
| | |
| | | }, |
| | | }, |
| | | { |
| | | name: "产品结构", |
| | | name: "物料清单", |
| | | type: "text", |
| | | clickFun: row => { |
| | | showProductStructure(row); |
| | |
| | | if (row.isFh) return ''; |
| | | |
| | | const diff = row.deliveryDaysDiff; |
| | | if (diff === undefined || diff === null || diff === '' || diff < 0) return ''; |
| | | |
| | | if (diff === 15) { |
| | | return 'yellow'; |
| | | } else if (diff === 10) { |
| | |
| | | const orderId = row.id; |
| | | try { |
| | | const res = await getOrderProcessRouteMain(orderId); |
| | | const data = res.data || {}; |
| | | if (!data || !data.id) { |
| | | const dataList = res.data || []; |
| | | if (!dataList || dataList.length === 0 || !dataList[0].id) { |
| | | proxy.$modal.msgWarning("未找到关联的工艺路线"); |
| | | return; |
| | | } |
| | | const data = dataList[0]; |
| | | router.push({ |
| | | path: "/productionManagement/processRouteItem", |
| | | query: { |
| | |
| | | } |
| | | }; |
| | | |
| | | const showProductStructure = row => { |
| | | const handleStartOrPause = async (row) => { |
| | | const operation = row.status === '待生产' ? 1 : 2; |
| | | const operationText = operation === 1 ? "开始" : "暂停"; |
| | | try { |
| | | await startOrPause({ id: row.id, operation }); |
| | | proxy.$modal.msgSuccess(`${operationText}成功`); |
| | | getList(); |
| | | } catch (e) { |
| | | console.error(`${operationText}失败:`, e); |
| | | proxy.$modal.msgError(`${operationText}失败`); |
| | | } |
| | | }; |
| | | |
| | | const showProductStructure = async row => { |
| | | let bomNo = row.bomNo || ""; |
| | | if (!bomNo && row.id) { |
| | | try { |
| | | const res = await getOrderProcessRouteMain(row.id); |
| | | const dataList = res.data || []; |
| | | if (dataList && dataList.length > 0 && dataList[0].bomNo) { |
| | | bomNo = dataList[0].bomNo; |
| | | } |
| | | } catch (e) { |
| | | console.error("获取BOM编号失败:", e); |
| | | } |
| | | } |
| | | router.push({ |
| | | path: "/productionManagement/productStructureDetail", |
| | | query: { |
| | | id: row.id, |
| | | bomNo: row.bomNo || "", |
| | | bomNo: bomNo, |
| | | drawingNumber: row.drawingNumber || "", |
| | | productName: row.productCategory || "", |
| | | productModelName: row.specificationModel || "", |
| | |
| | | } |
| | | |
| | | :deep(.red) { |
| | | background-color: #f80202; |
| | | background-color: #FFCCCC; |
| | | } |
| | | |
| | | :deep(.purple){ |