import request from '@/utils/request'
import download from '@/utils/download'
import { PageType, StrAnyObj } from '@/typings'

// 请款分页
export function getPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/paymentRequests/getPage', params)
}

// 请款明细
export function getDetailApi(params: StrAnyObj): Promise<StrAnyObj> {
  return request.get('/paymentRequests/getDetail', params)
}

// 请款新增
export function addApi(data: StrAnyObj): Promise<void> {
  return request.post('/paymentRequests/add', data)
}

// 请款编辑
export function editApi(data: StrAnyObj): Promise<void> {
  return request.post('/paymentRequests/edit', data)
}

// 请款删除
export function deleteApi(data: StrAnyObj): Promise<void> {
  return request.post('/paymentRequests/delete', data)
}

// 请款分页
export function getRemitPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/paymentRequests/getRemitPage', params)
}

// 请款
export function remitApi(data: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.post('/paymentRequests/remit', data)
}


// 取回流程
export function retrieveApi(data: StrAnyObj): Promise<void> {
  return request.post(`/paymentRequests/retrieve`,data)
}

// 下载excel
export function excelExportApi(params: StrAnyObj): Promise<void> {
  return download.get(`/paymentRequests/excelExport`,params)
}

// 下载excel
export function remitExcelExportApi(params: StrAnyObj): Promise<void> {
  return download.get(`/paymentRequests/remitExcelExport`,params)
}