瀏覽代碼

报工加载动画

quwangxin 2 年之前
父節點
當前提交
d814a70cbb
共有 1 個文件被更改,包括 10 次插入6 次删除
  1. 10 6
      src/views/produceOrder/report.vue

+ 10 - 6
src/views/produceOrder/report.vue

@@ -246,12 +246,16 @@
               ].code,
             ...data
           };
-          await report(params).then((res) => {
-            this.$message.success('报工成功!');
-            this.getDetail();
-            this.isUpdate = !this.isUpdate;
-            return res;
-          });
+          const loading = this.$loading({ lock: true, text: '正在报工...' });
+          try {
+            await report(params).then((res) => {
+              this.$message.success('报工成功!');
+              this.getDetail();
+              this.isUpdate = !this.isUpdate;
+              return res;
+            });
+          } catch (error) {}
+          loading.close();
         });
       },
       async init() {