resetClass.vue 47 KB

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