Lvtianfang
杜函宇 2 years ago
parent dd6c6d7943
commit 64eda390c6

@ -224,20 +224,30 @@ export default {
// //
babm: this.form1.babm, babm: this.form1.babm,
}; };
dchzpsj(query1).then((res) => { dchzpsj(query1)
const blob = new Blob([res],{type:res.type}); .then((res) => {
const link = document.createElement("a"); console.log(res);
link.href = window.URL.createObjectURL(blob); const blob = new Blob([res], { type: res.type });
link.style.display = 'none' // blob.text().then((res11) => console.log(res11));
// console.log(blob.stream());
link.download = this.filterTypes(this.types)+ '.xlsx' ; const link = document.createElement("a");
link.click(); link.href = window.URL.createObjectURL(blob);
this.loadA.close(); link.style.display = "none";
this.$message({ //
type: "success", link.download = this.filterTypes(this.types) + ".xlsx";
message: "导出成功", link.click();
this.loadA.close();
this.$message({
type: "success",
message: "导出成功",
});
})
.catch((err) => {
this.$message({
type: "info",
message: "导出失败",
});
}); });
});
}, },
closeDC() { closeDC() {
this.showCK = false; this.showCK = false;

@ -214,7 +214,12 @@ export default {
type: "success", type: "success",
message: "导出成功", message: "导出成功",
}); });
}); }) .catch((err) => {
this.$message({
type: "info",
message: "导出失败",
});
});
}, },
closeDC() { closeDC() {
this.showCK = false; this.showCK = false;

@ -213,19 +213,6 @@ export default {
this.chinaCosmetics(1); this.chinaCosmetics(1);
}, },
methods: { methods: {
// convertFileStreamToBinary(fileStream) {
// return new Promise((resolve, reject) => {
// const reader = new FileReader();
// reader.onload = function (event) {
// const binaryData = event.target.result;
// resolve(binaryData);
// };
// reader.onerror = function (event) {
// reject(event.target.error);
// };
// reader.readAsArrayBuffer(fileStream);
// });
// },
openDC() { openDC() {
this.showCK = false; this.showCK = false;
this.loadA = Loading.service({ this.loadA = Loading.service({
@ -234,16 +221,21 @@ export default {
background: "rgba(0, 0, 0, 0.7)", background: "rgba(0, 0, 0, 0.7)",
}); });
dcyp(this.form1).then((res) => { dcyp(this.form1).then((res) => {
const blob = new Blob([res],{type:res.type}); const blob = new Blob([res], { type: res.type });
const link = document.createElement("a"); const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob); link.href = window.URL.createObjectURL(blob);
link.style.display = 'none' link.style.display = "none";
link.download = "药品"+ '.xlsx'; link.download = "药品" + ".xlsx";
link.click(); link.click();
this.loadA.close(); this.loadA.close();
this.$message({ this.$message({
type: "success", type: "success",
message: "导出成功", message: "导出成功",
}).catch((err) => {
this.$message({
type: "info",
message: "导出失败",
});
}); });
}); });
}, },
@ -300,8 +292,8 @@ export default {
// //
reset() { reset() {
this.form1 = { this.form1 = {
// //
cpmc: "", cpmc: "",
// //
jx: "", jx: "",
// //

Loading…
Cancel
Save