import request from '@/router/axios'

export function listPackageSettleList(query) {
  return request({
    url: '/admin/settle/listPackageSettleList',
    method: 'get',
    params: query
  })
}

export function listMahPackageSettleList(query) {
  return request({
    url: '/admin/settle/listMahPackageSettleList',
    method: 'get',
    params: query
  })
}
export function settleById(obj) {
  return request({
    url: '/admin/settle/settleById',
    method: 'post',
    data: obj
  })
}
export function geSubmitToken() {
  return request({
    url: '/admin/settle/token',
    method: 'get'
  })
}

export function settleSave(obj) {
  return request({
    url: '/admin/settle/settleSave',
    method: 'post',
    data: obj
  })
}
export function settleIssue(obj) {
  return request({
    url: '/admin/settle/settleIssue',
    method: 'post',
    data: obj
  })
}

export function settleReIssue(obj) {
  return request({
    url: '/admin/settle/settleReIssue',
    method: 'post',
    data: obj
  })
}

export function settleIssueBySubType(obj) {
  return request({
    url: '/admin/settle/settleIssueBySubType',
    method: 'post',
    data: obj
  })
}



export function batchSettlementSubmit(obj) {
  return request({
    url: '/admin/settle/batch-financial-settle',
    method: 'post',
    data: obj
  })
}

export function settleSubmit(obj) {
  return request({
    url: '/admin/settle/settleSubmit',
    method: 'post',
    data: obj
  })
}
export function settleBack(obj) {
  return request({
    url: '/admin/settle/settleBack',
    method: 'post',
    data: obj
  })
}

export function exportPackageSettle(query) {
  return request({
    url: '/admin/settle/exportPackageSettle',
    method: 'get',
    params: query,
    responseType: 'arraybuffer'
  })
}

export function exportPackageSettleByMAH(data) {
  return request({
    url: '/admin/settle/exportPackageSettleByMAH',
    method: 'post',
    data,
    responseType: 'arraybuffer'
  })
}

export function forFina(id) {
  return request({
    url: '/admin/mobile/for-fina',
    method: 'get',
    params: {
      userId: id
    },
  })
}
export function checkForFina(code) {
  return request({
    url: '/admin/api/check-code/for-fina',
    method: 'get',
    params: {
      code: code
    },
  })
}


export function exportSettlementProof(packageIds) {
  return request({
    url: '/admin/settle/exportSettlementProof',
    method: 'get',
    responseType: 'arraybuffer',
    params: {
      packageIds: packageIds
    },
  })
}

// 积分包结算管理-发票上传
export function uploadInvoiceApi(obj) {
  return request({
    url: '/admin/wmscorepackage/upload-invoice',
    method: 'post',
    data: obj
  })
}

