品规、库存页面新增下载模板功能

merge-requests/1/head
张鑫 5 years ago
parent bbbc322dca
commit dc50c3e97c

@ -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'
},
}

@ -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;

@ -12,11 +12,15 @@
:showUploadList = 'false'
@change="handleChange"
ref="table"
style="margin-right:15px"
>
<a-button type="primary" class="plc" >
<a-button type="primary" >
导入
</a-button>
</a-upload>
<a-button type="" @click="categoryExportModel">
模板下载
</a-button>
</div>
<a-table
:columns="columns"
@ -147,6 +151,16 @@ export default {
});
},
categoryExportModel() {
this.$api.httpApi.categoryExportModel({
params: {}
}).then(res => {
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;
}
}
</style>

@ -10,9 +10,12 @@
@change="handleChange"
ref="table"
>
<a-button type="primary" class="plc" >
<a-button type="primary" style="margin-right:15px">
导入
</a-button>
<a-button type="" @click="stockExportModel">
模板下载
</a-button>
</a-upload>
</div>
<a-table
@ -129,6 +132,16 @@ export default {
});
}).catch(err => {
});
},
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 => {
});
},
},

Loading…
Cancel
Save