import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询手工凭证申请列表
 * @param query
 * @returns {*}
 */

export const listManualVoucher = (query) => {
  return request({
    url: '/bfs/manualVoucher/list',
    method: 'get',
    params: query
  });
};

export const listApplyManualVoucher = (query) => {
  return request({
    url: '/bfs/manualVoucher/applaylist',
    method: 'get',
    params: query
  });
};

export const addManaulBookkeeping = (data) => {
  return request({
    url: '/bfs/manualVoucher/add',
    method: 'post',
    data: data
  });
};
export const importDataManaulBookkeeping = (data) => {
  return request({
    url: '/bfs/manualVoucher/importData',
    method: 'post',
    data: data
  });
};

export const getManaulBymanualBatchId = (manualBatchId) =>{
  const data = {
    manualBatchId
  };
  return request({
    url: '/bfs/manualVoucher/getManaulBymanualBatchId',
    method: 'post',
    data: data
  });
};

export const listManualItemByBatchId = (query) => {
  return request({
    url: '/bfs/manualVoucher/listManualItemByBatchId',
    method: 'get',
    params: query
  });
};

export const delManualItem = (id) => {
  const data = {
    id
  };
  return request({
    url: '/bfs/manualVoucher/delManualItem',
    method: 'post',
    data: data
  });
};

export const applyConfirmation = (data) => {
  return request({
    url: '/bfs/manualVoucher/applyConfirmation',
    method: 'post',
    data: data
  });
};

export const applyCancellation = (data) => {
  return request({
    url: '/bfs/manualVoucher/applyCancellation',
    method: 'post',
    data: data
  });
};

export const auditPass = (data) => {
  return request({
    url: '/bfs/manualVoucher/auditPass',
    method: 'post',
    data: data
  });
};

export const auditUnPass = (data) => {
  return request({
    url: '/bfs/manualVoucher/auditUnPass',
    method: 'post',
    data: data
  });
};
