




export default (self, expData = []) => {
  return [
    {
      dataIndex: 'planBillNo',
      title: '计划单号',
      sorter: (a, b) => a.planBillNo?.localeCompare(b.planBillNo),
      width: 200,
      customRender: (txt, record) => {
        const { recordTagWord,colorTagFontColor } = record
      let text= self._c(
          'a',
          {
            attrs: {
              href: 'javascript:void(0)',
            },
            style: {[colorTagFontColor&&'color']: colorTagFontColor},
            on: {
              click: (event) => {
                event.stopPropagation()
                return self.$parent.handleView(record)
              },
            },
          },
          [self._v(txt)])
        if (recordTagWord) {
          return self._c('a-space', {}, [text, self._c('a-badge', {
            attrs: {
              numberStyle:{boxShadow:'none'},
              count: recordTagWord,
              overflowCount:Infinity
            }
          },
          )])
        } else {
          return text
        }

      },
    },
    {
      dataIndex: 'cargoOwnerName',
      title: '货主',
      sorter: (a, b) => a.cargoOwnerId?.localeCompare(b.cargoOwnerId),
      width: 100
    },
    {
      dataIndex: 'consigneeName',
      title: '收货方',
      sorter: (a, b) => a.consigneeId?.localeCompare(b.consigneeId),
      width: 100
    },
    {
      dataIndex: 'statusName',
      title: '计划状态',
      sorter: (a, b) => a.statusName?.localeCompare(b.statusName),
      width: 100
    },

    {
      dataIndex: 'carrierTypeName',
      title: '承运商类型',
      sorter: (a, b) => a.carrierTypeName?.localeCompare(b.carrierTypeName),
      width: 120
    },
    {
      dataIndex: 'carrierName',
      title: '承运商',
      sorter: (a, b) => a.carrierName?.localeCompare(b.carrierName),
      width: 120
    },

    {
      dataIndex: 'driverName',
      title: '司机',
      sorter: (a, b) => a.driverName?.localeCompare(b.driverName),
      width: 140
    },
    {
      dataIndex: 'vehiclePlateNumber',
      title: '车辆',
      sorter: (a, b) => a.vehiclePlateNumber?.localeCompare(b.vehiclePlateNumber),
      width: 100
    },


    {
      dataIndex: 'planTotalPcs',
      title: '计划箱数',
      alert:'center',
      sorter: (a, b) => a.planTotalPcs - b.planTotalPcs,
      width: 100
    },
    {
      dataIndex: 'actualTotalPcs',
      title: '实际箱数',
      alert:'center',
      sorter: (a, b) => a.actualTotalPcs - b.actualTotalPcs,
      width: 100
    },
    {
      dataIndex: 'planTotalVehicleNumber',
      title: '计划车数',
      sorter: (a, b) => a.planTotalVehicleNumber - b.planTotalVehicleNumber
    },
    {
      dataIndex: 'actualTotalVehicleNumber',
      title: '实际车数',
      sorter: (a, b) => a.actualTotalVehicleNumber - b.actualTotalVehicleNumber
    },
    {
      dataIndex: 'planDeliveryDate',
      title: '计划发运日期',
      width: 150,
      sorter: (a, b) => {
        return +new Date(a.planDeliveryDate) - +new Date(b.planDeliveryDate);
      }
    },
    {
      dataIndex: 'transfiniteCommitDate',
      title: '超限提交日期',
      width: 150,
      sorter: (a, b) => {
        return +new Date(a.transfiniteCommitDate) - +new Date(b.transfiniteCommitDate);
      },
    },
    {
      dataIndex: 'transfiniteDescription',
      title: '超限说明',
      sorter: (a, b) => a.transfiniteDescription?.localeCompare(b.transfiniteDescription),
    },
    {
      dataIndex: 'deliveryDescription',
      title: '待发运说明',
      sorter: (a, b) => a.deliveryDescription?.localeCompare(b.deliveryDescription),
    },
    {
      dataIndex: 'productName',
      title: '产品名称',
      sorter: (a, b) => a.productName?.localeCompare(b.productName),
    },
    {
      dataIndex: 'createperson',
      title: '创建人',
      width: 100,
      sorter: (a, b) => a.createperson?.localeCompare(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) => a.updateperson?.localeCompare(b.updateperson)

    },
    {
      dataIndex: 'updatetime',
      title: '修改时间',
      width: 150,
      sorter: (a, b) => {
        return +new Date(a.updatetime) - +new Date(b.updatetime);
      },
    },
    {
      key: 'operation',
      title: '操作',
      width: 120,
      fixed: 'right',
      align: 'center',

     scopedSlots: { customRender: 'operation' },
    },
  ]
}

