resetClass.vue 50 KB

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