|
@@ -18,7 +18,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<div>
|
|
|
- <excel-term-lesson :classType="ctList" :termnum="filterList()" :subject="subjectList"></excel-term-lesson>
|
|
|
+ <excel-term-lesson :classType="ctList" :termnum="filterList()" :subject="subjectList" @changeTeacher="cellClick"></excel-term-lesson>
|
|
|
</div>
|
|
|
|
|
|
<el-dialog title="选择教师" width="30%" :visible.sync="dialog" center :destroy-on-close="true" @close="toClose">
|
|
@@ -172,15 +172,27 @@ export default {
|
|
|
...trainplan({ getPlan: 'fetch', updatePlan: 'update' }),
|
|
|
...teacher({ getTeacher: 'query' }),
|
|
|
// 手动修改教师
|
|
|
- async cellClick(row, column, cell) {
|
|
|
- let status = _.get(row, 'status');
|
|
|
+ async cellClick(ldata) {
|
|
|
+ // 查看是否需要安排教师
|
|
|
+ let subid = _.get(ldata, 'subid');
|
|
|
+ if (!subid) return;
|
|
|
+ let subject = this.subjectList.find(f => f._id === subid);
|
|
|
+ if (!subject) {
|
|
|
+ console.warn('未找到该科目,可能是活动');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const { need_teacher } = subject;
|
|
|
+ if (need_teacher === '1') {
|
|
|
+ this.$message.warning('该科目不需要教师');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 查看是否已经确定教师
|
|
|
+ let status = _.get(ldata, 'status');
|
|
|
if (status === '1') {
|
|
|
this.$message.warning('此天教师已确定,不能更改!');
|
|
|
return false;
|
|
|
}
|
|
|
- let prop = _.get(column, 'property');
|
|
|
- if (prop != 'teaname') return;
|
|
|
- const { termid, subid, day: date } = row;
|
|
|
+ const { termid, day: date } = ldata;
|
|
|
const r = await this.getApplyTeacher({ termid, subid, date });
|
|
|
if (this.$checkRes(r)) {
|
|
|
let { data } = r;
|
|
@@ -195,7 +207,8 @@ export default {
|
|
|
data = _.orderBy(data, ['score'], ['desc']);
|
|
|
this.$set(this, `applyList`, data);
|
|
|
}
|
|
|
- this.$set(this, `info`, _.cloneDeep(row));
|
|
|
+ console.log(ldata);
|
|
|
+ this.$set(this, `info`, _.cloneDeep(ldata));
|
|
|
this.dialog = true;
|
|
|
},
|
|
|
|
|
@@ -348,7 +361,8 @@ export default {
|
|
|
async getSubjectList() {
|
|
|
const res = await this.getSubject();
|
|
|
if (this.$checkRes(res)) {
|
|
|
- let r = res.data.filter(f => f.need_teacher == '0');
|
|
|
+ // let r = res.data.filter(f => f.need_teacher == '0');
|
|
|
+ let r = _.cloneDeep(res.data);
|
|
|
r = r.map(i => {
|
|
|
let ctr = this.ctList.find(f => f.code == i.type);
|
|
|
if (ctr) i.name = `${i.name}(${ctr.name})`;
|