import { genWarehouseAuthSearchModal, genCargoownerAuthSearchModal } from "@/views/kzyWMS/SearchModal";

export function queryFormItems(self) {
    let _this = self
    let grid = {
      labelCol: { span: 8 }, span: 8,
    };
    const extendConfig = {
      mapper: {cargoOwnerId: 'consignorId', cargoOwnerName: 'consignorName', cargoOwnerCode: 'consignorCode'}
    }
    return [
      {
        type: 'input',
        hidden: true,
        name: 'spanId',
        label: 'spanId',
        value: ''
      },
      ...genWarehouseAuthSearchModal(1, true, false, null, null, grid),
      ...genCargoownerAuthSearchModal(1, true, false, null, null, grid, extendConfig),
      {
        type: 'input',
        name: 'billCode',
        label: '订单编号',
        value: ''
      },
      {
        span: 24,
        type: 'buttonGroup',
        style: { textAlign: 'right' },
        options: [
          {
            value: '查询',
            icon: 'search',
            btnType: 'primary',
            style: 'margin-right:10px',
            htmlType: 'submit'
          },
          {
            value: '重置',
            icon: 'redo',
            on: {
              click: () => {
                self.$refs.formTarget.form.resetFields()
              }
            }
          }
        ]
      }
    ]
  }
  



export function tableColumnsConfig(self) {
    let _this = self
    return  [
        {
          title: '订单ID',
          hidden: false,
          dataIndex: 'id',
          width: '150px',
          dicttypeCodes: 'do_bill_type'
        },
        {
          title: '订单数量',
          hidden: false,
          dataIndex: 'branchid',
          width: '100px',
          dicttypeCodes: 'do_bill_type'
        },
        {
          title: '总数量',
          hidden: false,
          dataIndex: 'branchname',
          width: '100px'
        },
        {
          title: '总体积',
          hidden: false,
          dataIndex: 'lineName',
          width: '100px'
        },
        {
          title: '总数量',
          hidden: false,
          dataIndex: 'statusName',
          width: '100px'
        },
        {
          title: '总体积',
          hidden: false,
          dataIndex: 'status',
          width: '100px'
        },
        {
          title: '总重量',
          hidden: false,
          dataIndex: 'createBy',
          width: '100px'
        },
        {
          title: '失败原因',
          hidden: false,
          dataIndex: 'createdate',
          width: '100px'
        },
        {
          title: '操作',
          key: 'operate',
          align: 'center',
          fixed: 'right',
          width: '175px',
          scopedSlots: { customRender: 'action' }
        }
    ]

}