1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909 |
- <template>
- <!-- m-container -->
- <div class>
- <!-- <h2>
- <div class='squrt'></div>
- 班级调整
- </h2>-->
- <div class="m-core">
- <el-form :inline="true"
- :model="topForm">
- <el-form-item label="班级类型">
- <el-select v-model.trim="topForm.classType"
- clearable
- filterable
- @change="changeMixClass">
- <el-option v-for="(item,index) in classTypeList"
- :key="index"
- :label="item.label"
- :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item>
- <div class="newBand"
- @click="search">搜索</div>
- </el-form-item> -->
- <!-- <el-form-item>
- <div class="newBand"
- @click="startRegest">开启报名</div>
- </el-form-item> -->
- </el-form>
- <div class="tableWrap"
- style>
- <el-table :data="activeSingleList"
- style
- ref="multipleTable"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- tooltip-effect="dark"
- @selection-change="handleSelectionChange">
- <el-table-column type="selection"
- v-bind:selectable="chkstu"
- width="55"></el-table-column>
- <el-table-column align="center"
- prop="name"
- label="班级名称"></el-table-column>
- <el-table-column align="center"
- prop="type"
- label="班级类型">
- <template slot-scope="scope">
- <div>{{ scope.row.type | classType }}</div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="studentNum"
- label="班级人数">
- <template slot-scope="scope">
- <div>{{scope.row.studentNum+'/'+scope.row.expectStudentNum}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop
- label="主教老师">
- <template slot-scope="scope">
- <div v-if="scope.row.classGroupTeacherMapperList">
- <p v-for="(item,index) in scope.row.classGroupTeacherMapperList"
- v-if="item.teacherRole == 'BISHOP'"
- :key="index">{{item.userName}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- label="助教老师">
- <template slot-scope="scope">
- <div v-if="scope.row.classGroupTeacherMapperList">
- <p v-for="(item,index) in scope.row.classGroupTeacherMapperList"
- v-if="item.teacherRole == 'TEACHING'"
- :key="index">{{item.userName}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- label="已上课时">
- <template slot-scope="scope">
- <div>{{scope.row.currentClassTimes}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- label="总课数">
- <template slot-scope="scope">
- <div>{{scope.row.totalClassTimes}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- width="220px"
- label="操作">
- <template slot-scope="scope">
- <div>
- <!-- v-if="scope.row.type !='MIX'" -->
- <el-button type="text"
- @click="resetClass(scope.row)"
- v-permission="'classGroupStudent/updateClassGroupStudents'"
- v-if="scope.row.type != 'MUSIC_NETWORK'">学员调整</el-button>
- <el-button type="text"
- v-if="permission('classGroup/classGroupUpdate') || permission('classGroup/revisionClassGroup') || permission('classGroup/revisionAddClassGroup')"
- @click="classAdjustment(scope.row)">班级调整</el-button>
- <!--<el-button type="text"
- @click="recourse(scope.row)">重新排课</el-button>-->
- <el-popover placement="top"
- width="200"
- :ref="`popover-${scope.$index}`">
- <p>确定删除?</p>
- <div style="text-align: right; margin: 0">
- <el-button size="mini"
- type="text"
- @click="scope._self.$refs[`popover-${scope.$index}`].doClose()">取消</el-button>
- <el-button type="primary"
- size="mini"
- @click="removeClass(scope)">确定</el-button>
- </div>
- <!-- v-if="scope.row.type !='MIX'" -->
- <el-button type="text"
- v-if="scope.row.studentNum == '0' || scope.row.totalClassTimes == '0'"
- slot="reference">删除班级</el-button>
- </el-popover>
- <!-- <el-popover placement="top"
- width="160"
- :ref="scope.$index">
- <p>是否清空课表?</p>
- <div style="text-align: right; margin: 0">
- <el-button size="mini"
- type="text"
- @click="scope._self.$refs[scope.$index].doClose()">取消</el-button>
- <el-button type="primary"
- size="mini"
- @click="clearCourse(scope)">确定</el-button>
- </div> -->
- <!-- v-if="scope.row.type !='MIX'" -->
- <!-- <el-button type="text"
- slot="reference">清空课表</el-button>
- </el-popover> -->
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="floor">
- <div class="add"
- @click="temporary">新建临时班</div>
- <div class="add"
- @click="addNewClass('NORMAL')">新建单技班</div>
- <div class="add"
- @click="addNewClass('MIX')">新建合奏班</div>
- <div class="add"
- @click="addNewClass('MUSIC_NETWORK')">新建乐团网管课</div>
- <div class="add"
- @click="newClassVisible = true">基础技能班</div>
- <!-- <div class="add"
- @click="addNewClass('HIGH_ONLINE')">线上基础技能班</div>-->
- </div>
- </div>
- </div>
- <!-- 学员选择 -->
- <el-dialog title="学员选择"
- width="750px"
- :visible.sync="studentVisible"
- destroy-on-close>
- <selectStudent :activeListStudent="activeListStudent"
- :studentList="studentList"
- :soundList="soundList"
- :classGroupId="activeClass"
- :isOnlyChangeUser="isOnlyChangeUser"
- :activeType="activeType"
- @changeActiveChioseSound="changeActiveChioseSound"
- @searchStudent="searchStudent"
- @submited="studentSubmited"
- @close="studentVisible = false" />
- </el-dialog>
- <!-- <el-dialog title="学员选择"
- width="700px"
- :visible.sync="studentVisible"
- :modal-append-to-body="false">
- <div class="studentMask">
- <div class="left">
- <div class="wrap">
- <el-input placeholder="请输入班级名称"
- :disabled="!isNewClass"
- v-model.trim="className"></el-input>
- </div>
- <div class="chioseStudentList">
- <h4 style="padding-left:10px;">当前已选学员</h4>
- <div class="studentItem"
- v-for="(item,index) in activeListStudent"
- :key="index">
- {{ item.name }}
- <el-popover v-if="!isNewClass"
- placement="top"
- v-model.trim="item.isVisible"
- width="160">
- <p>确定删除?</p>
- <div style="text-align: right; margin: 0">
- <el-button size="mini"
- type="text"
- @click="item.isVisible = false">取消</el-button>
- <el-button type="primary"
- size="mini"
- @click="removeStudent(item)">确定</el-button>
- </div>
- <el-button type="text"
- slot="reference">删除</el-button>
- </el-popover>
- <el-button v-if="isNewClass"
- type="text"
- @click="temporaryRemoveStudent(item)">删除</el-button>
- </div>
- </div>
- </div>
- <div class="right"> -->
- <!-- multiple
- collapse-tags v-if="isSearch" -->
- <!-- <el-select v-model.trim="activeChioseSound"
- style="width:180px"
- @change="searchStudent"
- clearable
- filterable
- placeholder="声部选择">
- <el-option v-for="(item,index) in soundList"
- :key="index"
- :label="item.name"
- :value="item.id"></el-option>
- </el-select> -->
- <!-- <el-button v-if="isSearch"
- type="danger"
- style="margin-left:20px;"
- @click="searchStudent">搜索</el-button>-->
- <!-- 列表开始 -->
- <!-- <div class="tableList">
- <el-table tooltip-effect="dark"
- v-if="!isNewClass"
- style="width: 100%; margin-top:10px;"
- :data="studentList"
- ref="studentList"
- @selection-change="SelectionStudent">
- <el-table-column type="selection"
- align="center"
- width="55"></el-table-column>
- <el-table-column prop="name"
- align="center"
- width="120"
- label="姓名"></el-table-column>
- <el-table-column prop="gender"
- align="center"
- width="100"
- label="性别">
- <template slot-scope="scope">
- <div>{{ scope.row.gender | sex }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="subjectName"
- width="100"
- align="center"
- label="学员声部"></el-table-column>
- </el-table> -->
- <!-- 临时调整table -->
- <!-- <el-table tooltip-effect="dark"
- v-if="isNewClass"
- style="width: 100%; margin-top:10px;"
- :data="studentList"
- ref="temporaryStudentList"
- @selection-change="NewselectionStudent">
- <el-table-column type="selection"
- align="center"
- width="55"></el-table-column>
- <el-table-column prop="name"
- align="center"
- width="120"
- label="姓名"></el-table-column>
- <el-table-column prop="gender"
- align="center"
- width="100"
- label="性别">
- <template slot-scope="scope">
- <div>{{ scope.row.gender | sex }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="subjectName"
- width="100"
- align="center"
- label="学员声部"></el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- <div slot="footer"
- class="dialog-footer">
- <el-button @click="studentVisible = false">取 消</el-button> -->
- <!-- 班级学员修改 -->
- <!-- <el-button type="primary"
- v-if="!isNewClass"
- @click="addSomeStudent">确 定</el-button> -->
- <!-- 临时调整或者新建班级 -->
- <!-- <el-button type="primary"
- v-if="isNewClass"
- @click="setInfoMsg">确 定</el-button>
- </div>
- </el-dialog> -->
- <!-- 老师以及课程设置 -->
- <el-dialog title="班级设置"
- width="950px"
- :visible.sync="infoVisible"
- :modal-append-to-body="false"
- destroy-on-close>
- <classroomSetting :classType="classType"
- :teacherList="teacherList"
- :musicGroupId="teamid"
- :activeType="activeType"
- :courseTypeList="courseTypeList"
- :cooperationList="cooperationList"
- :detail="infoDetail"
- :studentSubmitedData="studentSubmitedData"
- @close="infoVisible = false"
- @submited="getList" />
- </el-dialog>
- <!-- <el-dialog title="班级设置"
- width="780px"
- :visible.sync="infoVisible"
- :modal-append-to-body="false">
- <el-alert
- type="warning"
- style="margin-bottom: 20px;"
- :closable="false">
- <template #title>
- <div class="alert-content">
- <span>
- 该班级剩余可排课时长:<strong>1000分钟</strong>
- </span>
- <strong>学员列表>></strong>
- </div>
- </template>
- </el-alert>
- <el-form :inline="true"
- :model="teacherForm"
- ref="teacherForm"
- :rules="teacherRules"
- label-position="right"
- label-width="100px;"> -->
- <!-- <el-form-item label="调整方式"
- v-if="!isNewClass"
- prop="isAdd">
- <el-radio v-model.trim="teacherForm.isAdd"
- label="new">班级加课</el-radio>
- <el-radio v-model.trim="teacherForm.isAdd"
- label="renew">重新排课</el-radio>
- <el-radio v-model.trim="teacherForm.isAdd"
- label="onlyUpdateTeacher">修改老师 -->
- <!-- <el-tooltip placement="top"
- popper-class="mTooltip">
- <div slot="content">
- 仅修改班级老师,不修改课程老师.
- </div>
- <i class="el-icon-question micon el-tooltip"
- style="font-size: 18px; color: #F56C6C"></i>
- </el-tooltip> -->
- <!-- </el-radio>
- </el-form-item> -->
- <!-- <br /> -->
- <!-- <el-form-item label="主教老师"
- prop="coreTeacher">
- <el-select v-model.trim="teacherForm.coreTeacher"
- placeholder="请选择主教老师"
- clearable
- filterable>
- <el-option v-for="(item,index) in teacherList"
- :key="index"
- :label="item.realName"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="助教老师"
- v-if="activeType!='HIGH_ONLINE'&&activeType!='MUSIC_NETWORK'"
- prop="assistant">
- <el-select v-model.trim="teacherForm.assistant"
- placeholder="请选择助教老师"
- filterable
- clearable
- @change="setAssistant"
- multiple>
- <el-option v-for="(item,index) in cooperationList"
- :key="index"
- :label="item.realName"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <p v-if="teacherForm.isAdd =='onlyUpdateTeacher'"
- style="padding-left: 10px; color: red;">注意:仅修改班级老师,不修改课程老师。</p>
- <el-form-item label="课程类型"
- prop="courseType"
- v-if="teacherForm.isAdd !='onlyUpdateTeacher'">
- <el-select v-model.trim="teacherForm.courseType"
- placeholder="请选择课程类型"
- @change="changeCourseType"
- clearable
- filterable>
- <el-option v-for="(item,index) in courseTypeList"
- :key="index"
- :value="item.value"
- :label="item.label"></el-option>
- </el-select>
- </el-form-item> -->
- <!-- v-if="!isNewClass" -->
- <!-- <el-form-item label="声部"
- v-if="activeType=='HIGH_ONLINE'&&isNewClass"
- prop="sound">
- <el-select v-model.trim="teacherForm.sound"
- style="width:180px"
- clearable
- filterable
- placeholder="请选择声部">
- <el-option v-for="(item,index) in soundList"
- :key="index"
- :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="预计招生人数"
- v-if="isNewClass"
- prop="expectStudentNum">
- <el-input type="number"
- placeholder="请输入预计招生人数"
- :disabled="activeType=='HIGH_ONLINE'"
- @mousewheel.native.prevent
- v-model="teacherForm.expectStudentNum"></el-input>
- </el-form-item>
- <br />
- <el-form-item label="排课次数"
- prop="courseNum"
- v-if="teacherForm.isAdd !='onlyUpdateTeacher'">
- <el-input type="number"
- placeholder="请输入排课次数"
- @mousewheel.native.prevent
- v-model.trim="teacherForm.courseNum"></el-input>
- </el-form-item>
- <el-form-item label="排课起始时间"
- prop="courseTime"
- v-if="teacherForm.isAdd !='onlyUpdateTeacher'">
- <el-date-picker v-model.trim="teacherForm.courseTime"
- :picker-options="pickerOptions"
- style="width:200px!important;"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择日期"></el-date-picker>
- <el-checkbox style="margin-left:10px;"
- v-model.trim="teacherForm.checked">是否跳过节假日</el-checkbox>
- </el-form-item>
- </el-form>
- <div class="WeekWrap"
- v-if="teacherForm.isAdd !='onlyUpdateTeacher'">
- <h3 style="margin-bottom:20px;">
- 循环次数
- <el-button type="text"
- style="margin-left:10px;"
- @click="addWeek">添加</el-button>
- </h3>
- <div class="countWrap"
- style="margin-bottom:10px;">
- <div class="countItem"
- style="margin-bottom:20px;"
- v-for="(item,index) in weekList"
- :key="index">
- <span>循环周期:</span>
- <el-select v-model.trim="item.dayOfWeek"
- style="width:100px!important"
- clearable
- filterable>
- <el-option v-for="(item,index) in weekDateList"
- :key="index"
- :label="item.label"
- :value="item.value"></el-option>
- </el-select>
- <span>课程时长</span>
- <el-input placeholder="时长(分)"
- type="number"
- v-model.trim="item.time"
- disabled
- @input="()=>{setItem(item,index)}"
- style="width:100px!important"></el-input>
- <span>开始时间</span>
- <el-time-picker style="margin-left:10px;"
- placeholder
- v-model.trim="item.startClassTime"
- @change="(val)=>{changeStartTimes(val,item)}"
- format='HH:mm'
- value-format='HH:mm'
- :picker-options="{
- selectableRange: '04:30:00 - 23:59:59'
- }"></el-time-picker>
- <span style="margin-left:10px;">结束时间</span>
- <el-time-picker style="margin-left:10px;"
- placeholder
- v-model.trim="item.endClassTime"
- format='HH:mm'
- value-format='HH:mm'
- disabled
- :picker-options="{
- selectableRange: '04:30:00 - 24:00:00'
- }"></el-time-picker>
- <el-button type="danger"
- @click="removeWeek(item)"
- icon="el-icon-delete"
- circle></el-button>
- </div>
- </div>
- </div>
- <div slot="footer"
- class="dialog-footer"> -->
- <!-- 1为临时班级 -->
- <!-- <el-button type="primary"
- v-if="isTemporary&&isNewClass"
- @click="submitTemporary(1)">确 定</el-button> -->
- <!-- 2为新增班级 -->
- <!-- <el-button type="primary"
- v-if="!isTemporary&&isNewClass"
- @click="submitTemporary(2)">确 定</el-button> -->
- <!-- 修改班级信息 -->
- <!-- <el-button type="primary"
- v-if="!isNewClass"
- @click="submitTemporary(3)">确 定</el-button>
- </div>
- </el-dialog> -->
- <!-- 新增合奏班 -->
- <el-dialog title="新增合奏班"
- width="700px"
- :visible.sync="MixVisible"
- :modal-append-to-body="false">
- <div class="studentMask">
- <div class="left">
- <div class="wrap">
- <!-- :disabled="!isNewClass" -->
- <el-input placeholder="请输入合奏班名称"
- v-model.trim="className"></el-input>
- </div>
- <div class="chioseStudentList">
- <h4 style="padding-left:10px;">当前已选学生</h4>
- <div class="studentItem"
- v-for="(item,index) in activeListStudent"
- :key="index">
- {{ item.name }}
- <el-button type="text"
- @click="removeSiginforMix(item)">删除班级</el-button>
- </div>
- </div>
- </div>
- <div class="right">
- <!-- 列表开始 -->
- <div class="tableList">
- <el-table tooltip-effect="dark"
- style="width: 100%; margin-top:10px;"
- :data="singleList"
- ref="mixList"
- @selection-change="SelectionMix">
- <el-table-column type="selection"
- align="center"
- width="55"></el-table-column>
- <el-table-column prop="name"
- align="center"
- width="120"
- label="姓名"></el-table-column>
- <el-table-column prop="gender"
- align="center"
- width="100"
- label="性别">
- <template slot-scope="scope">
- <div>{{ scope.row.gender | sex }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="subjectName"
- width="120"
- align="center"
- label="学员声部"></el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- <div slot="footer"
- class="dialog-footer">
- <el-button @click="studentVisible = false">取 消</el-button>
- <!-- 班级学员修改 -->
- <el-button type="primary"
- v-if="!isNewClass"
- @click="addSomeStudent">确 定</el-button>
- <!-- 临时调整或者新建班级 -->
- <el-button type="primary"
- v-if="isNewClass"
- @click="setInfoMsg">确 定</el-button>
- </div>
- </el-dialog>
- <el-dialog :visible.sync="newClassVisible"
- width="700px"
- title="新增班级">
- <el-form :model="newClassForm"
- :inline="true"
- label-width="100px"
- ref="newClassForm"
- class="newClassForm">
- <el-form-item label="班级名称"
- :rules="[{ required: true, message: '请输入班级姓名',trigger: 'blur'}]"
- prop="className">
- <el-input style="width:180px;"
- v-model="newClassForm.className"></el-input>
- </el-form-item>
- <el-form-item label="班级类型"
- :rules="[{ required: true, message: '请输入班级人数',trigger: 'blur'}]"
- prop="type">
- <el-select v-model.trim="newClassForm.type"
- clearable
- @change="chioseHightype">
- <el-option v-for="(item,index) in highTypeList"
- :key="index"
- :label="item.label"
- :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="主教老师"
- prop="bishop"
- :rules="[{ required: true, message: '请选择主教老师',trigger: 'blur'}]">
- <el-select placeholder="请选择主教老师"
- v-model="newClassForm.bishop"
- clearable
- filterable>
- <el-option v-for="(item,index) in teacherList"
- :label="item.realName"
- :value="item.id"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="预计招生数"
- prop="expectStudentNum"
- :rules="[{ required: true, message: '请输入预计招生数',trigger: 'blur'},{pattern:/[3-5]/,message:'班级人数必须为3-5人',trigger: 'blur'}]"
- v-if=" newClassForm.type == 'HIGH_ONLINE'">
- <el-input style="width:180px;"
- type="number"
- @mousewheel.native.prevent
- v-model="newClassForm.expectStudentNum"></el-input>
- </el-form-item>
- <el-form-item label="预计招生数"
- prop="expectStudentNum"
- type="number"
- :rules="[{ required: true, message: '请输入预计招生数',trigger: 'blur'}]"
- @mousewheel.native.prevent
- v-else>
- <el-input style="width:180px;"
- v-model="newClassForm.expectStudentNum"></el-input>
- </el-form-item>
- <el-form-item label="助教老师"
- v-if=" newClassForm.type != 'HIGH_ONLINE'"
- prop="teaching">
- <el-select placeholder="请选择助教老师"
- v-model="newClassForm.teaching"
- @change="setAssistant1"
- clearable
- multiple
- filterable>
- <el-option v-for="(item,index) in teacherList"
- :label="item.realName"
- :value="item.id"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="声部"
- prop="subjectIdList"
- :rules="[{ required: true, message: '请选择声部',trigger: 'blur'}]"
- v-if="newClassForm.type =='HIGH' || newClassForm.type =='NORMAL'"
- :key="'HIGH'">
- <el-select v-model="newClassForm.subjectIdList"
- clearable
- multiple>
- <el-option v-for="(item,index) in soundList"
- :key="index"
- :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="可报名声部"
- prop="memo"
- :rules="[{ required: true, message: '请选择可报名声部',trigger: 'blur'}]"
- v-if="newClassForm.type == 'HIGH_ONLINE'">
- <el-select v-model.trim="newClassForm.memo"
- multiple
- clearable>
- <el-option v-for="(item,index) in soundList"
- :key="index"
- :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="声部"
- prop="subjectId"
- :rules="[{ required: true, message: '请选择线上声部',trigger: 'blur'}]"
- v-if="newClassForm.type == 'HIGH_ONLINE'"
- class="higheSelect"
- :key="'HIGH_ONLINE'">
- <el-select v-model="newClassForm.subjectId"
- clearable>
- <el-option v-for="(item,index) in soundList"
- :key="index"
- :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer"
- class="dialog-footer">
- <el-button @click="newClassVisible = false">取 消</el-button>
- <el-button type="primary"
- @click="newClassHight">确 定</el-button>
- </div>
- </el-dialog>
- <el-dialog title="学员列表"
- :visible.sync="studentListModalVisible"
- destroy-on-close>
- <viewStudentList :list="studentListModal"
- @close="studentListModalVisible = false" />
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- getAllClass,
- getAllSignClassandTeacher,
- getAllSignClass,
- removeSingleClass,
- getNoClassStudentAll,
- findSound,
- teamSoundStudent,
- findMusicGroupClassTeacher,
- revisionClassGroup,
- revisionAddClassGroup,
- getEmployeeOrgan,
- getTeacher,
- findNoClassSingle,
- getMusicGroupStuNoClassType,
- classGroupUpdate,
- getTeamBaseInfo,
- clearClassCourse,
- superFindClassGroups,
- createClass,
- pushMessage
- } from "@/api/buildTeam";
- import {
- getClassAllStudent,
- removeStudents,
- addStudents
- } from "@/api/studentManager";
- import { queryEmployByOrganId } from "@/api/systemManage";
- import { diffTimerFormMinute, addTimerFormMinute } from '@/utils/date'
- import dayjs from 'dayjs'
- import axios from "axios";
- import { classTimeList } from "@/utils/searchArray";
- import viewStudentList from './modals/view-student-list'
- import selectStudent from './modals/select-student'
- import classroomSetting from './modals/classroom-setting'
- import qs from "qs";
- import { permission } from '@/utils/directivePage'
- export default {
- name: "tresetClass",
- components: {
- viewStudentList,
- selectStudent,
- classroomSetting
- },
- data () {
- return {
- classType: 0,
- pickerOptions: {
- firstDayOfWeek: 1,
- disabledDate (time) {
- return time.getTime() + 86400000 <= new Date().getTime();
- }
- },
- step: '00:05',
- teamid: "",
- topForm: {
- classType: ""
- },
- studentSubmitedData: null,
- infoDetail: null,
- classTimeList,
- tableList: [],
- maxClassList: [],
- activeSingleList: [],
- studentListModal: [],
- studentListModalVisible: false,
- resetCourseVisible: false, // 重新排课弹窗
- resetClassVisible: false, // 班级调整弹窗
- studentVisible: false,
- MixVisible: false, // 新增合奏班弹窗
- activeListStudent: [], // 当前选中的学生列表
- activeChioseSound: "", //选择的声部
- chioseSoundList: [], //当前的所有声部
- studentList: [], //列表里的学生集合
- activeMixClass: "", // 选中的合奏班
- chioseStudent: [], // 勾选的学生信息
- isNewClass: false, // 是否为新建班级
- isOnlyChangeUser: false,
- isSearch: false, // 是否需要搜索
- isTemporary: false, // 是否为临时班级
- className: "", // 班级名称
- activeClass: "", // 当前操作的班级
- soundList: [],
- infoVisible: false, // 判断是否需要显示老师设置
- teacherForm: {
- isAdd: null,
- coreTeacher: "",
- assistant: [],
- courseType: "",
- courseTime: "",
- checked: true,
- courseNum: "",
- mixClassGroupId: "",
- sound: "",
- expectStudentNum: ""
- },
- teacherRules: {
- isAdd: [{ required: true, message: "请选择调整类型" }],
- coreTeacher: [{ required: true, message: "请选择主教老师" }],
- courseType: [{ required: true, message: "请选择上课类型" }],
- courseTime: [{ required: true, message: "请选择开始时间" }],
- courseNum: [{ required: true, message: "请输入排课次数" }],
- mixClassGroupId: [{ required: true, message: "请选择合奏班" }],
- sound: [{ required: true, message: "请选择合声部" }],
- expectStudentNum: [{ required: true, message: "请填写预计招生人数" }]
- },
- weekList: [
- ],
- teacherList: [], // 存储的老师列表
- courseTypeList: [],
- weekDateList: [
- { value: "1", label: "星期一" },
- { value: "2", label: "星期二" },
- { value: "3", label: "星期三" },
- { value: "4", label: "星期四" },
- { value: "5", label: "星期五" },
- { value: "6", label: "星期六" },
- { value: "7", label: "星期日" }
- ],
- // 班级类型
- classTypeList: [
- { value: "NORMAL", label: "单技班" },
- { value: "MIX", label: "合奏班" },
- { value: "HIGH", label: "基础技能班" },
- { value: "SNAP", label: "临时班" },
- { value: "HIGH_ONLINE", label: "线上基础技能班" },
- { value: "MUSIC_NETWORK", label: "乐团网管课" }
- ],
- // 基础技能班类型
- highTypeList: [
- { value: "HIGH", label: "基础技能班" },
- { value: "HIGH_ONLINE", label: "线上基础技能班" }
- ],
- cooperationList: [],
- singleList: [],
- activeSingleLists: [],
- activeType: "",
- resetClassForm: {
- // 班级调整form对象
- startTime: "",
- endTime: "",
- assistant: [],
- coreTeacher: ""
- },
- recourseForm: {
- courseType: "",
- checked: false,
- courseTime: "",
- courseNum: ""
- },
- organId: "",
- newClassVisible: false,
- newClassForm: {
- className: null,
- type: null,
- subjectIdList: [],
- expectStudentNum: null,
- bishop: null,
- teaching: [],
- memo: [],
- subjectId: null
- },
- classGroupIds: null,
- maxMun: 16,
- courseTime: ''
- };
- },
- created () {
- this.init();
- },
- activated () {
- this.init();
- },
- mounted () { },
- methods: {
- permission (val) {
- return permission(val)
- },
- init () {
- this.teamid = this.$route.query.id;
- // 根据乐团id获取乐团所属分部
- getTeamBaseInfo({ musicGroupId: this.teamid }).then(res => {
- if (res.code == 200) {
- this.organId = res.data.musicGroup.organId;
- getTeacher({ organId: this.organId }).then(res => {
- if (res.code == 200) {
- this.cooperationList = res.data;
- this.teacherList = res.data;
- }
- });
- // queryEmployByOrganId({ organId: this.organId, rows: 10000 }).then(res => {
- // if (res.code == 200) {
- // }
- // })
- }
- });
- // // 获取乐团下未分班的单技班
- // findNoClassSingle({ musicGroupId: this.teamid }).then(res => {
- // if (res.code == 200) {
- // this.singleList = res.data;
- // }
- // })
- // getMusicGroupStuNoClassType
- // 获取合奏班下
- // 1.获取乐团下所有的合奏班
- // 2.根据合奏班获取所有的单技班
- // 3.根据乐团id 查询 此乐团所有的合奏班
- // 4.获取当年的所有节假日
- getAllClass({ musicGroupId: this.teamid }).then(res => {
- if (res.code == 200) {
- this.maxClassList = res.data;
- }
- });
- // let year = new Date().getFullYear();
- // axios.post('/jiari/', qs.stringify({ d: year })).then(res => {
- // this.holidayList = Object.keys(res.data[year])
- // })
- // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
- // })
- // 获取默认乐团内的所有班
- this.changeMixClass();
- // 根据乐团id获取乐团的所有声部
- findSound({ musicGroupId: this.teamid }).then(res => {
- if (res.code == 200) {
- this.soundList = res.data;
- }
- });
- // 获取分部所有老师
- // findMusicGroupClassTeacher({
- // musicGroupId: this.teamid
- // }).then(res => {
- // if (res.code == 200) {
- // this.teacherList = res.data
- // }
- // })
- // 获取分部所有老师
- // 助教是从员工表里选
- },
- studentSubmited (data) {
- if (!this.isOnlyChangeUser) {
- this.studentSubmitedData = data
- this.infoVisible = true
- } else {
- this.getList()
- }
- },
- recourse (row) {
- (this.weekList = [
- {
- week: "",
- startTime: "",
- endTime: "",
- id: new Date()
- }
- ]),
- (this.resetCourseVisible = true);
- },
- addMix () {
- this.MixVisible = true;
- },
- changeActiveChioseSound (val) {
- this.activeChioseSound = val
- },
- setAssistant (val) {
- for (let i in val) {
- if (val[i] == this.teacherForm.coreTeacher) {
- val.splice(i, 1);
- }
- }
- },
- changeMixClass (val) {
- // 根据合奏班id获取合奏班下的所有单技班
- this.getList(val);
- this.activeMixClass = val;
- },
- getList (val) {
- getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(
- res => {
- if (res.code == 200) {
- this.activeSingleList = res.data;
- // this.topForm.count = this.activeSingleList.length
- }
- }
- );
- },
- // 临时调整
- temporary () {
- this.classType = 1;
- this.activeClass = "";
- this.activeListStudent = [];
- this.studentList = [];
- this.isNewClass = true;
- this.studentVisible = true;
- this.isOnlyChangeUser = false
- this.isSearch = true;
- this.className = "";
- this.isTemporary = true;
- this.activeType = "SPAN";
- this.activeChioseSound = null
- this.setType("SNAP");
- this.getNoClassStudent("SNAP");
- },
- setType (type) {
- switch (type) {
- case "NORMAL": {
- this.courseTypeList = [
- { value: "SINGLE", label: "单技课" },
- { value: "TRAINING_SINGLE", label: "集训单技课" },
- { value: "COMPREHENSIVE", label: "综合课" },
- { value: "CLASSROOM", label: "课堂课" }
- ];
- break;
- }
- case "MIX": {
- this.courseTypeList = [
- { value: "MIX", label: "合奏课" },
- { value: "TRAINING_MIX", label: "集训合奏课" },
- { value: "COMPREHENSIVE", label: "综合课" },
- { value: "CLASSROOM", label: "课堂课" }
- ];
- break;
- }
- case "HIGH": {
- this.courseTypeList = [{ value: "HIGH", label: "基础技能课" }];
- break;
- }
- case "HIGH_ONLINE": {
- this.courseTypeList = [
- { value: "HIGH_ONLINE", label: "线上基础技能课" }
- ];
- break;
- }
- case "MUSIC_NETWORK": {
- this.courseTypeList = [
- { value: "MUSIC_NETWORK", label: "乐团网管课" }
- ];
- break;
- }
- case "SNAP": {
- this.courseTypeList = [
- { value: "SINGLE", label: "单技课" },
- { value: "MIX", label: "合奏课" },
- { value: "TRAINING_SINGLE", label: "集训单技课" },
- { value: "TRAINING_MIX", label: "集训合奏课" },
- { value: "HIGH", label: "基础技能课" },
- { value: "COMPREHENSIVE", label: "综合课" },
- { value: "CLASSROOM", label: "课堂课" }
- ];
- }
- }
- },
- // 新增班级
- addNewClass (type) {
- const types = {
- NORMAL: 2,
- MUSIC_NETWORK: 4
- }
- this.isOnlyChangeUser = false
- this.classType = (types[type] || 3)
- /**
- * { value: 'NORMAL', label: '单技班' },
- { value: 'MIX', label: '合奏班' },
- { value: 'HIGH', label: '基础技能班' },
- { value: 'SNAP', label: '临时班' },
- */
- this.setType(type);
- this.activeType = type;
- this.activeClass = "";
- this.activeListStudent = [];
- this.studentList = [];
- this.isNewClass = true;
- this.studentVisible = true;
- this.isSearch = false;
- this.className = "";
- this.isTemporary = false;
- this.activeChioseSound = null;
- this.getNoClassStudent(type);
- },
- searchStudent () {
- console.log(this.activeChioseSound)
- // 搜索学生
- // 根据声部id 乐团id搜索学生
- if (this.activeType == 'SPAN') {
- teamSoundStudent({
- musicGroupId: this.teamid,
- actualSubjectId: this.activeChioseSound
- }).then(res => {
- if (res.code == 200) {
- this.studentList = res.data;
- }
- });
- } else {
- this.getNoClassStudent(this.activeType, this.activeChioseSound)
- }
- },
- // 选择学生的方法修改
- SelectionStudent (val) {
- this.chioseStudent = val;
- },
- // 新增选中的学生
- NewselectionStudent (val) {
- this.chioseStudent = val;
- // 这里新增的添加到选中的学生列表 根据学生id去重
- if (this.chioseStudent.length > 0) {
- this.chioseStudent = this.chioseStudent.concat(val);
- } else {
- this.chioseStudent = val;
- }
- // 联动版
- // this.activeListStudent = this.objArrayRemoval(this.chioseStudent, 'userId')
- // 非联动多选版
- this.activeListStudent = this.activeListStudent.concat(
- this.chioseStudent
- );
- // // 去重
- this.activeListStudent = this.objArrayRemoval(
- this.activeListStudent,
- "userId"
- );
- // 将其填入选中的学生
- },
- clearCourse (scope) {
- clearClassCourse({ classGroupId: scope.row.id })
- .then(res => {
- if (res.code == 200) {
- this.$message.success("清除成功");
- scope._self.$refs[scope.$index].doClose();
- // 重新请求列表
- this.getList(this.activeMixClass);
- } else {
- this.$message.error(res.msg);
- scope._self.$refs[scope.$index].doClose();
- }
- })
- .catch(res => {
- scope._self.$refs[scope.$index].doClose();
- });
- // 清空课表
- },
- // 删除班级
- removeClass (scope) {
- removeSingleClass({ classGroupId: scope.row.id })
- .then(res => {
- if (res.code == 200) {
- scope._self.$refs[`popover-${scope.$index}`].doClose();
- this.$message.success("删除成功");
- // 重新请求列表
- this.getList(this.activeMixClass);
- } else {
- this.$message.error(res.msg);
- scope._self.$refs[`popover-${scope.$index}`].doClose();
- }
- })
- .catch(res => {
- scope._self.$refs[`popover-${scope.$index}`].doClose();
- });
- },
- // 修改班级
- resetClass (row) {
- this.isOnlyChangeUser = true
- this.isNewClass = false;
- this.className = row.name;
- this.studentVisible = true;
- this.activeClass = row.id;
- this.isSearch = false;
- this.activeType = row.type;
- this.activeChioseSound = null
- // 根据单机班id 查询单技班内的所有学生
- getClassAllStudent({ classGroupId: row.id }).then(res => {
- if (res.code == 200) {
- this.activeListStudent = res.data.map(item => {
- item.isVisible = false;
- return item;
- });
- }
- });
- this.getNoClassStudent(row.type);
- },
- // 班级调整
- classAdjustment (row) {
- this.infoDetail = row
- this.activeType = row.type;
- this.activeClass = row.id;
- // this.activeListStudent = row.subjectIdList.split(',')
- this.setType(row.type);
- // activeListStudent
- this.isNewClass = false;
- this.teacherForm.assistant = [];
- for (let i in row.classGroupTeacherMapperList) {
- if (row.classGroupTeacherMapperList[i].teacherRole == "BISHOP") {
- this.teacherForm.coreTeacher =
- row.classGroupTeacherMapperList[i].userId;
- }
- if (row.classGroupTeacherMapperList[i].teacherRole == "TEACHING") {
- this.teacherForm.assistant.push(
- row.classGroupTeacherMapperList[i].userId
- );
- }
- }
- this.infoVisible = true;
- },
- async getNoClassStudent (type, actualSubjectId) {
- // 获取乐团内所有未分班的学生
- // if (type && type == 'SNAP') {
- // teamSoundStudent({ musicGroupId: this.teamid }).then(res => {
- // if (res.code == 200) {
- // this.studentList = res.data
- // }
- // })
- // } else {
- // getMusicGroupStuNoClassType({ musicGroupId: this.teamid, type }).then(res => {
- // if (res.code == 200) {
- // this.studentList = res.data
- // }
- // })
- // }
- // res.data - activeListStudent
- const params = {
- musicGroupId: this.teamid,
- type,
- actualSubjectId
- }
- await getMusicGroupStuNoClassType(params).then(
- res => {
- if (res.code == 200) {
- // this.studentList = res.data.concat(this.activeListStudent).filter(item=>{
- // return res.data
- // });
- // if (this.activeType == "SNAP") {
- // let idarr2 = [];
- // let arr3 = res.data
- // for (let j in this.activeListStudent) {
- // idarr2.push(this.activeListStudent[j].userId);
- // }
- // this.studentList = arr3.filter(item => {
- // return (
- // idarr2.indexOf(item.userId) === -1
- // );
- // });
- // console.log(params, [...this.studentList])
- // // let idarr1 = [];
- // // let idarr2 = [];
- // // let arr3 = res.data.concat(this.activeListStudent);
- // // for (let i in res.data) {
- // // idarr1.push(res.data[i].userId);
- // // }
- // // for (let j in this.activeListStudent) {
- // // idarr2.push(this.activeListStudent[j].userId);
- // // }
- // // this.studentList = arr3.filter(item => {
- // // return (
- // // idarr1.indexOf(item.userId) === -1 ||
- // // idarr2.indexOf(item.userId) === -1
- // // );
- // // });
- // } else {
- this.studentList = res.data;
- // }
- }
- }
- );
- },
- // 删除学生 调整
- removeStudent (item) {
- // 这里做判断如果是线上基础技能班 学生人数不能少于3人
- if (
- this.activeType == "HIGH_ONLINE" &&
- this.activeListStudent.length <= 3
- ) {
- this.$message.error("线上基础技能课不能小于3人");
- return;
- }
- removeStudents({
- classGroupId: this.activeClass,
- userId: item.userId
- }).then(res => {
- if (res.code == 200) {
- this.$message.success("删除成功");
- item.isVisible = false;
- // 这里刷新 this.studentList this.activeListStudent
- this.getList(this.activeMixClass);
- getClassAllStudent({ classGroupId: this.activeClass }).then(res => {
- if (res.code == 200) {
- this.activeListStudent = res.data;
- }
- });
- this.getNoClassStudent(this.activeType);
- // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
- // if (res.code == 200) {
- // this.$message.success('删除成功');
- // this.studentList = res.data.map(item => {
- // item.isVisible = false;
- // return item;
- // });
- // }
- // })
- }
- });
- },
- // 批量添加学生
- addSomeStudent () {
- // 获取勾选的学生
- let arr = this.chioseStudent.map(item => {
- return item.userId;
- });
- if (arr.length <= 0) {
- if (this.isNewClass) {
- this.$message.error("至少添加一名学员");
- return;
- } else {
- this.studentVisible = false;
- return;
- }
- }
- if (this.activeType == "HIGH_ONLINE") {
- superFindClassGroups({ classGroupId: this.activeClass }).then(res => {
- if (res.code == 200) {
- if (
- this.activeListStudent.length + this.chioseStudent.length > 5 ||
- this.activeListStudent.length + this.chioseStudent.length < 3
- ) {
- this.$message.error("线上技能班必须为3-5人");
- return;
- } else {
- addStudents({
- classGroupId: this.activeClass,
- userIdsStr: arr.join(",")
- }).then(res => {
- if (res.code == 200) {
- this.studentVisible = false;
- this.$message.success("添加成功");
- this.getList();
- return;
- }
- });
- }
- }
- });
- } else {
- addStudents({
- classGroupId: this.activeClass,
- userIdsStr: arr.join(",")
- }).then(res => {
- if (res.code == 200) {
- this.studentVisible = false;
- this.$message.success("添加成功");
- this.getList();
- }
- });
- }
- },
- SelectionMix (val) {
- this.activeSingleLists = val;
- },
- removeSiginforMix (item) {
- for (let k in this.activeSingleLists) {
- if (this.activeSingleLists[k].id == item.id) {
- this.$refs["mixList"].toggleRowSelection(item, false);
- }
- }
- },
- temporaryRemoveStudent (item) {
- // 列表中删除
- for (let i in this.activeListStudent) {
- if (this.activeListStudent[i].userId == item.userId) {
- this.activeListStudent.splice(i, 1);
- }
- }
- // 查询列表中的项 取消勾选 temporaryStudentList toggleRowSelection
- // 循环列表 找到相应的行取消勾选
- for (let k in this.studentList) {
- if (this.studentList[k].userId == item.userId) {
- this.$refs["temporaryStudentList"].toggleRowSelection(item, false);
- }
- }
- // this.$refs['temporaryStudentList'].toggleRowSelection(row, selected);
- },
- // 对象数组去重
- objArrayRemoval (arr, attr) {
- let obj = {};
- let result = [];
- for (let x in arr) {
- if (!obj[arr[x][attr]]) {
- result.push(arr[x]);
- obj[arr[x][attr]] = true;
- }
- }
- return result;
- },
- setInfoMsg () {
- // 判断班级名称是否输入
- if (!this.className) {
- this.$message.error("请输入班级名称");
- return;
- }
- // 判断有没有勾选学生
- if (this.activeListStudent.length <= 0) {
- // 没有勾学生
- this.$message.error("班级里至少要有一名学生");
- return;
- }
- if (this.activeType == "HIGH_ONLINE") {
- if (
- this.activeListStudent.length > 5 ||
- this.activeListStudent.length < 3
- ) {
- this.$message.error("线上技能班必须为3-5人");
- return;
- }
- this.teacherForm.expectStudentNum = this.activeListStudent.length;
- }
- this.infoVisible = true;
- },
- addWeek () {
- // 添加循环周期
- this.weekList.push({
- dayOfWeek: "",
- startClassTime: "",
- endClassTime: "",
- time: this.courseTime,
- id: new Date().getTime()
- });
- },
- // 删除循环周
- removeWeek (item) {
- for (let i in this.weekList) {
- if (this.weekList[i].id == item.id) {
- this.weekList.splice(i, 1);
- }
- }
- },
- // 提交临时班的信息
- submitTemporary (type) {
- // 参数是一样 type为1 新增临时班
- // type为2 新增单技班
- // type为3 修改班级信息
- if (type == 1) {
- this.isTemporary = true;
- } else {
- this.isTemporary = false;
- }
- this.$refs["teacherForm"].validate(item => {
- if (item) {
- let week = this.weekList;
- if (this.teacherForm.isAdd != "onlyUpdateTeacher") {
- if (
- !week[0] ||
- !week[0].startClassTime ||
- !week[0].endClassTime ||
- !week[0].dayOfWeek
- ) {
- this.$message.error("至少排一节课");
- return;
- }
- }
- // 这里代表排课成功 发请求 新增临时班
- let classGroupName = this.className;
- let classGroupTeacherMapperList = [
- { userId: this.teacherForm.coreTeacher, teacherRole: "BISHOP" }
- ];
- for (let i in this.teacherForm.assistant) {
- classGroupTeacherMapperList.push({
- userId: this.teacherForm.assistant[i],
- teacherRole: "TEACHING"
- });
- }
- // let mixClassGroupId = this.teacherForm.mixClassGroupId;
- let musicGroupId = this.teamid;
- let startDate = this.teacherForm.courseTime;
- let courseType = this.teacherForm.courseType;
- let courseTimes = this.teacherForm.courseNum;
- if (
- courseTimes <= 0 &&
- this.teacherForm.isAdd != "onlyUpdateTeacher"
- ) {
- this.$message.error("请至少排一节课");
- return;
- } else if (courseTimes > this.maxMun) {
- this.$message.error(`一次最多排${this.maxMun}节课`);
- return;
- }
- let students = this.activeListStudent.map(item => {
- return item.userId;
- });
- let holiday = this.teacherForm.checked;
- let courseList = [];
- for (let i in this.weekList) {
- courseList.push(this.weekList[i]);
- }
- if (
- courseList.length <= 0 &&
- this.teacherForm.isAdd != "onlyUpdateTeacher"
- ) {
- this.$message.error("新增班级至少排一节课");
- return;
- }
- if (this.teacherForm.isAdd == "onlyUpdateTeacher") {
- startDate = null;
- courseType = null;
- students = null;
- holiday = null;
- courseTimes = null;
- (courseList = null), (mineType = null);
- }
- // mixClassGroupId,
- let mineType = this.activeType;
- let obj = {
- classGroupName,
- classGroupTeacherMapperList,
- musicGroupId,
- startDate,
- courseType,
- students,
- holiday,
- courseTimes,
- courseTimeDtoList: courseList,
- type: mineType,
- courseAddType: this.teacherForm.isAdd
- };
- if (type == 1) {
- // 新增临时班级
- revisionClassGroup(obj).then(res => {
- if (res.code == 200) {
- // 提示修改成功
- this.$message.success("修改成功");
- this.infoVisible = false;
- this.studentVisible = false;
- this.getList();
- }
- });
- } else if (type == 2) {
- (obj.subjectId = this.teacherForm.sound),
- (obj.expectStudentNum = this.teacherForm.expectStudentNum);
- // 新增单技班
- revisionAddClassGroup(obj).then(res => {
- if (res.code == 200) {
- // 修改成功
- this.$message.success("修改成功");
- this.infoVisible = false;
- this.studentVisible = false;
- this.getList();
- }
- });
- } else if (type == 3) {
- // 乐团修改
- obj.classGroupId = this.activeClass;
- classGroupUpdate(obj).then(res => {
- if (res.code == 200) {
- this.$message.success("修改成功");
- this.infoVisible = false;
- this.getList();
- }
- });
- }
- } else {
- this.$message.error("请填写必要信息");
- return;
- }
- });
- },
- // 新建基础技能班
- newClassHight () {
- this.$refs["newClassForm"].validate(res => {
- if (res) {
- let obj = {};
- obj.musicGroupId = this.teamid;
- obj.name = this.newClassForm.className;
- obj.type = this.newClassForm.type;
- obj.groupType = "MUSIC";
- // if (this.newClassForm.memo.length > 0) {
- // obj.memo = this.newClassForm.memo.join(',')
- // } else {
- // obj.memo = null
- // }
- obj.expectStudentNum = this.newClassForm.expectStudentNum;
- obj.teacherMapperList = [];
- obj.teacherMapperList.push({
- userId: this.newClassForm.bishop,
- teacherRole: "BISHOP"
- });
- let subjectIdList;
- if (this.newClassForm.type == "HIGH_ONLINE") {
- subjectIdList = this.newClassForm.subjectId;
- if (this.newClassForm.memo.length > 0) {
- obj.memo = this.newClassForm.memo.join(",");
- }
- } else {
- subjectIdList =
- this.newClassForm.subjectIdList.length > 0
- ? this.newClassForm.subjectIdList.join(",")
- : null;
- for (let i in this.newClassForm.teaching) {
- obj.teacherMapperList.push({
- userId: this.newClassForm.teaching[i],
- teacherRole: "TEACHING"
- });
- }
- obj.memo = null;
- }
- obj.subjectIdList = subjectIdList;
- createClass(obj).then(res => {
- if (res.code == 200) {
- this.$message.success('创建成功');
- this.getList();
- this.newClassVisible = false;
- }
- });
- }
- });
- },
- setAssistant1 (val) {
- for (let i in val) {
- if (val[i] == this.newClassForm.bishop) {
- val.splice(i, 1);
- }
- }
- },
- handleSelectionChange (val) {
- if (val.length > 0) {
- this.classGroupIds = val
- .map(item => {
- return item.id;
- })
- .join(",");
- } else {
- this.classGroupIds = null;
- }
- },
- chkstu (row, index) {
- return (
- (row.type == "HIGH_ONLINE" && row.totalClassTimes <= 0) ||
- (row.type == "HIGH" && row.totalClassTimes <= 0)
- );
- },
- startRegest () {
- if (!this.classGroupIds) {
- this.$message.error("请至少选择1个基础技能班");
- return;
- }
- this.$confirm("是否开启报名?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- pushMessage({
- classGroupIds: this.classGroupIds,
- musicGroupId: this.teamid
- }).then(res => {
- if (res.code == 200) {
- this.$message.success(`开启成功,已推送${res.data}名学生`);
- this.getList();
- }
- });
- })
- .catch(() => { });
- },
- toggleSelection (rows) {
- if (rows) {
- rows.forEach(row => {
- this.$refs.multipleTable.toggleRowSelection(row);
- });
- } else {
- this.$refs.multipleTable.clearSelection();
- }
- },
- chioseHightype (val) {
- if (val == 'HIGH_ONLINE') {
- this.newClassForm.teaching = []
- this.$set(this.newClassForm, 'subjectIdList', [])
- } else {
- this.newClassForm.memo = []
- this.newClassForm.subjectId = ''
- }
- },
- changeStartClassTime (item) {
- // item.endClassTime = ''
- this.$set(item, 'endClassTime', '')
- },
- changeEndClassTime (item, val) {
- this.$set(item, 'endClassTime', val)
- },
- changeCourseType (val) {
- console.log(val)
- if (val) {
- this.classTimeList.forEach(item => {
- if (item.value == val) {
- this.courseTime = item.label
- }
- })
- // courseTime
- this.weekList = [
- {
- week: "",
- startTime: "",
- endTime: "",
- time: this.courseTime,
- id: new Date().getTime()
- }
- ]
- } else {
- this.courseTime = null
- this.weekList = []
- }
- // if (val === 'HIGH_ONLINE' || val === 'HIGH' || val === 'MUSIC_NETWORK') {
- // this.step = '00:05'
- // } else {
- // this.step = '00:15'
- // }
- },
- changeStartTimes (val, item) {
- if (val && item.time) {
- let str = dayjs(new Date()).format('YYYY-MM-DD')
- this.$set(item, 'endClassTime', addTimerFormMinute(str, val, item.time))
- } else {
- this.$set(item, 'endClassTime', '')
- this.$message.error('请先设置课程时间')
- }
- if (!item.endClassTime) {
- this.$set(item, 'startClassTime', '')
- }
- },
- setItem (item, index) {
- // console.log(item, index)
- this.weekList[index].startClassTime = ""
- this.weekList[index].endClassTime = ""
- console.log()
- }
- },
- watch: {
- infoVisible (val) {
- if (!val) {
- this.teacherForm = {
- isAdd: null,
- coreTeacher: "",
- assistant: [],
- courseType: "",
- courseTime: "",
- checked: true,
- courseNum: "",
- mixClassGroupId: "",
- sound: "",
- expectStudentNum: ""
- };
- this.infoDetail = null
- // this.$refs["teacherForm"].resetFields();
- this.weekList = [];
- }
- },
- newClassVisible (val) {
- if (!val) {
- this.newClassForm = {
- className: null,
- type: null,
- subjectIdList: [],
- expectStudentNum: null,
- bishop: null,
- teaching: null,
- memo: []
- };
- }
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- .floor {
- padding-right: 20px;
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- width: 100%;
- height: 48px;
- line-height: 48px;
- background: rgba(237, 238, 240, 1);
- font-size: 14px;
- color: #444;
- align-items: center;
- position: relative;
- z-index: 1;
- .remove {
- width: 98px;
- height: 32px;
- background: rgba(248, 80, 67, 1);
- border-radius: 3px;
- color: #fff;
- line-height: 32px;
- text-align: center;
- margin-left: 164px;
- cursor: pointer;
- }
- .add {
- width: auto;
- padding: 0 10px;
- height: 32px;
- background: rgba(20, 146, 138, 1);
- border-radius: 3px;
- color: #fff;
- line-height: 32px;
- text-align: center;
- margin-left: 20px;
- cursor: pointer;
- }
- }
- .studentMask {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- .left {
- width: 200px;
- margin-right: 20px;
- .wrap {
- margin-bottom: 20px;
- }
- h4 {
- font-size: 16px;
- color: #444;
- line-height: 38px;
- }
- .chioseStudentList {
- height: 500px;
- overflow-y: auto;
- border: 1px solid #ccc;
- .studentItem {
- padding-left: 10px;
- line-height: 25px;
- }
- }
- }
- .right {
- width: calc(100% - 200px);
- .tableList {
- max-height: 500px;
- overflow-y: auto;
- }
- }
- }
- .resetClassForm {
- /deep/.el-date-editor.el-input,
- /deep/.el-date-editor.el-input__inner {
- width: 180px !important;
- }
- }
- /deep/.el-date-editor.el-input,
- /deep/.el-date-editor.el-input__inner {
- width: 100px !important;
- }
- .higheSelect {
- /deep/.el-input__inner {
- height: 40px !important;
- }
- }
- /deep/ .el-alert__content {
- display: block;
- width: 100%;
- }
- .alert-content {
- display: flex;
- justify-content: space-between;
- > strong {
- cursor: pointer;
- }
- }
- </style>
|