

//派车单
export const setBillColumns = (self, expData = []) => {
  return [
    { dataIndex: 'loadingBillId', title: 'ID', hidden: true },
    {
      dataIndex: 'loadingBillNo',
      title: '派车单号',
      width: 200,
      sorter: (a, b) => {
        return a.loadingBillNo.replace(/[^0-9]/gi, '') - b.loadingBillNo.replace(/[^0-9]/gi, '')
      },
      customRender: (txt, record) => {
        return self._c(
          'a',
          {
            attrs: {
              href: 'javascript:void(0)'
            }
          },
          [self._v(txt ? txt : '')]
        )
      },
    },
    { dataIndex: 'groupName', title: '分组名称' ,width: 100 },
    {
      dataIndex: 'statusName',
      width: 100 ,
      title: '派车单状态',
      sorter: (a, b) => {
        if (!a.statusName) return
        return a.status.length - b.status.length
      },
    },
    {
      dataIndex: 'shipbillNumber',
      width: 100 ,
      title: '运单数',
      sorter: (a, b) => {
        return a.shipbillNumber - b.shipbillNumber
      },
    },

    {
      dataIndex: 'customerNumber',
      title: '客户数',
      width: 100 ,
      sorter: (a, b) => {
        return a.customerNumber - b.customerNumber
      },
    },
    {
      dataIndex: 'siteNumber',
      title: '总站数',
      width: 100 ,
      sorter: (a, b) => {
        return a.siteNumber - b.siteNumber
      },
    },
    {
      dataIndex: 'totalWholePiece',
      title: '总整件数',
      width: 100 ,
      sorter: (a, b) => {
        return a.totalWholePiece - b.totalWholePiece
      },
    },
    {
      dataIndex: 'totalLclPiece',
      title: '总拼箱数',
      align: 'center',
      sorter: (a, b) => {
        return a.totalLclPiece - b.totalLclPiece
      },
      width: 100
    },
    {
      dataIndex: 'totalPcs',
      title: '总件数',
      sorter: (a, b) => {
        return a.totalPcs - b.totalPcs
      },
      width: 100
    },
    {
      dataIndex: 'totalWeight',
      title: '总重量',
      sorter: (a, b) => {
        return a.totalWeight - b.totalWeight
      },
      width: 100
    },
    {
      dataIndex: 'totalVolume',
      title: '总体积',
      sorter: (a, b) => {
        return a.totalVolume - b.totalVolume
      },
      width: 100
    },
    {
      dataIndex: 'totalMileage',
      title: '总里程数',
      width: 120,
      sorter: (a, b) => {
        return a.totalMileage - b.totalMileage
      },
    },
    { dataIndex: 'driverName', title: '司机姓名', width: 120 },
    { dataIndex: 'driverPhoneNumber', title: '司机手机号', width: 120 },
    { dataIndex: 'deliverymanName', title: '送货员姓名', width: 80 },

    { dataIndex: 'deliverymanPhoneNumber', title: '送货员手机号', width: 120 },
    { dataIndex: 'vehiclePlateNumber', title: '车牌号', width: 120 },
    { dataIndex: 'vehicleTypeName', title: '车型', width: 120 },
    { dataIndex: 'volumeLoadingRate', title: '装载率' },
    { dataIndex: 'memo', title: '备注', width: 120 },
    {
      dataIndex: 'createperson',
      title: '创建人',
      width: 100,
      sorter: (a, b) => {
        return a.createperson != b.createperson
      },
    },
    {
      dataIndex: 'createtime',
      title: '创建时间',
      width: 150,
      sorter: (a, b) => {
        return +new Date(a.createtime) - +new Date(b.createtime)
      },
    },
    {
      dataIndex: 'updateperson',
      title: '修改人',
      width: 100,
      sorter: (a, b) => {
        return a.updateperson != b.updateperson
      },
    },
    {
      dataIndex: 'updatetime',
      title: '修改时间',
      width: 150,
      sorter: (a, b) => {
        return +new Date(a.updatetime) - +new Date(b.updatetime)
      },
    },

  ];
};