diff --git a/src/api/materialManagement/productionMaterial/mminventory.js b/src/api/materialManagement/productionMaterial/mminventory.js index 99517fe..62d6bb8 100644 --- a/src/api/materialManagement/productionMaterial/mminventory.js +++ b/src/api/materialManagement/productionMaterial/mminventory.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { downFile } from '@/utils/request' /** * 库存表分页查询 @@ -112,3 +113,15 @@ export function createOutboundReceipt(data) { data: data }) } + +/** + * 导出库存表 + */ +export async function exportMmInventory(query) { + // return request({ + // url: '/system/User/export', + // method: 'get', + // params: query + // }) + await downFile('/mes/productionMaterial/MmInventory/export', { ...query }) +} diff --git a/src/api/materialManagement/productionMaterial/mmrecordinbound.js b/src/api/materialManagement/productionMaterial/mmrecordinbound.js index 3fc4fa5..f822792 100644 --- a/src/api/materialManagement/productionMaterial/mmrecordinbound.js +++ b/src/api/materialManagement/productionMaterial/mmrecordinbound.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { downFile } from '@/utils/request' /** * 入库记录表分页查询 @@ -55,3 +56,15 @@ export function delMmRecordInbound(pid) { method: 'POST' }) } + +/** + * 导出库存表 + */ +export async function exportMmRecordInbound(query) { + // return request({ + // url: '/system/User/export', + // method: 'get', + // params: query + // }) + await downFile('/mes/productionMaterial/MmRecordInbound/export', { ...query }) +} diff --git a/src/views/materialManagement/productionMaterial/MmInventory.vue b/src/views/materialManagement/productionMaterial/MmInventory.vue index 62bb601..97e295b 100644 --- a/src/views/materialManagement/productionMaterial/MmInventory.vue +++ b/src/views/materialManagement/productionMaterial/MmInventory.vue @@ -430,7 +430,7 @@ import { import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js' import { warehouseOptions } from '@/utils/warehouse.js' import useUserStore from '@/store/modules/user' -import { exportUser } from '@/api/system/user' +import { exportMmInventory } from '@/api/materialManagement/productionMaterial/mminventory.js' import { getToken } from '@/utils/auth' const { proxy } = getCurrentInstance() const userStore = useUserStore() @@ -481,7 +481,7 @@ const upload = reactive({ // 设置上传的请求头部 headers: { Authorization: 'Bearer ' + getToken() }, // 上传的地址 - url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData' + url: import.meta.env.VITE_APP_BASE_API + '/mes/productionMaterial/MmInventory/importData' }) var dictParams = [] @@ -746,19 +746,36 @@ function handleImport() { /** 下载模板操作 */ function importTemplate() { - proxy.download('/system/user/importTemplate', '库存数据导入模板') + proxy.download('/mes/productionMaterial/MmInventory/importTemplate', '库存数据导入模板') } /**文件上传中处理 */ const handleFileUploadProgress = (event, file, fileList) => { upload.isUploading = true } /** 文件上传成功处理 */ +/** 文件上传成功处理 */ const handleFileSuccess = (response, file, fileList) => { const { code, msg, data } = response upload.open = false upload.isUploading = false proxy.$refs['uploadRef'].clearFiles() - proxy.$alert("
', '导入结果', { + + // 构建导入结果提示信息 + const resultHtml = ` + + ` + + proxy.$alert(resultHtml, '导入结果', { dangerouslyUseHTMLString: true }) getList() @@ -777,7 +794,7 @@ function handleExport() { type: 'warning' }) .then(async () => { - await exportUser(queryParams.value) + await exportMmInventory(queryParams.value) }) } diff --git a/src/views/materialManagement/productionMaterial/MmRecordInbound.vue b/src/views/materialManagement/productionMaterial/MmRecordInbound.vue index d058dd9..f1bf79f 100644 --- a/src/views/materialManagement/productionMaterial/MmRecordInbound.vue +++ b/src/views/materialManagement/productionMaterial/MmRecordInbound.vue @@ -293,7 +293,7 @@ import { listMmTransactionType } from '@/api/materialManagement/productionMateri import { getMaterialOption, getLocationOption } from '@/api/materialManagement/productionMaterial/mminventory.js' import { listUser } from '@/api/system/user.js' import useUserStore from '@/store/modules/user' -import { exportUser } from '@/api/system/user' +import { exportMmRecordInbound } from '@/api/materialManagement/productionMaterial/mmrecordinbound.js' import { getToken } from '@/utils/auth' const { proxy } = getCurrentInstance() const userStore = useUserStore() @@ -349,7 +349,7 @@ const upload = reactive({ // 设置上传的请求头部 headers: { Authorization: 'Bearer ' + getToken() }, // 上传的地址 - url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData' + url: import.meta.env.VITE_APP_BASE_API + '/mes/productionMaterial/MmRecordInbound/importData' }) var dictParams = [] @@ -594,13 +594,13 @@ function getOperatorList() { /** 导入按钮操作 */ function handleImport() { - upload.title = '出入库记录表导入' + upload.title = '入库记录表导入' upload.open = true } /** 下载模板操作 */ function importTemplate() { - proxy.download('/system/user/importTemplate', '出入库记录表数据导入模板') + proxy.download('/mes/productionMaterial/MmRecordInbound/importTemplate', '入库记录表数据导入模板') } /**文件上传中处理 */ const handleFileUploadProgress = (event, file, fileList) => { @@ -612,7 +612,23 @@ const handleFileSuccess = (response, file, fileList) => { upload.open = false upload.isUploading = false proxy.$refs['uploadRef'].clearFiles() - proxy.$alert("', '导入结果', { + + // 构建导入结果提示信息 + const resultHtml = ` + + ` + + proxy.$alert(resultHtml, '导入结果', { dangerouslyUseHTMLString: true }) getList() @@ -625,13 +641,13 @@ function submitFileForm() { /** 导出按钮操作 */ function handleExport() { proxy.$modal - .confirm('是否确认导出所有出入库记录表数据项?', '警告', { + .confirm('是否确认导出所有入库记录表数据项?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(async () => { - await exportUser(queryParams.value) + await exportMmRecordInbound(queryParams.value) }) }