resetClass.vue 41 KB

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