export const setMainColumns = (self,expData=[]) => {
  return [
    { dataIndex: 'id', title: 'ID', hidden: true },
    {
      dataIndex: 'itemCode', title: '商品编码',
      sorter: (a, b) => {
        if(!a.itemCode||!b.itemCode) return
        return a.itemCode.length - b.itemCode.length
      },
    },
    {
      dataIndex: 'itemName',
      title: '商品名称',
      sorter: (a, b) => {
        if(!a.itemName||!b.itemName) return
        return a.itemName.length - b.itemName.length
      },
    },
    {
      dataIndex: 'itemCategoryName',
      title: '商品品类',
      sorter: (a, b) => {
        return ~~a.itemCategory - ~~b.itemCategory
      },
    },
    {
      dataIndex: 'packTypeName',
      title: '包装类型',
      sorter: (a, b) => {
        return ~~a.packType - ~~b.packType
      },
    },
    {
      dataIndex: 'cargoThermosphereName',
      title: '货物温层',
      sorter: (a, b) => {
        return ~~a.cargoThermosphere - ~~b.cargoThermosphere
      },
    },
    {
      dataIndex: 'payPcs',
      title: '件数',
      sorter: (a, b) => {
        return ~~a.payPcs - ~~b.payPcs
      },
    },
    {
      dataIndex: 'payWeight',
      title: '重量(公斤)',
      sorter: (a, b) => {
        return ~~a.payWeight - ~~b.payWeight
      },
    },
    {
      dataIndex: 'payVolume',
      title: '体积(立方)',
      sorter: (a, b) => {
        return ~~a.payVolume - ~~b.payVolume
      },
    },
    { dataIndex: 'memo', title: '备注' },
    {
      dataIndex: 'branchName',
      title: '默认存放仓库',
      width: 120,
      type: 'txt',
      sorter: (a, b) => {
        return a.branchName != b.branchName
      },
    },
    {
      dataIndex: 'inventoryPcs',
      title: '库存数量',
      width: 120,
      type: 'txt',
      sorter: (a, b) => {
        return ~~a.inventoryPcs - ~~b.inventoryPcs
      },
    },
    {
      dataIndex: 'stagingLocation',
      title: '暂存位',
      type: 'txt',
      width: 120,
    },
    ...expData
  ]
}
