|
|
@@ -10,7 +10,7 @@
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
icon="el-icon-download"
|
|
|
- :disabled="confirmLoading"
|
|
|
+ :loading="confirmLoading"
|
|
|
@click="handleDownAll('/api/kd-scientific/archive/center/download', 0)"
|
|
|
>
|
|
|
一键下载
|
|
|
@@ -20,7 +20,7 @@
|
|
|
size="small"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
- :disabled="confirmLoading"
|
|
|
+ :loading="confirmLoading"
|
|
|
@click="handleDownAll('/api/kd-scientific/archive/center/download', 1)"
|
|
|
>
|
|
|
一键导出高新备查
|
|
|
@@ -30,7 +30,7 @@
|
|
|
size="small"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
- :disabled="confirmLoading"
|
|
|
+ :loading="confirmLoading"
|
|
|
@click="handleDownAll('/api/kd-scientific/archive/center/download', 2)"
|
|
|
>
|
|
|
一键导出加计备查
|
|
|
@@ -47,7 +47,7 @@
|
|
|
|
|
|
<el-dialog
|
|
|
title="下载进度条"
|
|
|
- :visible="confirmLoading"
|
|
|
+ :visible="showProgressDialog"
|
|
|
width="30%"
|
|
|
append-to-body
|
|
|
:show-close="false"
|
|
|
@@ -143,6 +143,7 @@ export default window.$crudCommon({
|
|
|
fileName: '其他加计扣除备查资料',
|
|
|
}],
|
|
|
|
|
|
+ showProgressDialog: false,
|
|
|
downPercent: 0,
|
|
|
};
|
|
|
},
|
|
|
@@ -170,7 +171,7 @@ export default window.$crudCommon({
|
|
|
};
|
|
|
let storeName = `taskType${type}_${this.params.year}_${this.userInfo.tenant_id}`;
|
|
|
let taskId = getStore({ name: storeName }) || undefined;
|
|
|
-
|
|
|
+ this.confirmLoading = true;
|
|
|
generateTaskId({ yearAndMonth: this.params.year, type, id: taskId }).then(taskRes => {
|
|
|
if (taskRes.data.code == 200) {
|
|
|
const { id, status, fileSize } = taskRes.data.data;
|
|
|
@@ -178,32 +179,34 @@ export default window.$crudCommon({
|
|
|
setStore({ name: storeName, content: taskId });
|
|
|
|
|
|
if (status == 2) {
|
|
|
- this.confirmLoading = true;
|
|
|
+ this.showProgressDialog = true;
|
|
|
exportBlob(`${downUrl}?${this.website.tokenHeader}=${getToken()}`, { taskId }, (progressEvent) => {
|
|
|
const progress = Math.round((progressEvent.loaded * 100) / fileSize);
|
|
|
-
|
|
|
this.downPercent = progress;
|
|
|
-
|
|
|
}).then(res => {
|
|
|
downloadXls(res.data, `${this.params.year}年${fileNameObj[type]}.zip`);
|
|
|
|
|
|
- if (this.downPercent == 100) {
|
|
|
this.$message.success("下载成功");
|
|
|
this.confirmLoading = false;
|
|
|
+ this.showProgressDialog = false;
|
|
|
this.downPercent = 0;
|
|
|
- }
|
|
|
}).catch(() => {
|
|
|
this.confirmLoading = false;
|
|
|
alert("下载失败!");
|
|
|
});
|
|
|
} else if (status == 3) {
|
|
|
+ this.confirmLoading = false;
|
|
|
this.$message.warning("下载任务已过期,请点击按钮,重新生成下载任务...");
|
|
|
removeStore({ name: storeName })
|
|
|
} else {
|
|
|
+ this.confirmLoading = false;
|
|
|
this.$message.warning("下载任务正在生成中,请您耐心等待...");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error("系统错误,请联系平台管理员");
|
|
|
+ this.confirmLoading = false;
|
|
|
})
|
|
|
},
|
|
|
handleDownAll(downUrl, type) {
|