import request from '@/utils/request';

// 获取模板列表
export const getInvoiceTplList = (params) =>
  request(`/invoice/${params.invoiceId}/detail-tpl`, { params });

// 生成模板
export const saveInvoiceDetail = (invoiceId) =>
  request(`/invoice/${invoiceId}/detail-tpl`, { method: 'post' });

// 更新模板报销费用信息
export const updateInvoiceDetail = (invoiceId, data) =>
  request(`/invoice/${invoiceId}/detail-tpl/item`, { data, method: 'post' });

/**
 * 删除报销模板
 * @param {*} data
 * @returns
 */
export const deleteInvoiceTpl = (invoiceId, itemId ) =>
  request(`/invoice/${invoiceId}/detail-tpl/item/${itemId}`, { method: 'delete' });

// 获取模板列表
export const getInvoiceDetailList = (params) =>
request(`/invoice/${params.invoiceId}/detail`, { params });
