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

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

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

@ -213,19 +213,6 @@ export default {
this.chinaCosmetics(1);
},
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() {
this.showCK = false;
this.loadA = Loading.service({
@ -234,16 +221,21 @@ export default {
background: "rgba(0, 0, 0, 0.7)",
});
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");
link.href = window.URL.createObjectURL(blob);
link.style.display = 'none'
link.download = "药品"+ '.xlsx';
link.style.display = "none";
link.download = "药品" + ".xlsx";
link.click();
this.loadA.close();
this.$message({
type: "success",
message: "导出成功",
}).catch((err) => {
this.$message({
type: "info",
message: "导出失败",
});
});
});
},
@ -300,8 +292,8 @@ export default {
//
reset() {
this.form1 = {
//
cpmc: "",
//
cpmc: "",
//
jx: "",
//

Loading…
Cancel
Save