新增标准节租金等功能
This commit is contained in:
@@ -6,9 +6,7 @@ import type { Project, ProjectParam } from '@/api/tower/project/model';
|
||||
* 项目数据
|
||||
*/
|
||||
export async function towerProjectData() {
|
||||
const res = await request.get(
|
||||
'/tower/tower-project/data'
|
||||
);
|
||||
const res = await request.get('/tower/tower-project/data');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ export interface Project {
|
||||
export interface ProjectParam extends PageParam {
|
||||
projectId?: number;
|
||||
projectName?: string;
|
||||
projectStatus?: any;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
107
src/api/tower/rent/index.ts
Normal file
107
src/api/tower/rent/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TowerRent, TowerRentParam } from './model';
|
||||
// const merchantCode = String(localStorage.getItem('merchantCode'));
|
||||
|
||||
/**
|
||||
* 分页查询标准节租金
|
||||
*/
|
||||
export async function pageTowerRent(params: TowerRentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerRent>>>(
|
||||
'/tower/tower-rent/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标准节租金列表
|
||||
*/
|
||||
export async function listTowerRent(params?: TowerRentParam) {
|
||||
const res = await request.get<ApiResult<TowerRent[]>>('/tower/tower-rent', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加标准节租金
|
||||
*/
|
||||
export async function addTowerRent(data: TowerRent) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-rent',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标准节租金
|
||||
*/
|
||||
export async function updateTowerRent(data: TowerRent) {
|
||||
const res = await request.put<ApiResult<unknown>>('/tower/tower-rent', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标准节租金
|
||||
*/
|
||||
export async function removeTowerRent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-rent/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除标准节租金
|
||||
*/
|
||||
export async function removeBatchTowerRent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-rent/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-rent/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
src/api/tower/rent/model/index.ts
Normal file
57
src/api/tower/rent/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 标准节租金
|
||||
*/
|
||||
export interface TowerRent {
|
||||
rentId?: number;
|
||||
name?: string;
|
||||
rent?: number;
|
||||
month?: number;
|
||||
num?: number;
|
||||
totalRent?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
// 型号分类图片
|
||||
image?: string;
|
||||
// 使用年限
|
||||
yearLife?: number;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 是否隐藏
|
||||
hide?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
merchantCode?: string;
|
||||
value?: number;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface TowerRentParam extends PageParam {
|
||||
rentId?: number;
|
||||
title?: string;
|
||||
categoryId?: string;
|
||||
yearLife?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user