resetClass.vue 50 KB

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