123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962 |
- <template>
- <!-- m-container -->
- <div>
- <!-- <h2>
- <div class='squrt'></div>
- 班级调整
- </h2>-->
- <div class="m-core">
- <div class="topWrap">
- <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 musicClassTypeList"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- <div class="btnList">
- <el-button
- type="primary"
- v-permission="'courseSchedule/coursePostpone'"
- v-if="team_status == 'PROGRESS'"
- @click="postpone"
- style="margin-bottom: 20px"
- >课程顺延</el-button
- >
- <el-button
- type="primary"
- v-permission="'/memberClassList'"
- v-if="courseViewType == 2 && team_status == 'PROGRESS'"
- @click="gotoMemberCourse"
- style="margin-bottom: 20px"
- >会员课程排课</el-button
- >
- <!-- <div
- class="newBand"
- style="width: 120px"
- v-permission="'courseSchedule/coursePostpone'"
- v-if="team_status == 'PROGRESS'"
- @click="postpone"
- >
- 课程顺延
- </div>
- <div
- class="newBand"
- style="width: 120px"
- v-permission="'/memberClassList'"
- v-if="courseViewType == 2 && team_status == 'PROGRESS'"
- @click="gotoMemberCourse"
- >
- 会员课程排课
- </div> -->
- </div>
- <div class="tableWrap" style>
- <el-table
- :data="activeSingleList"
- style
- ref="multipleTable"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- tooltip-effect="dark"
- @selection-change="handleSelectionChange"
- >
- <!-- checkSignPostpone -->
- <el-table-column
- :selectable="checkSignPostpone"
- type="selection"
- width="55"
- v-if="team_status == 'PROGRESS'"
- ></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 }}人</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"
- :key="index"
- >
- <span v-if="item.teacherRole == 'BISHOP'">
- {{ item.userName }}
- </span>
- </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"
- :key="index"
- >
- <span v-if="item.teacherRole == 'TEACHING'">
- {{ item.userName }}
- </span>
- </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" label="是否冻结">
- <template slot-scope="scope">
- <div>{{ scope.row.lockFlag | yesOrNo }}</div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- width="240px"
- label="操作"
- v-if="team_status == 'PREPARE' || team_status == 'PROGRESS'"
- >
- <template slot-scope="scope" v-if="scope.row.lockFlag != 1">
- <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"
- @click="resetTeacher(scope.row)"
- v-permission="'classGroup/classGroupUpdate'"
- >老师调整</el-button
- >
- <el-button
- type="text"
- v-if="
- (permission('classGroup/classGroupUpdate') ||
- permission('classGroup/revisionClassGroup') ||
- permission('classGroup/revisionAddClassGroup')) &&
- scope.row.studentNum > 0 &&
- team_status == 'PROGRESS'
- "
- @click="classAdjustment(scope.row)"
- >排课</el-button
- >
- <el-button
- type="text"
- v-if="
- (scope.row.studentNum == '0' ||
- scope.row.totalClassTimes == '0') &&
- permission('classGroup/delSingle')
- "
- @click="removeClass(scope)"
- >删除</el-button
- >
- <el-button
- type="text"
- v-if="
- team_status == 'PROGRESS' &&
- permission('courseSchedule/coursePostpone') &&
- checkSignPostpone(scope.row)
- "
- @click="signPostpone(scope.row)"
- >顺延课程</el-button
- >
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="floor">
- <div class="left">
- <div
- class="add"
- @click="studentResetVisiable = true"
- v-if="
- permission('classGroup/mergeClassSplitClassAffirm') &&
- team_status == 'PROGRESS'
- "
- >
- 拆分班级
- </div>
- </div>
- <div
- class="right"
- v-if="team_status == 'PREPARE' || team_status == 'PROGRESS'"
- >
- <div
- class="add"
- v-if="permission('classGroup/create')"
- @click="temporary"
- >
- 新建临时班
- </div>
- <div
- class="add"
- v-if="permission('classGroup/create')"
- @click="addNewClass('NORMAL')"
- >
- 新建声部班
- </div>
- <div
- class="add"
- v-if="permission('classGroup/create')"
- @click="addNewClass('MIX')"
- >
- 新建合奏班
- </div>
- <div
- class="add"
- v-if="
- permission('classGroup/revisionAddClassGroup') && tenantId == 1
- "
- @click="addNewClass('MUSIC_NETWORK')"
- >
- 新建乐团网管课
- </div>
- <div
- class="add"
- v-if="permission('classGroup/create')"
- @click="newClassVisible = true"
- >
- 基础技能班
- </div>
- </div>
- <!-- <div class="add"
- @click="addNewClass('HIGH_ONLINE')">线上基础技能班</div>-->
- </div>
- </div>
- </div>
- <el-dialog
- title="老师调整"
- width="750px"
- :visible.sync="teacherVisible"
- destroy-on-close
- >
- <changeTeacher
- v-if="teacherVisible && teacherDetail"
- :classGroupId="activeClass"
- :activeType="activeType"
- :teacherList="teacherList"
- :cooperationList="cooperationList"
- :detail="teacherDetail"
- @submited="teacherSubmited"
- @close="teacherVisible = false"
- />
- </el-dialog>
- <!-- 学员选择 -->
- <el-dialog
- :title="isOnlyChangeUser ? '学员调整' : '新建班级'"
- width="750px"
- :visible.sync="studentVisible"
- destroy-on-close
- >
- <selectStudent
- :activeListStudent="activeListStudent"
- :studentList="studentList"
- :soundList="activeSoundList"
- :classGroupId="activeClass"
- :teacherList="teacherList"
- :cooperationList="cooperationList"
- :isOnlyChangeUser="isOnlyChangeUser"
- :isStudentRemove="isStudentRemove"
- :activeType="activeType"
- @changeActiveChioseSound="changeActiveChioseSound"
- @searchStudent="searchStudent(activeClass)"
- @submited="studentSubmited"
- @close="studentVisible = false"
- />
- </el-dialog>
- <!-- 老师以及课程设置 -->
- <el-dialog
- title="班级排课"
- width="1200px"
- :visible.sync="infoVisible"
- :modal-append-to-body="false"
- >
- <classroomSetting
- v-if="infoVisible"
- :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="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="120px"
- 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-if="tenantId == 1"
- 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-select
- v-else
- v-model.trim="newClassForm.type"
- clearable
- @change="chioseHightype"
- >
- <el-option
- v-for="(item, index) in highTypeList1"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- <!-- highTypeList1 -->
- </el-form-item>
- <el-form-item
- label="主教老师"
- prop="bishop"
- :rules="[
- { required: true, message: '请选择主教老师', trigger: 'blur' },
- ]"
- >
- <el-select
- v-model.trim="newClassForm.bishop"
- placeholder="请选择主教老师"
- clearable
- filterable
- >
- <el-option
- v-for="(item, index) in teacherList"
- :key="index"
- :label="item.realName"
- :value="String(item.id)"
- >
- <span style="float: left">{{ item.realName }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px">{{
- String(item.id)
- }}</span>
- </el-option>
- </el-select>
- <!-- <remote-search
- :commit="'setTeachers'"
- v-model="newClassForm.bishop"
- /> -->
- </el-form-item>
- <el-form-item
- label="预计招生数"
- prop="expectStudentNum"
- type="number"
- :rules="[
- { required: true, message: '请输入预计招生数', trigger: 'blur' },
- ]"
- @mousewheel.native.prevent
- >
- <el-input
- style="width: 180px"
- :disabled="newClassForm.type == 'HIGH_ONLINE'"
- v-model="newClassForm.expectStudentNum"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="助教老师"
- v-if="
- newClassForm.type != 'HIGH_ONLINE' &&
- newClassForm.type != 'HIGH' &&
- newClassForm.type
- "
- prop="teaching"
- >
- <el-select
- v-model.trim="newClassForm.teaching"
- placeholder="请选择助教老师"
- filterable
- clearable
- multiple
- @change="setAssistant1"
- >
- <el-option
- v-for="(item, index) in cooperationList"
- :key="index"
- :label="item.realName"
- :value="item.id"
- >
- <span style="float: left">{{ item.realName }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px">{{
- String(item.id)
- }}</span>
- </el-option>
- </el-select>
- <!-- <remote-search
- :commit="'setTeachers'"
- v-model="newClassForm.teaching"
- @change="setAssistant1"
- :multiple="true"
- /> -->
- </el-form-item>
- <el-form-item
- label="声部"
- prop="subjectIdList"
- :rules="[{ required: true, message: '请选择声部', trigger: 'blur' }]"
- v-if="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'"
- >
- <select-all
- v-model.trim="newClassForm.memo"
- multiple
- clearable
- @change="changeMemo"
- >
- <el-option
- :disabled="item.disabled || appoint"
- v-for="(item, index) in soundList"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </select-all>
- </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 question">
- <div>
- <el-popover placement="right" width="500" trigger="click">
- <div class="popoverWrap">
- <p>线上基础技能班规则:</p>
- <p>班级数量:</p>
- <p>
- 可创建班级数量=各个声部学员数/6向上取整+乐团在读学员数/30向上取整
- </p>
- <p>上低音号、长号学员数合并计算</p>
- <p>班级人数:</p>
- <p>线上基础技能班人数上限为6人</p>
- </div>
- <el-button
- type="text"
- icon="el-icon-question"
- slot="reference"
- style="color: red"
- >线上基础技能班规则</el-button
- >
- </el-popover>
- </div>
- <div>
- <el-button @click="newClassVisible = false">取 消</el-button>
- <el-button type="primary" @click="newClassHight">确 定</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog
- title="学员列表"
- :visible.sync="studentListModalVisible"
- destroy-on-close
- >
- <viewStudentList
- :list="studentListModal"
- :showOk="true"
- @close="studentListModalVisible = false"
- />
- </el-dialog>
- <el-dialog
- title="学员班级调整"
- width="800px"
- :visible.sync="studentResetVisiable"
- >
- <studentResetView
- :teacherList="teacherList"
- :courseTypesByType="courseTypesByType"
- v-if="studentResetVisiable"
- :classList="mergeList"
- @close="closeStudentReset"
- />
- </el-dialog>
- <el-dialog
- title="课程顺延"
- :visible.sync="postponeVisible"
- width="600px"
- :before-close="handleClose"
- >
- <el-form :model="postponeForm" ref="postponeForm" :rules="postponeRules">
- <el-form-item label="开始日期" prop="stopTime">
- <el-date-picker
- v-model.trim="postponeForm.stopTime"
- type="date"
- :picker-options="bigin"
- value-format="yyyy-MM-dd"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="顺延日期" prop="resetTime">
- <el-date-picker
- v-model.trim="postponeForm.resetTime"
- type="date"
- :picker-options="options"
- value-format="yyyy-MM-dd"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="跳过节假日">
- <el-checkbox v-model.trim="postponeForm.holiday"></el-checkbox>
- </el-form-item>
- </el-form>
- <span style="color: #f56c6c"
- >注意:将会把所选班级的课表,「开始日期」之后的全部未开始课程;
- 调整到「顺延日期」之后重新排课,可以勾选跳过节假日;</span
- >
- <span slot="footer" class="dialog-footer">
- <el-button @click="postponeVisible = false">取 消</el-button>
- <el-button type="primary" @click="submitInfo">确 定</el-button>
- </span>
- </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,
- coursePostpone,
- musicGroupSchoolTermCourseDetail,
- } from "@/api/buildTeam";
- import {
- getClassAllStudent,
- removeStudents,
- addStudents,
- } from "@/api/studentManager";
- import { getOrganizationCourseUnitPriceSettings } from "@/api/specialSetting";
- import { queryEmployByOrganId } from "@/api/systemManage";
- import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
- import dayjs from "dayjs";
- import axios from "axios";
- import { classTimeList, musicClassTypeList } from "@/utils/searchArray";
- import viewStudentList from "./modals/view-student-list";
- import selectStudent from "./modals/select-student";
- import changeTeacher from "./modals/change-teacher";
- import classroomSetting from "./modals/classroom-setting";
- import studentResetView from "./modals/student-reset-view";
- import qs from "qs";
- import { permission } from "@/utils/directivePage";
- import { getCourseType } from "@/utils/utils";
- import { getSysTenantConfig } from "@/views/courseRulersManager/api";
- const formatClassGroupTeacherMapperList = (core, ass) => {
- const list = [];
- if (core) {
- list.push({ userId: core, teacherRole: "BISHOP" });
- }
- if (ass) {
- for (const item of ass) {
- list.push({ userId: item, teacherRole: "TEACHING" });
- }
- }
- return list;
- };
- export default {
- props: ["musicGroupInfo"],
- name: "tresetClass",
- components: {
- viewStudentList,
- selectStudent,
- classroomSetting,
- studentResetView,
- changeTeacher,
- },
- data() {
- return {
- teacherVisible: false,
- musicGroupInfos: this.musicGroupInfo,
- 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,
- isStudentRemove: 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: "乐团网管课" },
- ],
- musicClassTypeList,
- // 基础技能班类型
- highTypeList: [
- { value: "HIGH", label: "基础技能班" },
- { value: "HIGH_ONLINE", label: "线上基础技能班" },
- ],
- highTypeList1: [{ value: "HIGH", label: "基础技能班" }],
- cooperationList: [],
- singleList: [],
- activeSingleLists: [],
- activeType: "",
- resetClassForm: {
- // 班级调整form对象
- startTime: "",
- endTime: "",
- assistant: [],
- coreTeacher: "",
- },
- recourseForm: {
- courseType: "",
- checked: false,
- courseTime: "",
- courseNum: "",
- },
- teacherDetail: null,
- organId: "",
- newClassVisible: false,
- newClassForm: {
- className: null,
- type: null,
- subjectIdList: [],
- expectStudentNum: null,
- bishop: null,
- teaching: [],
- memo: [],
- subjectId: null,
- },
- classGroupIds: null,
- maxMun: 16,
- courseTime: "",
- studentResetVisiable: false,
- courseTypesByType: null,
- mergeList: [],
- activeSoundList: [],
- appoint: false,
- postponeForm: {
- stopTime: "",
- resetTime: "",
- holiday: false,
- },
- postponeVisible: false,
- postponeRules: {
- stopTime: [
- { required: true, message: "请选择开始日期", trigger: "blur" },
- ],
- resetTime: [
- { required: true, message: "请选择顺延日期", trigger: "blur" },
- ],
- },
- bigin: this.beginDate(),
- options: this.processDate(),
- team_status: "",
- activeList: [],
- courseViewType: "",
- tenantId: null,
- isFirst:false
- };
- },
- created() {
- this.init();
- this.getInstitutionRules()
- },
- // activated() {
- // this.init();
- // },
- mounted() {
- let tenantConfig = sessionStorage.getItem("tenantConfig");
- tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {};
- this.tenantId = tenantConfig.tenantId;
- },
- methods: {
- async getInstitutionRules() {
- try {
- const res = await getSysTenantConfig({ group: "OFFLINE" });
- this.isFirst = Boolean(res.data[0].createOn)
- if(!this.isFirst){
- this.$bus.$emit("showguide", ['offline']);
- }
- } catch (e) {
- console.log(e);
- }
- },
- permission(val) {
- return permission(val);
- },
- async init() {
- this.teamid = this.$route.query.id;
- this.team_status = this.$route.query.team_status;
- if (this.musicGroupInfo) {
- this.organId = this.musicGroupInfos.organId;
- this.chargeTypeId = this.musicGroupInfos.chargeTypeId;
- this.courseViewType = this.musicGroupInfos.courseViewType;
- } else {
- getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
- if (res.code == 200) {
- this.musicGroupInfos = res.data.musicGroup;
- this.organId = this.musicGroupInfos.organId;
- this.chargeTypeId = this.musicGroupInfos.chargeTypeId;
- this.courseViewType = this.musicGroupInfos.courseViewType;
- }
- });
- }
- this.$nextTick(async (res) => {
- try {
- if (this.organId && this.chargeTypeId) {
- const res = await getOrganizationCourseUnitPriceSettings({
- chargeTypeId: this.chargeTypeId,
- organId: this.organId,
- rows: 9999,
- });
- const d = {};
- this.courseTypes = res.data.rows;
- for (const item of this.courseTypes) {
- d[item.courseType] = item;
- }
- this.courseTypesByType = d;
- console.log(this.courseTypesByType);
- }
- } catch (error) {}
- // 根据乐团id获取乐团所属分部
- getTeacher({ organId: this.organId }).then((res) => {
- if (res.code == 200) {
- this.cooperationList = res.data;
- this.teacherList = res.data;
- if (this.teacherList.length <= 0) {
- this.$bus.$emit("showguide", ["teacher"]);
- return;
- }
- }
- });
- // getAllClass({ musicGroupId: this.teamid }).then((res) => {
- // if (res.code == 200) {
- // this.maxClassList = res.data;
- // }
- // });
- // 获取默认乐团内的所有班
- this.changeMixClass();
- // 根据乐团id获取乐团的所有声部
- findSound({ musicGroupId: this.teamid }).then((res) => {
- if (res.code == 200) {
- this.soundList = res.data;
- }
- });
- });
- // 根据分部id和缴费类型获取 可选课程类型
- },
- resetTeacher(row) {
- this.teacherVisible = true;
- this.teacherDetail = row;
- },
- teacherSubmited(data) {
- const obj = this.getSubmitData(data, {
- classGroupId: this.teacherDetail?.id,
- courseAddType: "onlyUpdateTeacher",
- });
- classGroupUpdate(obj).then((res) => {
- if (res.code == 200) {
- this.$message.success("修改成功");
- this.teacherVisible = false;
- this.getList();
- }
- });
- },
- getSubmitData(data, more = {}) {
- return [
- {
- type: this.activeType,
- classGroupName: data?.name,
- musicGroupId: this.teamid,
- classGroupTeacherMapperList: formatClassGroupTeacherMapperList(
- data.coreTeacher,
- data.assistant
- ),
- students: data?.seleched,
- ...more,
- },
- ];
- },
- getClassDate(data) {
- return {
- type: this.activeType,
- name: data?.name,
- musicGroupId: this.teamid,
- subjectIdList: data?.sound.length > 0 ? data?.sound.join(",") : null,
- teacherMapperList: formatClassGroupTeacherMapperList(
- data.coreTeacher,
- data.assistant
- ),
- groupType: "MUSIC",
- };
- },
- async submitClass(data) {
- const list = this.getSubmitData(data, { onlyCreateClassGroup: true });
- let obj = this.getClassDate(data);
- if (this.activeType == "MUSIC_NETWORK") {
- try {
- await revisionAddClassGroup(list);
- this.$message.success("提交成功");
- this.studentVisible = false;
- this.getList();
- } catch (error) {
- console.log(error);
- }
- } else {
- createClass(obj).then((res) => {
- if (res.code == 200) {
- this.studentVisible = false;
- this.$message.success("提交成功");
- this.getList();
- }
- });
- }
- return;
- console.log(data);
- try {
- if (this.classType == 1) {
- // 0新建班级 2 3 4新增班级修改
- console.log(list, "submitClass,临时班");
- return;
- await revisionClassGroup(list);
- this.$message.success("提交成功");
- } else if (
- this.classType == 2 ||
- this.classType == 3 ||
- this.classType == 4
- ) {
- console.log(list, "submitClass");
- return;
- await revisionAddClassGroup(list);
- this.$message.success("提交成功");
- }
- this.studentVisible = false;
- this.getList();
- } catch (error) {
- console.log(error);
- }
- },
- studentSubmited(data) {
- if (!this.isOnlyChangeUser) {
- this.submitClass(data);
- // 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获取合奏班下的所有声部班
- console.log(val);
- this.getList(val);
- this.activeMixClass = val;
- },
- getList(val) {
- getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(
- (res) => {
- if (res.code == 200) {
- this.activeSingleList = res.data;
- if (res.data?.length > 0) {
- this.mergeList = res.data.filter((item) => {
- return item.type != "MUSIC_NETWORK";
- });
- }
- // 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 = "SNAP";
- this.activeChioseSound = null;
- this.setType("SNAP");
- this.getNoClassStudent("SNAP");
- },
- setType(type) {
- this.courseTypeList = getCourseType(type);
- this.activeSoundList = this.soundList;
- },
- // 新增班级
- addNewClass(type) {
- const types = {
- NORMAL: 2,
- MUSIC_NETWORK: 4,
- };
- this.isOnlyChangeUser = false;
- this.classType = types[type] || 3;
- 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(classGroupId) {
- console.log(this.activeChioseSound);
- // 搜索学生
- // 根据声部id 乐团id搜索学生
- if (this.activeType == "SNAP") {
- teamSoundStudent({
- musicGroupId: this.teamid,
- actualSubjectId: this.activeChioseSound,
- }).then((res) => {
- if (res.code == 200) {
- this.studentList = res.data;
- }
- });
- } else {
- this.getNoClassStudent(
- this.activeType,
- this.activeChioseSound,
- classGroupId
- );
- }
- },
- // 选择学生的方法修改
- 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) {
- this.$confirm("是否确定删除该班级?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- removeSingleClass({ classGroupId: scope.row.id })
- .then((res) => {
- if (res.code == 200) {
- this.$message.success("删除成功");
- // 重新请求列表
- this.getList(this.activeMixClass);
- }
- })
- .catch((res) => {});
- })
- .catch(() => {});
- },
- // 修改班级
- 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;
- this.isStudentRemove =
- row.currentClassTimes == row.totalClassTimes ? true : false; // 上课时长是否没有
- // 根据单机班id 查询声部班内的所有学生
- getClassAllStudent({ classGroupId: row.id }).then((res) => {
- if (res.code == 200) {
- this.activeListStudent = res.data.map((item) => {
- item.isVisible = false;
- return item;
- });
- }
- });
- this.activeSoundList = this.soundList;
- this.getNoClassStudent(row.type); // 基础技能班能获取所有
- // if (this.activeType == "HIGH" || this.activeType == "HIGH_ONLINE") {
- // this.getNoClassStudent(row.type, row.memo);
- // let arr = row.memo.split(",");
- // console.log(arr);
- // this.activeSoundList = this.soundList.filter((sound) => {
- // return arr.indexOf(sound.id + "") != -1;
- // });
- // } else {
- // this.activeSoundList = this.soundList;
- // this.getNoClassStudent(row.type);
- // console.log(this.activeSoundList);
- // }
- },
- // 班级调整
- 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, classGroupId) {
- const params = {
- musicGroupId: this.teamid,
- type,
- actualSubjectId,
- classGroupId,
- };
- await getMusicGroupStuNoClassType(params).then((res) => {
- if (res.code == 200) {
- 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, null, this.activeClass);
- // 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 > 6 ||
- this.activeListStudent.length + this.chioseStudent.length < 3
- ) {
- this.$message.error("线上技能班必须为3-6人");
- 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 > 6 ||
- this.activeListStudent.length < 3
- ) {
- this.$message.error("线上技能班必须为3-6人");
- 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);
- }
- }
- },
- // 新建基础技能班
- 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";
- 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.memo.length > 0
- ? this.newClassForm.memo.join(",")
- : null;
- for (let i in this.newClassForm.teaching) {
- obj.teacherMapperList.push({
- userId: this.newClassForm.teaching[i],
- teacherRole: "TEACHING",
- });
- }
- obj.memo = subjectIdList;
- }
- obj.subjectIdList = subjectIdList;
- createClass(obj).then((res) => {
- if (res.code == 200) {
- this.$message.success("创建成功");
- this.getList();
- this.resetClassFrom();
- this.newClassVisible = false;
- }
- });
- }
- });
- },
- resetClassFrom() {
- this.newClassForm = {
- className: null,
- type: null,
- subjectIdList: [],
- subjectId: "",
- expectStudentNum: null,
- bishop: null,
- teaching: [],
- memo: [],
- };
- this.changeMemo([]);
- },
- setAssistant1(val) {
- if (val) {
- for (let i in val) {
- if (val[i] == this.newClassForm.bishop) {
- val.splice(i, 1);
- }
- }
- }
- },
- handleSelectionChange(val) {
- this.activeList = val;
- let arr = val.map((item) => {
- return item.id;
- });
- this.activeClass = arr.join(",");
- },
- 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) {
- this.changeMemo([]);
- if (val == "HIGH_ONLINE") {
- this.newClassForm.teaching = [];
- }
- this.newClassForm.subjectId = "";
- this.$set(this.newClassForm, "subjectIdList", []);
- this.$set(this.newClassForm, "memo", []);
- },
- 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();
- },
- closeStudentReset() {
- this.studentResetVisiable = false;
- },
- changeMemo(val) {},
- submitInfo() {
- this.$refs["postponeForm"].validate((res) => {
- if (res) {
- let classGroupIds = this.activeClass;
- let pauseDate = this.postponeForm.stopTime;
- let recoveryDate = this.postponeForm.resetTime;
- let skipHoliday = this.postponeForm.holiday;
- let obj = {
- classGroupIds,
- pauseDate,
- recoveryDate,
- skipHoliday,
- };
- coursePostpone(obj).then((res) => {
- if (res.code == 200) {
- this.$message.success("修改成功");
- this.postponeVisible = false;
- }
- });
- }
- });
- },
- postpone() {
- if (this.activeList.length <= 0) {
- this.$message.error("请至少选择一个班级");
- return;
- }
- this.postponeVisible = true;
- },
- checkSignPostpone(row) {
- return row.totalClassTimes - row.currentClassTimes > 0;
- },
- handleClose() {
- // 弹窗关闭之前
- this.postponeVisible = false;
- this.$refs["postponeForm"].resetFields();
- },
- beginDate() {
- let self = this;
- return {
- firstDayOfWeek: 1,
- disabledDate(time) {
- return time.getTime() + 86400000 <= new Date().getTime(); //开始时间不选时,结束时间最大值小于等于当天
- },
- };
- },
- processDate() {
- //提出结束时间必须大于提出开始时间
- let self = this;
- return {
- firstDayOfWeek: 1,
- disabledDate(time) {
- if (self.postponeForm.stopTime) {
- return (
- new Date(self.postponeForm.stopTime).getTime() > time.getTime()
- );
- } else {
- return time.getTime() > Date.now();
- //开始时间不选时,结束时间最大值小于等于当天
- }
- },
- };
- },
- signPostpone(row) {
- this.activeClass = row.id;
- this.postponeVisible = true;
- },
- async gotoMemberCourse() {
- // 这里跳转到课表
- try {
- const res = await musicGroupSchoolTermCourseDetail({
- musicGroupId: this.teamid,
- });
- this.$router.push({
- path: "/business/memberClassList",
- query: { ...this.$route.query },
- });
- } catch (e) {
- console.log(e);
- }
- },
- },
- watch: {
- "newClassForm.type"() {
- if (this.newClassForm.type === "HIGH_ONLINE") {
- this.$set(this.newClassForm, "expectStudentNum", 6);
- }
- },
- 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: [],
- };
- this.resetClassFrom();
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .btnList {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- .newBand {
- margin-right: 10px;
- }
- }
- .dialog-footer.question {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .topWrap {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .floor {
- padding-right: 20px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- 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;
- .right {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- .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: var(--color-primary);
- 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>
|