| | |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | | <el-form-item label="客户名称:"> |
| | | <el-input v-model="searchForm.customerName" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 160px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="合同号:"> |
| | | <el-input v-model="searchForm.salesContractNo" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 160px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称:"> |
| | | <el-input v-model="searchForm.productCategory" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 160px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="规格:"> |
| | | <el-input v-model="searchForm.specificationModel" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-button type="primary" @click="isShowNewModal = true">新增</el-button> |
| | | <el-button type="danger" @click="handleDelete">删除</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | :row-class-name="tableRowClassName" |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="pagination"> |
| | | <template #completionStatus="{ row }"> |
| | | <el-progress |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <new-product-order v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | type="qualified" |
| | | @completed="handleQuery" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | productOrderListPage, |
| | | listProcessRoute, |
| | | bindingRoute, |
| | | listProcessBom, |
| | | listProcessBom, delProductOrder, startOrPause, |
| | | } 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")); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const router = useRouter(); |
| | | const isShowNewModal = ref(false); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | |
| | | width: '120px', |
| | | }, |
| | | { |
| | | label: "销售合同号", |
| | | prop: "salesContractNo", |
| | | width: '150px', |
| | | }, |
| | | { |
| | | label: "客户名称", |
| | | prop: "customerName", |
| | | width: '200px', |
| | | }, |
| | | { |
| | | label: "产品名称", |
| | | prop: "productCategory", |
| | | width: '120px', |
| | | }, |
| | | { |
| | | label: "规格", |
| | | label: "图纸编号", |
| | | prop: "specificationModel", |
| | | width: '120px', |
| | | width: '160px', |
| | | }, |
| | | { |
| | | label: "工艺路线编号", |
| | |
| | | { |
| | | label: "完成数量", |
| | | prop: "completeQuantity", |
| | | }, |
| | | { |
| | | label: "库存数量", |
| | | prop: "inventoryQuantity", |
| | | }, |
| | | { |
| | | dataType: "slot", |
| | |
| | | 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); |
| | |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const selectedRows = ref([]); |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: "", |
| | | salesContractNo: "", |
| | | projectName: "", |
| | | productCategory: "", |
| | | specificationModel: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | |
| | | // 添加表行类名方法 |
| | | const tableRowClassName = ({ row }) => { |
| | | switch (row.deliveryDaysDiff) { |
| | | case 15: |
| | | return 'yellow' |
| | | case 10: |
| | | return 'red' |
| | | case 2: |
| | | return 'purple' |
| | | if (!row.deliveryDate) return ''; |
| | | 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) { |
| | | return 'pink'; |
| | | } else if (diff === 2) { |
| | | return 'purple'; |
| | | } else if (diff < 2) { |
| | | return 'red'; |
| | | } |
| | | }; |
| | | |
| | |
| | | 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: { |
| | | id: data.id, |
| | | processRouteCode: data.processRouteCode || "", |
| | | productName: data.productName || "", |
| | | drawingNumber: data.drawingNumber || "", |
| | | model: data.model || "", |
| | | bomNo: data.bomNo || "", |
| | | description: data.description || "", |
| | |
| | | } |
| | | }; |
| | | |
| | | 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 || "", |
| | | orderId: row.id, |
| | | type: "order", |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // 表格选择数据 |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | delProductOrder(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }); |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | |
| | | align-items: start; |
| | | } |
| | | |
| | | ::v-deep .yellow { |
| | | background-color: #e8b183; |
| | | :deep(.yellow) { |
| | | background-color: #FAF0DE; |
| | | } |
| | | |
| | | ::v-deep .red { |
| | | background-color: #e35050; |
| | | :deep(.pink) { |
| | | background-color: #FAE1DE; |
| | | } |
| | | |
| | | ::v-deep .purple{ |
| | | background-color: #c484dd; |
| | | :deep(.red) { |
| | | background-color: #FFCCCC; |
| | | } |
| | | |
| | | :deep(.purple){ |
| | | background-color: #F4DEFA; |
| | | } |
| | | </style> |