新增:配件管理模块

This commit is contained in:
gxwebsoft
2024-02-27 20:29:45 +08:00
parent aa56030cbd
commit 963b239333
15 changed files with 3084 additions and 373 deletions

View File

@@ -0,0 +1,102 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Goods, GoodsParam } from '@/api/tower/part/goods/model';
/**
* 分页查询仓库
*/
export async function pageGoods(params: GoodsParam) {
const res = await request.get<ApiResult<PageResult<Goods>>>(
'/tower/tower-part-goods/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询仓库列表
*/
export async function listGoods(params?: GoodsParam) {
const res = await request.get<ApiResult<Goods[]>>('/tower/tower-part-goods', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加仓库
*/
export async function addGoods(data: Goods) {
const res = await request.post<ApiResult<unknown>>(
'/tower/tower-part-goods',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改仓库
*/
export async function updateGoods(data: Goods) {
const res = await request.put<ApiResult<unknown>>(
'/tower/tower-part-goods',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 绑定仓库
*/
export async function bindGoods(data: Goods) {
const res = await request.put<ApiResult<unknown>>(
'/tower/tower-part-goods/bind',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除仓库
*/
export async function removeGoods(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/tower/tower-part-goods/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除仓库
*/
export async function removeBatchGoods(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/tower/tower-part-goods/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,30 @@
import type { PageParam } from '@/api';
export interface Goods {
goodsId?: number;
goodsName?: string;
goodsCode?: string;
category?: string;
specs?: string;
position?: string;
stock?: number;
stockMoney?: number;
price?: number;
salePrice?: number;
stockMin?: number;
stockLower?: boolean;
status?: number;
userId?: number;
comments?: string;
sortNumber?: number;
}
/**
* 搜索条件
*/
export interface GoodsParam extends PageParam {
goodsId?: number;
goodsCode?: string;
status?: number;
keywords?: string;
}

View File

@@ -23,6 +23,32 @@ export interface SecurityRecord {
accessoryNo?: string;
accessorySpecs?: string;
accessoryModel?: string;
before1?: string;
before2?: string;
before3?: string;
before4?: string;
before5?: string;
before6?: string;
before7?: string;
before8?: string;
before9?: string;
before10?: string;
before11?: string;
before12?: string;
before13?: string;
after1?: string;
after2?: string;
after3?: string;
after4?: string;
after5?: string;
after6?: string;
after7?: string;
after8?: string;
after9?: string;
after10?: string;
after11?: string;
after12?: string;
after13?: string;
}
/**