

export const setGoogColumns = (self, expData = []) => {


  return [
    { dataIndex: 'id', title: 'ID', hidden: true, type: 'txt', width: 200 },

    {
      type: 'txt',

      dataIndex: 'shipbillNo',
      title: '运单号',
      sorter: (a, b) => a.shipbillNo?.localeCompare(b.shipbillNo),
      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.toView(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
        }

      },
    },
    {
      type: 'txt',

      dataIndex: 'orderBusinessTypeName',
      title: '业务类型',
      width: 120,
      sorter: (a, b) => {
        return a.orderBusinessType - b.orderBusinessType
      },

    },
    {
      type: 'txt',

      dataIndex: 'orderNo',
      title: '订单号',
      sorter: (a, b) => a.orderNo?.localeCompare(b.orderNo),
      width: 160
    },
    // {
    //   type: 'txt',

    //   dataIndex: "mesOrderNo",
    //   title: "Mes单号",
    //   width: 120,
    //   sorter: (a, b) => {
    //     return a.mesOrderNo.localeCompare(b.mesOrderNo);
    //   }
    // },
    {
      dataIndex: 'statusName',
      title: '运单状态',
      sorter: (a, b) => a.statusName?.localeCompare(b.statusName),
      width: 100
    },



    {
      type: 'txt',

      dataIndex: 'itemCode',
      title: '商品编码',
      sorter: (a, b) => a.itemCode?.localeCompare(b.itemCode),
      width: 120
    },
    {
      type: 'txt',
      type: 'txt',

      dataIndex: 'itemName',
      title: '商品名称',
      sorter: (a, b) => a.itemName?.localeCompare(b.itemName),
      width: 160
    },


    {
      type: 'txt',

      dataIndex: 'itemCategoryName',
      title: '商品品类',
      type: 'txt',
      sorter: (a, b) => {
        return ~~a.itemCategory - ~~b.itemCategory
      },
    },

    {
      type: 'txt',

      dataIndex: 'pcs',
      title: '件数',
      alert: 'center',
      sorter: (a, b) => a.pcs - b.pcs,
      width: 100
    },


    {
      type: 'txt',

      dataIndex: "weight",
      title: "重量",
      width: 120,
      sorter: (a, b) => {
        return a.weight - b.weight;
      }
    },
    {
      type: 'txt',

      width: 120,
      dataIndex: 'volume',
      title: '体积',
      align: 'center',
      sorter: (a, b) => {
        return +a.volume - +b.volume
      },
    },
    {
      type: 'txt',

      dataIndex: "length",
      title: "长mm",
      width: 120,
      sorter: (a, b) => {
        return a.length - b.length;
      }
    },
    {
      type: 'txt',

      dataIndex: "width",
      title: "宽mm",
      width: 120,
      sorter: (a, b) => {
        return a.width - b.width;
      }
    },
    {
      type: 'txt',

      dataIndex: "height",
      title: "高mm",
      width: 120,
      sorter: (a, b) => {
        return a.height - b.height;
      }
    },
    {
      type: 'txt',
      dataIndex: 'branchName',
      title: '仓库',
      sorter: (a, b) => a.branchName?.localeCompare(b.branchName),
      width: 100
    },

    {
      dataIndex: 'loadingLocation',
      title: '装货地点(暂存储位)',
      sorter: (a, b) => a.loadingLocation?.localeCompare(b.loadingLocation),
      width: 160,
      type: 'txt'

    },
    // 预计入库日期
    {
      dataIndex: 'planWarehousingDate',
      title: '预计入库日期',
      sorter: (a, b) => +new Date(a.planWarehousingDate) - +new Date(b.planWarehousingDate),
      width: 140,
      type: 'txt'

    },
    // 实际入库日期
    {
      dataIndex: 'actualWarehousingDate',
      title: '实际入库日期',
      sorter: (a, b) => +new Date(a.actualWarehousingDate) - +new Date(b.actualWarehousingDate),
      width: 140,
      type: 'txt'
    },
    {
      dataIndex: 'planDeliveryDate',
      title: '计划发运日期',
      sorter: (a, b) => +new Date(a.planDeliveryDate) - +new Date(b.planDeliveryDate),
      width: 140,
      type:'date'

    },
    {
      dataIndex: 'memo',
      title: '备注',
      width: 140,
      type: 'txt',

      sorter: (a, b) => a.memo?.localeCompare(b.memo),
    }

  ]
}