resetClass.vue 50 KB

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