|
|
|
@ -130,6 +130,14 @@ |
|
|
|
> |
|
|
|
添加需求</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
@click="handleChu" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
class="diy-button--white el-button--default" |
|
|
|
> |
|
|
|
导出</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
ref="gxxq_table" |
|
|
|
@ -270,6 +278,7 @@ import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import addForm from "./addForm.vue"; |
|
|
|
import detailForm from "./detailForm.vue"; |
|
|
|
import axios from "axios"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
let endDisabledDate = (time) => { |
|
|
|
@ -394,6 +403,40 @@ export default { |
|
|
|
this.commonServiceTypeName = row.commonServiceTypeName; |
|
|
|
this.formEditShow = true; |
|
|
|
}, |
|
|
|
async handleChu() { |
|
|
|
const url = "/governance/commonDemand/export"; |
|
|
|
const {pageSize, pageNo, formData} = this; |
|
|
|
axios({ |
|
|
|
url: window.SITE_CONFIG["apiURL"] + url, |
|
|
|
method: "post", |
|
|
|
data: { |
|
|
|
pageSize, |
|
|
|
pageNo, |
|
|
|
...formData, |
|
|
|
}, |
|
|
|
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.ms-excel"}); |
|
|
|
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("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleSizeChange(val) { |
|
|
|
console.log(`每页 ${val} 条`); |
|
|
|
this.pageSize = val; |
|
|
|
@ -549,5 +592,7 @@ export default { |
|
|
|
@import "@/assets/scss/modules/management/list-main.scss"; |
|
|
|
.div_btn { |
|
|
|
margin-bottom: 12px; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|