resetClass.vue 65 KB

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