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. <!-- 学员选择 -->
  119. <el-dialog title="学员选择"
  120. width="700px"
  121. :visible.sync="studentVisible"
  122. :modal-append-to-body="false">
  123. <div class="studentMask">
  124. <div class="left">
  125. <div class="wrap">
  126. <el-input placeholder="请输入班级名称"
  127. :disabled="!isNewClass"
  128. v-model="className"></el-input>
  129. </div>
  130. <div class="chioseStudentList">
  131. <h4 style="padding-left:10px;">当前已选学员</h4>
  132. <div class="studentItem"
  133. v-for="(item,index) in activeListStudent"
  134. :key="index">
  135. {{ item.name }}
  136. <el-popover v-if="!isNewClass"
  137. placement="top"
  138. v-model="item.isVisible"
  139. width="160">
  140. <p>确定删除?</p>
  141. <div style="text-align: right; margin: 0">
  142. <el-button size="mini"
  143. type="text"
  144. @click="item.isVisible = false">取消</el-button>
  145. <el-button type="primary"
  146. size="mini"
  147. @click="removeStudent(item)">确定</el-button>
  148. </div>
  149. <el-button type="text"
  150. slot="reference">删除</el-button>
  151. </el-popover>
  152. <el-button v-if="isNewClass"
  153. type='text'
  154. @click="temporaryRemoveStudent(item)">删除</el-button>
  155. </div>
  156. </div>
  157. </div>
  158. <div class="right">
  159. <!-- multiple
  160. collapse-tags -->
  161. <el-select v-if="isSearch"
  162. v-model="activeChioseSound"
  163. style="width:180px"
  164. clearable
  165. placeholder="声部选择">
  166. <el-option v-for='(item,index) in soundList'
  167. :key='index'
  168. :label="item.name"
  169. :value="item.id"></el-option>
  170. </el-select>
  171. <el-button v-if="isSearch"
  172. type="danger"
  173. style="margin-left:20px;"
  174. @click="searchStudent">搜索</el-button>
  175. <!-- 列表开始 -->
  176. <div class="tableList">
  177. <el-table tooltip-effect="dark"
  178. v-if="!isNewClass"
  179. style="width: 100%; margin-top:10px;"
  180. :data='studentList'
  181. ref='studentList'
  182. @selection-change="SelectionStudent">
  183. <el-table-column type="selection"
  184. align='center'
  185. width="55">
  186. </el-table-column>
  187. <el-table-column prop="name"
  188. align='center'
  189. width="120"
  190. label="姓名">
  191. </el-table-column>
  192. <el-table-column prop="gender"
  193. align='center'
  194. width="100"
  195. label="性别">
  196. <template slot-scope="scope">
  197. <div>
  198. {{ scope.row.gender | sex }}
  199. </div>
  200. </template>
  201. </el-table-column>
  202. <el-table-column prop="subjectName"
  203. width="100"
  204. align='center'
  205. label="学员声部">
  206. </el-table-column>
  207. </el-table>
  208. <!-- 临时调整table -->
  209. <el-table tooltip-effect="dark"
  210. v-if="isNewClass"
  211. style="width: 100%; margin-top:10px;"
  212. :data='studentList'
  213. ref='temporaryStudentList'
  214. @selection-change="NewselectionStudent">
  215. <el-table-column type="selection"
  216. align='center'
  217. width="55">
  218. </el-table-column>
  219. <el-table-column prop="name"
  220. align='center'
  221. width="120"
  222. label="姓名">
  223. </el-table-column>
  224. <el-table-column prop="gender"
  225. align='center'
  226. width="100"
  227. label="性别">
  228. <template slot-scope="scope">
  229. <div>
  230. {{ scope.row.gender | sex }}
  231. </div>
  232. </template>
  233. </el-table-column>
  234. <el-table-column prop="subjectName"
  235. width="100"
  236. align='center'
  237. label="学员声部">
  238. </el-table-column>
  239. </el-table>
  240. </div>
  241. </div>
  242. </div>
  243. <div slot="footer"
  244. class="dialog-footer">
  245. <el-button @click="studentVisible = false">取 消</el-button>
  246. <!-- 班级学员修改 -->
  247. <el-button type="primary"
  248. v-if="!isNewClass"
  249. @click="addSomeStudent">确 定</el-button>
  250. <!-- 临时调整或者新建班级 -->
  251. <el-button type="primary"
  252. v-if="isNewClass"
  253. @click="setInfoMsg">确 定</el-button>
  254. </div>
  255. </el-dialog>
  256. <!-- 老师以及课程设置 -->
  257. <el-dialog title="班级设置"
  258. width="700px"
  259. :visible.sync="infoVisible"
  260. :modal-append-to-body="false">
  261. <el-form :inline="true"
  262. :model='teacherForm'
  263. ref='teacherForm'
  264. :rules="teacherRules"
  265. label-position='right'
  266. label-width="100px;">
  267. <!-- <el-form-item label="合奏班"
  268. v-if='!isTemporary&&activeType=="NORMAL"'
  269. prop="mixClassGroupId">
  270. <el-select v-model="teacherForm.mixClassGroupId">
  271. <el-option v-for="(item,index) in maxClassList"
  272. :label="item.name"
  273. :key="index"
  274. :value="item.id"></el-option>
  275. </el-select>
  276. </el-form-item> -->
  277. <el-form-item label="主教老师"
  278. prop='coreTeacher'>
  279. <el-select v-model="teacherForm.coreTeacher"
  280. filterable>
  281. <el-option v-for="(item,index) in teacherList"
  282. :key="index"
  283. :label="item.realName"
  284. :value="item.id"></el-option>
  285. </el-select>
  286. </el-form-item>
  287. <el-form-item label="助教老师"
  288. prop="assistant">
  289. <el-select v-model="teacherForm.assistant"
  290. filterable
  291. @change="setAssistant"
  292. multiple>
  293. <el-option v-for="(item,index) in cooperationList"
  294. :key="index"
  295. :label="item.realName"
  296. :value="item.id"></el-option>
  297. </el-select>
  298. </el-form-item>
  299. <el-form-item label="课程类型"
  300. prop="courseType">
  301. <el-select v-model="teacherForm.courseType">
  302. <el-option v-for="(item,index) in courseTypeList"
  303. :key="index"
  304. :value="item.value"
  305. :label="item.label"></el-option>
  306. </el-select>
  307. </el-form-item>
  308. <el-form-item label="排课次数"
  309. prop="courseNum">
  310. <el-input type='number'
  311. v-model="teacherForm.courseNum"></el-input>
  312. </el-form-item>
  313. <el-form-item label="排课起始时间"
  314. prop="courseTime">
  315. <el-date-picker v-model="teacherForm.courseTime"
  316. style="width:200px;"
  317. type="date"
  318. value-format="yyyy-MM-dd"
  319. placeholder="选择日期">
  320. </el-date-picker>
  321. <el-checkbox style='margin-left:10px;'
  322. v-model="teacherForm.checked">是否跳过节假日</el-checkbox>
  323. </el-form-item>
  324. </el-form>
  325. <div class="WeekWrap">
  326. <h3 style="margin-bottom:20px;">循环次数 <el-button type="text"
  327. style='margin-left:10px;'
  328. @click="addWeek">添加</el-button>
  329. </h3>
  330. <div class="countWrap"
  331. style="margin-bottom:10px;">
  332. <div class="countItem"
  333. style="margin-bottom:20px;"
  334. v-for="(item,index) in weekList"
  335. :key="index">
  336. <span>循环周期: </span>
  337. <el-select v-model="item.dayOfWeek">
  338. <el-option v-for="(item,index) in weekDateList"
  339. :key='index'
  340. :label="item.label"
  341. :value="item.value"></el-option>
  342. </el-select>
  343. <span>开始时间</span>
  344. <el-time-select placeholder=""
  345. v-model="item.startClassTime"
  346. :picker-options="{
  347. start: '08:30',
  348. step: '00:05',
  349. end: '23:55'
  350. }">
  351. </el-time-select>
  352. <span>结束时间</span>
  353. <el-time-select placeholder=""
  354. v-model="item.endClassTime"
  355. :picker-options="{
  356. start: '08:30',
  357. step: '00:05',
  358. end: '23:55',
  359. minTime:item.startClassTime
  360. }">
  361. </el-time-select>
  362. <el-button type="danger"
  363. @click="removeWeek(item)"
  364. icon="el-icon-delete"
  365. circle></el-button>
  366. </div>
  367. </div>
  368. </div>
  369. <div slot="footer"
  370. class="dialog-footer">
  371. <!-- 1为临时班级 -->
  372. <el-button type="primary"
  373. v-if="isTemporary"
  374. @click="submitTemporary(1)">确 定</el-button>
  375. <!-- 2为新增班级 -->
  376. <el-button type="primary"
  377. v-if="!isTemporary"
  378. @click="submitTemporary(2)">确 定</el-button>
  379. </div>
  380. </el-dialog>
  381. <!-- 新增合奏班 -->
  382. <el-dialog title="新增合奏班"
  383. width="700px"
  384. :visible.sync="MixVisible"
  385. :modal-append-to-body="false">
  386. <div class="studentMask">
  387. <div class="left">
  388. <div class="wrap">
  389. <!-- :disabled="!isNewClass" -->
  390. <el-input placeholder="请输入合奏班名称"
  391. v-model="className"></el-input>
  392. </div>
  393. <div class="chioseStudentList">
  394. <h4 style="padding-left:10px;">当前已选学生</h4>
  395. <div class="studentItem"
  396. v-for="(item,index) in activeListStudent"
  397. :key="index">
  398. {{ item.name }}
  399. <el-button type='text'
  400. @click="removeSiginforMix(item)">删除</el-button>
  401. </div>
  402. </div>
  403. </div>
  404. <div class="right">
  405. <!-- 列表开始 -->
  406. <div class="tableList">
  407. <el-table tooltip-effect="dark"
  408. style="width: 100%; margin-top:10px;"
  409. :data='singleList'
  410. ref='mixList'
  411. @selection-change="SelectionMix">
  412. <el-table-column type="selection"
  413. align='center'
  414. width="55">
  415. </el-table-column>
  416. <el-table-column prop="name"
  417. align='center'
  418. width="120"
  419. label="姓名">
  420. </el-table-column>
  421. <el-table-column prop="gender"
  422. align='center'
  423. width="100"
  424. label="性别">
  425. <template slot-scope="scope">
  426. <div>
  427. {{ scope.row.gender | sex }}
  428. </div>
  429. </template>
  430. </el-table-column>
  431. <el-table-column prop="subjectName"
  432. width="120"
  433. align='center'
  434. label="学员声部">
  435. </el-table-column>
  436. </el-table>
  437. </div>
  438. </div>
  439. </div>
  440. <div slot="footer"
  441. class="dialog-footer">
  442. <el-button @click="studentVisible = false">取 消</el-button>
  443. <!-- 班级学员修改 -->
  444. <el-button type="primary"
  445. v-if="!isNewClass"
  446. @click="addSomeStudent">确 定</el-button>
  447. <!-- 临时调整或者新建班级 -->
  448. <el-button type="primary"
  449. v-if="isNewClass"
  450. @click="setInfoMsg">确 定</el-button>
  451. </div>
  452. </el-dialog>
  453. <!-- 班级调整 -->
  454. <!-- <el-dialog title="班级调整"
  455. width="500px"
  456. :visible.sync="resetClassVisible"
  457. :modal-append-to-body="false">
  458. <el-form :model="resetClassForm"
  459. class="resetClassForm">
  460. <el-form-item label="主教老师">
  461. <el-select v-model="resetClassForm.coreTeacher">
  462. <el-option v-for="(item,index) in teacherList"
  463. :key="index"
  464. :label="item.realName"
  465. :value="item.id"></el-option>
  466. </el-select>
  467. </el-form-item>
  468. <el-form-item label="助教老师">
  469. <el-select v-model="resetClassForm.assistant"
  470. filterable
  471. @change="setAssistant"
  472. multiple>
  473. <el-option v-for="(item,index) in cooperationList"
  474. :key="index"
  475. :label="item.realName"
  476. :value="item.id"></el-option>
  477. </el-select>
  478. </el-form-item>
  479. <el-form-item label="开始时间">
  480. <el-time-select placeholder="开始时间"
  481. v-model="resetClassForm.startTime"
  482. :picker-options="{
  483. start: '06:30',
  484. step: '00:05',
  485. end: '23:30'
  486. }">
  487. </el-time-select>
  488. </el-form-item>
  489. <el-form-item label="结束时间">
  490. <el-time-select placeholder="结束时间"
  491. v-model="resetClassForm.endTime"
  492. :picker-options="{
  493. start: '06:30',
  494. step: '00:05',
  495. end: '23:30',
  496. minTime:resetClassForm.startTime
  497. }">
  498. </el-time-select>
  499. </el-form-item>
  500. </el-form>
  501. <div slot="footer"
  502. class="dialog-footer">
  503. <el-button @click="resetClassVisible = false">取 消</el-button>
  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. <el-button type="primary"
  585. @click="">确 定</el-button>
  586. </div>
  587. </el-dialog> -->
  588. </div>
  589. </template>
  590. <script>
  591. import { getAllClass, getAllSignClassandTeacher, getAllSignClass, removeSingleClass, getNoClassStudentAll, findSound, teamSoundStudent, findMusicGroupClassTeacher, revisionClassGroup, revisionAddClassGroup, getEmployeeOrgan, getTeacher, findNoClassSingle, getMusicGroupStuNoClassType } from '@/api/buildTeam'
  592. import { getClassAllStudent, removeStudents, addStudents } from '@/api/studentManager'
  593. import axios from 'axios'
  594. import qs from 'qs'
  595. export default {
  596. data () {
  597. return {
  598. teamid: '',
  599. topForm: {
  600. classType: ''
  601. },
  602. tableList: [],
  603. maxClassList: [],
  604. activeSingleList: [],
  605. resetCourseVisible: false, // 重新排课弹窗
  606. resetClassVisible: false, // 班级调整弹窗
  607. studentVisible: false,
  608. MixVisible: false,// 新增合奏班弹窗
  609. activeListStudent: [], // 当前选中的学生列表
  610. activeChioseSound: '', //选择的声部
  611. chioseSoundList: [], //当前的所有声部
  612. studentList: [], //列表里的学生集合
  613. activeMixClass: '', // 选中的合奏班
  614. chioseStudent: [],// 勾选的学生信息
  615. isNewClass: false, // 是否为新建班级
  616. isSearch: false, // 是否需要搜索
  617. isTemporary: false, // 是否为临时班级
  618. className: '', // 班级名称
  619. activeClass: '', // 当前操作的班级
  620. soundList: [],
  621. infoVisible: false, // 判断是否需要显示老师设置
  622. teacherForm: {
  623. coreTeacher: '',
  624. assistant: [],
  625. courseType: '',
  626. courseTime: '',
  627. checked: false,
  628. courseNum: '',
  629. mixClassGroupId: ''
  630. },
  631. teacherRules: {
  632. coreTeacher: [{ required: true, message: '请选择主教老师' }],
  633. courseType: [{ required: true, message: '请选择上课类型' }],
  634. courseTime: [{ required: true, message: '请选择开始时间' }],
  635. courseNum: [{ required: true, message: '请输入排课次数' }],
  636. mixClassGroupId: [{ required: true, message: '请选择合奏班' }]
  637. },
  638. weekList: [{
  639. week: '',
  640. startTime: '',
  641. endTime: '',
  642. id: new Date()
  643. }],
  644. teacherList: [], // 存储的老师列表
  645. courseTypeList: [
  646. { value: 'SINGLE', label: '单技课' },
  647. { value: 'MIX', label: '合奏课' },
  648. { value: 'TRAINING_SINGLE', label: '集训单技课' },
  649. { value: 'TRAINING_MIX', label: '集训合奏课' },
  650. { value: 'HIGH', label: '基础技能课' },
  651. { value: 'COMPREHENSIVE', label: '综合课' },
  652. { value: 'CLASSROOM', label: '课堂课' },
  653. ],
  654. weekDateList: [
  655. { value: '1', label: '星期一' },
  656. { value: '2', label: '星期二' },
  657. { value: '3', label: '星期三' },
  658. { value: '4', label: '星期四' },
  659. { value: '5', label: '星期五' },
  660. { value: '6', label: '星期六' },
  661. { value: '7', label: '星期日' },
  662. ],
  663. // 班级类型
  664. classTypeList: [
  665. { value: 'NORMAL', label: '单技班' },
  666. { value: 'MIX', label: '合奏班' },
  667. { value: 'HIGH', label: '基础技能班' },
  668. { value: 'SNAP', label: '临时班' },
  669. ],
  670. cooperationList: [],
  671. singleList: [],
  672. activeSingleLists: [],
  673. activeType: '',
  674. resetClassForm: { // 班级调整form对象
  675. startTime: '',
  676. endTime: '',
  677. assistant: [],
  678. coreTeacher: ''
  679. },
  680. recourseForm: {
  681. courseType: '',
  682. checked: false,
  683. courseTime: '',
  684. courseNum: ''
  685. }
  686. }
  687. },
  688. created () {
  689. this.teamid = this.$route.query.id;
  690. },
  691. mounted () {
  692. sessionStorage.setItem('resetCode', 3)
  693. // // 获取乐团下未分班的单技班
  694. // findNoClassSingle({ musicGroupId: this.teamid }).then(res => {
  695. // if (res.code == 200) {
  696. // this.singleList = res.data;
  697. // }
  698. // })
  699. // getMusicGroupStuNoClassType
  700. // 获取合奏班下
  701. // 1.获取乐团下所有的合奏班
  702. // 2.根据合奏班获取所有的单技班
  703. // 3.根据乐团id 查询 此乐团所有的合奏班
  704. // 4.获取当年的所有节假日
  705. getAllClass({ musicGroupId: this.teamid }).then(res => {
  706. if (res.code == 200) {
  707. this.maxClassList = res.data;
  708. }
  709. })
  710. // let year = new Date().getFullYear();
  711. // axios.post('/jiari/', qs.stringify({ d: year })).then(res => {
  712. // this.holidayList = Object.keys(res.data[year])
  713. // })
  714. // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
  715. // })
  716. // 获取默认乐团内的所有班
  717. this.changeMixClass()
  718. // 根据乐团id获取乐团的所有声部
  719. findSound({ musicGroupId: this.teamid }).then(res => {
  720. if (res.code == 200) {
  721. this.soundList = res.data
  722. }
  723. })
  724. // 获取分部所有老师
  725. // findMusicGroupClassTeacher({
  726. // musicGroupId: this.teamid
  727. // }).then(res => {
  728. // if (res.code == 200) {
  729. // this.teacherList = res.data
  730. // }
  731. // })
  732. // 获取分部所有老师
  733. getTeacher().then(res => {
  734. if (res.code == 200) {
  735. this.cooperationList = res.data;
  736. this.teacherList = res.data;
  737. }
  738. })
  739. },
  740. methods: {
  741. recourse (row) {
  742. this.weekList = [{
  743. week: '',
  744. startTime: '',
  745. endTime: '',
  746. id: new Date()
  747. }],
  748. this.resetCourseVisible = true;
  749. },
  750. addMix () {
  751. this.MixVisible = true;
  752. },
  753. setAssistant (val) {
  754. for (let i in val) {
  755. if (val[i] == this.teacherForm.coreTeacher) {
  756. val.splice(i, 1);
  757. }
  758. }
  759. },
  760. changeMixClass (val) {
  761. // 根据合奏班id获取合奏班下的所有单技班
  762. this.getList(val);
  763. this.activeMixClass = val;
  764. },
  765. getList (val) {
  766. getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(res => {
  767. if (res.code == 200) {
  768. this.activeSingleList = res.data;
  769. // this.topForm.count = this.activeSingleList.length
  770. }
  771. })
  772. },
  773. // 临时调整
  774. temporary () {
  775. this.activeClass = '';
  776. this.activeListStudent = [];
  777. this.studentList = [];
  778. this.isNewClass = true;
  779. this.studentVisible = true;
  780. this.isSearch = true;
  781. this.className = '';
  782. this.isTemporary = true;
  783. },
  784. // 新增班级
  785. addNewClass (type) {
  786. this.activeType = type;
  787. this.activeClass = '';
  788. this.activeListStudent = [];
  789. this.studentList = [];
  790. this.isNewClass = true;
  791. this.studentVisible = true;
  792. this.isSearch = false;
  793. this.className = '';
  794. this.isTemporary = false;
  795. this.getNoClassStudent(type)
  796. },
  797. searchStudent () {
  798. // 搜索学生
  799. // 根据声部id 乐团id搜索学生
  800. teamSoundStudent({ musicGroupId: this.teamid, actualSubjectId: this.activeChioseSound }).then(res => {
  801. if (res.code == 200) {
  802. this.studentList = res.data;
  803. }
  804. })
  805. },
  806. // 选择学生的方法修改
  807. SelectionStudent (val) {
  808. this.chioseStudent = val;
  809. },
  810. // 新增选中的学生
  811. NewselectionStudent (val) {
  812. this.chioseStudent = val;
  813. // 这里新增的添加到选中的学生列表 根据学生id去重
  814. if (this.chioseStudent.length > 0) {
  815. this.chioseStudent = this.chioseStudent.concat(val);
  816. } else {
  817. this.chioseStudent = val;
  818. }
  819. // 联动版
  820. // this.activeListStudent = this.objArrayRemoval(this.chioseStudent, 'userId')
  821. // 非联动多选版
  822. this.activeListStudent = this.activeListStudent.concat(this.chioseStudent);
  823. // // 去重
  824. this.activeListStudent = this.objArrayRemoval(this.activeListStudent, 'userId');
  825. // 将其填入选中的学生
  826. },
  827. // 删除班级
  828. removeClass (scope) {
  829. removeSingleClass({ classGroupId: scope.row.id }).then(res => {
  830. if (res.code == 200) {
  831. this.$message.success('删除成功')
  832. scope._self.$refs[scope.$index].doClose();
  833. // 重新请求列表
  834. this.getList(this.activeMixClass);
  835. } else {
  836. this.$message.error(res.msg)
  837. scope._self.$refs[scope.$index].doClose();
  838. }
  839. }).catch(res => {
  840. scope._self.$refs[scope.$index].doClose();
  841. })
  842. },
  843. // 修改班级
  844. resetClass (row) {
  845. this.isNewClass = false;
  846. this.className = row.name;
  847. this.studentVisible = true;
  848. this.activeClass = row.id
  849. this.isSearch = false;
  850. this.activeType = row.type;
  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.teacherForm.assistant = [];
  866. for (let i in row.classGroupTeacherMapperList) {
  867. if (row.classGroupTeacherMapperList[i].teacherRole == 'BISHOP') {
  868. this.teacherForm.coreTeacher = row.classGroupTeacherMapperList[i].userId;
  869. }
  870. if (row.classGroupTeacherMapperList[i].teacherRole == 'TEACHING') {
  871. this.teacherForm.assistant.push(row.classGroupTeacherMapperList[i].userId)
  872. }
  873. }
  874. this.infoVisible = 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. // removeStudents({ classGroupId:}).then(res => {
  900. removeStudents({ classGroupId: this.activeClass, userId: item.userId }).then(res => {
  901. if (res.code == 200) {
  902. item.isVisible = false;
  903. // 这里刷新 this.studentList this.activeListStudent
  904. this.getList(this.activeMixClass);
  905. getClassAllStudent({ classGroupId: this.activeClass }).then(res => {
  906. if (res.code == 200) {
  907. this.activeListStudent = res.data;
  908. }
  909. })
  910. this.getNoClassStudent(this.activeType);
  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>