resetClass.vue 60 KB

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