|
@@ -143,8 +143,30 @@ export default {
|
|
|
userDowm() {
|
|
|
var data = JSON.parse(JSON.stringify(this.listData));
|
|
|
delete data.index;
|
|
|
- this.$api.inquiresystemsubscribelistUserExport(data).then((res) => {
|
|
|
- let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
|
|
|
+ this.$api
|
|
|
+ .inquiresystemsubscribelistUserExport(data)
|
|
|
+ .then(async (res) => {
|
|
|
+ for (let k in res.data) {
|
|
|
+ if (res.data[k].code === 200) {
|
|
|
+ await this.dowmFunc(res, k);
|
|
|
+ } else {
|
|
|
+ this.$message.error("code值错误:", res.data[k].code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ let { message } = err;
|
|
|
+ if (message.includes("timeout")) {
|
|
|
+ this.$message.error(
|
|
|
+ "数据体量过大,无法正常导出,请调整导出的日期范围,缩小数据体量"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ dowmFunc(res, k) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let url =
|
|
|
+ baseUrls.baseURL + "common/download?fileName=" + res.data[k].msg;
|
|
|
let link = document.createElement("a");
|
|
|
let fileName = "导入模板" + ".xlsx";
|
|
|
document.body.appendChild(link);
|
|
@@ -152,6 +174,9 @@ export default {
|
|
|
link.dowmload = fileName;
|
|
|
link.click();
|
|
|
link.remove();
|
|
|
+ setTimeout(() => {
|
|
|
+ resolve();
|
|
|
+ }, 200);
|
|
|
});
|
|
|
},
|
|
|
//学员签到表
|
|
@@ -170,14 +195,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
openBox(row) {
|
|
|
- this.listData= {
|
|
|
+ this.listData = {
|
|
|
applyId: row.applyId,
|
|
|
siteId: "",
|
|
|
applySiteExamTime: "",
|
|
|
applySiteStartTime: "",
|
|
|
applySiteEndTime: "",
|
|
|
index: "",
|
|
|
- }
|
|
|
+ };
|
|
|
this.getAddress();
|
|
|
this.dialogVisible = true;
|
|
|
},
|