import items from './girdform'
import mainColumns from "./mainColumns";
import columns from './columns'

import { baseUrl } from "../../../../config/baseUrl";

const modelConfig = function (_this){
  return{
    title: '订单信息',
  //搜索框配置 girdform
  girdform: items,
  //订单列表数据
  mainlist: {
    remoteBefore(vn, params) {
      let p = { ...params }
      if (params.params.cargoOwnerId) p.params.mtlOwnerId = params.params.cargoOwnerId;
      return p;
    },
    columns: mainColumns,
    operators: [{
      label: '单位查看',
      click(item) {
        
        item.shipperid = item.vendorId
        _this.viewSupplierItem = item;
        _this.showViewSupplier = true;
      }
    }],
    rowKey: 'rqcHeaderId',
    remoteParams: {},
    remoteUrl: {
      url: baseUrl + '/rqcReHeaders/extractRcvH',
    }
  },
  //商品列表配置
  sublist: {
    rowKey: 'taskRecheckId',
    columns: columns,
    operators: [
      {
        label: '查看商品图片',
        click(item) {
          
          _this.viewCommodity = item;
          _this.showCommodity = true;
        }
      }
    ],
    GoodsremoteUrl: {
      url: baseUrl + '/rqcReHeaders/extractRqcReTask',
    },
    remoteBefore(data) {
      // rcvHeaderId
      return { rqcHeaderId: data[0] }
    },
  }

  }
  
}

export default modelConfig
