resetClass.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  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="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>
  23. <div class="tableWrap"
  24. style="">
  25. <el-table :data='activeSingleList'
  26. style=""
  27. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  28. <el-table-column align='center'
  29. prop="name"
  30. label="班级名称">
  31. </el-table-column>
  32. <el-table-column align='center'
  33. prop="type"
  34. label="班级类型">
  35. <template slot-scope="scope">
  36. <div>
  37. {{ scope.row.type | classType }}
  38. </div>
  39. </template>
  40. </el-table-column>
  41. <el-table-column align='center'
  42. prop="studentNum"
  43. label="班级人数">
  44. </el-table-column>
  45. <el-table-column align='center'
  46. prop=""
  47. label="主教老师">
  48. <template slot-scope="scope">
  49. <div v-if="scope.row.classGroupTeacherMapperList">
  50. <p v-for="(item,index) in scope.row.classGroupTeacherMapperList"
  51. v-if="item.teacherRole == 'BISHOP'"
  52. :key='index'>{{item.userName}}</p>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column align='center'
  57. label="助教老师">
  58. <template slot-scope="scope">
  59. <div v-if="scope.row.classGroupTeacherMapperList">
  60. <p v-for="(item,index) in scope.row.classGroupTeacherMapperList"
  61. v-if="item.teacherRole == 'TEACHING'"
  62. :key='index'>{{item.userName}}</p>
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column align='center'
  67. label="是否排课">
  68. <template slot-scope="scope">
  69. <div>
  70. <p v-if="scope.row.totalClassTimes > 0"> 是</p>
  71. <p v-if="scope.row.totalClassTimes <= 0"> 否</p>
  72. </div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column align='center'
  76. width="400px"
  77. label="操作">
  78. <template slot-scope="scope">
  79. <div>
  80. <!-- v-if="scope.row.type !='MIX'" -->
  81. <el-button type="text"
  82. @click="resetClass(scope.row)">学员调整</el-button>
  83. <el-button type="text"
  84. @click="classAdjustment(scope.row)">班级调整</el-button>
  85. <!--<el-button type="text"
  86. @click="recourse(scope.row)">重新排课</el-button> -->
  87. <el-popover placement="top"
  88. width="160"
  89. :ref="scope.$index">
  90. <p>确定删除?</p>
  91. <div style="text-align: right; margin: 0">
  92. <el-button size="mini"
  93. type="text"
  94. @click="scope._self.$refs[scope.$index].doClose()">取消</el-button>
  95. <el-button type="primary"
  96. size="mini"
  97. @click="removeClass(scope)">确定</el-button>
  98. </div>
  99. <!-- v-if="scope.row.type !='MIX'" -->
  100. <el-button type="text"
  101. slot="reference">删除</el-button>
  102. </el-popover>
  103. </div>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <div class="floor">
  108. <div class="add"
  109. @click="temporary">新建临时班</div>
  110. <div class='add'
  111. @click="addNewClass('NORMAL')">新建单技班</div>
  112. <div class='add'
  113. @click="addNewClass('MIX')">新建合奏班</div>
  114. <div class='add'
  115. @click="addNewClass('HIGH')">基础技能班</div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- 学员选择 -->
  120. <el-dialog title="学员选择"
  121. width="700px"
  122. :visible.sync="studentVisible"
  123. :modal-append-to-body="false">
  124. <div class="studentMask">
  125. <div class="left">
  126. <div class="wrap">
  127. <el-input placeholder="请输入班级名称"
  128. :disabled="!isNewClass"
  129. v-model="className"></el-input>
  130. </div>
  131. <div class="chioseStudentList">
  132. <h4 style="padding-left:10px;">当前已选学员</h4>
  133. <div class="studentItem"
  134. v-for="(item,index) in activeListStudent"
  135. :key="index">
  136. {{ item.name }}
  137. <el-popover v-if="!isNewClass"
  138. placement="top"
  139. v-model="item.isVisible"
  140. width="160">
  141. <p>确定删除?</p>
  142. <div style="text-align: right; margin: 0">
  143. <el-button size="mini"
  144. type="text"
  145. @click="item.isVisible = false">取消</el-button>
  146. <el-button type="primary"
  147. size="mini"
  148. @click="removeStudent(item)">确定</el-button>
  149. </div>
  150. <el-button type="text"
  151. slot="reference">删除</el-button>
  152. </el-popover>
  153. <el-button v-if="isNewClass"
  154. type='text'
  155. @click="temporaryRemoveStudent(item)">删除</el-button>
  156. </div>
  157. </div>
  158. </div>
  159. <div class="right">
  160. <!-- multiple
  161. collapse-tags -->
  162. <el-select v-if="isSearch"
  163. v-model="activeChioseSound"
  164. style="width:180px"
  165. @change="searchStudent"
  166. clearable
  167. filterable
  168. placeholder="声部选择">
  169. <el-option v-for='(item,index) in soundList'
  170. :key='index'
  171. :label="item.name"
  172. :value="item.id"></el-option>
  173. </el-select>
  174. <!-- <el-button v-if="isSearch"
  175. type="danger"
  176. style="margin-left:20px;"
  177. @click="searchStudent">搜索</el-button> -->
  178. <!-- 列表开始 -->
  179. <div class="tableList">
  180. <el-table tooltip-effect="dark"
  181. v-if="!isNewClass"
  182. style="width: 100%; margin-top:10px;"
  183. :data='studentList'
  184. ref='studentList'
  185. @selection-change="SelectionStudent">
  186. <el-table-column type="selection"
  187. align='center'
  188. width="55">
  189. </el-table-column>
  190. <el-table-column prop="name"
  191. align='center'
  192. width="120"
  193. label="姓名">
  194. </el-table-column>
  195. <el-table-column prop="gender"
  196. align='center'
  197. width="100"
  198. label="性别">
  199. <template slot-scope="scope">
  200. <div>
  201. {{ scope.row.gender | sex }}
  202. </div>
  203. </template>
  204. </el-table-column>
  205. <el-table-column prop="subjectName"
  206. width="100"
  207. align='center'
  208. label="学员声部">
  209. </el-table-column>
  210. </el-table>
  211. <!-- 临时调整table -->
  212. <el-table tooltip-effect="dark"
  213. v-if="isNewClass"
  214. style="width: 100%; margin-top:10px;"
  215. :data='studentList'
  216. ref='temporaryStudentList'
  217. @selection-change="NewselectionStudent">
  218. <el-table-column type="selection"
  219. align='center'
  220. width="55">
  221. </el-table-column>
  222. <el-table-column prop="name"
  223. align='center'
  224. width="120"
  225. label="姓名">
  226. </el-table-column>
  227. <el-table-column prop="gender"
  228. align='center'
  229. width="100"
  230. label="性别">
  231. <template slot-scope="scope">
  232. <div>
  233. {{ scope.row.gender | sex }}
  234. </div>
  235. </template>
  236. </el-table-column>
  237. <el-table-column prop="subjectName"
  238. width="100"
  239. align='center'
  240. label="学员声部">
  241. </el-table-column>
  242. </el-table>
  243. </div>
  244. </div>
  245. </div>
  246. <div slot="footer"
  247. class="dialog-footer">
  248. <el-button @click="studentVisible = false">取 消</el-button>
  249. <!-- 班级学员修改 -->
  250. <el-button type="primary"
  251. v-if="!isNewClass"
  252. @click="addSomeStudent">确 定</el-button>
  253. <!-- 临时调整或者新建班级 -->
  254. <el-button type="primary"
  255. v-if="isNewClass"
  256. @click="setInfoMsg">确 定</el-button>
  257. </div>
  258. </el-dialog>
  259. <!-- 老师以及课程设置 -->
  260. <el-dialog title="班级设置"
  261. width="700px"
  262. :visible.sync="infoVisible"
  263. :modal-append-to-body="false">
  264. <el-form :inline="true"
  265. :model='teacherForm'
  266. ref='teacherForm'
  267. :rules="teacherRules"
  268. label-position='right'
  269. label-width="100px;">
  270. <!-- <el-form-item label="合奏班"
  271. v-if='!isTemporary&&activeType=="NORMAL"'
  272. prop="mixClassGroupId">
  273. <el-select v-model="teacherForm.mixClassGroupId">
  274. <el-option v-for="(item,index) in maxClassList"
  275. :label="item.name"
  276. :key="index"
  277. :value="item.id"></el-option>
  278. </el-select>
  279. </el-form-item> -->
  280. <el-form-item label="调整方式"
  281. v-if="!isNewClass"
  282. prop="isAdd">
  283. <el-radio v-model="teacherForm.isAdd"
  284. label="new">班级加课</el-radio>
  285. <el-radio v-model="teacherForm.isAdd"
  286. label="renew">重新排课</el-radio>
  287. </el-form-item>
  288. <br>
  289. <el-form-item label="主教老师"
  290. prop='coreTeacher'>
  291. <el-select v-model="teacherForm.coreTeacher"
  292. clearable
  293. filterable>
  294. <el-option v-for="(item,index) in teacherList"
  295. :key="index"
  296. :label="item.realName"
  297. :value="item.id"></el-option>
  298. </el-select>
  299. </el-form-item>
  300. <el-form-item label="助教老师"
  301. prop="assistant">
  302. <el-select v-model="teacherForm.assistant"
  303. filterable
  304. clearable
  305. @change="setAssistant"
  306. multiple>
  307. <el-option v-for="(item,index) in cooperationList"
  308. :key="index"
  309. :label="item.realName"
  310. :value="item.id"></el-option>
  311. </el-select>
  312. </el-form-item>
  313. <el-form-item label="课程类型"
  314. prop="courseType">
  315. <el-select v-model="teacherForm.courseType"
  316. clearable
  317. filterable>
  318. <el-option v-for="(item,index) in courseTypeList"
  319. :key="index"
  320. :value="item.value"
  321. :label="item.label"></el-option>
  322. </el-select>
  323. </el-form-item>
  324. <br>
  325. <el-form-item label="排课次数"
  326. prop="courseNum">
  327. <el-input type='number'
  328. v-model="teacherForm.courseNum"></el-input>
  329. </el-form-item>
  330. <el-form-item label="排课起始时间"
  331. prop="courseTime">
  332. <el-date-picker v-model="teacherForm.courseTime"
  333. style="width:200px!important;"
  334. type="date"
  335. value-format="yyyy-MM-dd"
  336. placeholder="选择日期">
  337. </el-date-picker>
  338. <el-checkbox style='margin-left:10px;'
  339. v-model="teacherForm.checked">是否跳过节假日</el-checkbox>
  340. </el-form-item>
  341. </el-form>
  342. <div class="WeekWrap">
  343. <h3 style="margin-bottom:20px;">循环次数 <el-button type="text"
  344. style='margin-left:10px;'
  345. @click="addWeek">添加</el-button>
  346. </h3>
  347. <div class="countWrap"
  348. style="margin-bottom:10px;">
  349. <div class="countItem"
  350. style="margin-bottom:20px;"
  351. v-for="(item,index) in weekList"
  352. :key="index">
  353. <span>循环周期: </span>
  354. <el-select v-model="item.dayOfWeek"
  355. clearable
  356. filterable>
  357. <el-option v-for="(item,index) in weekDateList"
  358. :key='index'
  359. :label="item.label"
  360. :value="item.value"></el-option>
  361. </el-select>
  362. <span>开始时间</span>
  363. <el-time-select placeholder=""
  364. v-model="item.startClassTime"
  365. :picker-options="{
  366. start: '04:30',
  367. step: '00:05',
  368. end: '23:55'
  369. }">
  370. </el-time-select>
  371. <span>结束时间</span>
  372. <el-time-select placeholder=""
  373. v-model="item.endClassTime"
  374. :picker-options="{
  375. start: '04:30',
  376. step: '00:05',
  377. end: '23:55',
  378. minTime:item.startClassTime
  379. }">
  380. </el-time-select>
  381. <el-button type="danger"
  382. @click="removeWeek(item)"
  383. icon="el-icon-delete"
  384. circle></el-button>
  385. </div>
  386. </div>
  387. </div>
  388. <div slot="footer"
  389. class="dialog-footer">
  390. <!-- 1为临时班级 -->
  391. <el-button type="primary"
  392. v-if="isTemporary&&isNewClass"
  393. @click="submitTemporary(1)">确 定</el-button>
  394. <!-- 2为新增班级 -->
  395. <el-button type="primary"
  396. v-if="!isTemporary&&isNewClass"
  397. @click="submitTemporary(2)">确 定</el-button>
  398. <!-- 修改班级信息 -->
  399. <el-button type="primary"
  400. v-if="!isNewClass"
  401. @click="submitTemporary(3)">确 定</el-button>
  402. </div>
  403. </el-dialog>
  404. <!-- 新增合奏班 -->
  405. <el-dialog title="新增合奏班"
  406. width="700px"
  407. :visible.sync="MixVisible"
  408. :modal-append-to-body="false">
  409. <div class="studentMask">
  410. <div class="left">
  411. <div class="wrap">
  412. <!-- :disabled="!isNewClass" -->
  413. <el-input placeholder="请输入合奏班名称"
  414. v-model="className"></el-input>
  415. </div>
  416. <div class="chioseStudentList">
  417. <h4 style="padding-left:10px;">当前已选学生</h4>
  418. <div class="studentItem"
  419. v-for="(item,index) in activeListStudent"
  420. :key="index">
  421. {{ item.name }}
  422. <el-button type='text'
  423. @click="removeSiginforMix(item)">删除</el-button>
  424. </div>
  425. </div>
  426. </div>
  427. <div class="right">
  428. <!-- 列表开始 -->
  429. <div class="tableList">
  430. <el-table tooltip-effect="dark"
  431. style="width: 100%; margin-top:10px;"
  432. :data='singleList'
  433. ref='mixList'
  434. @selection-change="SelectionMix">
  435. <el-table-column type="selection"
  436. align='center'
  437. width="55">
  438. </el-table-column>
  439. <el-table-column prop="name"
  440. align='center'
  441. width="120"
  442. label="姓名">
  443. </el-table-column>
  444. <el-table-column prop="gender"
  445. align='center'
  446. width="100"
  447. label="性别">
  448. <template slot-scope="scope">
  449. <div>
  450. {{ scope.row.gender | sex }}
  451. </div>
  452. </template>
  453. </el-table-column>
  454. <el-table-column prop="subjectName"
  455. width="120"
  456. align='center'
  457. label="学员声部">
  458. </el-table-column>
  459. </el-table>
  460. </div>
  461. </div>
  462. </div>
  463. <div slot="footer"
  464. class="dialog-footer">
  465. <el-button @click="studentVisible = false">取 消</el-button>
  466. <!-- 班级学员修改 -->
  467. <el-button type="primary"
  468. v-if="!isNewClass"
  469. @click="addSomeStudent">确 定</el-button>
  470. <!-- 临时调整或者新建班级 -->
  471. <el-button type="primary"
  472. v-if="isNewClass"
  473. @click="setInfoMsg">确 定</el-button>
  474. </div>
  475. </el-dialog>
  476. <!-- 班级调整 -->
  477. <!-- <el-dialog title="班级调整"
  478. width="500px"
  479. :visible.sync="resetClassVisible"
  480. :modal-append-to-body="false">
  481. <el-form :model="resetClassForm"
  482. class="resetClassForm">
  483. <el-form-item label="主教老师">
  484. <el-select v-model="resetClassForm.coreTeacher">
  485. <el-option v-for="(item,index) in teacherList"
  486. :key="index"
  487. :label="item.realName"
  488. :value="item.id"></el-option>
  489. </el-select>
  490. </el-form-item>
  491. <el-form-item label="助教老师">
  492. <el-select v-model="resetClassForm.assistant"
  493. filterable
  494. @change="setAssistant"
  495. multiple>
  496. <el-option v-for="(item,index) in cooperationList"
  497. :key="index"
  498. :label="item.realName"
  499. :value="item.id"></el-option>
  500. </el-select>
  501. </el-form-item>
  502. <el-form-item label="开始时间">
  503. <el-time-select placeholder="开始时间"
  504. v-model="resetClassForm.startTime"
  505. :picker-options="{
  506. start: '06:30',
  507. step: '00:05',
  508. end: '23:30'
  509. }">
  510. </el-time-select>
  511. </el-form-item>
  512. <el-form-item label="结束时间">
  513. <el-time-select placeholder="结束时间"
  514. v-model="resetClassForm.endTime"
  515. :picker-options="{
  516. start: '06:30',
  517. step: '00:05',
  518. end: '23:30',
  519. minTime:resetClassForm.startTime
  520. }">
  521. </el-time-select>
  522. </el-form-item>
  523. </el-form>
  524. <div slot="footer"
  525. class="dialog-footer">
  526. <el-button @click="resetClassVisible = false">取 消</el-button>
  527. <el-button type="primary"
  528. @click="">确 定</el-button>
  529. </div>
  530. </el-dialog> -->
  531. <!-- 重新排课 -->
  532. <!-- <el-dialog title="重新排课"
  533. width="700px"
  534. :visible.sync="resetCourseVisible"
  535. :modal-append-to-body="false">
  536. <el-form :model="recourseForm"
  537. label-width="120px"
  538. label-position="right">
  539. <p style="border-bottom:1px solid #ccc; padding-bottom:10px; font-size:16px; margin-bottom:30px;">上课时间设置</p>
  540. <el-form-item label="课程类型">
  541. <el-select v-model="recourseForm.courseType">
  542. <el-option v-for="(item,index) in courseTypeList"
  543. :key="index"
  544. :value="item.value"
  545. :label="item.label"></el-option>
  546. </el-select>
  547. </el-form-item>
  548. <el-form-item label="排课起始时间">
  549. <el-date-picker v-model="recourseForm.courseTime"
  550. style="width:200px;"
  551. type="date"
  552. value-format="yyyy-MM-dd"
  553. placeholder="选择日期">
  554. </el-date-picker>
  555. <el-checkbox style='margin-left:10px;'
  556. v-model="recourseForm.checked">是否跳过节假日</el-checkbox>
  557. </el-form-item>
  558. </el-form>
  559. <div class="WeekWrap">
  560. <p style="border-bottom:1px solid #ccc; padding-bottom:10px; font-size:16px; margin-bottom:30px;">
  561. 循环次数 <el-button type="text"
  562. style='margin-left:10px;'
  563. @click="addWeek">添加</el-button>
  564. </p>
  565. <div class="countWrap"
  566. style="margin-bottom:10px;">
  567. <div class="countItem"
  568. style="margin-bottom:20px;"
  569. v-for="(item,index) in weekList"
  570. :key="index">
  571. <span>循环周期: </span>
  572. <el-select v-model="item.dayOfWeek">
  573. <el-option v-for="(item,index) in weekDateList"
  574. :key='index'
  575. :label="item.label"
  576. :value="item.value"></el-option>
  577. </el-select>
  578. <span>开始时间</span>
  579. <el-time-select placeholder=""
  580. v-model="item.startClassTime"
  581. :picker-options="{
  582. start: '08:30',
  583. step: '00:05',
  584. end: '23:55'
  585. }">
  586. </el-time-select>
  587. <span>结束时间</span>
  588. <el-time-select placeholder=""
  589. v-model="item.endClassTime"
  590. :picker-options="{
  591. start: '08:30',
  592. step: '00:05',
  593. end: '23:55',
  594. minTime:item.startClassTime
  595. }">
  596. </el-time-select>
  597. <el-button type="danger"
  598. @click="removeWeek(item)"
  599. icon="el-icon-delete"
  600. circle></el-button>
  601. </div>
  602. </div>
  603. </div>
  604. <div slot="footer"
  605. class="dialog-footer">
  606. <el-button @click="resetCourseVisible = false">取 消</el-button>
  607. <el-button type="primary"
  608. @click="">确 定</el-button>
  609. </div>
  610. </el-dialog> -->
  611. </div>
  612. </template>
  613. <script>
  614. import { getAllClass, getAllSignClassandTeacher, getAllSignClass, removeSingleClass, getNoClassStudentAll, findSound, teamSoundStudent, findMusicGroupClassTeacher, revisionClassGroup, revisionAddClassGroup, getEmployeeOrgan, getTeacher, findNoClassSingle, getMusicGroupStuNoClassType, classGroupUpdate, getTeamBaseInfo } from '@/api/buildTeam'
  615. import { getClassAllStudent, removeStudents, addStudents } from '@/api/studentManager'
  616. import { queryEmployByOrganId } from '@/api/systemManage'
  617. import axios from 'axios'
  618. import qs from 'qs'
  619. export default {
  620. data () {
  621. return {
  622. teamid: '',
  623. topForm: {
  624. classType: ''
  625. },
  626. tableList: [],
  627. maxClassList: [],
  628. activeSingleList: [],
  629. resetCourseVisible: false, // 重新排课弹窗
  630. resetClassVisible: false, // 班级调整弹窗
  631. studentVisible: false,
  632. MixVisible: false,// 新增合奏班弹窗
  633. activeListStudent: [], // 当前选中的学生列表
  634. activeChioseSound: '', //选择的声部
  635. chioseSoundList: [], //当前的所有声部
  636. studentList: [], //列表里的学生集合
  637. activeMixClass: '', // 选中的合奏班
  638. chioseStudent: [],// 勾选的学生信息
  639. isNewClass: false, // 是否为新建班级
  640. isSearch: false, // 是否需要搜索
  641. isTemporary: false, // 是否为临时班级
  642. className: '', // 班级名称
  643. activeClass: '', // 当前操作的班级
  644. soundList: [],
  645. infoVisible: false, // 判断是否需要显示老师设置
  646. teacherForm: {
  647. isAdd: null,
  648. coreTeacher: '',
  649. assistant: [],
  650. courseType: '',
  651. courseTime: '',
  652. checked: false,
  653. courseNum: '',
  654. mixClassGroupId: ''
  655. },
  656. teacherRules: {
  657. isAdd: [{ required: true, message: '请选择调整类型' }],
  658. coreTeacher: [{ required: true, message: '请选择主教老师' }],
  659. courseType: [{ required: true, message: '请选择上课类型' }],
  660. courseTime: [{ required: true, message: '请选择开始时间' }],
  661. courseNum: [{ required: true, message: '请输入排课次数' }],
  662. mixClassGroupId: [{ required: true, message: '请选择合奏班' }]
  663. },
  664. weekList: [{
  665. week: '',
  666. startTime: '',
  667. endTime: '',
  668. id: new Date()
  669. }],
  670. teacherList: [], // 存储的老师列表
  671. courseTypeList: [
  672. ],
  673. weekDateList: [
  674. { value: '1', label: '星期一' },
  675. { value: '2', label: '星期二' },
  676. { value: '3', label: '星期三' },
  677. { value: '4', label: '星期四' },
  678. { value: '5', label: '星期五' },
  679. { value: '6', label: '星期六' },
  680. { value: '7', label: '星期日' },
  681. ],
  682. // 班级类型
  683. classTypeList: [
  684. { value: 'NORMAL', label: '单技班' },
  685. { value: 'MIX', label: '合奏班' },
  686. { value: 'HIGH', label: '基础技能班' },
  687. { value: 'SNAP', label: '临时班' },
  688. ],
  689. cooperationList: [],
  690. singleList: [],
  691. activeSingleLists: [],
  692. activeType: '',
  693. resetClassForm: { // 班级调整form对象
  694. startTime: '',
  695. endTime: '',
  696. assistant: [],
  697. coreTeacher: ''
  698. },
  699. recourseForm: {
  700. courseType: '',
  701. checked: false,
  702. courseTime: '',
  703. courseNum: ''
  704. },
  705. organId: ''
  706. }
  707. },
  708. created () {
  709. this.teamid = this.$route.query.id;
  710. // 根据乐团id获取乐团所属分部
  711. getTeamBaseInfo({ musicGroupId: this.teamid }).then(res => {
  712. if (res.code == 200) {
  713. this.organId = res.data.musicGroup.organId
  714. getTeacher({ organId: this.organId }).then(res => {
  715. if (res.code == 200) {
  716. this.cooperationList = res.data;
  717. this.teacherList = res.data;
  718. }
  719. })
  720. // queryEmployByOrganId({ organId: this.organId, rows: 10000 }).then(res => {
  721. // if (res.code == 200) {
  722. // }
  723. // })
  724. }
  725. })
  726. },
  727. mounted () {
  728. sessionStorage.setItem('resetCode', 3)
  729. // // 获取乐团下未分班的单技班
  730. // findNoClassSingle({ musicGroupId: this.teamid }).then(res => {
  731. // if (res.code == 200) {
  732. // this.singleList = res.data;
  733. // }
  734. // })
  735. // getMusicGroupStuNoClassType
  736. // 获取合奏班下
  737. // 1.获取乐团下所有的合奏班
  738. // 2.根据合奏班获取所有的单技班
  739. // 3.根据乐团id 查询 此乐团所有的合奏班
  740. // 4.获取当年的所有节假日
  741. getAllClass({ musicGroupId: this.teamid }).then(res => {
  742. if (res.code == 200) {
  743. this.maxClassList = res.data;
  744. }
  745. })
  746. // let year = new Date().getFullYear();
  747. // axios.post('/jiari/', qs.stringify({ d: year })).then(res => {
  748. // this.holidayList = Object.keys(res.data[year])
  749. // })
  750. // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
  751. // })
  752. // 获取默认乐团内的所有班
  753. this.changeMixClass()
  754. // 根据乐团id获取乐团的所有声部
  755. findSound({ musicGroupId: this.teamid }).then(res => {
  756. if (res.code == 200) {
  757. this.soundList = res.data
  758. }
  759. })
  760. // 获取分部所有老师
  761. // findMusicGroupClassTeacher({
  762. // musicGroupId: this.teamid
  763. // }).then(res => {
  764. // if (res.code == 200) {
  765. // this.teacherList = res.data
  766. // }
  767. // })
  768. // 获取分部所有老师
  769. // 助教是从员工表里选
  770. },
  771. methods: {
  772. recourse (row) {
  773. this.weekList = [{
  774. week: '',
  775. startTime: '',
  776. endTime: '',
  777. id: new Date()
  778. }],
  779. this.resetCourseVisible = true;
  780. },
  781. addMix () {
  782. this.MixVisible = true;
  783. },
  784. setAssistant (val) {
  785. for (let i in val) {
  786. if (val[i] == this.teacherForm.coreTeacher) {
  787. val.splice(i, 1);
  788. }
  789. }
  790. },
  791. changeMixClass (val) {
  792. // 根据合奏班id获取合奏班下的所有单技班
  793. this.getList(val);
  794. this.activeMixClass = val;
  795. },
  796. getList (val) {
  797. getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(res => {
  798. if (res.code == 200) {
  799. this.activeSingleList = res.data;
  800. // this.topForm.count = this.activeSingleList.length
  801. }
  802. })
  803. },
  804. // 临时调整
  805. temporary () {
  806. this.activeClass = '';
  807. this.activeListStudent = [];
  808. this.studentList = [];
  809. this.isNewClass = true;
  810. this.studentVisible = true;
  811. this.isSearch = true;
  812. this.className = '';
  813. this.isTemporary = true;
  814. this.setType('SNAP');
  815. this.getNoClassStudent('SNAP')
  816. },
  817. setType (type) {
  818. switch (type) {
  819. case 'NORMAL': {
  820. this.courseTypeList = [
  821. { value: 'SINGLE', label: '单技课' },
  822. { value: 'TRAINING_SINGLE', label: '集训单技课' },
  823. { value: 'COMPREHENSIVE', label: '综合课' },
  824. { value: 'CLASSROOM', label: '课堂课' },
  825. ]
  826. break;
  827. }
  828. case 'MIX': {
  829. this.courseTypeList = [
  830. { value: 'MIX', label: '合奏课' },
  831. { value: 'TRAINING_MIX', label: '集训合奏课' },
  832. { value: 'COMPREHENSIVE', label: '综合课' },
  833. { value: 'CLASSROOM', label: '课堂课' },
  834. ]
  835. break;
  836. }
  837. case 'HIGH': {
  838. this.courseTypeList = [
  839. { value: 'SINGLE', label: '单技课' },
  840. { value: 'TRAINING_SINGLE', label: '集训单技课' },
  841. { value: 'HIGH', label: '基础技能课' },
  842. { value: 'COMPREHENSIVE', label: '综合课' },
  843. { value: 'CLASSROOM', label: '课堂课' },
  844. ]
  845. break;
  846. }
  847. case 'SNAP': {
  848. this.courseTypeList = [
  849. { value: 'SINGLE', label: '单技课' },
  850. { value: 'MIX', label: '合奏课' },
  851. { value: 'TRAINING_SINGLE', label: '集训单技课' },
  852. { value: 'TRAINING_MIX', label: '集训合奏课' },
  853. { value: 'HIGH', label: '基础技能课' },
  854. { value: 'COMPREHENSIVE', label: '综合课' },
  855. { value: 'CLASSROOM', label: '课堂课' },
  856. ]
  857. }
  858. }
  859. },
  860. // 新增班级
  861. addNewClass (type) {
  862. /**
  863. * { value: 'NORMAL', label: '单技班' },
  864. { value: 'MIX', label: '合奏班' },
  865. { value: 'HIGH', label: '基础技能班' },
  866. { value: 'SNAP', label: '临时班' },
  867. */
  868. this.setType(type);
  869. this.activeType = type;
  870. this.activeClass = '';
  871. this.activeListStudent = [];
  872. this.studentList = [];
  873. this.isNewClass = true;
  874. this.studentVisible = true;
  875. this.isSearch = false;
  876. this.className = '';
  877. this.isTemporary = false;
  878. this.getNoClassStudent(type)
  879. },
  880. searchStudent () {
  881. // 搜索学生
  882. // 根据声部id 乐团id搜索学生
  883. teamSoundStudent({ musicGroupId: this.teamid, actualSubjectId: this.activeChioseSound }).then(res => {
  884. if (res.code == 200) {
  885. this.studentList = res.data;
  886. }
  887. })
  888. },
  889. // 选择学生的方法修改
  890. SelectionStudent (val) {
  891. this.chioseStudent = val;
  892. },
  893. // 新增选中的学生
  894. NewselectionStudent (val) {
  895. this.chioseStudent = val;
  896. // 这里新增的添加到选中的学生列表 根据学生id去重
  897. if (this.chioseStudent.length > 0) {
  898. this.chioseStudent = this.chioseStudent.concat(val);
  899. } else {
  900. this.chioseStudent = val;
  901. }
  902. // 联动版
  903. // this.activeListStudent = this.objArrayRemoval(this.chioseStudent, 'userId')
  904. // 非联动多选版
  905. this.activeListStudent = this.activeListStudent.concat(this.chioseStudent);
  906. // // 去重
  907. this.activeListStudent = this.objArrayRemoval(this.activeListStudent, 'userId');
  908. // 将其填入选中的学生
  909. },
  910. // 删除班级
  911. removeClass (scope) {
  912. removeSingleClass({ classGroupId: scope.row.id }).then(res => {
  913. if (res.code == 200) {
  914. this.$message.success('删除成功')
  915. scope._self.$refs[scope.$index].doClose();
  916. // 重新请求列表
  917. this.getList(this.activeMixClass);
  918. } else {
  919. this.$message.error(res.msg)
  920. scope._self.$refs[scope.$index].doClose();
  921. }
  922. }).catch(res => {
  923. scope._self.$refs[scope.$index].doClose();
  924. })
  925. },
  926. // 修改班级
  927. resetClass (row) {
  928. this.isNewClass = false;
  929. this.className = row.name;
  930. this.studentVisible = true;
  931. this.activeClass = row.id
  932. this.isSearch = false;
  933. this.activeType = row.type;
  934. // 根据单机班id 查询单技班内的所有学生
  935. getClassAllStudent({ classGroupId: row.id }).then(res => {
  936. if (res.code == 200) {
  937. this.activeListStudent = res.data.map(item => {
  938. item.isVisible = false;
  939. return item;
  940. });
  941. }
  942. })
  943. this.getNoClassStudent(row.type)
  944. },
  945. // 班级调整
  946. classAdjustment (row) {
  947. this.activeType = row.type;
  948. this.activeClass = row.id;
  949. // this.activeListStudent = row.subjectIdList.split(',')
  950. this.setType(row.type)
  951. // activeListStudent
  952. this.isNewClass = false;
  953. this.teacherForm.assistant = [];
  954. for (let i in row.classGroupTeacherMapperList) {
  955. if (row.classGroupTeacherMapperList[i].teacherRole == 'BISHOP') {
  956. this.teacherForm.coreTeacher = row.classGroupTeacherMapperList[i].userId;
  957. }
  958. if (row.classGroupTeacherMapperList[i].teacherRole == 'TEACHING') {
  959. this.teacherForm.assistant.push(row.classGroupTeacherMapperList[i].userId)
  960. }
  961. }
  962. this.infoVisible = true;
  963. },
  964. getNoClassStudent (type) {
  965. // 获取乐团内所有未分班的学生
  966. // if (type && type == 'SNAP') {
  967. // teamSoundStudent({ musicGroupId: this.teamid }).then(res => {
  968. // if (res.code == 200) {
  969. // this.studentList = res.data
  970. // }
  971. // })
  972. // } else {
  973. // getMusicGroupStuNoClassType({ musicGroupId: this.teamid, type }).then(res => {
  974. // if (res.code == 200) {
  975. // this.studentList = res.data
  976. // }
  977. // })
  978. // }
  979. // res.data - activeListStudent
  980. getMusicGroupStuNoClassType({ musicGroupId: this.teamid, type }).then(res => {
  981. if (res.code == 200) {
  982. // this.studentList = res.data.concat(this.activeListStudent).filter(item=>{
  983. // return res.data
  984. // });
  985. if (this.activeType == 'SNAP') {
  986. let idarr1 = [];
  987. let idarr2 = [];
  988. let arr3 = res.data.concat(this.activeListStudent);
  989. for (let i in res.data) {
  990. idarr1.push(res.data[i].userId);
  991. }
  992. for (let j in this.activeListStudent) {
  993. idarr2.push(this.activeListStudent[j].userId);
  994. }
  995. this.studentList = arr3.filter(item => {
  996. return idarr1.indexOf(item.userId) === -1 || (idarr2.indexOf(item.userId) === -1)
  997. })
  998. } else {
  999. this.studentList = res.data;
  1000. }
  1001. }
  1002. })
  1003. },
  1004. // 删除学生 调整
  1005. removeStudent (item) {
  1006. // removeStudents({ classGroupId:}).then(res => {
  1007. removeStudents({ classGroupId: this.activeClass, userId: item.userId }).then(res => {
  1008. if (res.code == 200) {
  1009. this.$message.success('删除成功');
  1010. item.isVisible = false;
  1011. // 这里刷新 this.studentList this.activeListStudent
  1012. this.getList(this.activeMixClass);
  1013. getClassAllStudent({ classGroupId: this.activeClass }).then(res => {
  1014. if (res.code == 200) {
  1015. this.activeListStudent = res.data;
  1016. }
  1017. })
  1018. this.getNoClassStudent(this.activeType);
  1019. // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
  1020. // if (res.code == 200) {
  1021. // this.$message.success('删除成功');
  1022. // this.studentList = res.data.map(item => {
  1023. // item.isVisible = false;
  1024. // return item;
  1025. // });
  1026. // }
  1027. // })
  1028. }
  1029. })
  1030. },
  1031. // 批量添加学生
  1032. addSomeStudent () {
  1033. // 获取勾选的学生
  1034. let arr = this.chioseStudent.map(item => {
  1035. return item.userId;
  1036. });
  1037. if (arr.length <= 0) {
  1038. this.$message.error('至少添加一名学员')
  1039. return;
  1040. }
  1041. addStudents({ classGroupId: this.activeClass, userIdsStr: arr.join(',') }).then(res => {
  1042. if (res.code == 200) {
  1043. this.studentVisible = false;
  1044. this.$message.success('添加成功')
  1045. this.getList()
  1046. }
  1047. })
  1048. },
  1049. SelectionMix (val) {
  1050. this.activeSingleLists = val;
  1051. },
  1052. removeSiginforMix (item) {
  1053. for (let k in this.activeSingleLists) {
  1054. if (this.activeSingleLists[k].id == item.id) {
  1055. this.$refs['mixList'].toggleRowSelection(item, false)
  1056. }
  1057. }
  1058. },
  1059. temporaryRemoveStudent (item) {
  1060. // 列表中删除
  1061. for (let i in this.activeListStudent) {
  1062. if (this.activeListStudent[i].userId == item.userId) {
  1063. this.activeListStudent.splice(i, 1);
  1064. }
  1065. }
  1066. // 查询列表中的项 取消勾选 temporaryStudentList toggleRowSelection
  1067. // 循环列表 找到相应的行取消勾选
  1068. for (let k in this.studentList) {
  1069. if (this.studentList[k].userId == item.userId) {
  1070. this.$refs['temporaryStudentList'].toggleRowSelection(item, false)
  1071. }
  1072. }
  1073. // this.$refs['temporaryStudentList'].toggleRowSelection(row, selected);
  1074. },
  1075. // 对象数组去重
  1076. objArrayRemoval (arr, attr) {
  1077. let obj = {};
  1078. let result = [];
  1079. for (let x in arr) {
  1080. if (!obj[arr[x][attr]]) {
  1081. result.push(arr[x]);
  1082. obj[arr[x][attr]] = true;
  1083. }
  1084. }
  1085. return result;
  1086. },
  1087. setInfoMsg () {
  1088. // 判断班级名称是否输入
  1089. if (!this.className) {
  1090. this.$message.error('请输入班级名称')
  1091. return
  1092. }
  1093. // 判断有没有勾选学生
  1094. if (this.activeListStudent.length <= 0) {
  1095. // 没有勾学生
  1096. this.$message.error('班级里至少要有一名学生')
  1097. return
  1098. }
  1099. this.infoVisible = true;
  1100. },
  1101. addWeek () {
  1102. // 添加循环周期
  1103. this.weekList.push({
  1104. dayOfWeek: '',
  1105. startClassTime: '',
  1106. endClassTime: '',
  1107. id: new Date()
  1108. })
  1109. },
  1110. // 删除循环周
  1111. removeWeek (item) {
  1112. for (let i in this.weekList) {
  1113. if (this.weekList[i].id == item.id) {
  1114. this.weekList.splice(i, 1)
  1115. }
  1116. }
  1117. },
  1118. // 提交临时班的信息
  1119. submitTemporary (type) {
  1120. // 参数是一样 type为1 新增临时班
  1121. // type为2 新增单技班
  1122. // type为3 修改班级信息
  1123. if (type == 1) {
  1124. this.isTemporary = true;
  1125. } else {
  1126. this.isTemporary = false;
  1127. }
  1128. this.$refs['teacherForm'].validate(item => {
  1129. if (item) {
  1130. let week = this.weekList;
  1131. if (!week[0] || !week[0].startClassTime || !week[0].endClassTime || !week[0].dayOfWeek) {
  1132. this.$message.error('至少排一节课');
  1133. return
  1134. }
  1135. // 这里代表排课成功 发请求 新增临时班
  1136. let classGroupName = this.className;
  1137. let classGroupTeacherMapperList = [{ userId: this.teacherForm.coreTeacher, teacherRole: 'BISHOP' }]
  1138. for (let i in this.teacherForm.assistant) {
  1139. classGroupTeacherMapperList.push({ userId: this.teacherForm.assistant[i], teacherRole: 'TEACHING' })
  1140. }
  1141. // let mixClassGroupId = this.teacherForm.mixClassGroupId;
  1142. let musicGroupId = this.teamid;
  1143. let startDate = this.teacherForm.courseTime;
  1144. let courseType = this.teacherForm.courseType;
  1145. let courseTimes = this.teacherForm.courseNum
  1146. let students = this.activeListStudent.map(item => {
  1147. return item.userId;
  1148. })
  1149. let holiday = this.teacherForm.checked;
  1150. let courseList = [];
  1151. for (let i in this.weekList) {
  1152. courseList.push(this.weekList[i])
  1153. }
  1154. if (courseList.length <= 0) {
  1155. this.$message.error('新增班级至少排一节课')
  1156. return
  1157. }
  1158. // mixClassGroupId,
  1159. let mineType = this.activeType;
  1160. let obj = {
  1161. classGroupName,
  1162. classGroupTeacherMapperList,
  1163. musicGroupId,
  1164. startDate,
  1165. courseType,
  1166. students,
  1167. holiday,
  1168. courseTimes,
  1169. courseTimeDtoList: courseList,
  1170. type: mineType,
  1171. courseAddType: this.teacherForm.isAdd
  1172. }
  1173. if (type == 1) {
  1174. // 新增临时班级
  1175. revisionClassGroup(obj).then(res => {
  1176. if (res.code == 200) {
  1177. // 提示修改成功
  1178. this.$message.success('修改成功')
  1179. this.infoVisible = false;
  1180. this.studentVisible = false;
  1181. this.getList();
  1182. }
  1183. })
  1184. } else if (type == 2) {
  1185. // 新增单技班
  1186. revisionAddClassGroup(obj).then(res => {
  1187. if (res.code == 200) {
  1188. // 修改成功
  1189. this.$message.success('修改成功');
  1190. this.infoVisible = false;
  1191. this.studentVisible = false;
  1192. this.getList();
  1193. }
  1194. })
  1195. } else if (type == 3) {
  1196. // activeClass
  1197. obj.classGroupId = this.activeClass;
  1198. classGroupUpdate(obj).then(res => {
  1199. if (res.code == 200) {
  1200. this.$message.success('修改成功');
  1201. this.infoVisible = false;
  1202. this.getList();
  1203. }
  1204. })
  1205. }
  1206. } else {
  1207. this.$message.error('请填写必要信息')
  1208. return;
  1209. }
  1210. })
  1211. },
  1212. },
  1213. watch: {
  1214. infoVisible (val) {
  1215. if (!val) {
  1216. this.$refs['teacherForm'].resetFields();
  1217. this.weekList = [];
  1218. }
  1219. }
  1220. }
  1221. }
  1222. </script>
  1223. <style lang="scss" scoped>
  1224. .floor {
  1225. padding-right: 20px;
  1226. display: flex;
  1227. flex-direction: row;
  1228. justify-content: flex-end;
  1229. width: 100%;
  1230. height: 48px;
  1231. line-height: 48px;
  1232. background: rgba(237, 238, 240, 1);
  1233. font-size: 14px;
  1234. color: #444;
  1235. align-items: center;
  1236. position: relative;
  1237. z-index: 1;
  1238. .remove {
  1239. width: 98px;
  1240. height: 32px;
  1241. background: rgba(248, 80, 67, 1);
  1242. border-radius: 3px;
  1243. color: #fff;
  1244. line-height: 32px;
  1245. text-align: center;
  1246. margin-left: 164px;
  1247. cursor: pointer;
  1248. }
  1249. .add {
  1250. width: 98px;
  1251. height: 32px;
  1252. background: rgba(20, 146, 138, 1);
  1253. border-radius: 3px;
  1254. color: #fff;
  1255. line-height: 32px;
  1256. text-align: center;
  1257. margin-left: 20px;
  1258. cursor: pointer;
  1259. }
  1260. }
  1261. .studentMask {
  1262. display: flex;
  1263. flex-direction: row;
  1264. justify-content: flex-start;
  1265. .left {
  1266. width: 200px;
  1267. margin-right: 20px;
  1268. .wrap {
  1269. margin-bottom: 20px;
  1270. }
  1271. h4 {
  1272. font-size: 16px;
  1273. color: #444;
  1274. line-height: 38px;
  1275. }
  1276. .chioseStudentList {
  1277. height: 500px;
  1278. overflow-y: auto;
  1279. border: 1px solid #ccc;
  1280. .studentItem {
  1281. padding-left: 10px;
  1282. line-height: 25px;
  1283. }
  1284. }
  1285. }
  1286. .right {
  1287. width: calc(100% - 200px);
  1288. .tableList {
  1289. max-height: 500px;
  1290. overflow-y: auto;
  1291. }
  1292. }
  1293. }
  1294. .resetClassForm {
  1295. /deep/.el-date-editor.el-input,
  1296. /deep/.el-date-editor.el-input__inner {
  1297. width: 180px !important;
  1298. }
  1299. }
  1300. /deep/.el-date-editor.el-input,
  1301. /deep/.el-date-editor.el-input__inner {
  1302. width: 100px !important;
  1303. }
  1304. </style>