Browse Source

其他费用维护界面费用内容禁用非其他类型的选项

ljb 6 months ago
parent
commit
340f26f832
2 changed files with 15 additions and 8 deletions
  1. 14 7
      src/App.vue
  2. 1 1
      src/views/yf-cost-manage/basic-data-setting/other-cost-ledger.vue

+ 14 - 7
src/App.vue

@@ -89,7 +89,8 @@ export default {
     }
   },
   beforeDestroy() {
-    clearTimeout(this._timout);
+    this._timout && clearTimeout(this._timout);
+    this._checkTimeout && clearTimeout(this._checkTimeout);
     this.$store.commit("SET_TASK_OPEND_STATUS", false);
   },
   methods: {
@@ -110,6 +111,9 @@ export default {
      * @param fileType 文件类型
      */
     checkTaskId(yearAndMonth, fileType) {
+      if (this._checkTimeout) {
+        clearTimeout(this._checkTimeout);
+      }
       let storeTaskId = getStore({ name: this.taskStoreName }) || undefined;
       generateTaskId({ yearAndMonth, type: fileType, id: storeTaskId }).then(taskRes => {
         if (taskRes.data.code == 200) {
@@ -124,9 +128,13 @@ export default {
             this.downloadZip(yearAndMonth, taskId, fileType, fileSize);
           } else if (status == 3) {
             removeStore({ name: this.taskStoreName });
-            this.checkTaskId(yearAndMonth, fileType);
+            this._checkTimeout = setTimeout(() => {
+              this.checkTaskId(yearAndMonth, fileType);
+            }, 3000)
           } else {
-            this.checkTaskId(yearAndMonth, fileType);
+            this._checkTimeout = setTimeout(() => {
+              this.checkTaskId(yearAndMonth, fileType);
+            }, 3000)
           }
         }
         
@@ -149,15 +157,14 @@ export default {
           const progress = Math.round((progressEvent.loaded * 100) / fileSize);
           this.downPercent = progress;
         }).then(res => {
-          this.$message.success('文件下载成功!');
-          downloadXls(res.data, `${this.downloadTitle}.zip`);
-
           this._timout = setTimeout(() => {
+            this.$message.success('文件下载成功!');
+            downloadXls(res.data, `${this.downloadTitle}.zip`);
             this.downPercent = 0;
             this.showDownLoading = false;
             this.showSucc = true;
             this.$store.commit("SET_TASK_OPEND_STATUS", false);
-          }, 500)
+          }, 800)
         }).catch(() => {
           this.$message.error("文件下载失败!");
           this.showError = true;

+ 1 - 1
src/views/yf-cost-manage/basic-data-setting/other-cost-ledger.vue

@@ -163,7 +163,7 @@ export default window.$crudCommon({
       level++;
       return data.map(item => {
         item.level = level;
-        item.disabled = level === 4 ? false : true;
+        item.disabled = level === 4 && '40,95'.indexOf(item.parentId) > -1 ? false : true;
 
         if (item.children && item.children.length) {
           this.loopData(item.children, level);