Commit b01f3ee8 authored by 姬鋆屾's avatar 姬鋆屾

修改导出功能

parent 8f1f3fd0
......@@ -49,27 +49,18 @@ export default {
mixins: [table],
created() {},
methods: {
/** 导出Excel */
doExport() {
if (this.isExport == true) {
this.$message.info("数据正在导出中,请勿重复点击!");
return false;
}
this.isExport = true;
this.progress = true;
countDown() {
if (this.percent == 95) {
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
this.percent = 75;
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
console.log();
let that = this;
this.$download(
"/attendance/record/error/exportExcel",
......@@ -88,6 +79,26 @@ export default {
this.progress = false;
this.$message.error(error.message);
});
return;
} else {
this.percent = this.percent + 1;
let that = this;
setTimeout(function() {
that.countDown();
}, 100);
}
},
/** 导出Excel */
doExport() {
if (this.isExport == true) {
this.$message.info("数据正在导出中,请勿重复点击!");
return false;
}
this.isExport = true;
this.progress = true;
this.percent = 0;
this.countDown();
},
/** 重写新增方法 */
// toAdd(row) {
......
......@@ -308,28 +308,19 @@ export default {
submitFileForm() {
this.$refs.upload.submit();
},
/** 导出Excel */
doExport() {
if (this.isExport == true) {
this.$message.info("考勤数据正在导出中,请勿重复点击!");
return false;
}
this.isExport = true;
this.progress = true;
countDown() {
if (this.percent == 95) {
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
this.percent = 75;
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
let that = this;
this.$download(
"/attendance/record/hik/exportExcel",
{
......@@ -340,13 +331,34 @@ export default {
.then(() => {
this.percent = 100;
this.progress = false;
that.isExport = false;
this.isExport = false;
})
.catch((error) => {
this.percent = 100;
this.isExport = false;
this.progress = false;
this.$message.error(error.message);
});
return;
} else {
this.percent = this.percent + 1;
let that = this;
setTimeout(function() {
that.countDown();
}, 100);
}
},
/** 导出Excel */
doExport() {
if (this.isExport == true) {
this.$message.info("考勤数据正在导出中,请勿重复点击!");
return false;
}
this.isExport = true;
this.progress = true;
this.percent = 0;
this.countDown();
},
/** 重写新增方法 */
toAdd(row) {
......
......@@ -399,8 +399,8 @@ export default {
submitFileForm() {
this.$refs.upload.submit();
},
/** 导出Excel */
doExport() {
countDown() {
if (this.percent == 95) {
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
......@@ -413,15 +413,6 @@ export default {
if (this.checkList.length > 0) {
params["properties"] = this.checkList;
}
let flag = this.checkDate(
params.attendanceDateStart,
params.attendanceDateEnd,
1
);
if (!flag) {
this.isExport = true;
this.progress = true;
this.$download(
"/attendance/record/exportExcel",
{
......@@ -442,6 +433,40 @@ export default {
this.isExport = false;
this.$message.error(error.message);
});
return;
} else {
this.percent = this.percent + 1;
let that = this;
setTimeout(function() {
that.countDown();
}, 100);
}
},
/** 导出Excel */
doExport() {
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
if (this.checkList.length > 0) {
params["properties"] = this.checkList;
}
let flag = this.checkDate(
params.attendanceDateStart,
params.attendanceDateEnd,
1
);
if (!flag) {
this.isExport = true;
this.progress = true;
this.percent = 0;
this.countDown();
}
},
checkDate(startTime, endTime, compDay) {
......
......@@ -103,11 +103,8 @@ export default {
},
methods: {
/** 导出Excel */
doExport() {
this.progress = true;
this.percent = 75;
this.isExport = true;
countDown() {
if (this.percent == 95) {
this.$download(
"/staff/perform/summary/exportExcel",
......@@ -128,6 +125,21 @@ export default {
this.progress = false;
this.$message.error(error.message);
});
return;
} else {
this.percent = this.percent + 1;
let that = this;
setTimeout(function() {
that.countDown();
}, 200);
}
},
/** 导出Excel */
doExport() {
this.isExport = true;
this.progress = true;
this.percent = 0;
this.countDown();
},
/** 重写新增方法 */
toAdd(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment