From cfb9d71d7ed3ca3f1df0f0b0f417fecf4e133afc Mon Sep 17 00:00:00 2001 From: chenfang Date: Mon, 5 Feb 2024 15:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=BA=93=E5=8C=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AEapi=E6=89=A9=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/itemarea/index.ts | 7 ++- src/api/wms/itemareaDetail/index.ts | 50 +++++++++++++++++++ src/components/ImportForm/src/ImportForm.vue | 4 +- .../basicDataManage/itemarea/itemarea.data.ts | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 src/api/wms/itemareaDetail/index.ts diff --git a/src/api/wms/itemarea/index.ts b/src/api/wms/itemarea/index.ts index 8da52d432..bf4973755 100644 --- a/src/api/wms/itemarea/index.ts +++ b/src/api/wms/itemarea/index.ts @@ -55,7 +55,12 @@ export const deleteItemarea = async (id: number) => { // 导出物料库区配置 Excel export const exportItemarea = async (params) => { - return await request.download({ url: `/wms/itemarea/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/itemarea/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/itemarea/export-excel`, params }) + } } // 下载用户导入模板 diff --git a/src/api/wms/itemareaDetail/index.ts b/src/api/wms/itemareaDetail/index.ts new file mode 100644 index 000000000..1b0cfcdd4 --- /dev/null +++ b/src/api/wms/itemareaDetail/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface ItemareaDetailVO { + id: number + masterId: number + remark: string + locationGroup: string + locationCode: string +} + +// 查询物料库区配置表子列表 +export const getItemareaDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/itemarea-detail/senior', data }) + } else { + return await request.get({ url: `/wms/itemarea-detail/page`, params }) + } +} + +// 查询物料库区配置表子详情 +export const getItemareaDetail = async (id: number) => { + return await request.get({ url: `/wms/itemarea-detail/get?id=` + id }) +} + +// 新增物料库区配置表子 +export const createItemareaDetail = async (data: ItemareaDetailVO) => { + return await request.post({ url: `/wms/itemarea-detail/create`, data }) +} + +// 修改物料库区配置表子 +export const updateItemareaDetail = async (data: ItemareaDetailVO) => { + return await request.put({ url: `/wms/itemarea-detail/update`, data }) +} + +// 删除物料库区配置表子 +export const deleteItemareaDetail = async (id: number) => { + return await request.delete({ url: `/wms/itemarea-detail/delete?id=` + id }) +} + +// 导出物料库区配置表子 Excel +export const exportItemareaDetail = async (params) => { + return await request.download({ url: `/wms/itemarea-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/itemarea-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/components/ImportForm/src/ImportForm.vue b/src/components/ImportForm/src/ImportForm.vue index 15369c6ea..32c8e7279 100644 --- a/src/components/ImportForm/src/ImportForm.vue +++ b/src/components/ImportForm/src/ImportForm.vue @@ -245,7 +245,9 @@ const submitFormSuccess = (response: any) => { // 点击下载 // downloadElement.click() }) - } else { + } else if(response.data.errorCount = 0){ + message.error('导入数据不能为空') + }else { message.success('导入成功') } } diff --git a/src/views/wms/basicDataManage/itemarea/itemarea.data.ts b/src/views/wms/basicDataManage/itemarea/itemarea.data.ts index 334cb5361..790fb2bee 100644 --- a/src/views/wms/basicDataManage/itemarea/itemarea.data.ts +++ b/src/views/wms/basicDataManage/itemarea/itemarea.data.ts @@ -151,7 +151,7 @@ export const Itemarea = useCrudSchemas(reactive([ sort: 'custom', }, { - label: '出库后剩余库存自动转换为出库包装规格 出库后剩余库存自动转换为出库包装规格', + label: '出库后剩余库存自动转换为出库包装规格', field: 'surplusToOutpackunit', sort: 'custom', },