46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import type { PageParam, PageResult } from '@vben/request';
|
|
|
|
import { requestClient } from '#/api/request';
|
|
|
|
export namespace MaterialsApi {
|
|
/** 工料机-根节点 */
|
|
export interface Root {
|
|
id?: number;
|
|
code: string;
|
|
name: string;
|
|
sortOrder: number;
|
|
taxExclBaseCode: string;
|
|
taxInclBaseCode: string;
|
|
taxExclCompileCode: string;
|
|
taxInclCompileCode: string;
|
|
attributes?: {
|
|
description?: string;
|
|
[key: string]: any;
|
|
};
|
|
createTime?: number;
|
|
updateTime?: number;
|
|
creator?: string;
|
|
updater?: string;
|
|
deleted?: number;
|
|
tenantId?: number;
|
|
}
|
|
|
|
}
|
|
|
|
//工料机类别字典(辅助数据)
|
|
export function getCategoriesList() {
|
|
return requestClient.get<MaterialsApi.Root[]>('/core/resource/categories');
|
|
}
|
|
//5.3 创建类别
|
|
export function createCategories(data: any) {
|
|
return requestClient.post<MaterialsApi.Root>(`/core/resource/categories`,data);
|
|
}
|
|
//5.4 更新类别
|
|
export function updateCategories(data: MaterialsApi.Root) {
|
|
return requestClient.put<MaterialsApi.Root>(`/core/resource/categories`,data);
|
|
}
|
|
//5.5 删除类别
|
|
export function deleteCategories(id: number) {
|
|
return requestClient.delete(`/core/resource/categories/${id}`);
|
|
}
|