|
@@ -18,14 +18,6 @@
|
|
<Icon custom="iconfont icon-schedule" size="16" />
|
|
<Icon custom="iconfont icon-schedule" size="16" />
|
|
<span>{{$t('cusMgt.schdTable')}}</span>
|
|
<span>{{$t('cusMgt.schdTable')}}</span>
|
|
</span>
|
|
</span>
|
|
- <span v-if="$access.can('admin.*|course-upd')" @click="showTime = true" class="action-btn">
|
|
|
|
- <Icon custom="iconfont icon-time" size="16" />
|
|
|
|
- <span>{{$t('cusMgt.timeSetting')}}</span>
|
|
|
|
- </span>
|
|
|
|
- <span @click="goMgtStuList" :class="courseListShow.length == 0 ? 'action-btn-disabled action-btn':'action-btn'">
|
|
|
|
- <Icon type="ios-people" size="16" />
|
|
|
|
- <span>{{$t('cusMgt.stuListMgt')}}</span>
|
|
|
|
- </span>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<Split v-model="split1">
|
|
<Split v-model="split1">
|
|
@@ -85,12 +77,16 @@
|
|
<!-- 上课名单、上课时段设置 -->
|
|
<!-- 上课名单、上课时段设置 -->
|
|
<div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
|
|
<div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
|
|
<div class="teacher-list-header">
|
|
<div class="teacher-list-header">
|
|
- <span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
|
|
|
+ <span class="tab-label" style="padding-left:10px">
|
|
{{$t('cusMgt.cusNameList')}}
|
|
{{$t('cusMgt.cusNameList')}}
|
|
</span>
|
|
</span>
|
|
- <span @click="selectTab(1)" :class="curTab == 1 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
|
|
|
+ <!-- <span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
|
+ {{$t('cusMgt.cusNameList')}}
|
|
|
|
+ </span> -->
|
|
|
|
+ <!-- 取消根据老师设置课程时段的功能 -->
|
|
|
|
+ <!-- <span @click="selectTab(1)" :class="curTab == 1 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
{{$t('cusMgt.cusTime')}}
|
|
{{$t('cusMgt.cusTime')}}
|
|
- </span>
|
|
|
|
|
|
+ </span> -->
|
|
<div class="action-btn-wrap">
|
|
<div class="action-btn-wrap">
|
|
<span class="action-btn" style="margin-right:30px" @click="updCusInfo()" v-if="isUpd">
|
|
<span class="action-btn" style="margin-right:30px" @click="updCusInfo()" v-if="isUpd">
|
|
<Icon type="ios-albums-outline" size="16" />
|
|
<Icon type="ios-albums-outline" size="16" />
|
|
@@ -101,79 +97,72 @@
|
|
<span>{{$t('cusMgt.addStuList')}}</span>
|
|
<span>{{$t('cusMgt.addStuList')}}</span>
|
|
</span>
|
|
</span>
|
|
<span class="action-btn" v-show="curTab == 0" @click="removeStuList">
|
|
<span class="action-btn" v-show="curTab == 0" @click="removeStuList">
|
|
- <Icon type="md-trash" size="16" />
|
|
|
|
|
|
+ <Icon type="md-remove-circle" size="16" />
|
|
<span>{{$t('cusMgt.removeList')}}</span>
|
|
<span>{{$t('cusMgt.removeList')}}</span>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- 教师上课时段设置 -->
|
|
|
|
<div class="cus-time-setting">
|
|
<div class="cus-time-setting">
|
|
- <!-- 设置授课教室/名单 -->
|
|
|
|
|
|
+ <!-- 设置上课班级/名单 -->
|
|
<div class="set-cus-class" v-show="curTab == 0">
|
|
<div class="set-cus-class" v-show="curTab == 0">
|
|
<Split v-model="split3" v-show="schdList.length > 0">
|
|
<Split v-model="split3" v-show="schdList.length > 0">
|
|
- <!-- 教室列表 -->
|
|
|
|
|
|
+ <!-- 名单列表 -->
|
|
<div slot="left" class="class-list">
|
|
<div slot="left" class="class-list">
|
|
<div v-for="(item,index) in schdList" :key="index" @click="selectClass(index)" :class="['block-bg','tea-class-item',curClassIndex == index ? 'block-bg-active':'']">
|
|
<div v-for="(item,index) in schdList" :key="index" @click="selectClass(index)" :class="['block-bg','tea-class-item',curClassIndex == index ? 'block-bg-active':'']">
|
|
|
|
+ <!-- 上课班级/名单 -->
|
|
<p class="class-attr-item">
|
|
<p class="class-attr-item">
|
|
- <span class="attr-label">{{$t('cusMgt.classLabel')}}</span>
|
|
|
|
- <span class="class-name">{{item.classId ? item.classInfo.name : $t('cusMgt.noSet')}}</span>
|
|
|
|
- <!-- <span class="class-label" :style="{color:item.type == '专科教室' ? '#2db7f5' : item.type == '普通教室' ? '#19be6b' : '#ff9900',borderColor:item.type == '专科教室' ? '#2db7f5' : item.type == '普通教室' ? '#19be6b' : '#ff9900'}">
|
|
|
|
- {{item.type}}
|
|
|
|
- </span> -->
|
|
|
|
|
|
+ <span class="attr-label">{{$t('cusMgt.nameLabel')}} </span>
|
|
|
|
+ <span class="class-name">{{item.classId ? item.classInfo.name : item.listName }}</span>
|
|
</p>
|
|
</p>
|
|
<p class="class-attr-item">
|
|
<p class="class-attr-item">
|
|
- <span class="attr-label">{{$t('cusMgt.nameLabel')}}</span>
|
|
|
|
- <span :class="item.stulist ? 'class-name':'def-class-name'">{{item.stulist ? item.listName : $t('cusMgt.defaultList')}}</span>
|
|
|
|
|
|
+ <span class="attr-label">学生人数:</span>
|
|
|
|
+ <span class="class-name">--人</span>
|
|
</p>
|
|
</p>
|
|
|
|
+ <!-- 上课地点 取消设置上课教室-->
|
|
|
|
+ <!-- <p class="class-attr-item">
|
|
|
|
+ <span class="attr-label">{{$t('cusMgt.addrLabel')}} </span>
|
|
|
|
+ <span :class="item.room ? 'class-name':'def-class-name'">{{item.room && item.roomInfo ? item.roomInfo.name : $t('cusMgt.noSet')}}</span>
|
|
|
|
+ </p> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 设置教室名单 -->
|
|
<!-- 设置教室名单 -->
|
|
<div slot="right" class="set-stu-list dark-iview-table dark-el-cascader" v-if="schdList[curClassIndex]">
|
|
<div slot="right" class="set-stu-list dark-iview-table dark-el-cascader" v-if="schdList[curClassIndex]">
|
|
- <div class="stu-list-header dark-iview-select">
|
|
|
|
- <span class="attr-label">{{$t('cusMgt.classLabel')}}</span>
|
|
|
|
- <el-cascader size="mini" :placeholder="$t('cusMgt.noSet')" :show-all-levels="false" clearable v-model="schdList[curClassIndex].classId" :options="csOptions" :props="props" @change="setClassName($event,'upsert')" style="width:180px;">
|
|
|
|
- </el-cascader>
|
|
|
|
- <span class="attr-label" style="margin-left:50px">{{$t('cusMgt.defaultList')}}</span>
|
|
|
|
- <Tooltip :content="$t('cusMgt.defaultTips')" max-width="200">
|
|
|
|
- <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
|
|
|
|
- </Tooltip>
|
|
|
|
- <span>
|
|
|
|
- <i-switch v-model="isDefault" size="small" :before-change="handleSwitch" />
|
|
|
|
- </span>
|
|
|
|
- <span v-show="!isDefault" class="attr-label" style="margin-left:50px">{{$t('cusMgt.nameLabel')}}</span>
|
|
|
|
- <Select ref="sltStuList" v-show="!isDefault" clearable v-model="schdList[curClassIndex].stulist" style="width:200px;margin-right:5px" size="small">
|
|
|
|
- <Option v-for="(item,index) in stuList" :value="item.id" :key="index" @click.native="updateStuList(item.name)">{{ item.name }}</Option>
|
|
|
|
|
|
+ <!-- <div class="stu-list-header dark-iview-select">
|
|
|
|
+ <span class="attr-label">{{$t('cusMgt.addrLabel')}}</span>
|
|
|
|
+ <Select v-model="schdList[curClassIndex].room" style="width:200px" size="small" filterable clearable @on-clear="updCusInfo">
|
|
|
|
+ <Option v-for="item in roomList" :value="item.id" :key="item.id" @click.native="setCusRoom(item)">{{ item.name }}</Option>
|
|
</Select>
|
|
</Select>
|
|
- <Icon type="md-add-circle" v-show="!isDefault" style="cursor:pointer" @click="addStuListStatus = true" />
|
|
|
|
- </div>
|
|
|
|
- <Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" :no-data-text="$t('cusMgt.noStu')">
|
|
|
|
- <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 : $t('cusMgt.noGroup')}}</span>
|
|
|
|
- </template>
|
|
|
|
- </Table>
|
|
|
|
|
|
+ </div> -->
|
|
|
|
+ <vuescroll>
|
|
|
|
+ <Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" :no-data-text="$t('cusMgt.noStu')">
|
|
|
|
+ <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 : $t('cusMgt.noGroup')}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </Table>
|
|
|
|
+ </vuescroll>
|
|
</div>
|
|
</div>
|
|
</Split>
|
|
</Split>
|
|
<EmptyData v-show="schdList.length == 0" :textContent="$t('cusMgt.noListTips')"></EmptyData>
|
|
<EmptyData v-show="schdList.length == 0" :textContent="$t('cusMgt.noListTips')"></EmptyData>
|
|
</div>
|
|
</div>
|
|
- <!-- 教师课表 -->
|
|
|
|
|
|
+ <!-- 教师课表 标准课程取消根据老师设置上课时段的功能,保留以教室为单位设置时段-->
|
|
<vuescroll v-show="curTab == 1">
|
|
<vuescroll v-show="curTab == 1">
|
|
- <TeaTable style="height: calc(100% - 45px)" :tableLoading="tableLoading" :courseId="courseId" v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="schdData" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
|
|
|
|
|
|
+ <TeaTable style="height: calc(100% - 45px)" :tableLoading="tableLoading" :courseId="courseId" v-if="hasTimeTable" :teaRoomList="schdRoomList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="schdData" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
|
|
<div v-else>
|
|
<div v-else>
|
|
<p class="no-time-table-tips">
|
|
<p class="no-time-table-tips">
|
|
{{filterPeriodName}}{{$t('cusMgt.notime1')}}
|
|
{{filterPeriodName}}{{$t('cusMgt.notime1')}}
|
|
@@ -203,9 +192,9 @@
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <Table ref="sltClass" v-show="addType == 'class'" :columns="classroomCol" :data="calssTable" style="margin-top:10px" @on-selection-change="(selection)=>{sltClass = selection}">
|
|
|
|
|
|
+ <Table ref="sltClass" v-show="addType == 'class'" :columns="classroomCol" :data="classTableList" style="margin-top:10px" @on-selection-change="(selection)=>{sltClass = selection}">
|
|
<template slot-scope="{ row }" slot="grade">
|
|
<template slot-scope="{ row }" slot="grade">
|
|
- <span>{{$jsFn.getGradeName(schoolBase,row.gradeId)}}</span>
|
|
|
|
|
|
+ <span>{{getGradeByYear(row.year)}}</span>
|
|
</template>
|
|
</template>
|
|
</Table>
|
|
</Table>
|
|
<Table ref="sltList" v-show="addType == 'stulist'" :columns="listCol" :data="stuList" style="margin-top:10px" @on-selection-change="(selection)=>{sltList = selection}">
|
|
<Table ref="sltList" v-show="addType == 'stulist'" :columns="listCol" :data="stuList" style="margin-top:10px" @on-selection-change="(selection)=>{sltList = selection}">
|
|
@@ -250,7 +239,7 @@
|
|
<FormItem :label="$t('cusMgt.cusName')" prop="name">
|
|
<FormItem :label="$t('cusMgt.cusName')" prop="name">
|
|
<Input v-model="courseBaseInfo.name" :placeholder="$t('cusMgt.nameHolder')"></Input>
|
|
<Input v-model="courseBaseInfo.name" :placeholder="$t('cusMgt.nameHolder')"></Input>
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem :label="$t('cusMgt.cusCode')" prop="no">
|
|
|
|
|
|
+ <FormItem :label="$t('cusMgt.cusCode')">
|
|
<Input v-model="courseBaseInfo.no" :placeholder="$t('cusMgt.codeHolder')"></Input>
|
|
<Input v-model="courseBaseInfo.no" :placeholder="$t('cusMgt.codeHolder')"></Input>
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem :label="$t('cusMgt.cusPd')" prop="period.id">
|
|
<FormItem :label="$t('cusMgt.cusPd')" prop="period.id">
|
|
@@ -277,10 +266,6 @@
|
|
</div>
|
|
</div>
|
|
<StudentList @getSelectInfo="(selction)=>{listSelections = selction}"></StudentList>
|
|
<StudentList @getSelectInfo="(selction)=>{listSelections = selction}"></StudentList>
|
|
</Modal>
|
|
</Modal>
|
|
- <!-- 时段设置 -->
|
|
|
|
- <Drawer :title="$t('cusMgt.timeSetTitle')" class-name="dark-iview-drawer" :closable="false" v-model="showTime" :width="450">
|
|
|
|
- <TimeSetting :periodId="filterPeriod"></TimeSetting>
|
|
|
|
- </Drawer>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -308,7 +293,8 @@ export default {
|
|
return {
|
|
return {
|
|
tableLoading: false,
|
|
tableLoading: false,
|
|
listLoading: false,
|
|
listLoading: false,
|
|
- classList: [],
|
|
|
|
|
|
+ roomList: [], //教室列表
|
|
|
|
+ classList: [], //班级列表
|
|
addType: 'class',
|
|
addType: 'class',
|
|
listName: '',
|
|
listName: '',
|
|
addStuListStatus: false,
|
|
addStuListStatus: false,
|
|
@@ -521,6 +507,49 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //设置上课教室
|
|
|
|
+ setCusRoom(room) {
|
|
|
|
+ console.log(room)
|
|
|
|
+ this.$set(this.schdList[this.curClassIndex], 'roomInfo', {
|
|
|
|
+ id: room.id,
|
|
|
|
+ name: room.name
|
|
|
|
+ })
|
|
|
|
+ // this.schdList[this.curClassIndex].roomInfo = {
|
|
|
|
+ // id:room.id,
|
|
|
|
+ // name:room.name
|
|
|
|
+ // }
|
|
|
|
+ console.log(this.schdList[this.curClassIndex])
|
|
|
|
+ this.updCusInfo()
|
|
|
|
+ },
|
|
|
|
+ //根据班级学年计算年级
|
|
|
|
+ getGradeByYear(year) {
|
|
|
|
+ if (year && this.schoolBase && this.schoolBase.period.length && this.filterPeriod) {
|
|
|
|
+ let pData = this.schoolBase.period.find(item => {
|
|
|
|
+ return item.id == this.filterPeriod
|
|
|
|
+ })
|
|
|
|
+ if (pData) {
|
|
|
|
+ let date = new Date()
|
|
|
|
+ let curYear = date.getFullYear()
|
|
|
|
+ let month = date.getMonth() + 1
|
|
|
|
+ let start = pData.semesters.find(item => {
|
|
|
|
+ return item.start == 1
|
|
|
|
+ })
|
|
|
|
+ // 根据入学月份确定当前年级和学级的关系
|
|
|
|
+ if (start && month < start.month) {
|
|
|
|
+ curYear--
|
|
|
|
+ }
|
|
|
|
+ let res = pData.grades[curYear - year]
|
|
|
|
+ if (curYear - year >= pData.grades.length) {
|
|
|
|
+ return '已毕业'
|
|
|
|
+ }
|
|
|
|
+ return res ? res.name : '未入学'
|
|
|
|
+ } else {
|
|
|
|
+ return '- -'
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return '- -'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//查询教师课表数据
|
|
//查询教师课表数据
|
|
async getTeaSchd() {
|
|
async getTeaSchd() {
|
|
let teaId = this.teaList[this.curTeaIndex].id
|
|
let teaId = this.teaList[this.curTeaIndex].id
|
|
@@ -588,7 +617,7 @@ export default {
|
|
res.courses[0].schedule.forEach(item => {
|
|
res.courses[0].schedule.forEach(item => {
|
|
//补充教室信息
|
|
//补充教室信息
|
|
if (item.classId) {
|
|
if (item.classId) {
|
|
- let classInfo = this.classList.find(classItem => {
|
|
|
|
|
|
+ let classInfo = this.roomList.find(classItem => {
|
|
return classItem.id == item.classId
|
|
return classItem.id == item.classId
|
|
})
|
|
})
|
|
item.classInfo = {
|
|
item.classInfo = {
|
|
@@ -676,23 +705,23 @@ export default {
|
|
},
|
|
},
|
|
selectTab(index) {
|
|
selectTab(index) {
|
|
this.curTab = index
|
|
this.curTab = index
|
|
- this.setDefClass()
|
|
|
|
|
|
+ // this.setDefClass()
|
|
let teaId = this.teaList[this.curTeaIndex].id
|
|
let teaId = this.teaList[this.curTeaIndex].id
|
|
if (index == 1 && teaId && !this.teaSchds[teaId]) {
|
|
if (index == 1 && teaId && !this.teaSchds[teaId]) {
|
|
this.getTeaSchd()
|
|
this.getTeaSchd()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//设置默认授课教室
|
|
//设置默认授课教室
|
|
- setDefClass() {
|
|
|
|
- if (this.schdList[this.curClassIndex]) {
|
|
|
|
- this.setCurClass = this.schdList[this.curClassIndex].classId || ''
|
|
|
|
- if (!this.setCurClass && this.schdClassList[0]) {
|
|
|
|
- this.setCurClass = this.schdClassList[0].classId
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.setCurClass = ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ // setDefClass() {
|
|
|
|
+ // if (this.schdList[this.curClassIndex]) {
|
|
|
|
+ // this.setCurClass = this.schdList[this.curClassIndex].classId || ''
|
|
|
|
+ // if (!this.setCurClass && this.schdRoomList[0]) {
|
|
|
|
+ // this.setCurClass = this.schdRoomList[0].classId
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // this.setCurClass = ''
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
//设置课程时段
|
|
//设置课程时段
|
|
selectCell(data) {
|
|
selectCell(data) {
|
|
let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
|
|
let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
|
|
@@ -705,7 +734,7 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
- return item.classId == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
|
|
|
+ return item.room == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
})
|
|
})
|
|
if (schedule) {
|
|
if (schedule) {
|
|
schedule.time.push({
|
|
schedule.time.push({
|
|
@@ -721,7 +750,7 @@ export default {
|
|
})
|
|
})
|
|
if (tableData) {
|
|
if (tableData) {
|
|
let s = tableData.schedule.find(item => {
|
|
let s = tableData.schedule.find(item => {
|
|
- return item.classId == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
|
|
|
+ return item.room == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
})
|
|
})
|
|
if (s) {
|
|
if (s) {
|
|
s.time.push({
|
|
s.time.push({
|
|
@@ -737,7 +766,7 @@ export default {
|
|
//取消课程时段设置
|
|
//取消课程时段设置
|
|
cancelCell(data) {
|
|
cancelCell(data) {
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
- return item.classId == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
|
|
|
+ return item.room == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
})
|
|
})
|
|
if (schedule) {
|
|
if (schedule) {
|
|
for (let index in schedule.time) {
|
|
for (let index in schedule.time) {
|
|
@@ -755,7 +784,7 @@ export default {
|
|
})
|
|
})
|
|
if (tableData) {
|
|
if (tableData) {
|
|
let s = tableData.schedule.find(item => {
|
|
let s = tableData.schedule.find(item => {
|
|
- return item.classId == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
|
|
|
+ return item.room == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
})
|
|
})
|
|
if (s) {
|
|
if (s) {
|
|
for (let index in s.time) {
|
|
for (let index in s.time) {
|
|
@@ -811,12 +840,14 @@ export default {
|
|
this.curClassIndex = 0
|
|
this.curClassIndex = 0
|
|
this.curTeaIndex = index
|
|
this.curTeaIndex = index
|
|
this.setIsDefault()
|
|
this.setIsDefault()
|
|
- this.setDefClass()
|
|
|
|
|
|
+ // this.setDefClass()
|
|
this.initStatus()
|
|
this.initStatus()
|
|
//获取老师所有授课数据渲染课程表
|
|
//获取老师所有授课数据渲染课程表
|
|
- let teaId = this.teaList[this.curTeaIndex].id
|
|
|
|
- if (this.curTab == 1 && teaId && !this.teaSchds[teaId]) {
|
|
|
|
- this.getTeaSchd()
|
|
|
|
|
|
+ if (this.teaList.length) {
|
|
|
|
+ let teaId = this.teaList[this.curTeaIndex].id
|
|
|
|
+ if (this.curTab == 1 && teaId && !this.teaSchds[teaId]) {
|
|
|
|
+ this.getTeaSchd()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -836,7 +867,7 @@ export default {
|
|
}).then(
|
|
}).then(
|
|
res => {
|
|
res => {
|
|
res.stus.forEach(item => {
|
|
res.stus.forEach(item => {
|
|
- let classInfo = this.classList.find(classItem => {
|
|
|
|
|
|
+ let classInfo = this.roomList.find(classItem => {
|
|
return classItem.id == item.classId
|
|
return classItem.id == item.classId
|
|
})
|
|
})
|
|
if (classInfo) {
|
|
if (classInfo) {
|
|
@@ -873,7 +904,7 @@ export default {
|
|
},
|
|
},
|
|
//设置教室名称
|
|
//设置教室名称
|
|
setClassName(data, option) {
|
|
setClassName(data, option) {
|
|
- let curClass = this.classList.find(item => {
|
|
|
|
|
|
+ let curClass = this.roomList.find(item => {
|
|
return item.id == data
|
|
return item.id == data
|
|
})
|
|
})
|
|
if (option == 'insert') { //添加名单的逻辑
|
|
if (option == 'insert') { //添加名单的逻辑
|
|
@@ -915,9 +946,11 @@ export default {
|
|
}
|
|
}
|
|
if (this.addType == 'class' && this.sltClass.length > 0) {
|
|
if (this.addType == 'class' && this.sltClass.length > 0) {
|
|
//先判断是否有空的schedule(只是添加了老师,没有教室和名单)
|
|
//先判断是否有空的schedule(只是添加了老师,没有教室和名单)
|
|
|
|
+ let emptyIndex = -1
|
|
this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
|
|
this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
|
|
if (item.teacherId == this.schedule.teacherId && !item.stulist && !item.classId) {
|
|
if (item.teacherId == this.schedule.teacherId && !item.stulist && !item.classId) {
|
|
- this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
|
|
|
|
|
|
+ // this.courseListShow[this.curCusIndex].schedule.splice(index, 1) //直接删除会改变顺序,产生bug错觉
|
|
|
|
+ emptyIndex = index
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.sltClass.forEach(item => {
|
|
this.sltClass.forEach(item => {
|
|
@@ -930,18 +963,25 @@ export default {
|
|
id: item.id,
|
|
id: item.id,
|
|
name: item.name
|
|
name: item.name
|
|
}
|
|
}
|
|
- this.courseListShow[this.curCusIndex].schedule.push(JSON.parse(JSON.stringify(this.schedule)))
|
|
|
|
|
|
+ if (emptyIndex > -1) {
|
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.splice(emptyIndex, 1, JSON.parse(JSON.stringify(this.schedule))) //直接删除会改变顺序,产生bug错觉
|
|
|
|
+ emptyIndex = -1
|
|
|
|
+ } else {
|
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.push(JSON.parse(JSON.stringify(this.schedule)))
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.sltClass = []
|
|
this.sltClass = []
|
|
} else if (this.addType == 'stulist' && this.sltList.length > 0) {
|
|
} else if (this.addType == 'stulist' && this.sltList.length > 0) {
|
|
//先判断是否有空的schedule(只是添加了老师,没有教室和名单)
|
|
//先判断是否有空的schedule(只是添加了老师,没有教室和名单)
|
|
|
|
+ let emptyIndex = -1
|
|
this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
|
|
this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
|
|
if (item.teacherId == this.schedule.teacherId && !item.stulist && !item.classId) {
|
|
if (item.teacherId == this.schedule.teacherId && !item.stulist && !item.classId) {
|
|
- this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
|
|
|
|
|
|
+ // this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
|
|
|
|
+ emptyIndex = index
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
this.sltList.forEach(item => {
|
|
this.sltList.forEach(item => {
|
|
let exist = this.courseListShow[this.curCusIndex].schedule.find(schdItem => {
|
|
let exist = this.courseListShow[this.curCusIndex].schedule.find(schdItem => {
|
|
return schdItem.stulist == item.id && schdItem.teacherId == this.schedule.teacherId
|
|
return schdItem.stulist == item.id && schdItem.teacherId == this.schedule.teacherId
|
|
@@ -949,7 +989,12 @@ export default {
|
|
if (!exist) {
|
|
if (!exist) {
|
|
this.schedule.stulist = item.id
|
|
this.schedule.stulist = item.id
|
|
this.schedule.listName = item.name
|
|
this.schedule.listName = item.name
|
|
- this.courseListShow[this.curCusIndex].schedule.push(JSON.parse(JSON.stringify(this.schedule)))
|
|
|
|
|
|
+ if (emptyIndex > -1) {
|
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.splice(emptyIndex, 1, JSON.parse(JSON.stringify(this.schedule))) //直接删除会改变顺序,产生bug错觉
|
|
|
|
+ emptyIndex = -1
|
|
|
|
+ } else {
|
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.push(JSON.parse(JSON.stringify(this.schedule)))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.sltList = []
|
|
this.sltList = []
|
|
@@ -957,6 +1002,7 @@ export default {
|
|
this.$Message.warning(this.$t('cusMgt.sltListTips'))
|
|
this.$Message.warning(this.$t('cusMgt.sltListTips'))
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ console.log('课程信息:', this.courseListShow[this.curCusIndex])
|
|
this.isAddStuList = false
|
|
this.isAddStuList = false
|
|
this.updCusInfo()
|
|
this.updCusInfo()
|
|
this.initSchedule()
|
|
this.initSchedule()
|
|
@@ -1033,10 +1079,12 @@ export default {
|
|
title: this.$t('cusMgt.remvListTitle'),
|
|
title: this.$t('cusMgt.remvListTitle'),
|
|
content: `${this.$t('cusMgt.remvListConten')}${this.schdList[this.curClassIndex].listName || this.schdList[this.curClassIndex].classInfo.name}?`,
|
|
content: `${this.$t('cusMgt.remvListConten')}${this.schdList[this.curClassIndex].listName || this.schdList[this.curClassIndex].classInfo.name}?`,
|
|
onOk: () => {
|
|
onOk: () => {
|
|
|
|
+ let index = this.curClassIndex
|
|
|
|
+ this.curClassIndex = 0
|
|
|
|
+ let curSchd = this.schdList[index]
|
|
//如果只有一个名单的时候移除名单则为清空名单,不能真的删除
|
|
//如果只有一个名单的时候移除名单则为清空名单,不能真的删除
|
|
if (this.schdList.length == 1) {
|
|
if (this.schdList.length == 1) {
|
|
for (let i in this.courseListShow[this.curCusIndex].schedule) {
|
|
for (let i in this.courseListShow[this.curCusIndex].schedule) {
|
|
- let curSchd = this.schdList[this.curClassIndex]
|
|
|
|
if (this.courseListShow[this.curCusIndex].schedule[i].classId == curSchd.classId && this.courseListShow[this.curCusIndex].schedule[i].stulist == curSchd.stulist) {
|
|
if (this.courseListShow[this.curCusIndex].schedule[i].classId == curSchd.classId && this.courseListShow[this.curCusIndex].schedule[i].stulist == curSchd.stulist) {
|
|
this.courseListShow[this.curCusIndex].schedule[i].classId = ''
|
|
this.courseListShow[this.curCusIndex].schedule[i].classId = ''
|
|
this.courseListShow[this.curCusIndex].schedule[i].stulist = ''
|
|
this.courseListShow[this.curCusIndex].schedule[i].stulist = ''
|
|
@@ -1045,11 +1093,12 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- for (let i in this.courseListShow[this.curCusIndex].schedule) {
|
|
|
|
- let curSchd = this.schdList[this.curClassIndex]
|
|
|
|
|
|
+ for (let i = 0; i < this.courseListShow[this.curCusIndex].schedule.length; i++) {
|
|
|
|
+
|
|
if (this.courseListShow[this.curCusIndex].schedule[i].classId == curSchd.classId && this.courseListShow[this.curCusIndex].schedule[i].stulist == curSchd.stulist) {
|
|
if (this.courseListShow[this.curCusIndex].schedule[i].classId == curSchd.classId && this.courseListShow[this.curCusIndex].schedule[i].stulist == curSchd.stulist) {
|
|
this.courseListShow[this.curCusIndex].schedule.splice(i, 1)
|
|
this.courseListShow[this.curCusIndex].schedule.splice(i, 1)
|
|
- break
|
|
|
|
|
|
+ i--
|
|
|
|
+ // break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1099,15 +1148,16 @@ export default {
|
|
this.courseListShow = this.courseList.filter(item => {
|
|
this.courseListShow = this.courseList.filter(item => {
|
|
return item.period.id == this.filterPeriod
|
|
return item.period.id == this.filterPeriod
|
|
})
|
|
})
|
|
|
|
+ this.selectCus(0)
|
|
|
|
|
|
let curGd = this.schoolBase.period.find(item => {
|
|
let curGd = this.schoolBase.period.find(item => {
|
|
return item.id == this.filterPeriod
|
|
return item.id == this.filterPeriod
|
|
})
|
|
})
|
|
if (curGd) {
|
|
if (curGd) {
|
|
- let filters = curGd.grades.map(item => {
|
|
|
|
|
|
+ let filters = curGd.grades.map((item, index) => {
|
|
return {
|
|
return {
|
|
label: item.name,
|
|
label: item.name,
|
|
- value: item.id
|
|
|
|
|
|
+ value: index + 1
|
|
}
|
|
}
|
|
})
|
|
})
|
|
//年级筛选条件
|
|
//年级筛选条件
|
|
@@ -1164,6 +1214,7 @@ export default {
|
|
if (res.courses && res.courses.length > 0) {
|
|
if (res.courses && res.courses.length > 0) {
|
|
res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
res.courses[0].schedule.forEach(item => {
|
|
res.courses[0].schedule.forEach(item => {
|
|
|
|
+ //补充班级信息
|
|
if (item.classId) {
|
|
if (item.classId) {
|
|
let classInfo = this.classList.find(classItem => {
|
|
let classInfo = this.classList.find(classItem => {
|
|
return classItem.id == item.classId
|
|
return classItem.id == item.classId
|
|
@@ -1180,6 +1231,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 补充动态名单信息
|
|
if (item.stulist) {
|
|
if (item.stulist) {
|
|
let listInfo = this.stuList.find(listItem => {
|
|
let listInfo = this.stuList.find(listItem => {
|
|
return listItem.id == item.stulist
|
|
return listItem.id == item.stulist
|
|
@@ -1190,7 +1242,23 @@ export default {
|
|
item.listName = '--'
|
|
item.listName = '--'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 补充教室信息
|
|
|
|
+ if (item.room) {
|
|
|
|
+ let roomInfo = this.roomList.find(roomItem => {
|
|
|
|
+ return roomItem.id == item.room
|
|
|
|
+ })
|
|
|
|
+ if (roomInfo) {
|
|
|
|
+ item.roomInfo = {
|
|
|
|
+ id: item.room,
|
|
|
|
+ name: roomInfo.name
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ item.roomInfo = {
|
|
|
|
+ id: item.room,
|
|
|
|
+ name: '--'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
|
|
this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
|
|
@@ -1374,7 +1442,7 @@ export default {
|
|
}).then(
|
|
}).then(
|
|
res => {
|
|
res => {
|
|
res.stus.forEach(item => {
|
|
res.stus.forEach(item => {
|
|
- let classInfo = this.classList.find(classItem => {
|
|
|
|
|
|
+ let classInfo = this.roomList.find(classItem => {
|
|
return classItem.id == item.classId
|
|
return classItem.id == item.classId
|
|
})
|
|
})
|
|
if (classInfo) {
|
|
if (classInfo) {
|
|
@@ -1429,15 +1497,16 @@ export default {
|
|
this.filterPeriod = this.schoolBase.period[0].id
|
|
this.filterPeriod = this.schoolBase.period[0].id
|
|
this.hasTimeTable = this.schoolBase.period[0].timetable ? true : false
|
|
this.hasTimeTable = this.schoolBase.period[0].timetable ? true : false
|
|
}
|
|
}
|
|
|
|
+ this.roomList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_rooms))
|
|
this.classList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
|
|
this.classList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
|
|
let curGd = this.schoolBase.period[0].grades
|
|
let curGd = this.schoolBase.period[0].grades
|
|
- let filters = curGd.map(item => {
|
|
|
|
|
|
+ let filters = curGd.map((item, index) => {
|
|
return {
|
|
return {
|
|
label: item.name,
|
|
label: item.name,
|
|
- value: item.id
|
|
|
|
|
|
+ value: index + 1
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- //年级筛选条件
|
|
|
|
|
|
+ //年级筛选条件 现在教室没有年级属性,这里调整为筛选是否有设置上课班级
|
|
this.classroomCol.push({
|
|
this.classroomCol.push({
|
|
title: this.$t('cusMgt.gradeLabel'),
|
|
title: this.$t('cusMgt.gradeLabel'),
|
|
slot: 'grade',
|
|
slot: 'grade',
|
|
@@ -1445,7 +1514,24 @@ export default {
|
|
filters: filters,
|
|
filters: filters,
|
|
filterMultiple: false,
|
|
filterMultiple: false,
|
|
filterMethod(value, row) {
|
|
filterMethod(value, row) {
|
|
- return row.gradeId == value
|
|
|
|
|
|
+ let date = new Date()
|
|
|
|
+ let curYear = date.getFullYear()
|
|
|
|
+ if (this.schoolBase && this.schoolBase.period.length && this.filterPeriod) {
|
|
|
|
+ let pData = this.schoolBase.period.find(item => {
|
|
|
|
+ return item.id == this.filterPeriod
|
|
|
|
+ })
|
|
|
|
+ if (pData) {
|
|
|
|
+ let month = date.getMonth() + 1
|
|
|
|
+ let start = pData.semesters.find(item => {
|
|
|
|
+ return item.start == 1
|
|
|
|
+ })
|
|
|
|
+ // 根据入学月份确定当前年级和学级的关系
|
|
|
|
+ if (start && month < start.month) {
|
|
|
|
+ curYear--
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return row.year == curYear - value
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -1462,6 +1548,14 @@ export default {
|
|
this.findStuList()
|
|
this.findStuList()
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ //当前学段班级列表
|
|
|
|
+ classTableList() {
|
|
|
|
+ let data = []
|
|
|
|
+ data = this.classList.filter(item => {
|
|
|
|
+ return item.periodId == this.filterPeriod
|
|
|
|
+ })
|
|
|
|
+ return data
|
|
|
|
+ },
|
|
//当前课程id
|
|
//当前课程id
|
|
courseId() {
|
|
courseId() {
|
|
return this.courseListShow[this.curCusIndex] ? this.courseListShow[this.curCusIndex].id : ''
|
|
return this.courseListShow[this.curCusIndex] ? this.courseListShow[this.curCusIndex].id : ''
|
|
@@ -1474,9 +1568,9 @@ export default {
|
|
return []
|
|
return []
|
|
},
|
|
},
|
|
//选择教室名单列表
|
|
//选择教室名单列表
|
|
- calssTable() {
|
|
|
|
|
|
+ roomTable() {
|
|
let tbData = []
|
|
let tbData = []
|
|
- tbData = this.classList.filter(item => {
|
|
|
|
|
|
+ tbData = this.roomList.filter(item => {
|
|
return item.periodId == this.filterPeriod
|
|
return item.periodId == this.filterPeriod
|
|
})
|
|
})
|
|
return tbData
|
|
return tbData
|
|
@@ -1484,7 +1578,7 @@ export default {
|
|
//级联选择年级班级
|
|
//级联选择年级班级
|
|
csOptions() {
|
|
csOptions() {
|
|
let data = []
|
|
let data = []
|
|
- if (this.filterPeriod && this.schoolBase.period.length && this.classList.length) {
|
|
|
|
|
|
+ if (this.filterPeriod && this.schoolBase.period.length && this.roomList.length) {
|
|
let curPd = this.schoolBase.period.filter((item) => {
|
|
let curPd = this.schoolBase.period.filter((item) => {
|
|
return item.id == this.filterPeriod
|
|
return item.id == this.filterPeriod
|
|
})
|
|
})
|
|
@@ -1495,7 +1589,7 @@ export default {
|
|
name: item.name,
|
|
name: item.name,
|
|
children: []
|
|
children: []
|
|
}
|
|
}
|
|
- let child = this.classList.filter(classItem => {
|
|
|
|
|
|
+ let child = this.roomList.filter(classItem => {
|
|
return classItem.gradeId == item.id
|
|
return classItem.gradeId == item.id
|
|
})
|
|
})
|
|
dataItem.children = child
|
|
dataItem.children = child
|
|
@@ -1526,17 +1620,20 @@ export default {
|
|
let schds = this.courseListShow[this.curCusIndex].schedule.filter(item => {
|
|
let schds = this.courseListShow[this.curCusIndex].schedule.filter(item => {
|
|
return item.teacherId == this.teaList[this.curTeaIndex].id
|
|
return item.teacherId == this.teaList[this.curTeaIndex].id
|
|
})
|
|
})
|
|
|
|
+ //一个班级在不同的教室上课会出现重复的情况,这里用map去重
|
|
|
|
+ const ids = new Map()
|
|
return schds.filter(item => {
|
|
return schds.filter(item => {
|
|
- return (item.classId || item.stulist)
|
|
|
|
|
|
+ // return (item.classId || item.stulist) && (!ids.has(item.room) && ids.set(item.room, 1))
|
|
|
|
+ return (item.classId && !ids.has(item.classId) && ids.set(item.classId, 1)) || (item.stulist && !ids.has(item.stulist) && ids.set(item.stulist, 1))
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//当前老师课程安排,有设置教室的
|
|
//当前老师课程安排,有设置教室的
|
|
- schdClassList() {
|
|
|
|
|
|
+ schdRoomList() {
|
|
return this.schdList.filter(item => {
|
|
return this.schdList.filter(item => {
|
|
- return item.classId
|
|
|
|
|
|
+ return item.room
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//当前课程的授课老师列表
|
|
//当前课程的授课老师列表
|