resetClass.vue 48 KB

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