export const setColumns = (_this) => {

  _this.fieldOptions?.forEach(item => {
    item.value = String(item.value)
  })
  return [
    // {
    //   dataIndex: 'hdrId',
    //   title: 'hdrId',
    //   hidden: true,
    //   type: 'txt'
    // },
    {
      type: 'txt',
      dataIndex: 'groupNumber',
      title: '分组顺序',
      width: 100,
      align: 'center',
      customRender(txt, record) {
        record.groupNumber= record._row_count
        return _this._c('span',{},[_this._v(record.groupNumber)])
      }
    },
    {
      type: 'select',
      dataIndex: 'groupItem',
      title: '分组',
      required: true,
      autoLoad: false,
      mode: "multiple",
      placeholder: '请选分组',
      allowClear: true,
      dropdownClassName: 'groupItemDropdown',
      dropdownRender(menuNode, props) {
        let all = _this.tableDataform[_this.selectedKeys[0]]
          if (all?.length > 0) {
            let arrVal = []
            all.forEach(item => {
              console.log(item.groupItem)
              arrVal = arrVal.concat(item.groupItem)
            });
            menuNode.componentOptions.propsData.value=arrVal.concat(menuNode.componentOptions.propsData.value)
          }
        return menuNode
      },
      get options() {

       return _this.fieldOptions
      },
      on: {
        change({ value, label, name, options, record }) {
           console.log(record.groupItem)

        }
      },

    },
    {
      title: () => {
        let source =_this.tableDataform[_this.selectedKeys[0]];
        if (_this.selectedKeys[0]&&source?.length < 3) {
          return _this._c('a-icon', {
            style: 'font-size: 16px',
            attrs: {
              type: 'plus-circle',
              'data-value': 'params',
            },
            on: { click: _this.addtableformRow },
          })
        } else {
          return null
        }

      },
      width: 40,
      align: 'center',
      key: 'operation',
      scopedSlots: { customRender: 'operation' },
    }
  ]
}

export const bizTypeObj = {
  订单管理: 10,
  待审核: 20,
  待调度: 30,
  已调度: 40,
  已派车: 50,
  已托运: 60,
  所有运单: 70,
  已完成: 90,
  待装卸: 100,
  待送达: 110,
  待理货: 120,
  待自提: 130,
  待提货: 140,
  入库在途: 150,
  整车直发: 160,
  拣货出库: 170,
  出库在途: 180,
  外包跟踪: 190,
  提货确认: 200,
}

// "订单管理":10,
// "待审核":20,
// "待调度":30,
// "已调度":40,
// "已派车":50,
// "已托运":60,
// "所有运单":70,
// "已完成":90,
// "待装卸":100,
// "待送达":110,
// "待理货":120,
// "待自提":130,
// "待提货":140,
// "入库在途":150,
// "整车直发":160,
// "拣货出库":170,
// "出库在途":180,
// "外包跟踪":190,
// "提货确认":200,


