import request from '@/utils/request'
import { param } from 'jquery'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/order/orderInfo/teamOrderlist',
    method: 'get',
    params: query
  })
}


// id获取详情
export function getSelectById(id) {
  return request({
    url: '/order/orderInfo/teamOrderDetail?id=' + id,
    method: 'get'
  })
}

// 对公支付
export const gotoCorporatePay = (data) => {
  return request({
    url: '/order/orderInfo/gotoCorporatePay',
    method: 'post',
    data: data
  })
}

//  导出
export function downOrderListXls(params) {
  return request({
    url: '/order/orderInfo/teamOrderlistExport',
    method: 'get',
    responseType: 'blob',
    params
  });
}

// 团购订单修改
export const teamOrderReSubmitApi = (data) => {
  return request({
    url: '/member/marketTeamApply/teamOrderReSubmit',
    method: 'post',
    data: data
  })
}

// 代客下单
export const teamPayOrderUrlApi = (params) => {
  return request({
    url: '/member/marketTeam/teamPayOrderUrl',
    method: 'get',
    params: params
  })
}

// 获取余额信息
// export const getBalanceInfo = (params) => {
//   return request({
//     url: '/member/marketTeam/getBalanceInfo',
//     method: 'get',
//     params: params
//   })
// }

// 余额支付
export const balancePay = (data) => {
  return request({
    url: '/order/orderInfo/gotoTeamBalancePay',
    method: 'post',
    data: data
  })
}

// 授信额度支付
export const creditPay = (data) => {
  return request({
    url: '/order/orderInfo/gotoTeamQuotaPay',
    method: 'post',
    data: data
  })
}

// 获取剧目演出厅某日期场次列表
export const getDateTimeAllApi = (data) => {
  return request({
    url: '/merchant/merchantPerformTime/getDateTimeAll',
    method: 'get',
    params: data,
  })
}

// 查询团队剧目演出厅座位类型票务信息
export const listGoodsByTeamIdApi = (data) => {
  return request({
    url: '/goods/goods/listGoodsByTeamId',
    method: 'get',
    params: data,
  })
}

// 对公支付凭证修改
export const updateCorporateApi = (data) => {
  return request({
    url: '/order/orderInfo/updateCorporate',
    method: 'post',
    data: data
  })
}

// 提交开票
export const saveAndEdit = (data) => {
  return request({
    url: '/order/orderInvoice/submit',
    method: 'post',
    data: data
  })
}

// 获取开票信息
export function getInvoiceInfo(id) {
  return request({
    url: '/order/orderInvoice/getInvoiceInfo?orderId=' + id,
    method: 'get'
  })
}

// 座位列表 (按具体座位)
export const getGoodsSeatList = (query) => {
  return request({
    url: '/order/orderInfo/getGoodsSeatList',
    method: 'get',
    params: query
  })
}

// 团购子订单添加
export const childOrderSubmitApi = (data) => {
  return request({
    url: '/order/orderInfo/submitSub',
    method: 'post',
    data: data
  })
}