This commit is contained in:
2025-01-08 09:44:25 +08:00
parent 06f6e29972
commit 4d21314fc6
60 changed files with 5477 additions and 4495 deletions
+13 -12
View File
@@ -1,14 +1,15 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserInvoice, UserInvoiceParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
import { THINK_API_URL } from '@/config/setting';
import type {ThinkInvoice} from "@/api/think/thinkInvoice/model";
/**
* 分页查询发票
*/
export async function pageUserInvoice(params: UserInvoiceParam) {
const res = await request.get<ApiResult<PageResult<UserInvoice>>>(
MODULES_API_URL + '/booking/user-invoice/page',
THINK_API_URL + '/booking/booking-user-invoice/page',
{
params
}
@@ -24,7 +25,7 @@ export async function pageUserInvoice(params: UserInvoiceParam) {
*/
export async function listUserInvoice(params?: UserInvoiceParam) {
const res = await request.get<ApiResult<UserInvoice[]>>(
MODULES_API_URL + '/booking/user-invoice',
THINK_API_URL + '/booking/booking-user-invoice',
{
params
}
@@ -40,7 +41,7 @@ export async function listUserInvoice(params?: UserInvoiceParam) {
*/
export async function addUserInvoice(data: UserInvoice) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice',
THINK_API_URL + '/booking/booking-user-invoice',
data
);
if (res.data.code === 0) {
@@ -54,7 +55,7 @@ export async function addUserInvoice(data: UserInvoice) {
*/
export async function updateUserInvoice(data: UserInvoice) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice',
THINK_API_URL + '/booking/booking-user-invoice',
data
);
if (res.data.code === 0) {
@@ -68,7 +69,7 @@ export async function updateUserInvoice(data: UserInvoice) {
*/
export async function removeUserInvoice(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/' + id
THINK_API_URL + '/booking/booking-user-invoice/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -81,7 +82,7 @@ export async function removeUserInvoice(id?: number) {
*/
export async function removeBatchUserInvoice(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/batch',
THINK_API_URL + '/booking/booking-user-invoice/batch',
{
data
}
@@ -97,7 +98,7 @@ export async function removeBatchUserInvoice(data: (number | undefined)[]) {
*/
export async function getUserInvoice(id: number) {
const res = await request.get<ApiResult<UserInvoice>>(
MODULES_API_URL + '/booking/user-invoice/' + id
THINK_API_URL + '/booking/booking-user-invoice/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
@@ -108,9 +109,9 @@ export async function getUserInvoice(id: number) {
/**
* 开具发票
*/
export async function doInvoice(data: UserInvoice) {
export async function doInvoice(data: ThinkInvoice) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/doInvoice',
THINK_API_URL + '/think/think-invoice/doInvoice',
data
);
if (res.data.code === 0) {
@@ -123,9 +124,9 @@ export async function doInvoice(data: UserInvoice) {
/**
* 根据orderNo查询发票
*/
export async function showInvoice(orderNo: string) {
export async function showInvoice(id: number) {
const res = await request.get<ApiResult<UserInvoice>>(
MODULES_API_URL + '/booking/user-invoice/showInvoice/' + orderNo
THINK_API_URL + `/think/think-invoice/showInvoice/${id}`
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;