import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReconApplicationVO, ReconApplicationForm, ReconApplicationQuery } from '@/api/bill/reconApplication/types';

/**
 * 查询对账申请列表
 * @param query
 * @returns {*}
 */

export const listReconApplication = (query?: ReconApplicationQuery): AxiosPromise<ReconApplicationVO[]> => {
  return request({
    url: '/bill/reconApplication/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询对账申请详细
 * @param id
 */
export const getReconApplication = (id: string | number): AxiosPromise<ReconApplicationVO> => {
  return request({
    url: '/bill/reconApplication/' + id,
    method: 'get'
  });
};

/**
 * 新增对账申请
 * @param data
 */
export const addReconApplication = (data: ReconApplicationForm) => {
  return request({
    url: '/bill/reconApplication',
    method: 'post',
    data: data
  });
};

/**
 * 修改对账申请
 * @param data
 */
export const updateReconApplication = (data: ReconApplicationForm) => {
  return request({
    url: '/bill/reconApplication',
    method: 'put',
    data: data
  });
};

/**
 * 删除对账申请
 * @param id
 */
export const delReconApplication = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bill/reconApplication/' + id,
    method: 'delete'
  });
};
