import request from '@/utils/request'
import Qs from 'qs'

// export function listCollectionPayment(query) {
//   return request({
//     method: 'post',
//     params:{
//       _gp: 'admin.collectionpayment',
//       _mt: 'list',
//       page: query.page,
//       limit: query.limit,
//       ...query
//     }
//   })
// }
export function listCollectionPayment(query) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.collectionpayment',
      _mt: 'list',
      page: query.page,
      limit: query.limit,
      CollectionPaymentDTO: JSON.stringify(query.type),
    })
  })
}


export function createCollectionPayment(data) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.collectionpayment',
      _mt: 'create',
      CollectionPaymentDTO: JSON.stringify(data)
    })
  })
}

export function updateCollectionPayment(data) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.collectionpayment',
      _mt: 'edit',
      CollectionPaymentDTO: JSON.stringify(data)
    })
  })
}


export function importWord(data) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.collectionpayment',
      _mt: 'createAll',
      CollectionPaymentDTO: JSON.stringify(data)
    })
  })
}

export function exportXlsx(data) {debugger
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.collectionpayment',
      _mt: 'export',
      CollectionPaymentDTO: JSON.stringify(data),
      response: 'blob',
    })
  })
}

// export const exportXlsx ='/contractCostInfo/payment'