| | |
| | | <script lang="ts" setup> |
| | | <script lang="ts" setup> |
| | | import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder'; |
| | | import type { MesProWorkOrderProcessApi } from '#/api/mes/pro/workorder/process'; |
| | | |
| | |
| | | message.warning('当前订单未配置工序,请先在工单中维护工序信息'); |
| | | return; |
| | | } |
| | | // 确定工艺路线ID:工单路线 → 产品路线 |
| | | let tempRouteId = 0; |
| | | if (workOrder.value?.routeId) { |
| | | tempRouteId = workOrder.value.routeId; |
| | | } else { |
| | | const processes = await getRouteProcessListByProduct(productId); |
| | | tempRouteId = processes?.[0]?.routeId ?? 0; |
| | | } |
| | | currentRouteId.value = tempRouteId; |
| | | |
| | | routeProcessList.value = [...woProcesses].toSorted( |
| | | (a, b) => (a.sort ?? 0) - (b.sort ?? 0), |
| | | ); |
| | | // 确定工艺路线ID:工单路线 → 产品路线 |
| | | if (workOrder.value?.routeId) { |
| | | currentRouteId.value = workOrder.value.routeId; |
| | | } else { |
| | | const processes = await getRouteProcessListByProduct(productId); |
| | | currentRouteId.value = processes?.[0]?.routeId ?? 0; |
| | | } |
| | | } |
| | | |
| | | /** 完成订单 */ |
| | |
| | | :title="rp.processName" |
| | | /> |
| | | </Steps> |
| | | <Card |
| | | v-for="(rp, index) in routeProcessList" |
| | | v-show="activeProcessStep === index" |
| | | :key="rp.processId" |
| | | class="mx-4" |
| | | > |
| | | <TaskList |
| | | :color-code="rp.colorCode" |
| | | :disabled="isReadonly" |
| | | :item-id="rp.outputItemId || workOrder.productId" |
| | | :process-id="rp.processId!" |
| | | :route-id="currentRouteId" |
| | | :work-order-id="workOrder.id!" |
| | | :work-order-quantity="workOrder.quantity" |
| | | /> |
| | | </Card> |
| | | <template v-for="(rp, index) in routeProcessList" :key="rp.processId"> |
| | | <Card |
| | | v-if="activeProcessStep === index" |
| | | class="mx-4" |
| | | > |
| | | <TaskList |
| | | :color-code="rp.colorCode" |
| | | :disabled="isReadonly" |
| | | :item-id="rp.outputItemId || workOrder.productId" |
| | | :process-id="rp.processId!" |
| | | :route-id="currentRouteId" |
| | | :work-order-id="workOrder.id!" |
| | | :work-order-quantity="workOrder.quantity" |
| | | /> |
| | | </Card> |
| | | </template> |
| | | </template> |
| | | <template #prepend-footer> |
| | | <div class="flex flex-auto items-center gap-2"> |