From 69c14308361265e2245c4fd3c8e42a7774192e6e Mon Sep 17 00:00:00 2001 From: zc Date: Sun, 12 Apr 2026 18:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/materialType/materialType.ts | 28 +++ .../materialType/MaterialTypeImportDrawer.vue | 179 ++++++++++++++++++ src/views/materialType/index.vue | 13 ++ 3 files changed, 220 insertions(+) create mode 100644 src/views/materialType/MaterialTypeImportDrawer.vue diff --git a/src/apis/materialType/materialType.ts b/src/apis/materialType/materialType.ts index e49558a..4840a5d 100644 --- a/src/apis/materialType/materialType.ts +++ b/src/apis/materialType/materialType.ts @@ -21,6 +21,19 @@ export interface MaterialTypeQuery { } export interface MaterialTypePageQuery extends MaterialTypeQuery, PageQuery {} +export interface MaterialTypeImportResp { + importKey: string + totalRows: number + validRows: number + duplicateNameRows: number +} + +export interface MaterialTypeImportResult { + insertRows: number + updateRows: number + totalRows: number +} + /** @desc 查询物料品类列表 */ export function listMaterialType(query: MaterialTypePageQuery) { return http.get>(`${BASE_URL}`, query) @@ -50,3 +63,18 @@ export function deleteMaterialType(id: string) { export function exportMaterialType(query: MaterialTypeQuery) { return http.download(`${BASE_URL}/export`, query) } + +/** @desc 下载物料品类导入模板 */ +export function downloadMaterialTypeImportTemplate() { + return http.download(`${BASE_URL}/importTemplate`) +} + +/** @desc 解析物料品类导入数据 */ +export function parseImportMaterialType(data: FormData) { + return http.post(`${BASE_URL}/parseImport`, data) +} + +/** @desc 导入物料品类 */ +export function importMaterialType(data: any) { + return http.post(`${BASE_URL}/import`, data) +} diff --git a/src/views/materialType/MaterialTypeImportDrawer.vue b/src/views/materialType/MaterialTypeImportDrawer.vue new file mode 100644 index 0000000..fd89b8b --- /dev/null +++ b/src/views/materialType/MaterialTypeImportDrawer.vue @@ -0,0 +1,179 @@ + + + + + \ No newline at end of file diff --git a/src/views/materialType/index.vue b/src/views/materialType/index.vue index 7a0c2c7..eac7dc0 100644 --- a/src/views/materialType/index.vue +++ b/src/views/materialType/index.vue @@ -28,6 +28,10 @@ + + + + @@ -53,12 +57,14 @@ + \ No newline at end of file