import { genWorkercodeSearchModal, genWarehouseAuthSearchModal } from '../../../SearchModal'

let grid = { span: 6, labelCol: { span: 6 } }
let warehouseAreaStatus = true

export function changeFun(modalRowData, form) {
  // form.setFieldsValue({ cargoOwnerId: modalRowData.cargoOwnerId })
  // warehouseId = modalRowData[0].companyId
  console.log(modalRowData)
  warehouseAreaStatus = false
  console.log(form)
  // form.disableItem('warehouseAreaId')
}
export const formItems = function(self) {
  return [
    ...genWorkercodeSearchModal(
      1,
      true,
      false,
      function(vnode, remoteData) {
        remoteData.params.isEnable = 1
        return remoteData
      },
      null,
      grid,
      { mapper: { jobnumber: 'workercode', locname: 'personName' } }
    ),
    ...genWarehouseAuthSearchModal(
      1,
      true,
      false,
      null,
      function(rowDate, form) {
        console.log(form)
        // form.enableItem('warehouseAreaId')
        self.formWarehouseChange()
      },
      grid
    ),

    { type: 'input', name: 'assistantCode', label: '助记码', value: '', ...grid, required: true },
    { type: 'SwitchValue', name: 'isEnable', label: '是否启用', value: 1, ...grid },
    { hidden: true, type: 'input', name: 'itemCategoryCodes', label: '商品大类编码，逗号分隔', value: '' },
    { hidden: true, type: 'input', name: 'stationIds', label: '工作台ID，逗号分隔', value: '' }
  ]
}

export const tableCols1 = [
  { title: '编码', dataIndex: 'dictCode', key: 'dictCode' },
  { title: '名称', dataIndex: 'dictName', key: 'dictName' }
]

export const tableCols2 = [
  { hidden: true, title: 'stationId', dataIndex: 'stationId', key: 'stationId' },
  { title: '工作站编码', dataIndex: 'stationCode', key: 'stationCode' },
  { title: '工作站名称', dataIndex: 'stationName', key: 'stationName' },
  { title: '工作站类型', dataIndex: 'stationType', key: 'stationType' },
  { title: '复核台类别', dataIndex: 'stageGroup', key: 'stageGroup' },
  { title: '复核台类型', dataIndex: 'stageType', key: 'stageType' }
]
