duanliangtao 2 years ago
parent
commit
8141f6adf0
  1. 39
      src/views/modules/communityService/wennuanzhaoren/personList.vue

39
src/views/modules/communityService/wennuanzhaoren/personList.vue

@ -99,6 +99,7 @@
</div>
<div class="div_btn">
<!-- <el-button type="primary" size="small" class="diy-button--blue" @click="handleExport">导出</el-button> -->
<el-button type="primary" size="small" class="diy-button--blue" @click="handleIncrementServeTimes">标记享受服务人员</el-button>
<el-button type="primary" size="small" class="diy-button--blue" @click="handleSearch">查询</el-button>
</div>
@ -434,7 +435,43 @@ export default {
handleCurrentChange (pageNo) {
this.searchFormData.pageNo = pageNo
this.handleSearch()
}
},
//
async handleExport () {
//>>>
const url = "";
const { pageSize, pageNo, searchFormData } = this;
axios({
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
pageSize,
pageNo,
...searchFormData,
},
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
})
.catch((err) => {
console.log("获取导出情失败", err);
return this.$message.error("网络错误");
});
},
},
props: {
serviceId: {

Loading…
Cancel
Save