resetClass.vue 56 KB

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