优化网站导航模块
This commit is contained in:
106
modules/api/booking_____/bookingUserInvoice/index.ts
Normal file
106
modules/api/booking_____/bookingUserInvoice/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingUserInvoice, BookingUserInvoiceParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询发票
|
||||
*/
|
||||
export async function pageBookingUserInvoice(params: BookingUserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingUserInvoice>>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票列表
|
||||
*/
|
||||
export async function listBookingUserInvoice(params?: BookingUserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<BookingUserInvoice[]>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加发票
|
||||
*/
|
||||
export async function addBookingUserInvoice(data: BookingUserInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票
|
||||
*/
|
||||
export async function updateBookingUserInvoice(data: BookingUserInvoice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票
|
||||
*/
|
||||
export async function removeBookingUserInvoice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除发票
|
||||
*/
|
||||
export async function removeBatchBookingUserInvoice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询发票
|
||||
*/
|
||||
export async function getBookingUserInvoice(id: number) {
|
||||
const res = await request.get<ApiResult<BookingUserInvoice>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
modules/api/booking_____/bookingUserInvoice/model/index.ts
Normal file
61
modules/api/booking_____/bookingUserInvoice/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 发票
|
||||
*/
|
||||
export interface BookingUserInvoice {
|
||||
// id
|
||||
id?: number;
|
||||
// 发票类型(0纸质 1电子)
|
||||
type?: number;
|
||||
// 发票名称
|
||||
name?: string;
|
||||
// 开票类型(0普票 1专票)
|
||||
invoiceType?: number;
|
||||
// 税号
|
||||
invoiceCode?: string;
|
||||
// 公司地址
|
||||
address?: string;
|
||||
// 公司电话
|
||||
tel?: string;
|
||||
// 开户行
|
||||
bankName?: string;
|
||||
// 开户账号
|
||||
bankAccount?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 电子邮箱
|
||||
email?: string;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 发票图片预览
|
||||
invoiceImg?: string;
|
||||
// 发票pdf地址
|
||||
invoicePdf?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否启用
|
||||
isCompany?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票搜索条件
|
||||
*/
|
||||
export interface BookingUserInvoiceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user