|
@@ -43,7 +43,7 @@
|
|
|
</div>
|
|
|
<div class="cus-list-content">
|
|
|
<vuescroll>
|
|
|
- <div v-for="(item,index) in courseListShow" :key="index" @click="curCusIndex = index" :class="['block-bg','cus-item',curCusIndex == index ? 'block-bg-active':'']">
|
|
|
+ <div v-for="(item,index) in courseListShow" :key="index" @click="selectCus(index)" :class="['block-bg','cus-item',curCusIndex == index ? 'block-bg-active':'']">
|
|
|
<p class="cus-name">
|
|
|
<span class="cus-id">
|
|
|
{{item.no}}
|
|
@@ -61,67 +61,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div slot="right" class="cus-schd-box">
|
|
|
- <!-- 添加名单UI -->
|
|
|
- <div slot="right" class="class-setting dark-el-cascader dark-iview-select dark-iview-table" v-show="isAddStuList">
|
|
|
- <div class="add-list-header">
|
|
|
- <span class="add-list-label">教师:</span>
|
|
|
- <Select ref="sltStuList" clearable label-in-value v-model="schedule.teacher.id" style="width:200px;margin-right:30px" size="small" @on-change="setTeaName">
|
|
|
- <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- <span class="add-list-label">教室:</span>
|
|
|
- <el-cascader size="small" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="schedule.classId" :options="csOptions" :props="props" @change="setClassName($event,'insert')" style="width:180px;">
|
|
|
- </el-cascader>
|
|
|
- <span v-show="schedule.classId" class="attr-label" style="margin-left:20px">默认名单</span>
|
|
|
- <Tooltip v-show="schedule.classId" content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
|
|
|
- <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
|
|
|
- </Tooltip>
|
|
|
- <span v-show="schedule.classId">
|
|
|
- <i-switch v-model="preDefault" size="small" />
|
|
|
- </span>
|
|
|
- <span class="add-list-label" v-show="!preDefault || !schedule.classId" style="margin-left:40px">名单:</span>
|
|
|
- <Select ref="sltStuList" v-show="!preDefault || !schedule.classId" clearable v-model="schedule.stulist" style="width:200px;margin-right:5px" size="small">
|
|
|
- <Option v-for="(item,index) in stuList" :value="item.id" :key="index" @click.native="getStuList(item.name)">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- <Icon type="md-add-circle" v-show="!preDefault || !schedule.classId" class="create-list-icon" @click="goMgtStuList" />
|
|
|
- <div class="action-btn-wrap">
|
|
|
- <span class="action-btn" style="margin-right:40px" @click="confirmAddSchd">
|
|
|
- <Icon type="md-add" size="16" />
|
|
|
- <span>确认添加</span>
|
|
|
- </span>
|
|
|
- <span class="action-btn" @click="cancelAddSchd">
|
|
|
- <Icon type="md-close" size="16" />
|
|
|
- <span>取消添加</span>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <Table :columns="schedule.stulist ? listColumn : classColumn" :data="preStus" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
|
- <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
- <template slot-scope="{ row }" slot="picture">
|
|
|
- <PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="no">
|
|
|
- <span>{{row.no}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row ,index}" slot="action">
|
|
|
- <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
- <Icon type="md-create" size="18" color="white" @click="resetNo(index)" :title="$t('schoolBaseInfo.editSeat')" />
|
|
|
- <Icon type="md-remove-circle" size="18" color="white" style="margin-left:10px" @click="removeStudent(index)" :title="$t('schoolBaseInfo.delStuBtn')" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row, index }" slot="groupId">
|
|
|
- <span>{{row.groupId ? row.groupId : '- -'}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row, index }" slot="groupName">
|
|
|
- <span>{{row.groupName ? row.groupName : '未分组'}}</span>
|
|
|
- </template>
|
|
|
- </Table>
|
|
|
- </div>
|
|
|
- <Split v-model="split2" v-show="!isAddStuList">
|
|
|
+
|
|
|
+ <Split v-model="split2">
|
|
|
<!-- 授课教师列表 -->
|
|
|
<div slot="left" class="teacher-list">
|
|
|
<div class="teacher-list-header">
|
|
|
<span>教师</span>
|
|
|
- <Icon type="md-add" size="16" class="tea-action-icon" @click="isAddStuList = true" />
|
|
|
+ <Icon type="md-add" size="16" class="tea-action-icon" @click="addTeaStatus = true" />
|
|
|
<Icon type="md-trash" size="16" class="tea-action-icon" @click="removeTeacher" />
|
|
|
</div>
|
|
|
<div class="tea-list-content">
|
|
@@ -138,7 +84,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 上课名单、上课时段设置 -->
|
|
|
- <div slot="right" class="class-setting">
|
|
|
+ <div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
|
|
|
<div class="teacher-list-header">
|
|
|
<span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
课程名单
|
|
@@ -159,10 +105,10 @@
|
|
|
<Icon type="md-trash" size="16" />
|
|
|
<span>移除名单</span>
|
|
|
</span>
|
|
|
- <span v-show="curTab == 1">授课教室:</span>
|
|
|
+ <!-- <span v-show="curTab == 1">授课教室:</span>
|
|
|
<Select v-show="curTab == 1" v-model="setCurClass" style="width:200px;margin-right:30px" size="small">
|
|
|
<Option v-for="(item,index) in schdClassList" :value="item.classId" :key="index">{{ item.classInfo.name }}</Option>
|
|
|
- </Select>
|
|
|
+ </Select> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 教师上课时段设置 -->
|
|
@@ -228,11 +174,11 @@
|
|
|
</Table>
|
|
|
</div>
|
|
|
</Split>
|
|
|
- <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请先前往添加名单"></EmptyData>
|
|
|
+ <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请添加名单"></EmptyData>
|
|
|
</div>
|
|
|
<!-- 教师课表 -->
|
|
|
<vuescroll v-show="curTab == 1">
|
|
|
- <TeaTable v-if="hasTimeTable" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="[courseListShow[this.curCusIndex]]" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
|
|
|
+ <TeaTable v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="[courseListShow[this.curCusIndex]]" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
|
|
|
<div v-else>
|
|
|
<p class="no-time-table-tips">
|
|
|
{{filterPeriodName}}暂未设置时段,请先
|
|
@@ -243,7 +189,87 @@
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <!-- 添加名单UI -->
|
|
|
+ <div slot="right" class="class-setting dark-el-cascader dark-iview-select dark-iview-table" v-show="isAddStuList">
|
|
|
+ <div class="add-list-header">
|
|
|
+ <!-- <span class="add-list-label">教师:</span>
|
|
|
+ <Select ref="sltStuList" clearable label-in-value v-model="schedule.teacher.id" style="width:200px;margin-right:30px" size="small" @on-change="setTeaName">
|
|
|
+ <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
+ </Select> -->
|
|
|
+ <span class="add-list-label">教室:</span>
|
|
|
+ <el-cascader size="small" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="schedule.classId" :options="csOptions" :props="props" @change="setClassName($event,'insert')" style="width:180px;">
|
|
|
+ </el-cascader>
|
|
|
+ <span v-show="schedule.classId" class="attr-label" style="margin-left:20px">默认名单</span>
|
|
|
+ <Tooltip v-show="schedule.classId" content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
|
|
|
+ <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
|
|
|
+ </Tooltip>
|
|
|
+ <span v-show="schedule.classId">
|
|
|
+ <i-switch v-model="preDefault" size="small" />
|
|
|
+ </span>
|
|
|
+ <span class="add-list-label" v-show="!preDefault || !schedule.classId" style="margin-left:40px">名单:</span>
|
|
|
+ <Select ref="sltStuList" v-show="!preDefault || !schedule.classId" clearable v-model="schedule.stulist" style="width:200px;margin-right:5px" size="small">
|
|
|
+ <Option v-for="(item,index) in stuList" :value="item.id" :key="index" @click.native="getStuList(item.name)">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ <Icon type="md-add-circle" v-show="!preDefault || !schedule.classId" class="create-list-icon" @click="goMgtStuList" />
|
|
|
+ <div class="action-btn-wrap">
|
|
|
+ <span class="action-btn" style="margin-right:40px" @click="confirmAddSchd">
|
|
|
+ <Icon type="md-add" size="16" />
|
|
|
+ <span>确认添加</span>
|
|
|
+ </span>
|
|
|
+ <span class="action-btn" @click="cancelAddSchd">
|
|
|
+ <Icon type="md-close" size="16" />
|
|
|
+ <span>取消添加</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Table :columns="schedule.stulist ? listColumn : classColumn" :data="preStus" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
|
+ <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
+ <template slot-scope="{ row }" slot="picture">
|
|
|
+ <PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index }" slot="no">
|
|
|
+ <span>{{row.no}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row ,index}" slot="action">
|
|
|
+ <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
+ <Icon type="md-create" size="18" color="white" @click="resetNo(index)" :title="$t('schoolBaseInfo.editSeat')" />
|
|
|
+ <Icon type="md-remove-circle" size="18" color="white" style="margin-left:10px" @click="removeStudent(index)" :title="$t('schoolBaseInfo.delStuBtn')" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="groupId">
|
|
|
+ <span>{{row.groupId ? row.groupId : '- -'}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="groupName">
|
|
|
+ <span>{{row.groupName ? row.groupName : '未分组'}}</span>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </div>
|
|
|
+ <!-- 添加授课教师UI -->
|
|
|
+ <div slot="right" class="class-setting dark-iview-input dark-iview-table" v-show="addTeaStatus">
|
|
|
+ <vuescroll>
|
|
|
+ <div class="add-tea-header">
|
|
|
+ <Input search placeholder="" style="width:240px;margin-top:4px" size="small" />
|
|
|
+ <div class="action-btn-wrap">
|
|
|
+ <span class="action-btn" style="margin-right:40px" @click="confirmAddTea">
|
|
|
+ <Icon type="md-add" size="16" />
|
|
|
+ <span>确认添加</span>
|
|
|
+ </span>
|
|
|
+ <span class="action-btn" @click="cancelAddTea">
|
|
|
+ <Icon type="md-close" size="16" />
|
|
|
+ <span>取消添加</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Table :columns="teaCol" :data="teacherList" style="margin-top:10px" @on-selection-change="(selection)=>{sltTeachers = selection}">
|
|
|
+ <template slot-scope="{ row }" slot="picture">
|
|
|
+ <PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="job">
|
|
|
+ <span>{{row.job || '--'}}</span>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </vuescroll>
|
|
|
+ </div>
|
|
|
</Split>
|
|
|
</div>
|
|
|
</Split>
|
|
@@ -270,11 +296,6 @@
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <!-- <FormItem :label="$t('cusMgt.cusTeachers')" prop="teachers">
|
|
|
- <Select label-in-value multiple v-model="teacherId" :placeholder="$t('cusMgt.teacherHolder')" :max-tag-count="3" filterable @on-change="getTeahcers">
|
|
|
- <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem> -->
|
|
|
</Form>
|
|
|
</Modal>
|
|
|
<!-- 添加授课教师 -->
|
|
@@ -284,9 +305,9 @@
|
|
|
</Select>
|
|
|
</Modal> -->
|
|
|
<!-- 创建名单 -->
|
|
|
- <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
|
|
|
+ <!-- <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
|
|
|
<StudentList @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
|
|
|
- </Modal>
|
|
|
+ </Modal> -->
|
|
|
<!-- 时段设置 -->
|
|
|
<Drawer title="时段设置" class-name="dark-iview-drawer" :closable="false" v-model="showTime" :width="450">
|
|
|
<TimeSetting :periodId="filterPeriod"></TimeSetting>
|
|
@@ -332,6 +353,36 @@ export default {
|
|
|
preStus: [],
|
|
|
stuList: [],
|
|
|
isDefault: true,
|
|
|
+ teacherList: [],
|
|
|
+ sltTeachers: [],
|
|
|
+ teaCol: [
|
|
|
+ {
|
|
|
+ type: 'selection',
|
|
|
+ width: 60,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: ' ',
|
|
|
+ slot: 'picture',
|
|
|
+ align: 'center ',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '姓名',
|
|
|
+ key: 'name',
|
|
|
+ align: 'center '
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'id',
|
|
|
+ key: 'id',
|
|
|
+ align: 'center '
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '职位',
|
|
|
+ slot: 'job',
|
|
|
+ align: 'center '
|
|
|
+ }
|
|
|
+ ],
|
|
|
classColumn: [
|
|
|
{
|
|
|
title: ' ',
|
|
@@ -392,7 +443,6 @@ export default {
|
|
|
align: 'center'
|
|
|
},
|
|
|
],
|
|
|
- addTeachers: [],
|
|
|
curClassIndex: 0,
|
|
|
hasTimeTable: false,
|
|
|
selections: [],
|
|
@@ -408,7 +458,6 @@ export default {
|
|
|
schoolBase: {
|
|
|
period: []
|
|
|
},
|
|
|
- teacherId: [],
|
|
|
actionType: 0, //0新增 1编辑
|
|
|
delCusList: [],
|
|
|
courseBaseInfo: {
|
|
@@ -454,18 +503,19 @@ export default {
|
|
|
name: ''
|
|
|
},
|
|
|
stulist: '',
|
|
|
- time: [
|
|
|
- // {
|
|
|
- // week: "Mon",
|
|
|
- // start: "8:00",
|
|
|
- // end: "8:40"
|
|
|
- // }
|
|
|
- ],
|
|
|
+ time: [],
|
|
|
notice: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectCus(index) {
|
|
|
+ this.selectClass(0)
|
|
|
+ this.selectTea(0)
|
|
|
+ this.cancelAddTea()
|
|
|
+ this.cancelAddSchd()
|
|
|
+ this.curCusIndex = index
|
|
|
+ },
|
|
|
selectTab(index) {
|
|
|
this.curTab = index
|
|
|
this.setDefClass()
|
|
@@ -477,20 +527,23 @@ export default {
|
|
|
if (!this.setCurClass && this.schdClassList[0]) {
|
|
|
this.setCurClass = this.schdClassList[0].classId
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.setCurClass = ''
|
|
|
}
|
|
|
},
|
|
|
//设置课程时段
|
|
|
selectCell(data) {
|
|
|
- console.log('data', data)
|
|
|
let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
|
|
|
- if (!this.setCurClass || !teacher) {
|
|
|
- this.$Message.warning("暂无教师或授课教室信息,无法完成课程时段设置")
|
|
|
+ if (!teacher) {
|
|
|
+ this.$Message.warning("暂无教师信息,无法完成课程时段设置")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!data.setClass) {
|
|
|
+ this.$Message.warning("暂无教室信息,无法完成课程时段设置")
|
|
|
return
|
|
|
}
|
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
|
- return item.classId == this.setCurClass && item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
+ return item.classId == data.setClass && item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
})
|
|
|
if (schedule) {
|
|
|
schedule.time.push({
|
|
@@ -498,14 +551,12 @@ export default {
|
|
|
id: data.row.id
|
|
|
})
|
|
|
this.isUpd = true
|
|
|
- console.log('ss', schedule)
|
|
|
}
|
|
|
},
|
|
|
//取消课程时段设置
|
|
|
cancelCell(data) {
|
|
|
- console.log('data', data)
|
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
|
- return item.classId == this.setCurClass && item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
+ return item.classId == data.setClass && item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
})
|
|
|
if (schedule) {
|
|
|
for (let index in schedule.time) {
|
|
@@ -548,7 +599,7 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- //教室列表
|
|
|
+ //选择教室列表
|
|
|
selectClass(index) {
|
|
|
this.curClassIndex = index
|
|
|
this.setIsDefault()
|
|
@@ -612,17 +663,16 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //下拉选择授课教师,并设置教师名称
|
|
|
- setTeaName(data) {
|
|
|
- console.log(data)
|
|
|
- if (data) {
|
|
|
- this.schedule.teacher.name = data.label
|
|
|
- console.log(this.schedule)
|
|
|
- }
|
|
|
- },
|
|
|
+ //下拉选择授课教师,并设置教师名称 (废弃)
|
|
|
+ // setTeaName(data) {
|
|
|
+ // console.log(data)
|
|
|
+ // if (data) {
|
|
|
+ // this.schedule.teacher.name = data.label
|
|
|
+ // console.log(this.schedule)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
//设置教室名称
|
|
|
setClassName(data, option) {
|
|
|
- console.log(data, option)
|
|
|
let curClass = this.classList.find(item => {
|
|
|
return item.id == data
|
|
|
})
|
|
@@ -657,8 +707,6 @@ export default {
|
|
|
this.isUpd = true
|
|
|
if (curClass) this.schdList[this.curClassIndex].classInfo.name = curClass.name
|
|
|
}
|
|
|
-
|
|
|
- console.log(this)
|
|
|
},
|
|
|
//确认添加名单
|
|
|
confirmAddSchd() {
|
|
@@ -670,8 +718,12 @@ export default {
|
|
|
this.$Message.warning('请设置教室或者名单')
|
|
|
return
|
|
|
}
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
|
|
|
+ if (item.teacher.id == this.schedule.teacher.id && !item.stulist && !item.classId) {
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
this.courseListShow[this.curCusIndex].schedule.push(this.schedule)
|
|
|
- console.log(this.courseListShow[this.curCusIndex])
|
|
|
this.isAddStuList = false
|
|
|
this.updCusInfo()
|
|
|
this.initSchedule()
|
|
@@ -698,32 +750,35 @@ export default {
|
|
|
notice: ''
|
|
|
}
|
|
|
},
|
|
|
- // // (废弃)
|
|
|
- // seltChange(data) {
|
|
|
- // this.addTeachers = data
|
|
|
- // },
|
|
|
- // //确认添加教师 (废弃)
|
|
|
- // confirmAddTea() {
|
|
|
- // let teachers = this.addTeachers.map(item => {
|
|
|
- // return {
|
|
|
- // id: item.value,
|
|
|
- // name: item.label
|
|
|
- // }
|
|
|
- // })
|
|
|
- // let ids = this.courseListShow[this.curCusIndex].teachers.map(item => {
|
|
|
- // return item.id
|
|
|
- // })
|
|
|
- // let isUpd = false
|
|
|
- // teachers.forEach(item => {
|
|
|
- // if (ids.indexOf(item.id) == -1) {
|
|
|
- // this.courseListShow[this.curCusIndex].teachers.push(item)
|
|
|
- // isUpd = true
|
|
|
- // }
|
|
|
- // })
|
|
|
- // this.addTeachers = []
|
|
|
- // this.$refs['addTea'].clearSingleSelect()
|
|
|
- // if (isUpd) this.updCusInfo()
|
|
|
- // },
|
|
|
+ //取消添加老师
|
|
|
+ cancelAddTea() {
|
|
|
+ this.addTeaStatus = false
|
|
|
+ },
|
|
|
+ //确认添加教师
|
|
|
+ confirmAddTea() {
|
|
|
+ this.addTeaStatus = false
|
|
|
+ if (this.sltTeachers.length > 0) {
|
|
|
+ let ids = this.teaList.map(item => {
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ this.sltTeachers.forEach(item => {
|
|
|
+ if (ids.indexOf(item.id) == -1) {
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.push({
|
|
|
+ classId: '',
|
|
|
+ teacher: {
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ },
|
|
|
+ stulist: '',
|
|
|
+ time: [],
|
|
|
+ notice: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.updCusInfo()
|
|
|
+ this.sltTeachers = []
|
|
|
+ }
|
|
|
+ },
|
|
|
// 更新课程数据
|
|
|
updCusInfo() {
|
|
|
this.courseListShow[this.curCusIndex].code = this.courseListShow[this.curCusIndex].code.replace('Course-', '')
|
|
@@ -735,7 +790,6 @@ export default {
|
|
|
res => {
|
|
|
this.$Message.success('更新成功')
|
|
|
this.isUpd = false
|
|
|
- // this.$Modal.remove()
|
|
|
}
|
|
|
).catch(() => {
|
|
|
this.$Message.error('更新失败')
|
|
@@ -746,7 +800,6 @@ export default {
|
|
|
this.$Modal.confirm({
|
|
|
title: '移除名单',
|
|
|
content: `是否确认移除${this.schdList[this.curClassIndex].className || this.schdList[this.curClassIndex].listName}?`,
|
|
|
- // loading:true,
|
|
|
onOk: () => {
|
|
|
for (let i in this.courseListShow[this.curCusIndex].schedule) {
|
|
|
let curSchd = this.schdList[this.curClassIndex]
|
|
@@ -756,9 +809,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.updCusInfo()
|
|
|
- },
|
|
|
- onCancel: () => {
|
|
|
- // this.$Message.info('Clicked cancel')
|
|
|
+ this.selectClass(0)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -805,23 +856,6 @@ export default {
|
|
|
})
|
|
|
this.getCusInfo()
|
|
|
},
|
|
|
- // getTeahcers(val) {
|
|
|
- // this.courseBaseInfo.teachers.length = []
|
|
|
- // for (let item of val) {
|
|
|
- // this.courseBaseInfo.teachers.push({
|
|
|
- // id: item.value,
|
|
|
- // name: item.label
|
|
|
- // })
|
|
|
- // }
|
|
|
- // },
|
|
|
- //id换名字
|
|
|
- //获取名字集合
|
|
|
- getTeacherName(ids) {
|
|
|
- let names = ids.map(item => {
|
|
|
- return item.name
|
|
|
- })
|
|
|
- return names.join(', ')
|
|
|
- },
|
|
|
//关键字搜索课程
|
|
|
searchCourse() {
|
|
|
this.courseListShow = this.courseList.filter((item, index) => {
|
|
@@ -867,7 +901,6 @@ export default {
|
|
|
this.$api.courseMgmt.findCusInfo(requestData).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
- // [this.curCusIndex] = res.courses[0]
|
|
|
if (res.courses && res.courses.length > 0) {
|
|
|
res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
|
res.courses[0].schedule.forEach(item => {
|
|
@@ -899,7 +932,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- console.log('res', res)
|
|
|
}
|
|
|
this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
|
|
|
this.selectTea(0)
|
|
@@ -931,7 +963,6 @@ export default {
|
|
|
teachers: [],
|
|
|
option: 'insert'
|
|
|
}
|
|
|
- this.teacherId.length = 0
|
|
|
},
|
|
|
//显示确认删除对话框
|
|
|
showConfirmDel(index) {
|
|
@@ -965,7 +996,6 @@ export default {
|
|
|
})
|
|
|
let code = this.$store.state.userInfo.schoolCode
|
|
|
this.$api.courseMgmt.deleteCourse({
|
|
|
- // ids, code
|
|
|
id: this.courseListShow[this.curCusIndex].id,
|
|
|
code: this.courseListShow[this.curCusIndex].code.replace('Course-', ''),
|
|
|
scope: this.courseListShow[this.curCusIndex].scope || 'school',
|
|
@@ -982,7 +1012,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.keyWord = ''
|
|
|
- // this.searchCourse()
|
|
|
this.filterByPeriod()
|
|
|
} else {
|
|
|
this.$Message.error(this.$t('cusMgt.delErr'))
|
|
@@ -1009,9 +1038,6 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.courseBaseInfo = this.courseListShow[index]
|
|
|
- // this.teacherId = this.courseBaseInfo.teachers.map(item => {
|
|
|
- // return item.id
|
|
|
- // })
|
|
|
this.addCourseStatus = true
|
|
|
}
|
|
|
},
|
|
@@ -1037,13 +1063,11 @@ export default {
|
|
|
this.courseList.push(this.courseBaseInfo)
|
|
|
this.$Message.success(this.$t('cusMgt.addOk'))
|
|
|
} else {
|
|
|
- // this.courseListShow[index].teachers = this._.cloneDeep(this.courseBaseInfo.teachers)
|
|
|
this.$Message.success(this.$t('cusMgt.editOk'))
|
|
|
}
|
|
|
this.keyWord = ''
|
|
|
this.searchCourse()
|
|
|
this.filterByPeriod()
|
|
|
- this.teacherId = []
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -1099,7 +1123,6 @@ export default {
|
|
|
stulist.students = res.stus
|
|
|
stulist.full = true
|
|
|
this.students = res.stus
|
|
|
- console.log('stuinfo', this.students)
|
|
|
}
|
|
|
)
|
|
|
}
|
|
@@ -1133,12 +1156,7 @@ export default {
|
|
|
(err) => {
|
|
|
this.$Message.error('API error!')
|
|
|
}
|
|
|
- ).finally(() => {
|
|
|
- setTimeout(() => {
|
|
|
- // this.tableLoading = false
|
|
|
- console.log(this.courseListShow[this.curCusIndex])
|
|
|
- }, 500)
|
|
|
- })
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -1157,14 +1175,14 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
this.$store.dispatch('teachers/getTeacherList').then(res => {
|
|
|
+ this.teacherList = this.$store.state.teachers.teacherList.filter(item => {
|
|
|
+ return item.status == 'join'
|
|
|
+ })
|
|
|
})
|
|
|
this.getCourseList()
|
|
|
this.findStuList()
|
|
|
},
|
|
|
computed: {
|
|
|
- // async students() {
|
|
|
-
|
|
|
- // },
|
|
|
//级联选择年级班级
|
|
|
csOptions() {
|
|
|
let data = []
|
|
@@ -1187,7 +1205,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- console.log('数据', data)
|
|
|
return data
|
|
|
},
|
|
|
filterPeriodName() {
|
|
@@ -1211,7 +1228,9 @@ export default {
|
|
|
let schds = this.courseListShow[this.curCusIndex].schedule.filter(item => {
|
|
|
return item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
})
|
|
|
- return schds
|
|
|
+ return schds.filter(item => {
|
|
|
+ return (item.classId || item.stulist)
|
|
|
+ })
|
|
|
} else {
|
|
|
return []
|
|
|
}
|
|
@@ -1230,8 +1249,6 @@ export default {
|
|
|
})
|
|
|
const res = new Map()
|
|
|
let removeRep = all.filter((a) => !res.has(a.id) && res.set(a.id, 1))
|
|
|
-
|
|
|
- console.log(removeRep)
|
|
|
return removeRep
|
|
|
} else {
|
|
|
return []
|
|
@@ -1241,15 +1258,7 @@ export default {
|
|
|
watch: {
|
|
|
curCusIndex() {
|
|
|
this.getCusInfo()
|
|
|
- },
|
|
|
- // schdList:{
|
|
|
- // handler(){
|
|
|
- // console.log('watch',this.isDefault)
|
|
|
- // this.setIsDefault()
|
|
|
- // console.log('watch',this.isDefault)
|
|
|
- // },
|
|
|
- // deep:true
|
|
|
- // }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -1260,6 +1269,9 @@ export default {
|
|
|
.class-setting thead {
|
|
|
background: #505050;
|
|
|
}
|
|
|
+.class-setting .ivu-input {
|
|
|
+ border-radius: 16px;
|
|
|
+}
|
|
|
.add-list-header .el-input--small .el-input__inner {
|
|
|
height: 26px;
|
|
|
line-height: 26px;
|