到处全部盘点

merge-requests/3/merge
yiming 4 years ago
parent c44fa4ea64
commit 8245eb379f

@ -180,6 +180,11 @@ export default {
},
exportStock: {
url: '/stock/export',
name: '导出单个巷道',
method: 'GET'
},
exportAllStock: {
url: '/stock/exportAll',
name: '导出所有巷道',
method: 'GET'
},

@ -143,6 +143,16 @@ export default {
document.body.removeChild(elink)
}
},
downloadFileUrl(fileName, fileUrl) {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = fileUrl
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
},
/*
* 根据文件名的尾缀 返回文件类型
* @param {any} fileName 文件名

@ -1,8 +1,13 @@
<template>
<div class="check-page">
<div class="button-box">
<a-button type="primary" @click="exportStock" class="export-all">
导出巷道盘点数据
</a-button>
<a-button type="primary" @click="exportAllStock" class="export-all">
导出全部巷道盘点数据
</a-button>
</div>
<div class="title-info">
<span class="explain">颜色说明</span>
<span class="info-text">
@ -221,6 +226,10 @@ export default {
});
},
exportAllStock() {
this.$utils.downloadFileUrl('盘点列表.xls', '/api/stock/exportAll');
},
},
components: {Subsection}
};
@ -296,9 +305,21 @@ export default {
width: 200px;
}
}
.export-all {
}
.button-box{
position: absolute;
right: 20px;
top:20px;
right: 40px;
display: flex;
align-items: center;
justify-content: center;
.export-all {
margin-right: 20px;
}
}
}
</style>

Loading…
Cancel
Save