import {FilterGroupMap, MapValue} from '@components';
import {contextState} from '../context';

export const sourceMap: FilterGroupMap<typeof contextState> = new Map([
  [
    '1',
    {
      label: '所属公司',
      type: 'keySelect',
      selectKey: '公司',
      value: 'companyCode',
    },
  ],
  [
    '2',
    {
      label: '领用部门',
      type: 'keySelect',
      selectKey: '部门字典',
      value: 'departmentCode',
    },
  ],
  ['3', {label: '移动类型', type: 'field', value: 'moveType'}],
  ['4', {label: '来源类型', type: 'field', value: 'sourceType'}],
  ['5', {label: '分录号', type: 'field', value: 'entryNumber'}],
  ['6', {label: 'WBS编号', type: 'field', value: 'wbs'}],
]);

export const fixedMap: MapValue<typeof contextState>[] = [
  {label: '领料单号', type: 'field', value: 'askGoodsCode'},
  {label: '生产订单号', type: 'field', value: 'productionCode'},
  {label: '物料编号', type: 'field', value: 'materialCode'},
  {label: '物料名称', type: 'field', value: 'materialName'},
  {
    label: '明细类型',
    type: 'select',
    value: 'type',
    options: [
      {label: '生产领用单', value: '1'},
      {label: '非生产领用单', value: '2'},
    ],
    hideClear: true,
  },
];
