resetClass.vue 52 KB

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