11 小时以前 908fae82bbf0476df66c9213b49a8199571e8333
src/views/mes/pro/task/data.ts
@@ -3,6 +3,8 @@
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';
@@ -166,7 +168,7 @@
    },
    {
      title: '操作',
      width: 100,
      width: 160,
      fixed: 'right',
      slots: { default: 'actions' },
    },
@@ -279,7 +281,7 @@
        class: '!w-full',
        disabled: true,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
      },
    },
    {
@@ -376,7 +378,7 @@
}
/** 生产任务新增/修改的表单 */
export function useTaskFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] {
  return [
    {
      fieldName: 'workstationId',
@@ -391,6 +393,7 @@
      fieldName: 'quantity',
      label: '排产数量',
      component: 'InputNumber',
      description: () => workOrderQuantity?.value != null ? `订单数量:${workOrderQuantity.value}` : '',
      componentProps: {
        class: '!w-full',
        min: 0.01,
@@ -412,7 +415,7 @@
        class: '!w-full',
        placeholder: '请选择开始时间',
        showTime: true,
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD HH:mm:ss',
        // 开始时间变更:重新计算结束时间
        onChange: () => recalcEndTime(formApi),
      },
@@ -440,7 +443,7 @@
        class: '!w-full',
        disabled: true,
        showTime: true,
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD HH:mm:ss',
      },
    },
    {