初始版本提交
This commit is contained in:
299
src/api/erp/material/list/index.ts
Normal file
299
src/api/erp/material/list/index.ts
Normal file
@ -0,0 +1,299 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
import {
|
||||
MaterialPageListSearchModel,
|
||||
MaterialAddParamsModel,
|
||||
MaterialUpdateParamsModel,
|
||||
MaterialPageListResultModel,
|
||||
MaterialInfoParams,
|
||||
PurchaseModel,
|
||||
InStoreModel,
|
||||
OutStoreModel,
|
||||
LogModel,
|
||||
MaterialStockParamsModel,
|
||||
MaterialHistoryPageListSearchModel,
|
||||
MaterialHistoryPageListResultModel,
|
||||
} from './model';
|
||||
|
||||
enum Api {
|
||||
Page = '/caseErpMaterial/caseErpMaterial/page',
|
||||
List = '/caseErpMaterial/caseErpMaterial/list',
|
||||
Material = '/caseErpMaterial/caseErpMaterial',
|
||||
Info = '/caseErpMaterial/caseErpMaterial/info',
|
||||
Export = '/caseErpMaterial/caseErpMaterial/export',
|
||||
Import = '/caseErpMaterial/caseErpMaterial/import',
|
||||
Code = '/caseErpMaterial/caseErpMaterial/codeNumber',
|
||||
Purchase = '/caseErpMaterial/caseErpMaterial/purchase',
|
||||
InStore = '/caseErpMaterial/caseErpMaterial/in-store',
|
||||
OutStore = '/caseErpMaterial/caseErpMaterial/out-store',
|
||||
Log = '/caseErpMaterial/caseErpMaterial/log',
|
||||
Stock = '/caseErpMaterial/caseErpMaterial/stock-count',
|
||||
History = '/caseErpMaterial/caseErpMaterial/material-history-page',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询物料清单(分页)
|
||||
*/
|
||||
export async function getMaterialPageList(
|
||||
params?: MaterialPageListSearchModel,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.get<MaterialPageListResultModel>(
|
||||
{
|
||||
url: Api.Page,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询物料清单(不分页)
|
||||
*/
|
||||
export async function getMaterialList(
|
||||
params?: MaterialPageListSearchModel,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.get<MaterialPageListResultModel>(
|
||||
{
|
||||
url: Api.List,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 新增物料信息
|
||||
*/
|
||||
export async function addMaterialList(
|
||||
type: MaterialAddParamsModel,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.post<number>(
|
||||
{
|
||||
url: Api.Material,
|
||||
params: type,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改物料信息
|
||||
*/
|
||||
export async function updateMaterialList(
|
||||
type: MaterialUpdateParamsModel,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.put<number>(
|
||||
{
|
||||
url: Api.Material,
|
||||
params: type,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除物料信息
|
||||
*/
|
||||
export async function deleteMaterialList(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.delete<number>(
|
||||
{
|
||||
url: Api.Material,
|
||||
data: id,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询物料信息详情
|
||||
*/
|
||||
export async function getMaterialListInfo(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<MaterialAddParamsModel>(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询采购记录详情
|
||||
*/
|
||||
export async function getPurchaseInfo(
|
||||
params: MaterialInfoParams,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.get<PurchaseModel[]>(
|
||||
{
|
||||
url: Api.Purchase,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询入库记录详情
|
||||
*/
|
||||
export async function getInStoreInfo(params: MaterialInfoParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<InStoreModel[]>(
|
||||
{
|
||||
url: Api.InStore,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询出库记录详情
|
||||
*/
|
||||
export async function getOutStoreInfo(
|
||||
params: MaterialInfoParams,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.get<OutStoreModel[]>(
|
||||
{
|
||||
url: Api.OutStore,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询操作记录详情
|
||||
*/
|
||||
export async function getLogInfo(params: MaterialInfoParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LogModel[]>(
|
||||
{
|
||||
url: Api.Log,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 导出
|
||||
*/
|
||||
export async function exportInfo(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.download(
|
||||
{
|
||||
url: Api.Export,
|
||||
method: 'POST',
|
||||
params: ids,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 下载模板
|
||||
*/
|
||||
export async function downloadTemplate(mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.download(
|
||||
{
|
||||
url: Api.Export,
|
||||
method: 'GET',
|
||||
responseType: 'blob',
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 导入
|
||||
*/
|
||||
export async function importInfo(params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post(
|
||||
{
|
||||
url: Api.Import,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取物料编码
|
||||
*/
|
||||
export async function getMaterialCode(mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<string>(
|
||||
{
|
||||
url: Api.Code,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改库存盘点、报废
|
||||
*/
|
||||
export async function updateMaterialStock(
|
||||
params: MaterialStockParamsModel,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.put<number>(
|
||||
{
|
||||
url: Api.Stock,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询历史记录明细(分页)
|
||||
*/
|
||||
export async function getMaterialHistoryPageList(
|
||||
params?: MaterialHistoryPageListSearchModel,
|
||||
mode: ErrorMessageMode = 'modal',
|
||||
) {
|
||||
return defHttp.get<MaterialHistoryPageListResultModel>(
|
||||
{
|
||||
url: Api.History,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
119
src/api/erp/material/list/model/index.ts
Normal file
119
src/api/erp/material/list/model/index.ts
Normal file
@ -0,0 +1,119 @@
|
||||
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
|
||||
|
||||
export interface MaterialPageListParams {
|
||||
name?: string; //物料名称
|
||||
typeName?: string; //物料类别
|
||||
propertyName?: string; //物料属性
|
||||
state: number; //状态 0-关闭 1-开启
|
||||
}
|
||||
|
||||
export interface MaterialAddParamsModel {
|
||||
classesId: string; //物料类别id
|
||||
code: string; //物料编码
|
||||
fileId: string; //图片路径
|
||||
isSysCodeBoolean: number; //是否系统编码
|
||||
model: string; //规格型号
|
||||
name: string; //物料名称
|
||||
propertyId: string; //物料属性id
|
||||
unitId: string; //单位id
|
||||
createUserName: string; //创建人
|
||||
createDate: string; //创建时间
|
||||
modifyDate: string; //修改时间
|
||||
modifyUserName: string; //修改人
|
||||
unitName: string; //单位名称
|
||||
typeName: string; //物料类别名称
|
||||
propertyName: string; //物料属性名称
|
||||
}
|
||||
|
||||
export interface MaterialUpdateParamsModel {
|
||||
id: string; //详情id
|
||||
classesId: string; //物料类别id
|
||||
code: string; //物料编码
|
||||
fileId: string; //图片路径
|
||||
isSysCodeBoolean: number; //是否系统编码
|
||||
model: string; //规格型号
|
||||
name: string; //物料名称
|
||||
propertyId: string; //物料属性id
|
||||
unitId: string; //单位id
|
||||
}
|
||||
|
||||
export interface MaterialListModel {
|
||||
id: string; //详情id
|
||||
code: string; //物料编码
|
||||
name: string; //物料名称
|
||||
model: string; //规格型号
|
||||
inventory: number; //当前库存
|
||||
unitName: string; //单位
|
||||
typeName: string; //物料类别
|
||||
propertyName: string; //物料属性
|
||||
state: number; //状态 0-关闭 1-开启
|
||||
}
|
||||
|
||||
export interface PurchaseModel {
|
||||
number: string; //采购单号
|
||||
theme: string; //采购主题
|
||||
purchaseDate: string; //采购日期
|
||||
purchasePersonName: string; //采购人员
|
||||
purchaseDept: number; //采购部门
|
||||
supplierName: string; //供应商
|
||||
count: number; //采购数量
|
||||
accountSum: number; //采购金额
|
||||
}
|
||||
|
||||
export interface InStoreModel {
|
||||
number: string; //入库单号
|
||||
theme: string; //入库主题
|
||||
date: string; //入库日期
|
||||
insertType: string; //入库类型
|
||||
count: number; //数量
|
||||
person: string; //入库人员
|
||||
store: number; //入库仓库
|
||||
}
|
||||
|
||||
export interface OutStoreModel {
|
||||
number: string; //出库单号
|
||||
theme: string; //出库主题
|
||||
date: string; //出库日期
|
||||
outType: string; //出库类型
|
||||
count: number; //数量
|
||||
person: string; //出库人员
|
||||
store: number; //出库仓库
|
||||
}
|
||||
|
||||
export interface LogModel {
|
||||
operateUserAccount: string; //操作人
|
||||
operateTime: string; //操作时间
|
||||
executeResultJson: string; //操作内容
|
||||
}
|
||||
|
||||
export interface MaterialInfoParams {
|
||||
id: string; //id
|
||||
keyword?: string; //关键字
|
||||
}
|
||||
|
||||
export interface MaterialStockParamsModel {
|
||||
id: string;
|
||||
count: number; //数量
|
||||
type: number; //-1:减少、1:增加、0:报废
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface MaterialHistoryPageListParams {
|
||||
id: string; //详情id
|
||||
type?: string; //类型
|
||||
}
|
||||
|
||||
export interface MaterialHistoryListModel {
|
||||
id: string; //详情id
|
||||
typeName: string; //库存类别
|
||||
name: string; //产品名称
|
||||
operateTypeName: string; //操作类型
|
||||
createDate: number; //操作时间
|
||||
count: number; //数量
|
||||
localInventory?: number; //库存结余
|
||||
}
|
||||
|
||||
export type MaterialPageListSearchModel = BasicPageParams & MaterialPageListParams;
|
||||
export type MaterialPageListResultModel = BasicFetchResult<MaterialListModel>;
|
||||
export type MaterialHistoryPageListSearchModel = BasicPageParams & MaterialHistoryPageListParams;
|
||||
export type MaterialHistoryPageListResultModel = BasicFetchResult<MaterialHistoryListModel>;
|
||||
Reference in New Issue
Block a user