import { request } from '@eciol/request'; import { replaceVariables } from '@eciol/shared'; import { useUserStoreWithOut } from '@/store/modules/user'; import type { RefundService } from './typing'; enum Api { GetRefundList = '/api/RefundBill/QueryPage', GetInvoiceDetail = '/api/RefundBill/{orgId}/{id}', GetRefundInvoiceDetail = '/api/RefundBill/GetInvoice/{orgId}/{invoiceId}', } /** * 扣款坏账单列表 * @param data */ function getRefundList(data: RefundService.GetRefundListParams) { const { getCompanyId } = useUserStoreWithOut(); return request.post( { url: Api.GetRefundList, data: { ...data, orgId: getCompanyId }, }, { showLoading: true, }, ); } /** * 扣款坏账单详细 * @param id */ function getRefundDetail(id: number) { const { getCompanyId } = useUserStoreWithOut(); return request.get( { url: replaceVariables(Api.GetInvoiceDetail, { id, orgId: getCompanyId }), }, { showLoading: true, }, ); } /** * @description Invoice的扣款坏账详情 GET /api/RefundBill/GetInvoice/{orgId}/{InvoiceId} 接口ID:142728569 接口地址:https://app.apifox.com/link/project/3222086/apis/api-142728569 * @param invoiceId */ function getRefundInvoiceDetail(invoiceId: number) { const { getCompanyId } = useUserStoreWithOut(); return request.get( { url: replaceVariables(Api.GetRefundInvoiceDetail, { invoiceId, orgId: getCompanyId }), }, { showLoading: true, }, ); } export { getRefundDetail, getRefundInvoiceDetail, getRefundList }; export type { RefundService } from './typing';