diff --git a/src/api/http/http-api.js b/src/api/http/http-api.js index 8adf18a..b0eefea 100644 --- a/src/api/http/http-api.js +++ b/src/api/http/http-api.js @@ -157,5 +157,15 @@ export default { name: '库存列表', method: 'POST' }, + categoryExportModel: { + url: '/category/export/model', + name: '品规模板下载', + method: 'GET' + }, + stockExportModel: { + url: '/stock/export/model', + name: '库存模板下载', + method: 'GET' + }, } diff --git a/src/plugins/axios/axios.js b/src/plugins/axios/axios.js index a87edf7..486c5f7 100644 --- a/src/plugins/axios/axios.js +++ b/src/plugins/axios/axios.js @@ -10,7 +10,9 @@ const instance = axios.create({ }); window.once = 0 let blobList = [ - '/stock/export' + '/stock/export', + '/category/export/model', + '/stock/export/model' ] instance.interceptors.request.use((config) => { const reqObj = config; diff --git a/src/views/productSpecManage/index.vue b/src/views/productSpecManage/index.vue index 86eb051..8bad1ea 100644 --- a/src/views/productSpecManage/index.vue +++ b/src/views/productSpecManage/index.vue @@ -12,11 +12,15 @@ :showUploadList = 'false' @change="handleChange" ref="table" + style="margin-right:15px" > - + 导入 + + 模板下载 + { + let blob = new Blob([res], {type: "application/vnd.ms-excel"}) + this.$utils.downloadFile('品规模板.xls', blob) + }).catch(err => { + + }); + }, showModel(type,data){ this.visible = true console.log(type) @@ -190,7 +204,7 @@ export default { align-items: center; justify-content: center; .add{ - margin-right: 20px; + margin-right: 15px; } } diff --git a/src/views/repertoryManage/index.vue b/src/views/repertoryManage/index.vue index 5b8dd75..6b9182c 100644 --- a/src/views/repertoryManage/index.vue +++ b/src/views/repertoryManage/index.vue @@ -10,9 +10,12 @@ @change="handleChange" ref="table" > - + 导入 + + 模板下载 + { + }); + }, + stockExportModel() { + this.$api.httpApi.stockExportModel({ + params: {} + }).then(res => { + let blob = new Blob([res], {type: "application/vnd.ms-excel"}) + this.$utils.downloadFile('库存模板.xls', blob) + }).catch(err => { + }); }, },