Просмотр исходного кода

工时同步功能增加loading

ljb месяцев назад: 7
Родитель
Сommit
54bbea91fd
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

+ 10 - 1
src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

@@ -396,11 +396,20 @@ export default window.$crudCommon({
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning"
         type: "warning"
       }).then(() => {
       }).then(() => {
+      const loading = this.$loading({
+        lock: true,
+        text: '数据同步中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
         obj[type].method({ yearAndMonth: this.params.yearAndMonth }).then(() => {
         obj[type].method({ yearAndMonth: this.params.yearAndMonth }).then(() => {
           this.$message.success('同步成功!');
           this.$message.success('同步成功!');
           this.page.currentPage = 1;
           this.page.currentPage = 1;
           this.getList();
           this.getList();
-        })
+          loading.close();
+        }).catch(() => {
+          loading.close();
+        });
       });
       });
     },
     },
   },
   },