| | |
| | | import type { MesProTaskApi } from '#/api/mes/pro/task'; |
| | | import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder'; |
| | | |
| | | import type { Ref } from 'vue'; |
| | | |
| | | import { markRaw } from 'vue'; |
| | | |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 100, |
| | | width: 160, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | |
| | | class: '!w-full', |
| | | disabled: true, |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | } |
| | | |
| | | /** 生产任务新增/修改的表单 */ |
| | | export function useTaskFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { |
| | | export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'workstationId', |
| | |
| | | fieldName: 'quantity', |
| | | label: '排产数量', |
| | | component: 'InputNumber', |
| | | description: () => workOrderQuantity?.value != null ? `订单数量:${workOrderQuantity.value}` : '', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | min: 0.01, |
| | |
| | | class: '!w-full', |
| | | placeholder: '请选择开始时间', |
| | | showTime: true, |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | // 开始时间变更:重新计算结束时间 |
| | | onChange: () => recalcEndTime(formApi), |
| | | }, |
| | |
| | | class: '!w-full', |
| | | disabled: true, |
| | | showTime: true, |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | }, |
| | | { |