4 天以前 b9b476d4b4f1bf9e08b58249fb42f7b07aa3a0fa
src/views/mes/pro/task/data.ts
@@ -1,7 +1,8 @@
import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { z } from '#/adapter/form';
import { getSimpleUserList } from '#/api/system/user';
import { getSimpleUserListByRoleCode } from '#/api/system/user';
import { getTemplatePage } from '#/api/mes/pro/processdesign/template';
import type { MesProTaskApi } from '#/api/mes/pro/task';
import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
@@ -393,8 +394,21 @@
}
/** 生产任务新增/修改的表单 */
export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] {
export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>, feedbackRole?: Ref<string | undefined>): VbenFormSchema[] {
  return [
    {
      fieldName: 'paramTemplateId',
      label: '工艺参数模板',
      component: 'ApiSelect',
      componentProps: {
        api: () => getTemplatePage({ pageNo: 1, pageSize: 100 }),
        labelField: 'templateName',
        valueField: 'id',
        resultField: 'list',
        allowClear: true,
        placeholder: '请选择工艺参数模板',
      },
    },
    {
      fieldName: 'workstationId',
      label: '工作站',
@@ -475,7 +489,8 @@
      component: 'ApiSelect',
      componentProps: {
        placeholder: '请选择报工人',
        api: getSimpleUserList,
        api: getSimpleUserListByRoleCode,
        params: { code: feedbackRole?.value || 'production_submit_work' },
        labelField: 'nickname',
        valueField: 'id',
        mode: 'multiple',