import request from '@/utils/request';

/**
 * 查询收据信息总列表
 * @param query
 * @returns {*}
 */

export const listInfo = (query) => {
  return request({
    url: '/bls/ReceiptInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询收据拆分信息
 * @param receiptId
 */
export const listSplit = (receiptId) => {
  const data = {
    receiptId
  };
  return request({
    url: '/bls/ReceiptInfo/listSplit',
    method: 'post',
    data: data
  });
};

/**
 * 收据详情展示
 * @param receiptId
 */
export const showDetail = (receiptId) => {
  const data = {
    receiptId
  };
  return request({
    url: '/bls/ReceiptInfo/showDetail',
    method: 'post',
    data: data
  });
};

/**
 * 获取打印模版
 */
export const getTemplate = () => {
  return request({
    url: '/bls/ReceiptInfo/getTemplate',
    method: 'post'
  });
};

export const PrintReceipt = (data) => {
  return request({
    url: '/bls/ReceiptInfo/PrintReceipt',
    method: 'post',
    data: data
  });
};

export const getPrintData = (data) => {
  return request({
    url: '/bls/ReceiptInfo/getPrintData',
    method: 'post',
    data: data
  });
};

export const deleteData = (data) => {
  return request({
    url: '/bls/ReceiptInfo/deleteData',
    method: 'post',
    data: data
  });
};

/**
 * 收据预览
 * @param data
 * @constructor
 */
export const PrintPreviewReceipt = (data) => {
  return request({
    url: '/bls/ReceiptInfo/PrintPreviewReceipt',
    method: 'post',
    data: data
  });
};
