Browse Source

项目管理导出报错修改

V1.0
mk 3 years ago
parent
commit
966bc69ad0
  1. 5
      src/views/modules/shequzhili/issue/issueList.vue
  2. 25
      src/views/modules/shequzhili/xiangmu/index.vue

5
src/views/modules/shequzhili/issue/issueList.vue

@ -373,13 +373,14 @@ export default {
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
// pageSize,
// pageNo,
pageSize,
pageNo,
...formData,
},
responseType: "blob",
})
.then((res) => {
console.log(res);
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);

25
src/views/modules/shequzhili/xiangmu/index.vue

@ -526,16 +526,31 @@ export default {
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
// pageSize,
// pageNo,
pageSize,
pageNo,
...fmData,
},
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log(res);
// content-dispositionres,
// let fileName = window.decodeURI(
// res.headers["content-disposition"].split(";")[1].split("=")[1]
// );
let yy = new Date().getFullYear();
var mm =
new Date().getMonth() > 9
? new Date().getMonth() + 1
: new Date().getMonth() == 9
? new Date().getMonth() + 1
: "0" + (new Date().getMonth() + 1);
var dd =
new Date().getDate() < 10
? "0" + new Date().getDate()
: new Date().getDate();
let time = `${yy}-${mm}-${dd} `;
let fileName = `项目管理${time}`;
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);

Loading…
Cancel
Save