|
@@ -248,23 +248,24 @@ export default window.$crudCommon({
|
|
|
};
|
|
};
|
|
|
if (type) {}
|
|
if (type) {}
|
|
|
let storeName = `taskType${type}`;
|
|
let storeName = `taskType${type}`;
|
|
|
- let taskId = getStore({ name: storeName });
|
|
|
|
|
- if (taskId) {
|
|
|
|
|
- exportBlob(`${downUrl}?${this.website.tokenHeader}=${getToken()}`, { taskId }).then(res => {
|
|
|
|
|
- downloadXls(res.data, `${this.params.year}年${fileNameObj[type]}.zip`);
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- generateTaskId({ yearAndMonth: this.params.year, type: 0 }).then(res => {
|
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
|
- let taskId = res.data.data.id;
|
|
|
|
|
- setStore({ name: storeName, content: taskId });
|
|
|
|
|
|
|
+ let taskId = getStore({ name: storeName }) || undefined;
|
|
|
|
|
+
|
|
|
|
|
+ generateTaskId({ yearAndMonth: this.params.year, type, id: taskId }).then(res => {
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
|
+ const { id, status } = res.data.data;
|
|
|
|
|
+ let taskId = id;
|
|
|
|
|
+ setStore({ name: storeName, content: taskId });
|
|
|
|
|
+
|
|
|
|
|
+ if (status == 2) {
|
|
|
exportBlob(`${downUrl}?${this.website.tokenHeader}=${getToken()}`, { taskId }).then(res => {
|
|
exportBlob(`${downUrl}?${this.website.tokenHeader}=${getToken()}`, { taskId }).then(res => {
|
|
|
downloadXls(res.data, `${this.params.year}年${fileNameObj[type]}.zip`);
|
|
downloadXls(res.data, `${this.params.year}年${fileNameObj[type]}.zip`);
|
|
|
});
|
|
});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning("下载任务正在生成中,请您耐心等待...");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handleRowDown() {
|
|
handleRowDown() {
|
|
|
this.$message.warning("功能建设中...");
|
|
this.$message.warning("功能建设中...");
|