reloaded 5 years ago
parent
commit
317a179540
1 changed files with 8 additions and 6 deletions
  1. 8 6
      src/views/new-plan/arrange/school-num.vue

+ 8 - 6
src/views/new-plan/arrange/school-num.vue

@@ -131,12 +131,14 @@ export default {
       this.$set(this, `form`, { code, name, num, num_id });
       this.dialog = true;
     },
-    async handleSave({ data }) {
-      let { num_id: _id, name, ...info } = data;
-      if (_id) {
-        let i = this.plan.school.findIndex(f => f._id == _id);
-        this.$set(this.plan.school, i, { _id, ...info });
-      } else this.plan.school.push({ _id, ...info });
+    async handleSave() {
+      for (const _list of this.list) {
+        let { num_id: _id, name, ...info } = _list;
+        if (_id) {
+          let i = this.plan.school.findIndex(f => f._id == _id);
+          this.$set(this.plan.school, i, { _id, ...info });
+        } else this.plan.school.push({ _id, ...info });
+      }
       let duplicate = _.cloneDeep(this.plan);
       let res = await this.updatePlan(duplicate);
       if (this.$checkRes(res)) {