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

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

// 合同明细
export function getDetailApi(params: StrAnyObj): Promise<StrAnyObj> {
  return request.get('/contractInfo/getDetail', params)
}

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

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

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

// 统计数据
export function getStatistics(params: StrAnyObj): Promise<void> {
  return request.get('/contractInfo/statistics', params)
}

// 统计数据
export function getTransactionList(params: StrAnyObj): Promise<void> {
  return request.get('/contractInfo/getTransactionList', params)
}

// 客户付款数据
export function getFundReceived(params: StrAnyObj): Promise<void> {
  return request.get('/contractFundReceived/getList', params)
}

// 请款数据
export function getPayment(params: StrAnyObj): Promise<void> {
  return request.get('/paymentRequests/getDetailList', params)
}

// 订单
export function getOrderList(params: StrAnyObj): Promise<void> {
  return request.get('/contractInfo/getOrderList', params)
}

// 结算利润
export function settlementProfit(data: StrAnyObj): Promise<void> {
  return request.post('/contractInfo/settlement', data)
}
