产品管理

This commit is contained in:
FLL
2025-06-26 09:50:41 +08:00
parent 7371da5f48
commit 8d3f5331a5
6 changed files with 655 additions and 5 deletions

View File

@@ -0,0 +1,61 @@
import type { PropertyVO, PropertyForm, PropertyQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-绿植产品列表
* @param params
* @returns 绿植租赁-绿植产品列表
*/
export function plantsProductList(params?: PropertyQuery) {
return requestClient.get<PageResult<PropertyVO>>('/property/plantsProduct/list', { params });
}
/**
* 导出绿植租赁-绿植产品列表
* @param params
* @returns 绿植租赁-绿植产品列表
*/
export function plantsProductExport(params?: PropertyQuery) {
return commonExport('/property/plantsProduct/export', params ?? {});
}
/**
* 查询绿植租赁-绿植产品详情
* @param id id
* @returns 绿植租赁-绿植产品详情
*/
export function plantsProductInfo(id: ID) {
return requestClient.get<PropertyVO>(`/property/plantsProduct/${id}`);
}
/**
* 新增绿植租赁-绿植产品
* @param data
* @returns void
*/
export function plantsProductAdd(data: PropertyForm) {
return requestClient.postWithMsg<void>('/property/plantsProduct', data);
}
/**
* 更新绿植租赁-绿植产品
* @param data
* @returns void
*/
export function plantsProductUpdate(data: PropertyForm) {
return requestClient.putWithMsg<void>('/property/plantsProduct', data);
}
/**
* 删除绿植租赁-绿植产品
* @param id id
* @returns void
*/
export function plantsProductRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/plantsProduct/${id}`);
}

View File

@@ -0,0 +1,154 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface PropertyVO {
/**
* 主键
*/
id: string | number;
/**
* 产品编号
*/
plantCode: string;
/**
* 产品名称
*/
plantName: string;
/**
* 产品分类
*/
plantType: number;
/**
* 产品图片
*/
imgPath: string;
/**
* 规格
*/
specification: string;
/**
* 租金
*/
rent: number;
/**
* 库存数量
*/
inventory: number;
/**
* 状态0下架 1上架
*/
state: number;
/**
* 备注
*/
remark: string;
}
export interface PropertyForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 备注
*/
remark?: string;
}
export interface PropertyQuery extends PageQuery {
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 日期范围参数
*/
params?: any;
}