resetClass.vue 54 KB

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