| | |
| | | }, |
| | | { |
| | | field: 'duration', |
| | | title: '生产时长', |
| | | width: 80, |
| | | title: '生产时长(h)', |
| | | width: 120, |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | |
| | | }, |
| | | { |
| | | fieldName: 'duration', |
| | | label: '生产时长', |
| | | label: '生产时长(h)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | |
| | | ]; |
| | | } |
| | | |
| | | /** 计算结束时间:开始时间 + 生产时长 × 8 小时 */ |
| | | /** 计算结束时间:开始时间 + 生产时长(小时) */ |
| | | async function recalcEndTime(formApi?: VbenFormApi) { |
| | | if (!formApi) { |
| | | return; |
| | |
| | | const start = Number(values.startTime); |
| | | await formApi.setFieldValue( |
| | | 'endTime', |
| | | start + values.duration * 8 * 3600 * 1000, |
| | | start + values.duration * 3600 * 1000, |
| | | ); |
| | | } |
| | | } |
| | |
| | | width: 170, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | { field: 'duration', title: '生产时长', width: 100 }, |
| | | { field: 'duration', title: '生产时长(h)', width: 120 }, |
| | | { |
| | | field: 'endTime', |
| | | title: '预计完成时间', |