|
@@ -283,8 +283,33 @@ const checkTheFlow = (item) => {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+
|
|
const deriveExcel = () => {
|
|
const deriveExcel = () => {
|
|
- console.log("deriveExcel");
|
|
|
|
|
|
+ let queryParams = proxy.deepClone(sourceList.value.pagination);
|
|
|
|
+ queryParams.pageNum = 1;
|
|
|
|
+ queryParams.pageSize = 9999;
|
|
|
|
+ proxy.postTwo("/stock/excelExport", queryParams).then((res) => {
|
|
|
|
+ exportData(res, "库存查询.xlsx");
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const exportData = (res, name) => {
|
|
|
|
+ const content = res;
|
|
|
|
+ const blob = new Blob([content], { type: "application/ms-excel" });
|
|
|
|
+ const fileName = name;
|
|
|
|
+ if ("download" in document.createElement("a")) {
|
|
|
|
+ // 非IE下载
|
|
|
|
+ const elink = document.createElement("a");
|
|
|
|
+ elink.download = fileName;
|
|
|
|
+ elink.style.display = "none";
|
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
+ elink.click();
|
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
+ } else {
|
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
// const clickSelect = (item) => {
|
|
// const clickSelect = (item) => {
|
|
// proxy.$emit("select", item);
|
|
// proxy.$emit("select", item);
|