diff --git a/src/api/material.js b/src/api/material.js index 3a04275..6683dfd 100644 --- a/src/api/material.js +++ b/src/api/material.js @@ -126,3 +126,20 @@ export function warn(pageNum, pageSize) { }) } +export function donwload() { + request({ + url: '/template.xlsx', + method: 'get', + responseType: 'blob' + }).then(response => { + const blob = new Blob([response.data], { + type: 'application/vnd.ms-excel' + }) + const fileName = 'template.xlsx' + var link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = fileName + link.click() + window.URL.revokeObjectURL(link.href) + }) +} diff --git a/src/views/material/warehouse/index.vue b/src/views/material/warehouse/index.vue index 54126dd..e468c4c 100644 --- a/src/views/material/warehouse/index.vue +++ b/src/views/material/warehouse/index.vue @@ -52,6 +52,11 @@ 批量出库 + + + + +