Commit 9ce14ee8 authored by ytbdmhy's avatar ytbdmhy

完善导出更新信息的pdf

parent 5e646b10
......@@ -77,7 +77,7 @@ const router = new Router({
component: drxxbg
},
{
path:"/modifyidcard",
path:"/modifybankcard",
name:"银行卡变更",
component: dryhkbg
},
......
......@@ -66,26 +66,26 @@
methods: {
toPdf(s, d) {
console.log(d)
// axios.get(baseUrl + '/exportPdf/insuredRegistration?id=' + d.eventId, {
// headers: {
// "token": Cookies.get("token")
// },
// responseType: 'blob' //告诉服务器我们需要的响应格式
// })
// .then(res => {
// let a = document.createElement("a");
// let blob = new Blob([res.data], {
// type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
// });
// a.href = URL.createObjectURL(blob); //生成一个url
// a.download = "西充县城乡居民社会养老保险参保登记表.pdf";
// a.click();
// // let objectUrl = URL.createObjectURL(blob); //生成一个url
// // window.location.href = objectUrl; //浏览器打开这个url
// })
// .catch(err => {
// console.log(err);
// });
axios.get(baseUrl + '/exportPdf/informationChange?id=' + d.eventId, {
headers: {
"token": Cookies.get("token")
},
responseType: 'blob' //告诉服务器我们需要的响应格式
})
.then(res => {
let a = document.createElement("a");
let blob = new Blob([res.data], {
type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
});
a.href = URL.createObjectURL(blob); //生成一个url
a.download = "西充县城乡居民社会养老保险信息变更登记表.pdf";
a.click();
// let objectUrl = URL.createObjectURL(blob); //生成一个url
// window.location.href = objectUrl; //浏览器打开这个url
})
.catch(err => {
console.log(err);
});
},
current_change(s) {
var data = {
......
......@@ -87,26 +87,26 @@
methods: {
toPdf(s, d) {
console.log(d)
// axios.get(baseUrl + '/exportPdf/insuredRegistration?id=' + d.eventId, {
// headers: {
// "token": Cookies.get("token")
// },
// responseType: 'blob' //告诉服务器我们需要的响应格式
// })
// .then(res => {
// let a = document.createElement("a");
// let blob = new Blob([res.data], {
// type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
// });
// a.href = URL.createObjectURL(blob); //生成一个url
// a.download = "西充县城乡居民社会养老保险参保登记表.pdf";
// a.click();
// // let objectUrl = URL.createObjectURL(blob); //生成一个url
// // window.location.href = objectUrl; //浏览器打开这个url
// })
// .catch(err => {
// console.log(err);
// });
axios.get(baseUrl + '/exportPdf/informationChange?id=' + d.eventId, {
headers: {
"token": Cookies.get("token")
},
responseType: 'blob' //告诉服务器我们需要的响应格式
})
.then(res => {
let a = document.createElement("a");
let blob = new Blob([res.data], {
type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
});
a.href = URL.createObjectURL(blob); //生成一个url
a.download = "西充县城乡居民社会养老保险信息变更登记表.pdf";
a.click();
// let objectUrl = URL.createObjectURL(blob); //生成一个url
// window.location.href = objectUrl; //浏览器打开这个url
})
.catch(err => {
console.log(err);
});
},
current_change(s) {
var data = {
......
......@@ -66,26 +66,26 @@
methods: {
toPdf(s, d) {
console.log(d)
// axios.get(baseUrl + '/exportPdf/insuredRegistration?id=' + d.eventId, {
// headers: {
// "token": Cookies.get("token")
// },
// responseType: 'blob' //告诉服务器我们需要的响应格式
// })
// .then(res => {
// let a = document.createElement("a");
// let blob = new Blob([res.data], {
// type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
// });
// a.href = URL.createObjectURL(blob); //生成一个url
// a.download = "西充县城乡居民社会养老保险参保登记表.pdf";
// a.click();
// // let objectUrl = URL.createObjectURL(blob); //生成一个url
// // window.location.href = objectUrl; //浏览器打开这个url
// })
// .catch(err => {
// console.log(err);
// });
axios.get(baseUrl + '/exportPdf/informationChange?id=' + d.eventId, {
headers: {
"token": Cookies.get("token")
},
responseType: 'blob' //告诉服务器我们需要的响应格式
})
.then(res => {
let a = document.createElement("a");
let blob = new Blob([res.data], {
type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
});
a.href = URL.createObjectURL(blob); //生成一个url
a.download = "西充县城乡居民社会养老保险信息变更登记表.pdf";
a.click();
// let objectUrl = URL.createObjectURL(blob); //生成一个url
// window.location.href = objectUrl; //浏览器打开这个url
})
.catch(err => {
console.log(err);
});
},
current_change(s) {
var data = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment