完成仓库模块
This commit is contained in:
63
src/api/system/Tmaterial/index.ts
Normal file
63
src/api/system/Tmaterial/index.ts
Normal 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'
|
||||
});
|
||||
};
|
||||
90
src/api/system/Tmaterial/type.ts
Normal file
90
src/api/system/Tmaterial/type.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user