|
@@ -74,6 +74,8 @@
|
|
<a @click="handleDetail(record)" >查看详情</a>
|
|
<a @click="handleDetail(record)" >查看详情</a>
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
<a @click="handleDownload(record)" >下载</a>
|
|
<a @click="handleDownload(record)" >下载</a>
|
|
|
|
+ <a-divider type="vertical" />
|
|
|
|
+ <a @click="handleExport(record)" >导出</a>
|
|
</span>
|
|
</span>
|
|
</a-table>
|
|
</a-table>
|
|
</div>
|
|
</div>
|
|
@@ -251,6 +253,27 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ handleExport(record){
|
|
|
|
+ downFile('/salary/salaryManagement/exportXls2',{id:record.id,type:record.type}).then(data => {
|
|
|
|
+ if (!data) {
|
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), record.type + '.xlsx')
|
|
|
|
+ } else {
|
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
|
+ let link = document.createElement('a')
|
|
|
|
+ link.style.display = 'none'
|
|
|
|
+ link.href = url
|
|
|
|
+ link.setAttribute('download', record.type+'.xlsx')
|
|
|
|
+ document.body.appendChild(link)
|
|
|
|
+ link.click()
|
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
onSelectChange(selectedRowKeys, selectionRows) {
|
|
onSelectChange(selectedRowKeys, selectionRows) {
|
|
this.selectedRowKeys = selectedRowKeys;
|
|
this.selectedRowKeys = selectedRowKeys;
|
|
this.selectedRows = selectionRows;
|
|
this.selectedRows = selectionRows;
|