resetClass.vue 53 KB

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