feat(workorder): 添加工序投料BOM明细展开功能
- 在工单工序表格中添加展开列以显示BOM明细
- 定义ProcessBomItem接口用于存储投料明细数据
- 在工艺路线工序和工单工序API中添加bomItems字段
- 实现展开面板显示工序对应的投料明细信息
- 使用标签组件展示每个BOM项目的名称和数量
| | |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | export namespace MesProRouteProcessApi { |
| | | /** 工序投料BOM明细 */ |
| | | export interface ProcessBomItem { |
| | | itemId?: number; |
| | | itemCode?: string; |
| | | itemName?: string; |
| | | quantity?: number; |
| | | remark?: string; |
| | | } |
| | | |
| | | /** MES 工艺路线工序 */ |
| | | export interface RouteProcess { |
| | | id?: number; |
| | |
| | | outputItemCode?: string; |
| | | outputItemName?: string; |
| | | remark?: string; |
| | | bomItems?: ProcessBomItem[]; |
| | | createTime?: Date; |
| | | } |
| | | } |
| | |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | export namespace MesProWorkOrderProcessApi { |
| | | /** 工序投料BOM明细 */ |
| | | export interface ProcessBomItem { |
| | | itemId?: number; |
| | | itemCode?: string; |
| | | itemName?: string; |
| | | quantity?: number; |
| | | remark?: string; |
| | | } |
| | | |
| | | /** MES 生产工单工序 */ |
| | | export interface WorkOrderProcess { |
| | | id?: number; // 编号 |
| | |
| | | outputItemId?: number; // 产出产品物料编号 |
| | | outputItemCode?: string; // 产出产品物料编码 |
| | | outputItemName?: string; // 产出产品物料名称 |
| | | bomItems?: ProcessBomItem[]; // 工序投料BOM明细 |
| | | remark?: string; // 备注 |
| | | } |
| | | } |
| | |
| | | ] |
| | | : []), |
| | | { |
| | | type: 'expand', |
| | | width: 50, |
| | | } as const, |
| | | { |
| | | field: 'sort', |
| | | title: '序号', |
| | | width: 80, |
| | |
| | | outputItemCode: item.outputItemCode, |
| | | outputItemName: item.outputItemName, |
| | | remark: item.remark, |
| | | bomItems: item.bomItems, |
| | | })); |
| | | } |
| | | } else { |
| | |
| | | ]" |
| | | /> |
| | | </template> |
| | | <template #expand="{ row }"> |
| | | <div |
| | | v-if="row.bomItems && row.bomItems.length > 0" |
| | | class="bg-gray-50 px-8 py-3" |
| | | > |
| | | <div class="text-xs text-gray-500 mb-2 font-medium">投料明细</div> |
| | | <div class="flex flex-wrap gap-2"> |
| | | <Tag |
| | | v-for="(bom, idx) in row.bomItems" |
| | | :key="idx" |
| | | color="blue" |
| | | > |
| | | {{ bom.itemName || bom.itemCode }} |
| | | <span class="text-gray-400 ml-1">×{{ bom.quantity }}</span> |
| | | </Tag> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </Grid> |
| | | </div> |
| | | </template> |