import request from '@/utils/request'

// 创建收款单
export function createReceipt(data) {
  return request({
    url: '/ecw/receipt/create',
    method: 'post',
    data: data
  })
}

// 获取应收款列表
export function getReceivableList(query) {
  return request({
    url: '/ecw/receivable/page',
    method: 'get',
    params: query
  })
}

// 根据获取应收款列表
// export function getReceivableListByIds(query) {
//   return request({
//     url: '/ecw/receivable/list',
//     method: 'get',
//     params: query
//   })
// }

// 更新应付款
export function updatePayable(data) {
  return request({
    url: '/ecw/payable/update',
    method: 'put',
    data: data
  })
}

// 删除应付款
export function deletePayable(id) {
  return request({
    url: '/ecw/payable/delete?id=' + id,
    method: 'delete'
  })
}



// 获取应付款列表
export function getPayableList(query) {
  return request({
    url: '/ecw/payable/page',
    method: 'get',
    params: query
  })
}

// 获取应付款详情
export function getPayableInfoByIds(query) {
  return request({
    url: '/ecw/payable/get',
    method: 'get',
    params: query
  })
}

// 创建付款单
export function createPayment(data) {
  return request({
    url: '/ecw/payment/create',
    method: 'post',
    data: data
  })
}

// 获取付款单列表
export function getPaymentList(query) {
  return request({
    url: '/ecw/payment/page',
    method: 'get',
    params: query
  })
}

// 获取付款单详情
export function getPaymentInfoByIds(query) {
  return request({
    url: '/ecw/payment/get',
    method: 'get',
    params: query
  })
}

// 获得付款单付款明细
export function getPaymentItem(query) {
  return request({
    url: '/ecw/payment/getPaymentItem',
    method: 'get',
    params: query
  })
}

// 更新付款单
export function updatePayment(data) {
  return request({
    url: '/ecw/payment/update',
    method: 'put',
    data: data
  })
}

// 删除付款单
export function deletePayment(id) {
  return request({
    url: '/ecw/payment/delete?id=' + id,
    method: 'delete'
  })
}

// 审核付款单
export function paymentVerify(query) {
  return request({
    url: '/ecw/payment/verify',
    method: 'post',
    data: query
  })
}

// 核销付款单
export function paymentVerification(id) {
  return request({
    url: '/ecw/payment/verification/' + id,
    method: 'GET'
  })
}

// 反核销付款单
export function paymentVerificationCancel(id) {
  return request({
    url: '/ecw/payment/verificationCancel/' + id,
    method: 'GET'
  })
}

// 反审核付款单
export function paymentVerifyCancel(id) {
  return request({
    url: '/ecw/payment/verifyCancel/' + id,
    method: 'GET'
  })
}
