完成仓库模块

This commit is contained in:
Zy
2026-04-23 17:59:36 +08:00
parent 985860c9de
commit 9d4416b238
39 changed files with 5040 additions and 80 deletions

View File

@@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MaterialVO, MaterialForm, MaterialQuery } from './type';
/**
* 查询物料列表
* @param query
* @returns {*}
*/
export const listMaterial = (query?: MaterialQuery): AxiosPromise<MaterialVO[]> => {
return request({
url: '/warehouse/material/list',
method: 'get',
params: query
});
};
/**
* 查询物料详细
* @param id
*/
export const getMaterial = (id: string | number): AxiosPromise<MaterialVO> => {
return request({
url: '/warehouse/material/' + id,
method: 'get'
});
};
/**
* 新增物料
* @param data
*/
export const addMaterial = (data: MaterialForm) => {
return request({
url: '/warehouse/material',
method: 'post',
data: data
});
};
/**
* 修改物料
* @param data
*/
export const updateMaterial = (data: MaterialForm) => {
return request({
url: '/warehouse/material',
method: 'put',
data: data
});
};
/**
* 删除物料
* @param id
*/
export const delMaterial = (id: string | number | Array<string | number>) => {
return request({
url: '/warehouse/material/' + id,
method: 'delete'
});
};

View File

@@ -0,0 +1,90 @@
export interface MaterialVO {
/**
* 物料ID
*/
id: string;
/**
* 物料名称*
*/
materialName: string;
/**
* 品牌*
*/
brand: string;
/**
* 规格型号*
*/
model: string;
/**
* 计量单位
*/
unit: string;
/**
* 备注
*/
remark: string;
}
export interface MaterialForm extends BaseEntity {
/**
* 物料ID
*/
id?: string;
/**
* 物料名称*
*/
materialName?: string;
/**
* 品牌*
*/
brand?: string;
/**
* 规格型号*
*/
model?: string;
/**
* 计量单位
*/
unit?: string;
/**
* 备注
*/
remark?: string;
}
export interface MaterialQuery extends PageQuery {
/**
* 物料名称*
*/
materialName?: string;
/**
* 品牌*
*/
brand?: string;
/**
* 规格型号*
*/
model?: string;
/**
* 计量单位
*/
unit?: string;
/**
* 日期范围参数
*/
params?: any;
}