import http from '@/utils/request'

// 获取门票种类
export function getTicketCategory () {
  return http.post('tickettype/getTicketTypeCategory')
}

// 获取门票列表
export function getTicketTypeList (params) {
  return http.post('/admin/ticketType', { data: params })
}

// 获取门票详情
export function getTicketTypeInfo (params) {
  debugger
  return http.post('/admin/ticketType/detail', { data: params })
}

// 新增门票
export function addTicket (params) {
  return http.post('/admin/ticketType/add', { data: params })
}

// 更新门票
export function updateTicket (params) {
  return http.post('tickettype/updateTicketType', { data: params })
}

// 删除门票
export function deleteTicket (id) {
  let params = {
    idList: [id]
  }
  return http.post('/admin/ticketType/delete', { data: params })
}

// 获取景点列表
export function getScenic () {
  const params = {
    export: false,
    pageSize: 100,
    pageNum: 1
  }
  return http.post('/admin/scenic', { data: params })
}

// 获取景点列表
export function updateScenic (params) {
  return http.post('/admin/scenic/update', { data: params })
}

// 新建景点
export function createScenic (params) {
  return http.post('/admin/scenic/add', { data: params })
}

// 删除景点
export function delScenic (data) {
  return http.post('/admin/scenic/delete', { data: { idList: [data.id] } })
}
// 生成库存
export function createTicketInStock (params) {
  return http.post('ticketInStock/createTicketInStock', params)
}
// 获取库存列表
export function getTicketInStockLog (params) {
  return http.post('ticketInStock/getTicketInStockLog', params)
}
// 激活
export function ticketInStockActivate (params) {
  return http.post('ticketInStock/ticketInStockActivate', params)
}
// 打印
export function ticketInStockPrint (params) {
  return http.post('ticketInStock/ticketInStockPrint', params)
}
// 退库
export function ticketBackToStock (params) {
  return http.post('ticketInStock/ticketBackToStock', params)
}
// 任务列表
export function getMission (params) {
  return http.post('ticketInStock/getTicketInStockMissionList', params)
}

// 获取日期段价格
export function getPeriodPrice (id) {
  return http.post(`tickettype/${id}/periodprice`)
}

// 设置日期段价格
export function setPeriodPrice (id, params) {
  return http.post(`tickettype/${id}/periodprice`, params)
}

// 获取周价格
export function getWeekDayPrice (id) {
  return http.post(`tickettype/${id}/weekdayprice`)
}

// 设置周价格
export function setWeekDayPrice (id, params) {
  return http.post(`tickettype/${id}/weekdayprice`, params)
}

// 获取价格策略
export function getTicketPriceStragegy () {
  return http.post(`config/ticketpricestragegy`)
}

// 任务详情
export function getMissionDetail (params) {
  return http.post('ticketInStock/getTicketInStockMissionDetail', params)
}

// 预订单统计
export function ticketInStockStatistics (params) {
  return http.post('ticketInStock/ticketInStockStatistics', params)
}

// 创建子项目
export function createSubProject (params) {
  return http.post('subProject/createSubProject', params)
}

// 编辑子项目
export function updateSubProject (params) {
  return http.post('subProject/updateSubProject', params)
}

// 子项目列表
export function subProjectList (params) {
  return http.post('subProject/subProjectList', params)
}

// 删除子项目
export function deleteSubProject (params) {
  return http.post('subProject/deleteSubProject', params)
}

// 获取发票供应商
export function listInvoiceChannel (params) {
  return http.post('invoice/listInvoiceChannel', params)
}

// 修改发票供应商接口参数
export function updateInvoiceChannel (params) {
  return http.post('invoice/updateInvoiceChannel', params)
}

// 获取所有销售方
export function listInvoiceSales (params) {
  return http.post('invoice/listInvoiceSales', params)
}

// 添加销售方
export function addInvoiceSale (params) {
  return http.post('invoice/addInvoiceSale', params)
}

// 删除销售方
export function deleteInvoiceSale (params) {
  return http.post('invoice/deleteInvoiceSale', params)
}

// 修改发票供应商接口参数
export function updateInvoiceSale (params) {
  return http.post('invoice/updateInvoiceSale', params)
}

// 获取开票记录
export function listInvoiceRecord (params) {
  return http.post('invoice/listInvoiceRecord', params)
}

// 获取预印票
export function getTicketInStockBySeq (params) {
  return http.post('ticketInStock/getTicketInStockBySeq', params)
}

// 百旺云票平台 二维码
export function invoiceBaiWangGetFaceQrcode (params) {
  return http.post('invoice/invoiceBaiWangGetFaceQrcode', params)
}

// 通过传预印票号和数量返回预印票
export function getTicketInStockByQrcodeAndNumber (params) {
  return http.post('ticketInStock/getTicketInStockByQrcodeAndNumber', params)
}

// 预印门票详情
export function ticketInStockDetailStatistics (params) {
  return http.post('ticketInStock/ticketInStockDetailStatistics', params)
}

export function exportTicketInStockDetail (params) {
  return http.post('exportMission/exportTicketInStockDetail', params)
}

export function queueList (params) {
  return http.post('/queue/list', params)
}

export function createQueue (params) {
  return http.post('/queue/createQueue', params)
}

export function updateQueue (params) {
  return http.post('/queue/updateQueue', params)
}

export function deleteQueue (id) {
  return http.post(`/queue/deleteQueue/${id}`)
}

export function listTransferLog (params) {
  return http.post('/queue/listTransferLog', params)
}

export function signInAfterPass (params) {
  return http.post('/queue/signInAfterPass', params)
}
