feat(mes): 迁移客户、供应商、车间管理到 vben
This commit is contained in:
86
apps/web-antd/src/api/mes/md/client/index.ts
Normal file
86
apps/web-antd/src/api/mes/md/client/index.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MesMdClientApi {
|
||||
/** MES 客户 */
|
||||
export interface Client {
|
||||
id?: number; // 客户编号
|
||||
code?: string; // 客户编码
|
||||
name?: string; // 客户名称
|
||||
nickname?: string; // 客户简称
|
||||
englishName?: string; // 客户英文名称
|
||||
description?: string; // 客户简介
|
||||
logo?: string; // 客户 LOGO 地址
|
||||
type?: number; // 客户类型
|
||||
address?: string; // 客户地址
|
||||
website?: string; // 客户官网地址
|
||||
email?: string; // 客户邮箱地址
|
||||
telephone?: string; // 客户电话
|
||||
contact1Name?: string; // 联系人1
|
||||
contact1Telephone?: string; // 联系人1电话
|
||||
contact1Email?: string; // 联系人1邮箱
|
||||
contact2Name?: string; // 联系人2
|
||||
contact2Telephone?: string; // 联系人2电话
|
||||
contact2Email?: string; // 联系人2邮箱
|
||||
creditCode?: string; // 统一社会信用代码
|
||||
status?: number; // 状态
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
}
|
||||
|
||||
/** 客户导入结果 */
|
||||
export interface ClientImportRespVO {
|
||||
createCodes?: string[]; // 新增成功的客户编码
|
||||
updateCodes?: string[]; // 更新成功的客户编码
|
||||
failureCodes?: Record<string, string>; // 导入失败的客户编码及原因
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询客户分页 */
|
||||
export function getClientPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdClientApi.Client>>(
|
||||
'/mes/md-client/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询客户详情 */
|
||||
export function getClient(id: number) {
|
||||
return requestClient.get<MesMdClientApi.Client>(
|
||||
`/mes/md-client/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户 */
|
||||
export function createClient(data: MesMdClientApi.Client) {
|
||||
return requestClient.post('/mes/md-client/create', data);
|
||||
}
|
||||
|
||||
/** 修改客户 */
|
||||
export function updateClient(data: MesMdClientApi.Client) {
|
||||
return requestClient.put('/mes/md-client/update', data);
|
||||
}
|
||||
|
||||
/** 删除客户 */
|
||||
export function deleteClient(id: number) {
|
||||
return requestClient.delete(`/mes/md-client/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出客户 */
|
||||
export function exportClient(params: any) {
|
||||
return requestClient.download('/mes/md-client/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 下载客户导入模板 */
|
||||
export function importClientTemplate() {
|
||||
return requestClient.download('/mes/md-client/get-import-template');
|
||||
}
|
||||
|
||||
/** 导入客户 */
|
||||
export function importClient(file: File, updateSupport: boolean) {
|
||||
return requestClient.upload<MesMdClientApi.ClientImportRespVO>(
|
||||
`/mes/md-client/import?updateSupport=${updateSupport}`,
|
||||
{ file },
|
||||
);
|
||||
}
|
||||
87
apps/web-antd/src/api/mes/md/vendor/index.ts
vendored
Normal file
87
apps/web-antd/src/api/mes/md/vendor/index.ts
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MesMdVendorApi {
|
||||
/** MES 供应商 */
|
||||
export interface Vendor {
|
||||
id?: number; // 供应商编号
|
||||
code?: string; // 供应商编码
|
||||
name?: string; // 供应商名称
|
||||
nickname?: string; // 供应商简称
|
||||
englishName?: string; // 供应商英文名称
|
||||
description?: string; // 供应商简介
|
||||
logo?: string; // 供应商 LOGO 地址
|
||||
level?: string; // 供应商等级
|
||||
score?: number; // 供应商评分
|
||||
address?: string; // 供应商地址
|
||||
website?: string; // 供应商官网地址
|
||||
email?: string; // 供应商邮箱地址
|
||||
telephone?: string; // 供应商电话
|
||||
contact1Name?: string; // 联系人1
|
||||
contact1Telephone?: string; // 联系人1电话
|
||||
contact1Email?: string; // 联系人1邮箱
|
||||
contact2Name?: string; // 联系人2
|
||||
contact2Telephone?: string; // 联系人2电话
|
||||
contact2Email?: string; // 联系人2邮箱
|
||||
creditCode?: string; // 统一社会信用代码
|
||||
status?: number; // 状态
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
}
|
||||
|
||||
/** 供应商导入结果 */
|
||||
export interface VendorImportRespVO {
|
||||
createCodes?: string[]; // 新增成功的供应商编码
|
||||
updateCodes?: string[]; // 更新成功的供应商编码
|
||||
failureCodes?: Record<string, string>; // 导入失败的供应商编码及原因
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询供应商分页 */
|
||||
export function getVendorPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdVendorApi.Vendor>>(
|
||||
'/mes/md-vendor/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询供应商详情 */
|
||||
export function getVendor(id: number) {
|
||||
return requestClient.get<MesMdVendorApi.Vendor>(
|
||||
`/mes/md-vendor/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增供应商 */
|
||||
export function createVendor(data: MesMdVendorApi.Vendor) {
|
||||
return requestClient.post('/mes/md-vendor/create', data);
|
||||
}
|
||||
|
||||
/** 修改供应商 */
|
||||
export function updateVendor(data: MesMdVendorApi.Vendor) {
|
||||
return requestClient.put('/mes/md-vendor/update', data);
|
||||
}
|
||||
|
||||
/** 删除供应商 */
|
||||
export function deleteVendor(id: number) {
|
||||
return requestClient.delete(`/mes/md-vendor/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出供应商 */
|
||||
export function exportVendor(params: any) {
|
||||
return requestClient.download('/mes/md-vendor/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 下载供应商导入模板 */
|
||||
export function importVendorTemplate() {
|
||||
return requestClient.download('/mes/md-vendor/get-import-template');
|
||||
}
|
||||
|
||||
/** 导入供应商 */
|
||||
export function importVendor(file: File, updateSupport: boolean) {
|
||||
return requestClient.upload<MesMdVendorApi.VendorImportRespVO>(
|
||||
`/mes/md-vendor/import?updateSupport=${updateSupport}`,
|
||||
{ file },
|
||||
);
|
||||
}
|
||||
60
apps/web-antd/src/api/mes/md/workstation/workshop/index.ts
Normal file
60
apps/web-antd/src/api/mes/md/workstation/workshop/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MesMdWorkshopApi {
|
||||
/** MES 车间 */
|
||||
export interface Workshop {
|
||||
id?: number; // 车间编号
|
||||
code?: string; // 车间编码
|
||||
name?: string; // 车间名称
|
||||
area?: number; // 面积
|
||||
chargeUserId?: number; // 负责人用户编号
|
||||
chargeUserName?: string; // 负责人名称
|
||||
status?: number; // 状态
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询车间分页 */
|
||||
export function getWorkshopPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdWorkshopApi.Workshop>>(
|
||||
'/mes/md-workshop/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询车间精简列表 */
|
||||
export function getWorkshopSimpleList() {
|
||||
return requestClient.get<MesMdWorkshopApi.Workshop[]>(
|
||||
'/mes/md-workshop/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询车间详情 */
|
||||
export function getWorkshop(id: number) {
|
||||
return requestClient.get<MesMdWorkshopApi.Workshop>(
|
||||
`/mes/md-workshop/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增车间 */
|
||||
export function createWorkshop(data: MesMdWorkshopApi.Workshop) {
|
||||
return requestClient.post('/mes/md-workshop/create', data);
|
||||
}
|
||||
|
||||
/** 修改车间 */
|
||||
export function updateWorkshop(data: MesMdWorkshopApi.Workshop) {
|
||||
return requestClient.put('/mes/md-workshop/update', data);
|
||||
}
|
||||
|
||||
/** 删除车间 */
|
||||
export function deleteWorkshop(id: number) {
|
||||
return requestClient.delete(`/mes/md-workshop/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出车间 */
|
||||
export function exportWorkshop(params: any) {
|
||||
return requestClient.download('/mes/md-workshop/export-excel', { params });
|
||||
}
|
||||
28
apps/web-antd/src/api/mes/wm/itemreceipt/line/index.ts
Normal file
28
apps/web-antd/src/api/mes/wm/itemreceipt/line/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MesWmItemReceiptLineApi {
|
||||
/** MES 物料接收单行 */
|
||||
export interface ItemReceiptLine {
|
||||
id?: number; // 行编号
|
||||
receiptId?: number; // 入库单编号
|
||||
receiptCode?: string; // 入库单编码
|
||||
purchaseOrderCode?: string; // 采购订单号
|
||||
itemId?: number; // 物料编号
|
||||
itemCode?: string; // 物料编码
|
||||
itemName?: string; // 物料名称
|
||||
specification?: string; // 规格型号
|
||||
unitMeasureName?: string; // 单位
|
||||
receivedQuantity?: number; // 入库数量
|
||||
batchCode?: string; // 批次号
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询物料接收单行分页 */
|
||||
export function getItemReceiptLinePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesWmItemReceiptLineApi.ItemReceiptLine>>(
|
||||
'/mes/wm/item-receipt-line/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
23
apps/web-antd/src/api/mes/wm/productsales/index.ts
Normal file
23
apps/web-antd/src/api/mes/wm/productsales/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MesWmProductSalesApi {
|
||||
/** MES 销售出库单 */
|
||||
export interface ProductSales {
|
||||
id?: number; // 销售出库单编号
|
||||
code?: string; // 出库单编号
|
||||
name?: string; // 出库单名称
|
||||
salesOrderCode?: string; // 销售订单编号
|
||||
salesDate?: Date; // 出库日期
|
||||
status?: number; // 单据状态
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询销售出库单分页 */
|
||||
export function getProductSalesPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesWmProductSalesApi.ProductSales>>(
|
||||
'/mes/wm/product-sales/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
24
apps/web-antd/src/api/mes/wm/productsales/line/index.ts
Normal file
24
apps/web-antd/src/api/mes/wm/productsales/line/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MesWmProductSalesLineApi {
|
||||
/** MES 销售出库单行 */
|
||||
export interface ProductSalesLine {
|
||||
id?: number; // 行编号
|
||||
itemId?: number; // 物料编号
|
||||
itemCode?: string; // 物料编码
|
||||
itemName?: string; // 物料名称
|
||||
specification?: string; // 规格型号
|
||||
unitMeasureName?: string; // 单位
|
||||
quantity?: number; // 出库数量
|
||||
batchCode?: string; // 批次号
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询销售出库单行分页 */
|
||||
export function getProductSalesLinePage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MesWmProductSalesLineApi.ProductSalesLine>
|
||||
>('/mes/wm/product-sales-line/page', { params });
|
||||
}
|
||||
Reference in New Issue
Block a user