import { genBldgSearchModal, genWarehouseAuthSearchModal } from '@/views/kzyWMS/SearchModal'
import { remote2 } from './remote'

let grid = { span: 8, labelCol: { span: 8 } }

export const formItems = function(self) {
  return [
    { type: 'input', name: 'dcId', hidden: true, label: 'dcId', value: '' },
    { type: 'input', name: 'warehouseId', hidden: true, label: 'warehouseId', value: '' },
    { type: 'input', name: 'warehouseRoomId', hidden: true, label: '库房编码', value: '' },

    { type: 'input', disabled: true, name: 'dcName', label: '所属仓配中心', value: '' },
    { type: 'input',  disabled: true, name: 'warehouseName', label: '仓库名称', value: '' },
    ...genBldgSearchModal(1, true, false, null, self.changeBldg, grid, null),
    { type: 'input', name: 'warehouseRoomCode', label: '库房编码', value: '', required: true, },
    { type: 'input', name: 'warehouseRoomName', label: '库房名称', value: '' , required: true},
    { type: 'select', name: 'warehouseRoomType', label: '库房类型', value: '', ...remote2('wms_storeroom'), required: true },
    { type: 'input', name: 'floorNum', label: '所在楼层', value: '' },
    { type: 'switch', name: 'isEnable', label: '是否启用', value: '' },
    { type: 'switch', name: 'isFunctionRoom', label: '是否开启功能库房', value: '' }
  ]
}

export const addItems1 = [
  {
    type: 'select',
    name: 'warehouseLayoutType',
    label: '仓库布局类型',
    options: [
      { title: '平面', value: '平面' },
      { title: '立体', value: '立体' },
      { title: '自动', value: '自动' }
    ]
  },
  {
    type: 'select',
    name: 'warehouseWorkingMethod',
    label: '拣货方式',
    ...remote2('wms_pickmode')
  },
  {
    type: 'input',
    name: 'attribute1',
    label: '预留字段1'
  },
  {
    type: 'input',
    name: 'attribute2',
    label: '预留字段2'
  },
  {
    type: 'input',
    name: 'attribute3',
    label: '预留字段3'
  },
  {
    type: 'input',
    name: 'attribute4',
    label: '预留字段4'
  }
]
