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

修改导出功能

parent 8f1f3fd0
...@@ -49,6 +49,45 @@ export default { ...@@ -49,6 +49,45 @@ export default {
mixins: [table], mixins: [table],
created() {}, created() {},
methods: { methods: {
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];
}
}
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
let that = this;
this.$download(
"/attendance/record/error/exportExcel",
{
...params,
},
{ type: "excel" }
)
.then(() => {
this.percent = 100;
this.progress = false;
that.isExport = false;
})
.catch((error) => {
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 */ /** 导出Excel */
doExport() { doExport() {
if (this.isExport == true) { if (this.isExport == true) {
...@@ -58,36 +97,8 @@ export default { ...@@ -58,36 +97,8 @@ export default {
this.isExport = true; this.isExport = true;
this.progress = true; this.progress = true;
let params = {}; this.percent = 0;
for (let value of this.config.search) { this.countDown();
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",
{
...params,
},
{ type: "excel" }
)
.then(() => {
this.percent = 100;
this.progress = false;
that.isExport = false;
})
.catch((error) => {
this.isExport = false;
this.progress = false;
this.$message.error(error.message);
});
}, },
/** 重写新增方法 */ /** 重写新增方法 */
// toAdd(row) { // toAdd(row) {
......
...@@ -308,6 +308,46 @@ export default { ...@@ -308,6 +308,46 @@ export default {
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
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];
}
}
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
this.$download(
"/attendance/record/hik/exportExcel",
{
...params,
},
{ type: "excel" }
)
.then(() => {
this.percent = 100;
this.progress = 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 */ /** 导出Excel */
doExport() { doExport() {
if (this.isExport == true) { if (this.isExport == true) {
...@@ -317,36 +357,8 @@ export default { ...@@ -317,36 +357,8 @@ export default {
this.isExport = true; this.isExport = true;
this.progress = true; this.progress = true;
let params = {}; this.percent = 0;
for (let value of this.config.search) { this.countDown();
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",
{
...params,
},
{ type: "excel" }
)
.then(() => {
this.percent = 100;
this.progress = false;
that.isExport = false;
})
.catch((error) => {
this.isExport = false;
this.progress = false;
this.$message.error(error.message);
});
}, },
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
......
...@@ -399,6 +399,49 @@ export default { ...@@ -399,6 +399,49 @@ export default {
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
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];
}
}
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
if (this.checkList.length > 0) {
params["properties"] = this.checkList;
}
this.$download(
"/attendance/record/exportExcel",
{
...params,
},
{ type: "excel" }
)
.then((res) => {
this.percent = 100;
this.progress = false;
this.isExport = false;
this.checkList = [];
})
.catch((error) => {
this.percent = 100;
this.progress = false;
this.isExport = false;
this.$message.error(error.message);
});
return;
} else {
this.percent = this.percent + 1;
let that = this;
setTimeout(function() {
that.countDown();
}, 100);
}
},
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
let params = {}; let params = {};
...@@ -422,26 +465,8 @@ export default { ...@@ -422,26 +465,8 @@ export default {
this.isExport = true; this.isExport = true;
this.progress = true; this.progress = true;
this.$download( this.percent = 0;
"/attendance/record/exportExcel", this.countDown();
{
...params,
},
{ type: "excel" }
)
.then((res) => {
this.percent = 100;
this.progress = false;
this.isExport = false;
this.checkList = [];
})
.catch((error) => {
this.percent = 100;
this.progress = false;
this.isExport = false;
this.$message.error(error.message);
});
} }
}, },
checkDate(startTime, endTime, compDay) { checkDate(startTime, endTime, compDay) {
......
...@@ -103,31 +103,43 @@ export default { ...@@ -103,31 +103,43 @@ export default {
}, },
methods: { methods: {
countDown() {
if (this.percent == 95) {
this.$download(
"/staff/perform/summary/exportExcel",
{
...this.query,
page: 1,
size: -1,
},
{ type: "excel" }
)
.then(() => {
this.percent = 100;
this.progress = false;
this.isExport = false;
})
.catch((error) => {
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();
}, 200);
}
},
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
this.progress = true;
this.percent = 75;
this.isExport = true; this.isExport = true;
this.$download( this.progress = true;
"/staff/perform/summary/exportExcel", this.percent = 0;
this.countDown();
{
...this.query,
page: 1,
size: -1,
},
{ type: "excel" }
)
.then(() => {
this.percent = 100;
this.progress = false;
this.isExport = false;
})
.catch((error) => {
this.isExport = false;
this.progress = false;
this.$message.error(error.message);
});
}, },
/** 重写新增方法 */ /** 重写新增方法 */
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