
export const setMainColumns = (self,isoperation=true) => {
  let operation = []
  if (isoperation) {
    operation=[{
      key: 'operation',
      title: '操作',
      fixed: 'right',
      align: 'center',
      width: 160,
      scopedSlots: { customRender: 'operation' }
    }]
  }


  return [

    {
      dataIndex: 'containerCode', title: '容器编码', width: 120,
      sorter: (a, b) => a.containerCode.localeCompare(b.containerCode)
    },
    { dataIndex: 'containerTypeName', title: '容器类型', width: 120, sorter: (a, b) => a.containerType - b.containerType },
    { dataIndex: 'statusName', title: '当前状态', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'abnormalMemo', title: '是否异常', width: 120, sorter: (a, b) => a.abnormalStatus.localeCompare(b.abnormalStatusName) },
    { dataIndex: 'consigneeName', title: '收货方', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'consigneePhoneNumber', title: '收货方电话', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'consigneeAddress', title: '收货方地址', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'driverName', title: '司机姓名', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'driverPhoneNumber', title: '司机电话', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'vehiclePlateNumber', title: '运输车辆', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'shipperName', title: '发货方', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'shipperPhoneNumber', title: '发货方电话', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'shipperAddress', title: '发货方地址', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    { dataIndex: 'containerBillNo', title: '关联单号', width: 120, sorter: (a, b) => a.containerCode.localeCompare(b.containerCode) },
    {
      dataIndex: 'updatetime', title: '更新时间', width: 160,
      sorter: (a, b) => {
        return +new Date(a.updatetime) - +new Date(b.updatetime)
      },

      },
    ...operation

  ]
}


//容器明细
export const setContinerColumns = (self,isoperation=true) => {
  let operation = []
  if (isoperation) {
    operation=[{
      key: 'operation',
      title: '操作',
      align: 'center',
      width: 160,
      scopedSlots: { customRender: 'operation' }
    }]
  }
  return [
    {
      dataIndex: 'containerCode', title: '容器编码',
      sorter: (a, b) => a.containerCode.localeCompare(b.containerCode)
    },
    { dataIndex: 'containerTypeName', title: '容器类型',sorter: (a, b) => a.containerType - b.containerType },
    ...operation

  ]
}



