|
@@ -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)) {
|