优化网站导航模块
This commit is contained in:
106
modules/api/booking_____/userInvoice/index.ts
Normal file
106
modules/api/booking_____/userInvoice/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserInvoice, UserInvoiceParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询发票
|
||||
*/
|
||||
export async function pageUserInvoice(params: UserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserInvoice>>>(
|
||||
MODULES_API_URL + '/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 listUserInvoice(params?: UserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<UserInvoice[]>>(
|
||||
MODULES_API_URL + '/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 addUserInvoice(data: UserInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票
|
||||
*/
|
||||
export async function updateUserInvoice(data: UserInvoice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票
|
||||
*/
|
||||
export async function removeUserInvoice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除发票
|
||||
*/
|
||||
export async function removeBatchUserInvoice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/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 getUserInvoice(id: number) {
|
||||
const res = await request.get<ApiResult<UserInvoice>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
modules/api/booking_____/userInvoice/model/index.ts
Normal file
53
modules/api/booking_____/userInvoice/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 发票
|
||||
*/
|
||||
export interface UserInvoice {
|
||||
// id
|
||||
id?: number;
|
||||
// 发票类型(0纸质 1电子)
|
||||
type?: number;
|
||||
// 发票名称
|
||||
name?: string;
|
||||
// 开票类型(0铺票 1专票)
|
||||
invoiceType?: string;
|
||||
// 税号
|
||||
invoiceCode?: string;
|
||||
// 公司地址
|
||||
address?: string;
|
||||
// 公司电话
|
||||
tel?: string;
|
||||
// 开户行
|
||||
bankName?: string;
|
||||
// 开户账号
|
||||
bankAccount?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 电子邮箱
|
||||
email?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票搜索条件
|
||||
*/
|
||||
export interface UserInvoiceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user