resetClass.vue 58 KB

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