![]()
//导出
exportData2() {
this.modal.isOkLoading = true;
const path = environment.projectName + `/dormitoryAttendace/exportStatisticExcel`;
const dateTime = this.dateTime;
this.http.post(`${environment.local}${path}`, dateTime, {responseType: 'blob'})
.subscribe(
(val: any) => {
const blob = new Blob([val], {
type: 'application/vnd.ms-excel'
});
const a = document.createElement('a');
document.body.appendChild(a);
a.download = '考勤统计数据详情.xls';
a.href = URL.createObjectURL(blob);
a.click();
this.modal.isOkLoading = false;
this.closeExport();
},
error => {
this.modal.isOkLoading = false;
console.log('error', error);
}
);
}