Explorar el Código

报工加载动画

quwangxin hace 2 años
padre
commit
d814a70cbb
Se han modificado 1 ficheros con 10 adiciones y 6 borrados
  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() {