import { lte } from 'lodash'

let grid = {
  labelCol: { span: 8 },
  wrapperCol: { span: 12 },
  span: 12,
  // 高度
  itemHeight: '50px',
}
export function formItems(self) {
  let _this = self
  return [
    { type: 'input', hidden: true, name: 'checkTaskNo', label: '任务号', ...grid, value: '' },
    { type: 'input', name: 'id', label: 'id', ...grid, value: '', hidden: true },
    { type: 'input', name: 'goodsId', label: 'goodsId', ...grid, value: '', hidden: true },
    { type: 'input', name: 'ownerId', label: 'ownerId', ...grid, value: '', hidden: true },
    {
      type: 'input',
      className: 'input-md',
      size: 'large',
      name: 'stationNo',
      label: '工作站',
      ...grid,
      value: '',
      on: {
        pressEnter() {
          self.checkApi('stationNo')
        },
      },
    },
    {
      type: 'input',
      className: 'input-md',
      size: 'large',
      name: 'containerNo',
      label: '容器条码',
      ...grid,
      value: '',
      on: {
        pressEnter(KeyboardEvent, vonde) {
          self.checkApi('containerNo', KeyboardEvent, vonde)
        },
      },
    },
    {
      type: 'input',
      className: 'input-md',
      size: 'large',
      name: 'barcode',
      label: '商品条码',
      ...grid,
      value: '',
      on: {
        pressEnter() {
          self.checkApi('barcode')
        },
      },
    },
    { type: 'input', className: 'input-md', size: 'large', name: 'goodsName', label: '商品名称', ...grid, value: '' },
    {
      type: 'input',
      className: 'input-md',
      size: 'large',
      name: 'approveDocNo',
      label: '国药准字',
      ...grid,
      value: '',
    },
    { type: 'input', className: 'input-md', size: 'large', name: 'prodDate', label: '生产日期', ...grid, value: '' },
    { type: 'input', className: 'input-md', size: 'large', name: 'validDate', label: '有效期至', ...grid, value: '' },
    { type: 'input', className: 'input-md', size: 'large', name: 'lotFactName', label: '生产厂家', ...grid, value: '' },
    { type: 'input', className: 'input-md', size: 'large', name: 'goodsOwnerName', label: '货主', ...grid, value: '' },
    { type: 'input', className: 'input-md', size: 'large', name: 'goodsType', label: '规格', ...grid, value: '' },
    { type: 'input', className: 'input-md', size: 'large', name: 'lotNo', label: '批号', ...grid, value: '' },
    { type: 'input', className: 'input-md', size: 'large', name: 'plantyQty', label: '出货件数', ...grid, value: '' },
    { type: 'number', className: 'input-md', size: 'large', name: 'qty', label: '实际数量', ...grid, value: '' },
    { type: 'number', className: 'input-md', size: 'large', name: 'packSize', label: '包装大小', ...grid, value: '' },
    {
      type: 'number',
      className: 'input-md',
      size: 'large',
      name: 'goodsStatusDecr',
      label: '商品状态',
      ...grid,
      value: '',
    },
    {
      type: 'buttonGroup',
      style: { textAlign: 'right' },
      ...grid,
      span: 24,
      options: [
        {
          value: '-10',
          style: 'margin-left:10px',
          on: {
            click: (event, form) => {
              self.numEvent(event, form, -10)
            },
          },
        },
        {
          value: '-1',
          style: 'margin-left:10px',
          on: {
            click: (event, form) => {
              self.numEvent(event, form, -1)
            },
          },
        },
        {
          value: '+10',
          style: 'margin-left:10px',
          on: {
            click: (event, form) => {
              self.numEvent(event, form, 10)
            },
          },
        },
        {
          value: '+1',
          style: 'margin-left:10px',
          on: {
            click: (event, form) => {
              self.numEvent(event, form, 1)
            },
          },
        },
      ],
    },
  ]
}
