| | |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { getProcessSimpleList } from '#/api/mes/pro/process'; |
| | | import { getProcess, getProcessSimpleList } from '#/api/mes/pro/process'; |
| | | import { |
| | | createRouteProcess, |
| | | getRouteProcess, |
| | |
| | | wrapperClass: 'grid-cols-2', |
| | | }); |
| | | |
| | | /** 选择工序后,自动带出该工序配置的等待时长(直接填小时数,不换算) */ |
| | | async function handleProcessChange(processId?: number) { |
| | | if (!processId) { |
| | | return; |
| | | } |
| | | try { |
| | | const process = await getProcess(processId); |
| | | await formApi.setFieldValue('waitTime', process.waitDuration ?? 0); |
| | | } catch { |
| | | // 工序详情获取失败时忽略反显 |
| | | } |
| | | } |
| | | |
| | | /** 加载工序选项后再生成 schema(避免下拉空选项) */ |
| | | async function loadSchema(): Promise<VbenFormSchema[]> { |
| | | const list = await getProcessSimpleList(); |
| | |
| | | label: item.name ?? '', |
| | | value: item.id!, |
| | | })); |
| | | return useRouteProcessFormSchema(options); |
| | | return useRouteProcessFormSchema(options, handleProcessChange); |
| | | } |
| | | |
| | | const [Modal, modalApi] = useVbenModal({ |