resetClass.vue 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699
  1. <template>
  2. <!-- m-container -->
  3. <div>
  4. <!-- <h2>
  5. <div class='squrt'></div>
  6. 班级调整
  7. </h2>-->
  8. <!-- @change="changeMixClass" -->
  9. <div class="m-core">
  10. <div class="topWrap">
  11. <el-form :inline="true" :model="topForm" @submit.stop.native.prevent="submit" @reset.stop.native.prevent="reset">
  12. <el-form-item>
  13. <el-select v-model.trim="topForm.type" clearable filterable placeholder="请选择班级类型">
  14. <el-option v-for="(item, index) in musicClassTypeList" :key="index" :label="item.label"
  15. :value="item.value"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-select v-model.trim="topForm.hasCourse" clearable filterable placeholder="是否有剩余课程">
  20. <el-option label="是" :value="1"></el-option>
  21. <el-option label="否" :value="0"></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="primary" native-type="submit">搜索</el-button>
  26. <el-button type="danger" native-type="reset">重置</el-button>
  27. </el-form-item>
  28. </el-form>
  29. </div>
  30. <div class="btnList">
  31. <el-button type="primary" v-permission="'courseSchedule/coursePostpone'" v-if="team_status == 'PROGRESS'"
  32. @click="postpone" style="margin-bottom: 20px">课程顺延</el-button>
  33. <!-- <el-button type="primary" v-permission="'/memberClassList'"
  34. v-if="courseViewType == 2 && team_status == 'PROGRESS'" @click="gotoMemberCourse"
  35. style="margin-bottom: 20px">会员课程排课</el-button> -->
  36. <!-- <div
  37. class="newBand"
  38. style="width: 120px"
  39. v-permission="'courseSchedule/coursePostpone'"
  40. v-if="team_status == 'PROGRESS'"
  41. @click="postpone"
  42. >
  43. 课程顺延
  44. </div>
  45. <div
  46. class="newBand"
  47. style="width: 120px"
  48. v-permission="'/memberClassList'"
  49. v-if="courseViewType == 2 && team_status == 'PROGRESS'"
  50. @click="gotoMemberCourse"
  51. >
  52. 会员课程排课
  53. </div> -->
  54. </div>
  55. <div class="tableWrap" style>
  56. <el-table :data="activeSingleList" style ref="multipleTable"
  57. :header-cell-style="{ background: '#EDEEF0', color: '#444' }" tooltip-effect="dark"
  58. @selection-change="handleSelectionChange">
  59. <!-- checkSignPostpone -->
  60. <el-table-column :selectable="checkSignPostpone" type="selection" width="55"
  61. v-if="team_status == 'PROGRESS'"></el-table-column>
  62. <el-table-column align="center" prop="name" label="班级名称"></el-table-column>
  63. <el-table-column align="center" prop="type" label="班级类型">
  64. <template slot-scope="scope">
  65. <div>{{ scope.row.type | classType }}</div>
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="center" prop="studentNum" label="当前班级人数">
  69. <template slot-scope="scope">
  70. <div>{{ scope.row.studentNum }}人</div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="center" prop label="主教老师">
  74. <template slot-scope="scope">
  75. <div v-if="scope.row.classGroupTeacherMapperList">
  76. <p v-for="(item, index) in scope.row.classGroupTeacherMapperList" :key="index">
  77. <span v-if="item.teacherRole == 'BISHOP'">
  78. {{ item.userName }}
  79. </span>
  80. </p>
  81. </div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="center" label="助教老师">
  85. <template slot-scope="scope">
  86. <div v-if="scope.row.classGroupTeacherMapperList">
  87. <p v-for="(item, index) in scope.row.classGroupTeacherMapperList" :key="index">
  88. <span v-if="item.teacherRole == 'TEACHING'">
  89. {{ item.userName }}
  90. </span>
  91. </p>
  92. </div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" label="已上课时">
  96. <template slot-scope="scope">
  97. <div>{{ scope.row.currentClassTimes }}</div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column align="center" label="总课数">
  101. <template slot-scope="scope">
  102. <div>{{ scope.row.totalClassTimes }}</div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column align="center" label="是否冻结">
  106. <template slot-scope="scope">
  107. <div>{{ scope.row.lockFlag | yesOrNo }}</div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" width="240px" label="操作"
  111. v-if="team_status == 'PREPARE' || team_status == 'PROGRESS'">
  112. <template slot-scope="scope" v-if="scope.row.lockFlag != 1">
  113. <div>
  114. <!-- v-if="scope.row.type !='MIX'" -->
  115. <el-button type="text" @click="resetClass(scope.row)"
  116. v-permission="'classGroupStudent/updateClassGroupStudents'"
  117. v-if="scope.row.type != 'MUSIC_NETWORK'">学员调整</el-button>
  118. <el-button type="text" @click="resetTeacher(scope.row)"
  119. v-permission="'classGroup/classGroupUpdate'">老师调整</el-button>
  120. <el-button type="text" v-if="(permission('classGroup/classGroupUpdate') ||
  121. permission('classGroup/revisionClassGroup') ||
  122. permission('classGroup/revisionAddClassGroup')) &&
  123. scope.row.studentNum > 0 &&
  124. team_status == 'PROGRESS'
  125. " @click="classAdjustment(scope.row)">排课</el-button>
  126. <el-button type="text" v-if="(scope.row.studentNum == '0' ||
  127. scope.row.totalClassTimes == '0') &&
  128. permission('classGroup/delSingle')
  129. " @click="removeClass(scope)">删除</el-button>
  130. <el-button type="text" v-if="team_status == 'PROGRESS' &&
  131. permission('courseSchedule/coursePostpone') &&
  132. checkSignPostpone(scope.row)
  133. " @click="signPostpone(scope.row)">顺延课程</el-button>
  134. <el-button type="text" v-if="team_status == 'PROGRESS' && permission('classGroup/update')
  135. " @click="resetClassName(scope.row)">班级名称调整</el-button>
  136. </div>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <div class="floor">
  141. <div class="left">
  142. <div class="add" @click="openStudentReset" v-if="permission('classGroup/mergeClassSplitClassAffirm') &&
  143. team_status == 'PROGRESS'
  144. ">
  145. 拆分班级
  146. </div>
  147. </div>
  148. <div class="right" v-if="team_status == 'PREPARE' || team_status == 'PROGRESS'">
  149. <div class="add" v-if="permission('classGroup/create')" @click="temporary">
  150. 新建临时班
  151. </div>
  152. <div class="add" v-if="permission('classGroup/create')" @click="addNewClass('NORMAL')">
  153. 新建声部班
  154. </div>
  155. <div class="add" v-if="permission('classGroup/create')" @click="addNewClass('MIX')">
  156. 新建合奏班
  157. </div>
  158. <div class="add" v-if="permission('classGroup/revisionAddClassGroup') && tenantId == 1
  159. " @click="addNewClass('MUSIC_NETWORK')">
  160. 新建乐团网管课
  161. </div>
  162. <div class="add" v-if="permission('classGroup/create')" @click="newClassVisible = true">
  163. 基础技能班
  164. </div>
  165. </div>
  166. <!-- <div class="add"
  167. @click="addNewClass('HIGH_ONLINE')">线上基础技能班</div>-->
  168. </div>
  169. </div>
  170. </div>
  171. <el-dialog title="老师调整" width="750px" :visible.sync="teacherVisible" v-if="teacherVisible">
  172. <changeTeacher v-if="teacherVisible && teacherDetail" :classGroupId="activeClass" :activeType="activeType"
  173. :teacherList="teacherList" :cooperationList="cooperationList" :detail="teacherDetail" @submited="teacherSubmited"
  174. @close="teacherVisible = false" />
  175. </el-dialog>
  176. <!-- 修改班级名称 -->
  177. <el-dialog title="班级名称调整" width="400px" :visible.sync="classNameVisible" v-if="classNameVisible">
  178. <changeClassName :detail="classDetail" @submited="submitedResetClassName" @close="classNameVisible = false" />
  179. </el-dialog>
  180. <!-- 学员选择 -->
  181. <el-dialog :title="isOnlyChangeUser ? '学员调整' : '新建班级'" width="760px" :visible.sync="studentVisible"
  182. v-if="studentVisible">
  183. <selectStudent :activeListStudent="activeListStudent" :studentList="studentList" :soundList="activeSoundList"
  184. :classGroupId="activeClass" :teacherList="teacherList" :cooperationList="cooperationList"
  185. :isOnlyChangeUser="isOnlyChangeUser" :isStudentRemove="isStudentRemove" :activeType="activeType"
  186. @changeActiveChioseSound="changeActiveChioseSound" @searchStudent="searchStudent(activeClass)"
  187. @submited="studentSubmited" @close="studentVisible = false" />
  188. </el-dialog>
  189. <!-- 老师以及课程设置 -->
  190. <el-dialog title="班级排课" width="1200px" :visible.sync="infoVisible" :modal-append-to-body="false">
  191. <classroomSetting v-if="infoVisible" :classType="classType" :teacherList="teacherList" :musicGroupId="teamid"
  192. :activeType="activeType" :courseTypeList="courseTypeList" :cooperationList="cooperationList" :detail="infoDetail"
  193. :studentSubmitedData="studentSubmitedData" @close="infoVisible = false" @submited="getList" />
  194. </el-dialog>
  195. <!-- 新增合奏班 -->
  196. <el-dialog title="新增合奏班" width="700px" :visible.sync="MixVisible" :modal-append-to-body="false">
  197. <div class="studentMask">
  198. <div class="left">
  199. <div class="wrap">
  200. <!-- :disabled="!isNewClass" -->
  201. <el-input placeholder="请输入合奏班名称" v-model.trim="className"></el-input>
  202. </div>
  203. <div class="chioseStudentList">
  204. <h4 style="padding-left: 10px">当前已选学生</h4>
  205. <div class="studentItem" v-for="(item, index) in activeListStudent" :key="index">
  206. {{ item.name }}
  207. <el-button type="text" @click="removeSiginforMix(item)">删除班级</el-button>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="right">
  212. <!-- 列表开始 -->
  213. <div class="tableList">
  214. <el-table tooltip-effect="dark" style="width: 100%; margin-top: 10px" :data="singleList" ref="mixList"
  215. @selection-change="SelectionMix">
  216. <el-table-column type="selection" align="center" width="55"></el-table-column>
  217. <el-table-column prop="name" align="center" width="120" label="姓名"></el-table-column>
  218. <el-table-column prop="gender" align="center" width="100" label="性别">
  219. <template slot-scope="scope">
  220. <div>{{ scope.row.gender | sex }}</div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column prop="subjectName" width="120" align="center" label="学员声部"></el-table-column>
  224. </el-table>
  225. </div>
  226. </div>
  227. </div>
  228. <div slot="footer" class="dialog-footer">
  229. <el-button @click="studentVisible = false">取 消</el-button>
  230. <!-- 班级学员修改 -->
  231. <el-button type="primary" v-if="!isNewClass" @click="addSomeStudent">确 定</el-button>
  232. <!-- 临时调整或者新建班级 -->
  233. <el-button type="primary" v-if="isNewClass" @click="setInfoMsg">确 定</el-button>
  234. </div>
  235. </el-dialog>
  236. <el-dialog :visible.sync="newClassVisible" width="700px" title="新增班级">
  237. <el-form :model="newClassForm" :inline="true" label-width="120px" ref="newClassForm" class="newClassForm">
  238. <el-form-item label="班级名称" :rules="[
  239. { required: true, message: '请输入班级姓名', trigger: 'blur' }
  240. ]" prop="className">
  241. <el-input style="width: 180px" v-model="newClassForm.className"></el-input>
  242. </el-form-item>
  243. <el-form-item label="班级类型" :rules="[
  244. { required: true, message: '请选择班级类型', trigger: 'blur' }
  245. ]" prop="type">
  246. <el-select v-if="tenantId == 1" v-model.trim="newClassForm.type" clearable @change="chioseHightype">
  247. <el-option v-for="(item, index) in highTypeList" :key="index" :label="item.label"
  248. :value="item.value"></el-option>
  249. </el-select>
  250. <el-select v-else v-model.trim="newClassForm.type" clearable @change="chioseHightype">
  251. <el-option v-for="(item, index) in highTypeList1" :key="index" :label="item.label"
  252. :value="item.value"></el-option>
  253. </el-select>
  254. <!-- highTypeList1 -->
  255. </el-form-item>
  256. <el-form-item label="主教老师" prop="bishop" :rules="[
  257. { required: true, message: '请选择主教老师', trigger: 'blur' }
  258. ]">
  259. <el-select v-model.trim="newClassForm.bishop" placeholder="请选择主教老师" clearable filterable>
  260. <el-option v-for="(item, index) in teacherList" :key="index" :label="item.realName" :value="String(item.id)">
  261. <span style="float: left">{{ item.realName }}</span>
  262. <span style="float: right; color: #8492a6; font-size: 13px">{{
  263. String(item.id)
  264. }}</span>
  265. </el-option>
  266. </el-select>
  267. <!-- <remote-search
  268. :commit="'setTeachers'"
  269. v-model="newClassForm.bishop"
  270. /> -->
  271. </el-form-item>
  272. <el-form-item label="预计招生数" prop="expectStudentNum" type="number" :rules="[
  273. { required: true, message: '请输入预计招生数', trigger: 'blur' }
  274. ]" @mousewheel.native.prevent>
  275. <el-input style="width: 180px" :disabled="newClassForm.type == 'HIGH_ONLINE'"
  276. v-model="newClassForm.expectStudentNum"></el-input>
  277. </el-form-item>
  278. <el-form-item label="助教老师" v-if="newClassForm.type != 'HIGH_ONLINE' &&
  279. newClassForm.type != 'HIGH' &&
  280. newClassForm.type && $helpers.permission('is/teacher/findTeachers')
  281. " prop="teaching">
  282. <el-select v-model.trim="newClassForm.teaching" placeholder="请选择助教老师" filterable clearable multiple
  283. @change="setAssistant1">
  284. <el-option v-for="(item, index) in cooperationList" :key="index" :label="item.realName" :value="item.id">
  285. <span style="float: left">{{ item.realName }}</span>
  286. <span style="float: right; color: #8492a6; font-size: 13px">{{
  287. String(item.id)
  288. }}</span>
  289. </el-option>
  290. </el-select>
  291. <!-- <remote-search
  292. :commit="'setTeachers'"
  293. v-model="newClassForm.teaching"
  294. @change="setAssistant1"
  295. :multiple="true"
  296. /> -->
  297. </el-form-item>
  298. <el-form-item label="声部" prop="subjectIdList" :rules="[{ required: true, message: '请选择声部', trigger: 'blur' }]"
  299. v-if="newClassForm.type == 'NORMAL'" :key="'HIGH'">
  300. <el-select v-model="newClassForm.subjectIdList" clearable multiple>
  301. <el-option v-for="(item, index) in soundList" :key="index" :label="item.name" :value="item.id"></el-option>
  302. </el-select>
  303. </el-form-item>
  304. <!-- 恢复可报名声部 因为建班和加学生分开所以又要添加可报名声部(焕焕狗乱吠) -->
  305. <el-form-item label="可报名声部" prop="memo" :rules="[
  306. { required: true, message: '请选择可报名声部', trigger: 'blur' }
  307. ]" v-if="newClassForm.type == 'HIGH'">
  308. <select-all v-model.trim="newClassForm.memo" multiple clearable @change="changeMemo">
  309. <el-option :disabled="item.disabled || appoint" v-for="(item, index) in soundList" :key="index"
  310. :label="item.name" :value="item.id"></el-option>
  311. </select-all>
  312. </el-form-item>
  313. <el-form-item label="网络教室声部" prop="subjectId" :rules="[
  314. { required: true, message: '请选择线上声部', trigger: 'blur' }
  315. ]" v-if="newClassForm.type == 'HIGH_ONLINE'" class="higheSelect" :key="'HIGH_ONLINE'">
  316. <el-select v-model="newClassForm.subjectId" clearable>
  317. <el-option v-for="(item, index) in soundList" :key="index" :label="item.name" :value="item.id"></el-option>
  318. </el-select>
  319. </el-form-item>
  320. </el-form>
  321. <div slot="footer" class="dialog-footer question">
  322. <div>
  323. <el-popover placement="right" width="500" trigger="click">
  324. <div class="popoverWrap">
  325. <p>线上基础技能班规则:</p>
  326. <p>班级数量:</p>
  327. <p>
  328. 可创建班级数量=各个声部学员数/6向上取整+乐团在读学员数/30向上取整
  329. </p>
  330. <p>上低音号、长号学员数合并计算</p>
  331. <p>班级人数:</p>
  332. <p>线上基础技能班人数上限为6人</p>
  333. </div>
  334. <el-button type="text" icon="el-icon-question" slot="reference" style="color: red">线上基础技能班规则</el-button>
  335. </el-popover>
  336. </div>
  337. <div>
  338. <el-button @click="newClassVisible = false">取 消</el-button>
  339. <el-button type="primary" @click="newClassHight">确 定</el-button>
  340. </div>
  341. </div>
  342. </el-dialog>
  343. <el-dialog title="学员列表" :visible.sync="studentListModalVisible" v-if="studentListModalVisible">
  344. <viewStudentList :list="studentListModal" :showOk="true" @close="studentListModalVisible = false" />
  345. </el-dialog>
  346. <el-dialog title="学员班级调整" width="800px" :visible.sync="studentResetVisiable">
  347. <studentResetView :teacherList="teacherList" :courseTypesByType="courseTypesByType" v-if="studentResetVisiable"
  348. :classList="mergeList" :soundList="activeSoundList" @close="closeStudentReset" />
  349. </el-dialog>
  350. <el-dialog title="课程顺延" :visible.sync="postponeVisible" width="600px" :before-close="handleClose">
  351. <el-form :model="postponeForm" ref="postponeForm" :rules="postponeRules">
  352. <el-form-item label="开始日期" prop="stopTime">
  353. <el-date-picker v-model.trim="postponeForm.stopTime" type="date" :picker-options="bigin"
  354. value-format="yyyy-MM-dd" placeholder="选择日期">
  355. </el-date-picker>
  356. </el-form-item>
  357. <el-form-item label="顺延日期" prop="resetTime">
  358. <el-date-picker v-model.trim="postponeForm.resetTime" type="date" :picker-options="options"
  359. value-format="yyyy-MM-dd" placeholder="选择日期">
  360. </el-date-picker>
  361. </el-form-item>
  362. <el-form-item label="跳过节假日">
  363. <el-checkbox v-model.trim="postponeForm.holiday"></el-checkbox>
  364. </el-form-item>
  365. </el-form>
  366. <span style="color: #f56c6c">注意:将会把所选班级的课表,「开始日期」之后的全部未开始课程;
  367. 调整到「顺延日期」之后重新排课,可以勾选跳过节假日;</span>
  368. <span slot="footer" class="dialog-footer">
  369. <el-button @click="postponeVisible = false">取 消</el-button>
  370. <el-button type="primary" @click="submitInfo">确 定</el-button>
  371. </span>
  372. </el-dialog>
  373. </div>
  374. </template>
  375. <script>
  376. import {
  377. getAllClass,
  378. getAllSignClassandTeacher,
  379. getAllSignClass,
  380. removeSingleClass,
  381. getNoClassStudentAll,
  382. findSound,
  383. teamSoundStudent,
  384. findMusicGroupClassTeacher,
  385. revisionClassGroup,
  386. revisionAddClassGroup,
  387. getEmployeeOrgan,
  388. getTeacher,
  389. findNoClassSingle,
  390. getMusicGroupStuNoClassType,
  391. classGroupUpdate,
  392. getTeamBaseInfo,
  393. clearClassCourse,
  394. superFindClassGroups,
  395. createClass,
  396. pushMessage,
  397. coursePostpone,
  398. musicGroupSchoolTermCourseDetail
  399. } from "@/api/buildTeam";
  400. import {
  401. getClassAllStudent,
  402. removeStudents,
  403. addStudents
  404. } from "@/api/studentManager";
  405. import { getOrganizationCourseUnitPriceSettings } from "@/api/specialSetting";
  406. import { queryEmployByOrganId } from "@/api/systemManage";
  407. import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
  408. import dayjs from "dayjs";
  409. import axios from "axios";
  410. import { classTimeList, musicClassTypeList } from "@/utils/searchArray";
  411. import viewStudentList from "./modals/view-student-list";
  412. import selectStudent from "./modals/select-student";
  413. import changeTeacher from "./modals/change-teacher";
  414. import classroomSetting from "./modals/classroom-setting";
  415. import studentResetView from "./modals/student-reset-view";
  416. import changeClassName from "./modals/class-resetclass-name.vue";
  417. import qs from "qs";
  418. import { permission } from "@/utils/directivePage";
  419. import { getCourseType } from "@/utils/utils";
  420. import { getSysTenantConfig } from "@/views/courseRulersManager/api";
  421. import { resetClassName } from "../api";
  422. const formatClassGroupTeacherMapperList = (core, ass) => {
  423. const list = [];
  424. if (core) {
  425. list.push({ userId: core, teacherRole: "BISHOP" });
  426. }
  427. if (ass) {
  428. for (const item of ass) {
  429. list.push({ userId: item, teacherRole: "TEACHING" });
  430. }
  431. }
  432. return list;
  433. };
  434. export default {
  435. props: ["musicGroupInfo"],
  436. name: "tresetClass",
  437. components: {
  438. viewStudentList,
  439. selectStudent,
  440. classroomSetting,
  441. studentResetView,
  442. changeTeacher,
  443. changeClassName
  444. },
  445. data() {
  446. return {
  447. teacherVisible: false,
  448. musicGroupInfos: this.musicGroupInfo,
  449. classType: 0,
  450. pickerOptions: {
  451. firstDayOfWeek: 1,
  452. disabledDate(time) {
  453. return time.getTime() + 86400000 <= new Date().getTime();
  454. }
  455. },
  456. step: "00:05",
  457. teamid: "",
  458. topForm: {
  459. type: "",
  460. hasCourse: ""
  461. },
  462. studentSubmitedData: null,
  463. infoDetail: null,
  464. classTimeList,
  465. tableList: [],
  466. maxClassList: [],
  467. activeSingleList: [],
  468. studentListModal: [],
  469. studentListModalVisible: false,
  470. resetCourseVisible: false, // 重新排课弹窗
  471. resetClassVisible: false, // 班级调整弹窗
  472. studentVisible: false,
  473. MixVisible: false, // 新增合奏班弹窗
  474. activeListStudent: [], // 当前选中的学生列表
  475. activeChioseSound: "", //选择的声部
  476. chioseSoundList: [], //当前的所有声部
  477. studentList: [], //列表里的学生集合
  478. activeMixClass: "", // 选中的合奏班
  479. chioseStudent: [], // 勾选的学生信息
  480. isNewClass: false, // 是否为新建班级
  481. isOnlyChangeUser: false,
  482. isStudentRemove: false, // 班级上没有未开始课程时
  483. isSearch: false, // 是否需要搜索
  484. isTemporary: false, // 是否为临时班级
  485. className: "", // 班级名称
  486. activeClass: "", // 当前操作的班级
  487. soundList: [],
  488. infoVisible: false, // 判断是否需要显示老师设置
  489. teacherForm: {
  490. isAdd: null,
  491. coreTeacher: "",
  492. assistant: [],
  493. courseType: "",
  494. courseTime: "",
  495. checked: true,
  496. courseNum: "",
  497. mixClassGroupId: "",
  498. sound: "",
  499. expectStudentNum: ""
  500. },
  501. teacherRules: {
  502. isAdd: [{ required: true, message: "请选择调整类型" }],
  503. coreTeacher: [{ required: true, message: "请选择主教老师" }],
  504. courseType: [{ required: true, message: "请选择上课类型" }],
  505. courseTime: [{ required: true, message: "请选择开始时间" }],
  506. courseNum: [{ required: true, message: "请输入排课次数" }],
  507. mixClassGroupId: [{ required: true, message: "请选择合奏班" }],
  508. sound: [{ required: true, message: "请选择合声部" }],
  509. expectStudentNum: [{ required: true, message: "请填写预计招生人数" }]
  510. },
  511. weekList: [],
  512. teacherList: [], // 存储的老师列表
  513. courseTypeList: [],
  514. weekDateList: [
  515. { value: "1", label: "星期一" },
  516. { value: "2", label: "星期二" },
  517. { value: "3", label: "星期三" },
  518. { value: "4", label: "星期四" },
  519. { value: "5", label: "星期五" },
  520. { value: "6", label: "星期六" },
  521. { value: "7", label: "星期日" }
  522. ],
  523. // 班级类型
  524. classTypeList: [
  525. { value: "NORMAL", label: "声部班" },
  526. { value: "MIX", label: "合奏班" },
  527. { value: "HIGH", label: "基础技能班" },
  528. { value: "SNAP", label: "临时班" },
  529. { value: "HIGH_ONLINE", label: "线上基础技能班" },
  530. { value: "MUSIC_NETWORK", label: "乐团网管课" }
  531. ],
  532. musicClassTypeList,
  533. // 基础技能班类型
  534. highTypeList: [
  535. { value: "HIGH", label: "基础技能班" },
  536. { value: "HIGH_ONLINE", label: "线上基础技能班" }
  537. ],
  538. highTypeList1: [{ value: "HIGH", label: "基础技能班" }],
  539. cooperationList: [],
  540. singleList: [],
  541. activeSingleLists: [],
  542. activeType: "",
  543. resetClassForm: {
  544. // 班级调整form对象
  545. startTime: "",
  546. endTime: "",
  547. assistant: [],
  548. coreTeacher: ""
  549. },
  550. recourseForm: {
  551. courseType: "",
  552. checked: false,
  553. courseTime: "",
  554. courseNum: ""
  555. },
  556. teacherDetail: null,
  557. organId: "",
  558. newClassVisible: false,
  559. newClassForm: {
  560. className: null,
  561. type: null,
  562. subjectIdList: [],
  563. expectStudentNum: null,
  564. bishop: null,
  565. teaching: [],
  566. memo: [],
  567. subjectId: null
  568. },
  569. classGroupIds: null,
  570. maxMun: 16,
  571. courseTime: "",
  572. studentResetVisiable: false,
  573. courseTypesByType: null,
  574. mergeList: [],
  575. activeSoundList: [],
  576. appoint: false,
  577. postponeForm: {
  578. stopTime: "",
  579. resetTime: "",
  580. holiday: false
  581. },
  582. postponeVisible: false,
  583. postponeRules: {
  584. stopTime: [
  585. { required: true, message: "请选择开始日期", trigger: "blur" }
  586. ],
  587. resetTime: [
  588. { required: true, message: "请选择顺延日期", trigger: "blur" }
  589. ]
  590. },
  591. bigin: this.beginDate(),
  592. options: this.processDate(),
  593. team_status: "",
  594. activeList: [],
  595. courseViewType: "",
  596. tenantId: null,
  597. isFirst: false,
  598. classDetail: null,
  599. classNameVisible: false
  600. };
  601. },
  602. created() {
  603. this.init();
  604. this.getInstitutionRules();
  605. },
  606. // activated() {
  607. // this.init();
  608. // },
  609. mounted() {
  610. let tenantConfig = sessionStorage.getItem("tenantConfig");
  611. tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {};
  612. this.tenantId = tenantConfig.tenantId;
  613. },
  614. methods: {
  615. submit() {
  616. this.getList();
  617. },
  618. reset() {
  619. this.topForm = {
  620. classType: "",
  621. hasCourse: ""
  622. };
  623. this.$nextTick(() => {
  624. this.getList();
  625. });
  626. },
  627. async getInstitutionRules() {
  628. try {
  629. const res = await getSysTenantConfig({ group: "OFFLINE" });
  630. this.isFirst = Boolean(res.data[0].createOn);
  631. if (!this.isFirst) {
  632. this.$bus.$emit("showguide", ["offline"]);
  633. }
  634. } catch (e) {
  635. console.log(e);
  636. }
  637. },
  638. permission(val) {
  639. return permission(val);
  640. },
  641. async init() {
  642. this.teamid = this.$route.query.id;
  643. this.team_status = this.$route.query.team_status;
  644. if (this.musicGroupInfo) {
  645. this.organId = this.musicGroupInfos.organId;
  646. this.courseViewType = this.musicGroupInfos.courseViewType;
  647. this.courseViewType = this.musicGroupInfos.courseViewType;
  648. } else {
  649. getTeamBaseInfo({ musicGroupId: this.teamid }).then(res => {
  650. if (res.code == 200) {
  651. this.musicGroupInfos = res.data.musicGroup;
  652. this.organId = this.musicGroupInfos.organId;
  653. this.courseViewType = this.musicGroupInfos.courseViewType;
  654. this.courseViewType = this.musicGroupInfos.courseViewType;
  655. }
  656. });
  657. }
  658. this.$nextTick(async res => {
  659. try {
  660. if (this.organId && this.courseViewType != null) {
  661. const res = await getOrganizationCourseUnitPriceSettings({
  662. courseViewType: this.courseViewType,
  663. organId: this.organId,
  664. rows: 9999
  665. });
  666. const d = {};
  667. this.courseTypes = res.data.rows;
  668. for (const item of this.courseTypes) {
  669. d[item.courseType] = item;
  670. }
  671. this.courseTypesByType = d;
  672. console.log(this.courseTypesByType);
  673. }
  674. } catch (error) { }
  675. // 根据乐团id获取乐团所属分部
  676. getTeacher({ organId: this.organId }).then(res => {
  677. if (res.code == 200) {
  678. this.cooperationList = res.data;
  679. this.teacherList = res.data;
  680. if (this.teacherList.length <= 0) {
  681. this.$bus.$emit("showguide", ["teacher"]);
  682. return;
  683. }
  684. }
  685. });
  686. // getAllClass({ musicGroupId: this.teamid }).then((res) => {
  687. // if (res.code == 200) {
  688. // this.maxClassList = res.data;
  689. // }
  690. // });
  691. // 获取默认乐团内的所有班
  692. this.changeMixClass();
  693. // 根据乐团id获取乐团的所有声部
  694. findSound({ musicGroupId: this.teamid }).then(res => {
  695. if (res.code == 200) {
  696. this.soundList = res.data;
  697. }
  698. });
  699. });
  700. // 根据分部id和缴费类型获取 可选课程类型
  701. },
  702. resetTeacher(row) {
  703. this.teacherVisible = true;
  704. this.teacherDetail = row;
  705. },
  706. teacherSubmited(data) {
  707. const obj = this.getSubmitData(data, {
  708. classGroupId: this.teacherDetail?.id,
  709. courseAddType: "onlyUpdateTeacher"
  710. });
  711. classGroupUpdate(obj).then(res => {
  712. if (res.code == 200) {
  713. this.$message.success("修改成功");
  714. this.teacherVisible = false;
  715. this.getList();
  716. }
  717. });
  718. },
  719. getSubmitData(data, more = {}) {
  720. return [
  721. {
  722. type: this.activeType,
  723. classGroupName: data?.name,
  724. musicGroupId: this.teamid,
  725. classGroupTeacherMapperList: formatClassGroupTeacherMapperList(
  726. data.coreTeacher,
  727. data.assistant
  728. ),
  729. students: data?.seleched,
  730. ...more
  731. }
  732. ];
  733. },
  734. getClassDate(data) {
  735. return {
  736. type: this.activeType,
  737. name: data?.name,
  738. musicGroupId: this.teamid,
  739. subjectIdList: data?.sound.length > 0 ? data?.sound.join(",") : null,
  740. teacherMapperList: formatClassGroupTeacherMapperList(
  741. data.coreTeacher,
  742. data.assistant
  743. ),
  744. groupType: "MUSIC"
  745. };
  746. },
  747. async submitClass(data) {
  748. const list = this.getSubmitData(data, { onlyCreateClassGroup: true });
  749. let obj = this.getClassDate(data);
  750. if (this.activeType == "MUSIC_NETWORK") {
  751. try {
  752. await revisionAddClassGroup(list);
  753. this.$message.success("提交成功");
  754. this.studentVisible = false;
  755. this.getList();
  756. } catch (error) {
  757. console.log(error);
  758. }
  759. } else {
  760. createClass(obj).then(res => {
  761. if (res.code == 200) {
  762. this.studentVisible = false;
  763. this.$message.success("提交成功");
  764. this.getList();
  765. }
  766. });
  767. }
  768. return;
  769. console.log(data);
  770. try {
  771. if (this.classType == 1) {
  772. // 0新建班级 2 3 4新增班级修改
  773. console.log(list, "submitClass,临时班");
  774. return;
  775. await revisionClassGroup(list);
  776. this.$message.success("提交成功");
  777. } else if (
  778. this.classType == 2 ||
  779. this.classType == 3 ||
  780. this.classType == 4
  781. ) {
  782. console.log(list, "submitClass");
  783. return;
  784. await revisionAddClassGroup(list);
  785. this.$message.success("提交成功");
  786. }
  787. this.studentVisible = false;
  788. this.getList();
  789. } catch (error) {
  790. console.log(error);
  791. }
  792. },
  793. studentSubmited(data) {
  794. if (!this.isOnlyChangeUser) {
  795. this.submitClass(data);
  796. // this.studentSubmitedData = data;
  797. // this.infoVisible = true;
  798. } else {
  799. this.getList();
  800. }
  801. },
  802. recourse(row) {
  803. (this.weekList = [
  804. {
  805. week: "",
  806. startTime: "",
  807. endTime: "",
  808. id: new Date()
  809. }
  810. ]),
  811. (this.resetCourseVisible = true);
  812. },
  813. addMix() {
  814. this.MixVisible = true;
  815. },
  816. changeActiveChioseSound(val) {
  817. this.activeChioseSound = val;
  818. },
  819. setAssistant(val) {
  820. for (let i in val) {
  821. if (val[i] == this.teacherForm.coreTeacher) {
  822. val.splice(i, 1);
  823. }
  824. }
  825. },
  826. changeMixClass(val) {
  827. // 根据合奏班id获取合奏班下的所有声部班
  828. console.log(val);
  829. this.getList(val);
  830. this.activeMixClass = val;
  831. },
  832. getList(val) {
  833. getAllSignClassandTeacher({
  834. musicGroupId: this.teamid,
  835. ...this.topForm
  836. }).then(res => {
  837. if (res.code == 200) {
  838. this.activeSingleList = res.data;
  839. if (res.data?.length > 0) {
  840. this.mergeList = res.data.filter(item => {
  841. return item.type != "MUSIC_NETWORK";
  842. });
  843. }
  844. // this.topForm.count = this.activeSingleList.length
  845. }
  846. });
  847. },
  848. // 临时调整
  849. temporary() {
  850. this.classType = 1;
  851. this.activeClass = "";
  852. this.activeListStudent = [];
  853. this.studentList = [];
  854. this.isNewClass = true;
  855. this.studentVisible = true;
  856. this.isOnlyChangeUser = false;
  857. this.isSearch = true;
  858. this.className = "";
  859. this.isTemporary = true;
  860. this.activeType = "SNAP";
  861. this.activeChioseSound = null;
  862. this.setType("SNAP");
  863. this.getNoClassStudent("SNAP");
  864. },
  865. setType(type) {
  866. this.courseTypeList = getCourseType(type);
  867. this.activeSoundList = this.soundList;
  868. },
  869. // 新增班级
  870. addNewClass(type) {
  871. const types = {
  872. NORMAL: 2,
  873. MUSIC_NETWORK: 4
  874. };
  875. this.isOnlyChangeUser = false;
  876. this.classType = types[type] || 3;
  877. this.setType(type);
  878. this.activeType = type;
  879. this.activeClass = "";
  880. this.activeListStudent = [];
  881. this.studentList = [];
  882. this.isNewClass = true;
  883. this.studentVisible = true;
  884. this.isSearch = false;
  885. this.className = "";
  886. this.isTemporary = false;
  887. this.activeChioseSound = null;
  888. this.getNoClassStudent(type);
  889. },
  890. searchStudent(classGroupId) {
  891. console.log(this.activeChioseSound);
  892. // 搜索学生
  893. // 根据声部id 乐团id搜索学生
  894. if (this.activeType == "SNAP") {
  895. teamSoundStudent({
  896. musicGroupId: this.teamid,
  897. actualSubjectId: this.activeChioseSound
  898. }).then(res => {
  899. if (res.code == 200) {
  900. this.studentList = res.data;
  901. }
  902. });
  903. } else {
  904. this.getNoClassStudent(
  905. this.activeType,
  906. this.activeChioseSound,
  907. classGroupId
  908. );
  909. }
  910. },
  911. // 选择学生的方法修改
  912. SelectionStudent(val) {
  913. this.chioseStudent = val;
  914. },
  915. // 新增选中的学生
  916. NewselectionStudent(val) {
  917. this.chioseStudent = val;
  918. // 这里新增的添加到选中的学生列表 根据学生id去重
  919. if (this.chioseStudent.length > 0) {
  920. this.chioseStudent = this.chioseStudent.concat(val);
  921. } else {
  922. this.chioseStudent = val;
  923. }
  924. // 联动版
  925. // this.activeListStudent = this.objArrayRemoval(this.chioseStudent, 'userId')
  926. // 非联动多选版
  927. this.activeListStudent = this.activeListStudent.concat(
  928. this.chioseStudent
  929. );
  930. // // 去重
  931. this.activeListStudent = this.objArrayRemoval(
  932. this.activeListStudent,
  933. "userId"
  934. );
  935. // 将其填入选中的学生
  936. },
  937. clearCourse(scope) {
  938. clearClassCourse({ classGroupId: scope.row.id })
  939. .then(res => {
  940. if (res.code == 200) {
  941. this.$message.success("清除成功");
  942. scope._self.$refs[scope.$index].doClose();
  943. // 重新请求列表
  944. this.getList(this.activeMixClass);
  945. } else {
  946. this.$message.error(res.msg);
  947. scope._self.$refs[scope.$index].doClose();
  948. }
  949. })
  950. .catch(res => {
  951. scope._self.$refs[scope.$index].doClose();
  952. });
  953. // 清空课表
  954. },
  955. // 删除班级
  956. removeClass(scope) {
  957. this.$confirm("是否确定删除该班级?", "提示", {
  958. confirmButtonText: "确定",
  959. cancelButtonText: "取消",
  960. type: "warning"
  961. })
  962. .then(() => {
  963. removeSingleClass({ classGroupId: scope.row.id })
  964. .then(res => {
  965. if (res.code == 200) {
  966. this.$message.success("删除成功");
  967. // 重新请求列表
  968. this.getList(this.activeMixClass);
  969. }
  970. })
  971. .catch(res => { });
  972. })
  973. .catch(() => { });
  974. },
  975. // 修改班级
  976. resetClass(row) {
  977. this.isOnlyChangeUser = true;
  978. this.isNewClass = false;
  979. this.className = row.name;
  980. this.studentVisible = true;
  981. this.activeClass = row.id;
  982. this.isSearch = false;
  983. this.activeType = row.type;
  984. this.activeChioseSound = null;
  985. this.isStudentRemove =
  986. row.currentClassTimes == row.totalClassTimes ? true : false; // 上课时长是否没有
  987. // 根据单机班id 查询声部班内的所有学生
  988. getClassAllStudent({ classGroupId: row.id }).then(res => {
  989. if (res.code == 200) {
  990. this.activeListStudent = res.data.map(item => {
  991. item.isVisible = false;
  992. return item;
  993. });
  994. }
  995. });
  996. this.activeSoundList = this.soundList;
  997. this.getNoClassStudent(row.type); // 基础技能班能获取所有
  998. // if (this.activeType == "HIGH" || this.activeType == "HIGH_ONLINE") {
  999. // this.getNoClassStudent(row.type, row.memo);
  1000. // let arr = row.memo.split(",");
  1001. // console.log(arr);
  1002. // this.activeSoundList = this.soundList.filter((sound) => {
  1003. // return arr.indexOf(sound.id + "") != -1;
  1004. // });
  1005. // } else {
  1006. // this.activeSoundList = this.soundList;
  1007. // this.getNoClassStudent(row.type);
  1008. // console.log(this.activeSoundList);
  1009. // }
  1010. },
  1011. // 班级调整
  1012. classAdjustment(row) {
  1013. this.infoDetail = row;
  1014. this.activeType = row.type;
  1015. this.activeClass = row.id;
  1016. // this.activeListStudent = row.subjectIdList.split(',')
  1017. this.setType(row.type);
  1018. // activeListStudent
  1019. this.isNewClass = false;
  1020. this.teacherForm.assistant = [];
  1021. for (let i in row.classGroupTeacherMapperList) {
  1022. if (row.classGroupTeacherMapperList[i].teacherRole == "BISHOP") {
  1023. this.teacherForm.coreTeacher =
  1024. row.classGroupTeacherMapperList[i].userId;
  1025. }
  1026. if (row.classGroupTeacherMapperList[i].teacherRole == "TEACHING") {
  1027. this.teacherForm.assistant.push(
  1028. row.classGroupTeacherMapperList[i].userId
  1029. );
  1030. }
  1031. }
  1032. this.infoVisible = true;
  1033. },
  1034. async getNoClassStudent(type, actualSubjectId, classGroupId) {
  1035. const params = {
  1036. musicGroupId: this.teamid,
  1037. type,
  1038. actualSubjectId,
  1039. classGroupId
  1040. };
  1041. await getMusicGroupStuNoClassType(params).then(res => {
  1042. if (res.code == 200) {
  1043. this.studentList = res.data;
  1044. // }
  1045. }
  1046. });
  1047. },
  1048. // 删除学生 调整
  1049. removeStudent(item) {
  1050. // 这里做判断如果是线上基础技能班 学生人数不能少于3人
  1051. if (
  1052. this.activeType == "HIGH_ONLINE" &&
  1053. this.activeListStudent.length <= 3
  1054. ) {
  1055. this.$message.error("线上基础技能课不能小于3人");
  1056. return;
  1057. }
  1058. removeStudents({
  1059. classGroupId: this.activeClass,
  1060. userId: item.userId
  1061. }).then(res => {
  1062. if (res.code == 200) {
  1063. this.$message.success("删除成功");
  1064. item.isVisible = false;
  1065. // 这里刷新 this.studentList this.activeListStudent
  1066. this.getList(this.activeMixClass);
  1067. getClassAllStudent({ classGroupId: this.activeClass }).then(res => {
  1068. if (res.code == 200) {
  1069. this.activeListStudent = res.data;
  1070. }
  1071. });
  1072. this.getNoClassStudent(this.activeType);
  1073. // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
  1074. // if (res.code == 200) {
  1075. // this.$message.success('删除成功');
  1076. // this.studentList = res.data.map(item => {
  1077. // item.isVisible = false;
  1078. // return item;
  1079. // });
  1080. // }
  1081. // })
  1082. }
  1083. });
  1084. },
  1085. // 批量添加学生
  1086. addSomeStudent() {
  1087. // 获取勾选的学生
  1088. let arr = this.chioseStudent.map(item => {
  1089. return item.userId;
  1090. });
  1091. if (arr.length <= 0) {
  1092. if (this.isNewClass) {
  1093. this.$message.error("至少添加一名学员");
  1094. return;
  1095. } else {
  1096. this.studentVisible = false;
  1097. return;
  1098. }
  1099. }
  1100. if (this.activeType == "HIGH_ONLINE") {
  1101. superFindClassGroups({ classGroupId: this.activeClass }).then(res => {
  1102. if (res.code == 200) {
  1103. if (
  1104. this.activeListStudent.length + this.chioseStudent.length > 6 ||
  1105. this.activeListStudent.length + this.chioseStudent.length < 3
  1106. ) {
  1107. this.$message.error("线上技能班必须为3-6人");
  1108. return;
  1109. } else {
  1110. addStudents({
  1111. classGroupId: this.activeClass,
  1112. userIdsStr: arr.join(",")
  1113. }).then(res => {
  1114. if (res.code == 200) {
  1115. this.studentVisible = false;
  1116. this.$message.success("添加成功");
  1117. this.getList();
  1118. return;
  1119. }
  1120. });
  1121. }
  1122. }
  1123. });
  1124. } else {
  1125. addStudents({
  1126. classGroupId: this.activeClass,
  1127. userIdsStr: arr.join(",")
  1128. }).then(res => {
  1129. if (res.code == 200) {
  1130. this.studentVisible = false;
  1131. this.$message.success("添加成功");
  1132. this.getList();
  1133. }
  1134. });
  1135. }
  1136. },
  1137. SelectionMix(val) {
  1138. this.activeSingleLists = val;
  1139. },
  1140. removeSiginforMix(item) {
  1141. for (let k in this.activeSingleLists) {
  1142. if (this.activeSingleLists[k].id == item.id) {
  1143. this.$refs["mixList"].toggleRowSelection(item, false);
  1144. }
  1145. }
  1146. },
  1147. temporaryRemoveStudent(item) {
  1148. // 列表中删除
  1149. for (let i in this.activeListStudent) {
  1150. if (this.activeListStudent[i].userId == item.userId) {
  1151. this.activeListStudent.splice(i, 1);
  1152. }
  1153. }
  1154. // 查询列表中的项 取消勾选 temporaryStudentList toggleRowSelection
  1155. // 循环列表 找到相应的行取消勾选
  1156. for (let k in this.studentList) {
  1157. if (this.studentList[k].userId == item.userId) {
  1158. this.$refs["temporaryStudentList"].toggleRowSelection(item, false);
  1159. }
  1160. }
  1161. // this.$refs['temporaryStudentList'].toggleRowSelection(row, selected);
  1162. },
  1163. // 对象数组去重
  1164. objArrayRemoval(arr, attr) {
  1165. let obj = {};
  1166. let result = [];
  1167. for (let x in arr) {
  1168. if (!obj[arr[x][attr]]) {
  1169. result.push(arr[x]);
  1170. obj[arr[x][attr]] = true;
  1171. }
  1172. }
  1173. return result;
  1174. },
  1175. setInfoMsg() {
  1176. // 判断班级名称是否输入
  1177. if (!this.className) {
  1178. this.$message.error("请输入班级名称");
  1179. return;
  1180. }
  1181. // 判断有没有勾选学生
  1182. if (this.activeListStudent.length <= 0) {
  1183. // 没有勾学生
  1184. this.$message.error("班级里至少要有一名学生");
  1185. return;
  1186. }
  1187. if (this.activeType == "HIGH_ONLINE") {
  1188. if (
  1189. this.activeListStudent.length > 6 ||
  1190. this.activeListStudent.length < 3
  1191. ) {
  1192. this.$message.error("线上技能班必须为3-6人");
  1193. return;
  1194. }
  1195. this.teacherForm.expectStudentNum = this.activeListStudent.length;
  1196. }
  1197. this.infoVisible = true;
  1198. },
  1199. addWeek() {
  1200. // 添加循环周期
  1201. this.weekList.push({
  1202. dayOfWeek: "",
  1203. startClassTime: "",
  1204. endClassTime: "",
  1205. time: this.courseTime,
  1206. id: new Date().getTime()
  1207. });
  1208. },
  1209. // 删除循环周
  1210. removeWeek(item) {
  1211. for (let i in this.weekList) {
  1212. if (this.weekList[i].id == item.id) {
  1213. this.weekList.splice(i, 1);
  1214. }
  1215. }
  1216. },
  1217. // 新建基础技能班
  1218. newClassHight() {
  1219. this.$refs["newClassForm"].validate(res => {
  1220. if (res) {
  1221. let obj = {};
  1222. obj.musicGroupId = this.teamid;
  1223. obj.name = this.newClassForm.className;
  1224. obj.type = this.newClassForm.type;
  1225. obj.groupType = "MUSIC";
  1226. obj.expectStudentNum = this.newClassForm.expectStudentNum;
  1227. obj.teacherMapperList = [];
  1228. obj.teacherMapperList.push({
  1229. userId: this.newClassForm.bishop,
  1230. teacherRole: "BISHOP"
  1231. });
  1232. let subjectIdList;
  1233. if (this.newClassForm.type == "HIGH_ONLINE") {
  1234. subjectIdList = this.newClassForm.subjectId;
  1235. if (this.newClassForm.memo.length > 0) {
  1236. obj.memo = this.newClassForm.memo.join(",");
  1237. }
  1238. } else {
  1239. subjectIdList =
  1240. this.newClassForm.memo.length > 0
  1241. ? this.newClassForm.memo.join(",")
  1242. : null;
  1243. for (let i in this.newClassForm.teaching) {
  1244. obj.teacherMapperList.push({
  1245. userId: this.newClassForm.teaching[i],
  1246. teacherRole: "TEACHING"
  1247. });
  1248. }
  1249. obj.memo = subjectIdList;
  1250. }
  1251. obj.subjectIdList = subjectIdList;
  1252. createClass(obj).then(res => {
  1253. if (res.code == 200) {
  1254. this.$message.success("创建成功");
  1255. this.getList();
  1256. this.resetClassFrom();
  1257. this.newClassVisible = false;
  1258. }
  1259. });
  1260. }
  1261. });
  1262. },
  1263. resetClassFrom() {
  1264. this.newClassForm = {
  1265. className: null,
  1266. type: null,
  1267. subjectIdList: [],
  1268. subjectId: "",
  1269. expectStudentNum: null,
  1270. bishop: null,
  1271. teaching: [],
  1272. memo: []
  1273. };
  1274. this.changeMemo([]);
  1275. },
  1276. setAssistant1(val) {
  1277. if (val) {
  1278. for (let i in val) {
  1279. if (val[i] == this.newClassForm.bishop) {
  1280. val.splice(i, 1);
  1281. }
  1282. }
  1283. }
  1284. },
  1285. handleSelectionChange(val) {
  1286. this.activeList = val;
  1287. let arr = val.map(item => {
  1288. return item.id;
  1289. });
  1290. this.activeClass = arr.join(",");
  1291. },
  1292. chkstu(row, index) {
  1293. return (
  1294. (row.type == "HIGH_ONLINE" && row.totalClassTimes <= 0) ||
  1295. (row.type == "HIGH" && row.totalClassTimes <= 0)
  1296. );
  1297. },
  1298. startRegest() {
  1299. if (!this.classGroupIds) {
  1300. this.$message.error("请至少选择1个基础技能班");
  1301. return;
  1302. }
  1303. this.$confirm("是否开启报名?", "提示", {
  1304. confirmButtonText: "确定",
  1305. cancelButtonText: "取消",
  1306. type: "warning"
  1307. })
  1308. .then(() => {
  1309. pushMessage({
  1310. classGroupIds: this.classGroupIds,
  1311. musicGroupId: this.teamid
  1312. }).then(res => {
  1313. if (res.code == 200) {
  1314. this.$message.success(`开启成功,已推送${res.data}名学生`);
  1315. this.getList();
  1316. }
  1317. });
  1318. })
  1319. .catch(() => { });
  1320. },
  1321. toggleSelection(rows) {
  1322. if (rows) {
  1323. rows.forEach(row => {
  1324. this.$refs.multipleTable.toggleRowSelection(row);
  1325. });
  1326. } else {
  1327. this.$refs.multipleTable.clearSelection();
  1328. }
  1329. },
  1330. chioseHightype(val) {
  1331. this.changeMemo([]);
  1332. if (val == "HIGH_ONLINE") {
  1333. this.newClassForm.teaching = [];
  1334. }
  1335. this.newClassForm.subjectId = "";
  1336. this.$set(this.newClassForm, "subjectIdList", []);
  1337. this.$set(this.newClassForm, "memo", []);
  1338. },
  1339. changeStartClassTime(item) {
  1340. // item.endClassTime = ''
  1341. this.$set(item, "endClassTime", "");
  1342. },
  1343. changeEndClassTime(item, val) {
  1344. this.$set(item, "endClassTime", val);
  1345. },
  1346. changeCourseType(val) {
  1347. console.log(val);
  1348. if (val) {
  1349. this.classTimeList.forEach(item => {
  1350. if (item.value == val) {
  1351. this.courseTime = item.label;
  1352. }
  1353. });
  1354. // courseTime
  1355. this.weekList = [
  1356. {
  1357. week: "",
  1358. startTime: "",
  1359. endTime: "",
  1360. time: this.courseTime,
  1361. id: new Date().getTime()
  1362. }
  1363. ];
  1364. } else {
  1365. this.courseTime = null;
  1366. this.weekList = [];
  1367. }
  1368. // if (val === 'HIGH_ONLINE' || val === 'HIGH' || val === 'MUSIC_NETWORK') {
  1369. // this.step = '00:05'
  1370. // } else {
  1371. // this.step = '00:15'
  1372. // }
  1373. },
  1374. changeStartTimes(val, item) {
  1375. if (val && item.time) {
  1376. let str = dayjs(new Date()).format("YYYY-MM-DD");
  1377. this.$set(
  1378. item,
  1379. "endClassTime",
  1380. addTimerFormMinute(str, val, item.time)
  1381. );
  1382. } else {
  1383. this.$set(item, "endClassTime", "");
  1384. this.$message.error("请先设置课程时间");
  1385. }
  1386. if (!item.endClassTime) {
  1387. this.$set(item, "startClassTime", "");
  1388. }
  1389. },
  1390. setItem(item, index) {
  1391. // console.log(item, index)
  1392. this.weekList[index].startClassTime = "";
  1393. this.weekList[index].endClassTime = "";
  1394. console.log();
  1395. },
  1396. openStudentReset() {
  1397. this.activeSoundList = this.soundList;
  1398. this.studentResetVisiable = true;
  1399. },
  1400. closeStudentReset() {
  1401. this.studentResetVisiable = false;
  1402. },
  1403. changeMemo(val) { },
  1404. submitInfo() {
  1405. this.$refs["postponeForm"].validate(res => {
  1406. if (res) {
  1407. let classGroupIds = this.activeClass;
  1408. let pauseDate = this.postponeForm.stopTime;
  1409. let recoveryDate = this.postponeForm.resetTime;
  1410. let skipHoliday = this.postponeForm.holiday;
  1411. let obj = {
  1412. classGroupIds,
  1413. pauseDate,
  1414. recoveryDate,
  1415. skipHoliday
  1416. };
  1417. coursePostpone(obj).then(res => {
  1418. if (res.code == 200) {
  1419. this.$message.success("修改成功");
  1420. this.postponeVisible = false;
  1421. }
  1422. });
  1423. }
  1424. });
  1425. },
  1426. postpone() {
  1427. if (this.activeList.length <= 0) {
  1428. this.$message.error("请至少选择一个班级");
  1429. return;
  1430. }
  1431. this.postponeVisible = true;
  1432. },
  1433. checkSignPostpone(row) {
  1434. return row.totalClassTimes - row.currentClassTimes > 0;
  1435. },
  1436. handleClose() {
  1437. // 弹窗关闭之前
  1438. this.postponeVisible = false;
  1439. this.$refs["postponeForm"].resetFields();
  1440. },
  1441. beginDate() {
  1442. let self = this;
  1443. return {
  1444. firstDayOfWeek: 1,
  1445. disabledDate(time) {
  1446. return time.getTime() + 86400000 <= new Date().getTime(); //开始时间不选时,结束时间最大值小于等于当天
  1447. }
  1448. };
  1449. },
  1450. processDate() {
  1451. //提出结束时间必须大于提出开始时间
  1452. let self = this;
  1453. return {
  1454. firstDayOfWeek: 1,
  1455. disabledDate(time) {
  1456. if (self.postponeForm.stopTime) {
  1457. return (
  1458. new Date(self.postponeForm.stopTime).getTime() > time.getTime()
  1459. );
  1460. } else {
  1461. return time.getTime() > Date.now();
  1462. //开始时间不选时,结束时间最大值小于等于当天
  1463. }
  1464. }
  1465. };
  1466. },
  1467. signPostpone(row) {
  1468. this.activeClass = row.id;
  1469. this.postponeVisible = true;
  1470. },
  1471. async gotoMemberCourse() {
  1472. // 这里跳转到课表
  1473. try {
  1474. const res = await musicGroupSchoolTermCourseDetail({
  1475. musicGroupId: this.teamid
  1476. });
  1477. this.$router.push({
  1478. path: "/business/memberClassList",
  1479. query: { ...this.$route.query }
  1480. });
  1481. } catch (e) {
  1482. console.log(e);
  1483. }
  1484. },
  1485. resetClassName(row) {
  1486. this.classDetail = row;
  1487. this.classNameVisible = true;
  1488. },
  1489. async submitedResetClassName(data) {
  1490. const obj = { ...data };
  1491. resetClassName(obj).then(res => {
  1492. if (res.code == 200) {
  1493. this.$message.success("修改成功");
  1494. this.classNameVisible = false;
  1495. this.getList();
  1496. }
  1497. });
  1498. }
  1499. },
  1500. watch: {
  1501. "newClassForm.type"() {
  1502. if (this.newClassForm.type === "HIGH_ONLINE") {
  1503. this.$set(this.newClassForm, "expectStudentNum", 6);
  1504. }
  1505. },
  1506. infoVisible(val) {
  1507. if (!val) {
  1508. this.teacherForm = {
  1509. isAdd: null,
  1510. coreTeacher: "",
  1511. assistant: [],
  1512. courseType: "",
  1513. courseTime: "",
  1514. checked: true,
  1515. courseNum: "",
  1516. mixClassGroupId: "",
  1517. sound: "",
  1518. expectStudentNum: ""
  1519. };
  1520. this.infoDetail = null;
  1521. // this.$refs["teacherForm"].resetFields();
  1522. this.weekList = [];
  1523. }
  1524. },
  1525. newClassVisible(val) {
  1526. if (!val) {
  1527. this.newClassForm = {
  1528. className: null,
  1529. type: null,
  1530. subjectIdList: [],
  1531. expectStudentNum: null,
  1532. bishop: null,
  1533. teaching: null,
  1534. memo: []
  1535. };
  1536. this.resetClassFrom();
  1537. }
  1538. }
  1539. }
  1540. };
  1541. </script>
  1542. <style lang="scss" scoped>
  1543. .btnList {
  1544. display: flex;
  1545. flex-direction: row;
  1546. justify-content: flex-start;
  1547. align-items: center;
  1548. .newBand {
  1549. margin-right: 10px;
  1550. }
  1551. }
  1552. .dialog-footer.question {
  1553. display: flex;
  1554. flex-direction: row;
  1555. justify-content: space-between;
  1556. }
  1557. .topWrap {
  1558. display: flex;
  1559. flex-direction: row;
  1560. justify-content: space-between;
  1561. }
  1562. .floor {
  1563. padding-right: 20px;
  1564. display: flex;
  1565. flex-direction: row;
  1566. justify-content: space-between;
  1567. width: 100%;
  1568. height: 48px;
  1569. line-height: 48px;
  1570. background: rgba(237, 238, 240, 1);
  1571. font-size: 14px;
  1572. color: #444;
  1573. align-items: center;
  1574. position: relative;
  1575. z-index: 1;
  1576. .right {
  1577. display: flex;
  1578. flex-direction: row;
  1579. justify-content: flex-start;
  1580. .remove {
  1581. width: 98px;
  1582. height: 32px;
  1583. background: rgba(248, 80, 67, 1);
  1584. border-radius: 3px;
  1585. color: #fff;
  1586. line-height: 32px;
  1587. text-align: center;
  1588. margin-left: 164px;
  1589. cursor: pointer;
  1590. }
  1591. }
  1592. .add {
  1593. width: auto;
  1594. padding: 0 10px;
  1595. height: 32px;
  1596. background: var(--color-primary);
  1597. border-radius: 3px;
  1598. color: #fff;
  1599. line-height: 32px;
  1600. text-align: center;
  1601. margin-left: 20px;
  1602. cursor: pointer;
  1603. }
  1604. }
  1605. .studentMask {
  1606. display: flex;
  1607. flex-direction: row;
  1608. justify-content: flex-start;
  1609. .left {
  1610. width: 200px;
  1611. margin-right: 20px;
  1612. .wrap {
  1613. margin-bottom: 20px;
  1614. }
  1615. h4 {
  1616. font-size: 16px;
  1617. color: #444;
  1618. line-height: 38px;
  1619. }
  1620. .chioseStudentList {
  1621. height: 500px;
  1622. overflow-y: auto;
  1623. border: 1px solid #ccc;
  1624. .studentItem {
  1625. padding-left: 10px;
  1626. line-height: 25px;
  1627. }
  1628. }
  1629. }
  1630. .right {
  1631. width: calc(100% - 200px);
  1632. .tableList {
  1633. max-height: 500px;
  1634. overflow-y: auto;
  1635. }
  1636. }
  1637. }
  1638. .resetClassForm {
  1639. ::v-deep .el-date-editor.el-input,
  1640. ::v-deep .el-date-editor.el-input__inner {
  1641. width: 180px !important;
  1642. }
  1643. }
  1644. // ::v-deep .el-date-editor.el-input,
  1645. // ::v-deep .el-date-editor.el-input__inner {
  1646. // width: 100px !important;
  1647. // }
  1648. .higheSelect {
  1649. ::v-deep .el-input__inner {
  1650. height: 40px !important;
  1651. }
  1652. }
  1653. ::v-deep .el-alert__content {
  1654. display: block;
  1655. width: 100%;
  1656. }
  1657. .alert-content {
  1658. display: flex;
  1659. justify-content: space-between;
  1660. >strong {
  1661. cursor: pointer;
  1662. }
  1663. }
  1664. </style>