import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';

export const searchFormSchema: FormSchema[] = [
  {
    field: 'dataDate',
    label: '日期',
    component: 'RangePicker',
    componentProps: {
      format: 'YYYY-MM-DD',
      style: { width: '100%' },
      getPopupContainer: () => document.body,
    },
    colProps: { span: 8 },
  },

  {
    field: 'keyword',
    label: '',
    component: 'Input',
    componentProps: {
      pplaceholder: '请输入产品编码或名称',
    },
    colProps: { span: 8 },
  },
];

export const columns: BasicColumn[] = [
  {
    dataIndex: 'workDate',
    title: '报工时间',
    componentType: 'auto-code',

    sorter: true,
  },

  {
    dataIndex: 'userCode',
    title: '人员编码',
    componentType: 'date',

    sorter: true,
  },

  {
    dataIndex: 'userName',
    title: '人员名称',
    componentType: 'input',

    sorter: true,
  },

  {
    dataIndex: 'realEndDate',
    title: '生产日期',
    componentType: 'select',

    sorter: true,
  },
  {
    dataIndex: 'workNo',
    title: '关联工单',
    componentType: 'select',

    sorter: true,
  },
  {
    dataIndex: 'processName',
    title: '报工工序',
    componentType: 'input',
    sorter: true,
    align: 'right',
  },
  {
    dataIndex: 'materialName',
    title: '产品名称',
    componentType: 'user',

    sorter: true,
  },
  {
    dataIndex: 'planNum',
    title: '计划产量',
    componentType: 'textarea',

    sorter: true,
  },
  {
    dataIndex: 'realNum',
    title: '生产数量',
    componentType: 'textarea',

    sorter: true,
  },

  {
    dataIndex: 'samplingNum',
    title: '抽样数量',
    componentType: 'textarea',

    sorter: true,
  },
  {
    dataIndex: 'errorNum',
    title: '不合格数量',
    componentType: 'textarea',

    sorter: true,
  },
  {
    dataIndex: 'errorRate',
    title: '合格率',
    componentType: 'textarea',

    sorter: true,
  },
];
