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

修改导出功能

parent 8f1f3fd0
...@@ -49,27 +49,18 @@ export default { ...@@ -49,27 +49,18 @@ export default {
mixins: [table], mixins: [table],
created() {}, created() {},
methods: { methods: {
/** 导出Excel */ countDown() {
doExport() { if (this.percent == 95) {
if (this.isExport == true) {
this.$message.info("数据正在导出中,请勿重复点击!");
return false;
}
this.isExport = true;
this.progress = true;
let params = {}; let params = {};
for (let value of this.config.search) { for (let value of this.config.search) {
if (this.query[value.name]) { if (this.query[value.name]) {
params[value.name] = this.query[value.name]; params[value.name] = this.query[value.name];
} }
} }
this.percent = 75;
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params["idList"] = this.selection;
} }
console.log();
let that = this; let that = this;
this.$download( this.$download(
"/attendance/record/error/exportExcel", "/attendance/record/error/exportExcel",
...@@ -88,6 +79,26 @@ export default { ...@@ -88,6 +79,26 @@ export default {
this.progress = false; this.progress = false;
this.$message.error(error.message); 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) { // toAdd(row) {
......
...@@ -308,28 +308,19 @@ export default { ...@@ -308,28 +308,19 @@ export default {
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
/** 导出Excel */ countDown() {
doExport() { if (this.percent == 95) {
if (this.isExport == true) {
this.$message.info("考勤数据正在导出中,请勿重复点击!");
return false;
}
this.isExport = true;
this.progress = true;
let params = {}; let params = {};
for (let value of this.config.search) { for (let value of this.config.search) {
if (this.query[value.name]) { if (this.query[value.name]) {
params[value.name] = this.query[value.name]; params[value.name] = this.query[value.name];
} }
} }
this.percent = 75;
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params["idList"] = this.selection;
} }
let that = this;
this.$download( this.$download(
"/attendance/record/hik/exportExcel", "/attendance/record/hik/exportExcel",
{ {
...@@ -340,13 +331,34 @@ export default { ...@@ -340,13 +331,34 @@ export default {
.then(() => { .then(() => {
this.percent = 100; this.percent = 100;
this.progress = false; this.progress = false;
that.isExport = false; this.isExport = false;
}) })
.catch((error) => { .catch((error) => {
this.percent = 100;
this.isExport = false; this.isExport = false;
this.progress = false; this.progress = false;
this.$message.error(error.message); 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) { toAdd(row) {
......
...@@ -399,8 +399,8 @@ export default { ...@@ -399,8 +399,8 @@ export default {
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
/** 导出Excel */ countDown() {
doExport() { if (this.percent == 95) {
let params = {}; let params = {};
for (let value of this.config.search) { for (let value of this.config.search) {
if (this.query[value.name]) { if (this.query[value.name]) {
...@@ -413,15 +413,6 @@ export default { ...@@ -413,15 +413,6 @@ export default {
if (this.checkList.length > 0) { if (this.checkList.length > 0) {
params["properties"] = this.checkList; params["properties"] = this.checkList;
} }
let flag = this.checkDate(
params.attendanceDateStart,
params.attendanceDateEnd,
1
);
if (!flag) {
this.isExport = true;
this.progress = true;
this.$download( this.$download(
"/attendance/record/exportExcel", "/attendance/record/exportExcel",
{ {
...@@ -442,6 +433,40 @@ export default { ...@@ -442,6 +433,40 @@ export default {
this.isExport = false; this.isExport = false;
this.$message.error(error.message); 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) { checkDate(startTime, endTime, compDay) {
......
...@@ -103,11 +103,8 @@ export default { ...@@ -103,11 +103,8 @@ export default {
}, },
methods: { methods: {
/** 导出Excel */ countDown() {
doExport() { if (this.percent == 95) {
this.progress = true;
this.percent = 75;
this.isExport = true;
this.$download( this.$download(
"/staff/perform/summary/exportExcel", "/staff/perform/summary/exportExcel",
...@@ -128,6 +125,21 @@ export default { ...@@ -128,6 +125,21 @@ export default {
this.progress = false; this.progress = false;
this.$message.error(error.message); 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) { 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