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