From dc50c3e97c5685eacd4299fbc3d5f65dd064679a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=91=AB?= Date: Mon, 22 Mar 2021 15:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E8=A7=84=E3=80=81=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=E4=B8=8B=E8=BD=BD=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/http/http-api.js | 10 ++++++++++ src/plugins/axios/axios.js | 4 +++- src/views/productSpecManage/index.vue | 18 ++++++++++++++++-- src/views/repertoryManage/index.vue | 15 ++++++++++++++- 4 files changed, 43 insertions(+), 4 deletions(-) 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 => { + }); }, },