|
@@ -16,10 +16,17 @@
|
|
<el-option v-for="(i, index) in termList" :key="index" :label="`第${i.term}期`" :value="i._id"></el-option>
|
|
<el-option v-for="(i, index) in termList" :key="index" :label="`第${i.term}期`" :value="i._id"></el-option>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
- <data-table ref="table" :fields="fields" :data="list" :opera="opera" @date="toDate"></data-table>
|
|
|
|
|
|
+ <data-table ref="table" :fields="fields" :data="list" :opera="opera" @date="toDate" @msg="toMsg"></data-table>
|
|
</list-frame>
|
|
</list-frame>
|
|
<detail-frame v-else title="返回批次列表" :returns="returnList">
|
|
<detail-frame v-else title="返回批次列表" :returns="returnList">
|
|
- <lesson-plan :startDate="batch.startdate" :endDate="batch.enddate" :classes="classes" @save="handleSave"></lesson-plan>
|
|
|
|
|
|
+ <lesson-plan
|
|
|
|
+ :startDate="batch.startdate"
|
|
|
|
+ :endDate="batch.enddate"
|
|
|
|
+ :classes="classes"
|
|
|
|
+ :trainplanid="id"
|
|
|
|
+ :batchid="batchid"
|
|
|
|
+ @save="handleSave"
|
|
|
|
+ ></lesson-plan>
|
|
</detail-frame>
|
|
</detail-frame>
|
|
</transition>
|
|
</transition>
|
|
</div>
|
|
</div>
|
|
@@ -52,6 +59,11 @@ export default {
|
|
icon: 'el-icon-date',
|
|
icon: 'el-icon-date',
|
|
method: 'date',
|
|
method: 'date',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: '发送确认通知',
|
|
|
|
+ icon: 'el-icon-message-solid',
|
|
|
|
+ method: 'msg',
|
|
|
|
+ },
|
|
],
|
|
],
|
|
fields: [
|
|
fields: [
|
|
{ label: '', prop: 'name' },
|
|
{ label: '', prop: 'name' },
|
|
@@ -62,12 +74,13 @@ export default {
|
|
batch: {},
|
|
batch: {},
|
|
total: 0,
|
|
total: 0,
|
|
classes: [],
|
|
classes: [],
|
|
|
|
+ batchid: [],
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...trainPlan({ getTrainPlan: 'fetch' }),
|
|
|
|
|
|
+ ...trainPlan({ getTrainPlan: 'fetch', sendNotice: 'notice' }),
|
|
...mapClasses({ getClass: 'query', updateClass: 'update' }),
|
|
...mapClasses({ getClass: 'query', updateClass: 'update' }),
|
|
...lesson({ getLessonList: 'query', lessonCreate: 'create', lessonUpdate: 'update' }),
|
|
...lesson({ getLessonList: 'query', lessonCreate: 'create', lessonUpdate: 'update' }),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
@@ -84,6 +97,7 @@ export default {
|
|
},
|
|
},
|
|
async toDate({ data }) {
|
|
async toDate({ data }) {
|
|
let res = await this.getClass({ batchid: data._id });
|
|
let res = await this.getClass({ batchid: data._id });
|
|
|
|
+ this.$set(this, 'batchid', data._id);
|
|
// this.view = 'lesson';
|
|
// this.view = 'lesson';
|
|
let { startdate, enddate } = data;
|
|
let { startdate, enddate } = data;
|
|
this.$set(this.batch, `startdate`, startdate);
|
|
this.$set(this.batch, `startdate`, startdate);
|
|
@@ -104,9 +118,9 @@ export default {
|
|
} else {
|
|
} else {
|
|
//没排课,需要动手干下,整理好数据
|
|
//没排课,需要动手干下,整理好数据
|
|
let object = { name, lyteacherid, yclocationid, kzjhlocationid, kbyslocationid, headteacherid, jslocationid };
|
|
let object = { name, lyteacherid, yclocationid, kzjhlocationid, kbyslocationid, headteacherid, jslocationid };
|
|
- object.class = tClass.id;
|
|
|
|
- object.batch = tClass.batchid;
|
|
|
|
- object.term = tClass.termid;
|
|
|
|
|
|
+ object.classid = tClass.id;
|
|
|
|
+ object.batchid = tClass.batchid;
|
|
|
|
+ object.termid = tClass.termid;
|
|
cArr.push(object);
|
|
cArr.push(object);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -123,8 +137,8 @@ export default {
|
|
//根据data中是否有id,判断是课表的添加还是修改
|
|
//根据data中是否有id,判断是课表的添加还是修改
|
|
//解构出data中class字段,是班级id,将各种地点,礼仪课老师,班主任修改好
|
|
//解构出data中class字段,是班级id,将各种地点,礼仪课老师,班主任修改好
|
|
let classid = data.class;
|
|
let classid = data.class;
|
|
- let { lessons, term, batch, headteacherid, jslocationid, yclocationid, kzjhlocationid, kbyslocationid, lyteacherid } = data;
|
|
|
|
- let newLessons = { lessons, term, batch, class: classid };
|
|
|
|
|
|
+ let { lessons, termid, batchid, headteacherid, jslocationid, yclocationid, kzjhlocationid, kbyslocationid, lyteacherid } = data;
|
|
|
|
+ let newLessons = { lessons, termid, batchid, classid };
|
|
let newClass = { id: classid, headteacherid, jslocationid, yclocationid, kzjhlocationid, kbyslocationid, lyteacherid };
|
|
let newClass = { id: classid, headteacherid, jslocationid, yclocationid, kzjhlocationid, kbyslocationid, lyteacherid };
|
|
let lid = _.get(data, `id`);
|
|
let lid = _.get(data, `id`);
|
|
let res;
|
|
let res;
|
|
@@ -148,6 +162,16 @@ export default {
|
|
check(res, '班级信息修改成功', '班级信息修改失败');
|
|
check(res, '班级信息修改成功', '班级信息修改失败');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async toMsg({ data }) {
|
|
|
|
+ let res = await this.getClass({ batchid: data._id });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ let arr = res.data.map(i => i.id);
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
+ const resNotice = await this.sendNotice({ classids: arr });
|
|
|
|
+ this.$checkRes(resNotice, '发送成功', '发送失败');
|
|
|
|
+ } else this.$message.warning(`该批次下未分班`);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
mainTitle() {
|
|
mainTitle() {
|