Browse Source

评卷员分组修改

zhangjie 4 years ago
parent
commit
0e941351e0
1 changed files with 12 additions and 9 deletions
  1. 12 9
      src/modules/grading/GradingGroupManage.vue

+ 12 - 9
src/modules/grading/GradingGroupManage.vue

@@ -114,16 +114,19 @@ export default {
     },
     async save() {
       this.isSubmit = true;
-      const toSaveAll = this.groups.map(group => {
-        return updateGradingGroup(this.subjectId, group);
-      });
-      const result = await Promise.all(toSaveAll).catch(() => {});
-      this.isSubmit = false;
-      console.log(result);
-      if (!result) {
-        this.$Message.error("保存失败,请重新尝试!");
-        return;
+      for (let i = 0; i < this.groups.length; i++) {
+        const group = this.groups[i];
+        let result = await updateGradingGroup(
+          this.subjectId,
+          group
+        ).catch(() => {});
+        if (!result) {
+          this.isSubmit = false;
+          this.$Message.error("保存失败,请重新尝试!");
+          return;
+        }
       }
+      this.isSubmit = false;
       this.$Message.success("保存成功!");
       this.initData();
     },