vue
handleDownloadTemplate () {
const queryParams = this.queryParams
this.$confirm('是否确认模板?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return downloadTemplate(queryParams)
})
.then((response) => {
this.download(response.msg)
})
.catch(() => { })
},
export function downloadTemplate(query) {
return request({
url: '/material/info/downloadTemplate',
method: 'get',
params: query
}
java
@GetMapping("/downloadTemplate")
public AjaxResult downloadTemplate(WmsMaterialInfoDto wmsMaterialInfoDto)
{
ExcelUtil<WmsMaterialInfoDto> util = new ExcelUtil<WmsMaterialInfoDto>(WmsMaterialInfoDto.class);
return util.exportExcel(null, "器材信息模板");
}