resetClass.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  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 + "/" + scope.row.expectStudentNum }}
  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="activeSingleList"
  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. };
  654. },
  655. created() {
  656. this.init();
  657. },
  658. activated() {
  659. this.init();
  660. },
  661. mounted() {},
  662. methods: {
  663. permission(val) {
  664. return permission(val);
  665. },
  666. async init() {
  667. this.teamid = this.$route.query.id;
  668. this.organId = this.musicGroupInfo.organId
  669. this.chargeTypeId = this.musicGroupInfo.chargeTypeId
  670. // 根据分部id和缴费类型获取 可选课程类型
  671. try{
  672. if (this.organId && this.chargeTypeId) {
  673. const res = await getOrganizationCourseUnitPriceSettings({
  674. chargeTypeId: this.chargeTypeId,
  675. organId: this.organId,
  676. rows: 9999
  677. })
  678. const d = {}
  679. this.courseTypes = res.data.rows
  680. for (const item of this.courseTypes) {
  681. d[item.courseType] = item
  682. }
  683. this.courseTypesByType = d
  684. }
  685. } catch (error) { }
  686. // 根据乐团id获取乐团所属分部
  687. getTeacher({ organId: this.organId }).then((res) => {
  688. if (res.code == 200) {
  689. this.cooperationList = res.data;
  690. this.teacherList = res.data;
  691. }
  692. });
  693. getAllClass({ musicGroupId: this.teamid }).then((res) => {
  694. if (res.code == 200) {
  695. this.maxClassList = res.data;
  696. }
  697. });
  698. // 获取默认乐团内的所有班
  699. this.changeMixClass();
  700. // 根据乐团id获取乐团的所有声部
  701. findSound({ musicGroupId: this.teamid }).then((res) => {
  702. if (res.code == 200) {
  703. this.soundList = res.data;
  704. }
  705. });
  706. },
  707. studentSubmited(data) {
  708. if (!this.isOnlyChangeUser) {
  709. this.studentSubmitedData = data;
  710. this.infoVisible = true;
  711. } else {
  712. this.getList();
  713. }
  714. },
  715. recourse(row) {
  716. (this.weekList = [
  717. {
  718. week: "",
  719. startTime: "",
  720. endTime: "",
  721. id: new Date(),
  722. },
  723. ]),
  724. (this.resetCourseVisible = true);
  725. },
  726. addMix() {
  727. this.MixVisible = true;
  728. },
  729. changeActiveChioseSound(val) {
  730. this.activeChioseSound = val;
  731. },
  732. setAssistant(val) {
  733. for (let i in val) {
  734. if (val[i] == this.teacherForm.coreTeacher) {
  735. val.splice(i, 1);
  736. }
  737. }
  738. },
  739. changeMixClass(val) {
  740. // 根据合奏班id获取合奏班下的所有单技班
  741. this.getList(val);
  742. this.activeMixClass = val;
  743. },
  744. getList(val) {
  745. getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(
  746. (res) => {
  747. if (res.code == 200) {
  748. this.activeSingleList = res.data;
  749. // this.topForm.count = this.activeSingleList.length
  750. }
  751. }
  752. );
  753. },
  754. // 临时调整
  755. temporary() {
  756. this.classType = 1;
  757. this.activeClass = "";
  758. this.activeListStudent = [];
  759. this.studentList = [];
  760. this.isNewClass = true;
  761. this.studentVisible = true;
  762. this.isOnlyChangeUser = false;
  763. this.isSearch = true;
  764. this.className = "";
  765. this.isTemporary = true;
  766. this.activeType = "SPAN";
  767. this.activeChioseSound = null;
  768. this.setType("SNAP");
  769. this.getNoClassStudent("SNAP");
  770. },
  771. setType(type) {
  772. this.courseTypeList = getCourseType(type)
  773. console.log(this.courseTypeList)
  774. },
  775. // 新增班级
  776. addNewClass(type) {
  777. const types = {
  778. NORMAL: 2,
  779. MUSIC_NETWORK: 4,
  780. };
  781. this.isOnlyChangeUser = false;
  782. this.classType = types[type] || 3;
  783. this.setType(type);
  784. this.activeType = type;
  785. this.activeClass = "";
  786. this.activeListStudent = [];
  787. this.studentList = [];
  788. this.isNewClass = true;
  789. this.studentVisible = true;
  790. this.isSearch = false;
  791. this.className = "";
  792. this.isTemporary = false;
  793. this.activeChioseSound = null;
  794. this.getNoClassStudent(type);
  795. },
  796. searchStudent(classGroupId) {
  797. console.log(this.activeChioseSound);
  798. // 搜索学生
  799. // 根据声部id 乐团id搜索学生
  800. if (this.activeType == "SPAN") {
  801. teamSoundStudent({
  802. musicGroupId: this.teamid,
  803. actualSubjectId: this.activeChioseSound,
  804. }).then((res) => {
  805. if (res.code == 200) {
  806. this.studentList = res.data;
  807. }
  808. });
  809. } else {
  810. this.getNoClassStudent(this.activeType, this.activeChioseSound,classGroupId);
  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. this.getNoClassStudent(row.type,null,row.id);
  895. },
  896. // 班级调整
  897. classAdjustment(row) {
  898. this.infoDetail = row;
  899. this.activeType = row.type;
  900. this.activeClass = row.id;
  901. // this.activeListStudent = row.subjectIdList.split(',')
  902. this.setType(row.type);
  903. // activeListStudent
  904. this.isNewClass = false;
  905. this.teacherForm.assistant = [];
  906. for (let i in row.classGroupTeacherMapperList) {
  907. if (row.classGroupTeacherMapperList[i].teacherRole == "BISHOP") {
  908. this.teacherForm.coreTeacher =
  909. row.classGroupTeacherMapperList[i].userId;
  910. }
  911. if (row.classGroupTeacherMapperList[i].teacherRole == "TEACHING") {
  912. this.teacherForm.assistant.push(
  913. row.classGroupTeacherMapperList[i].userId
  914. );
  915. }
  916. }
  917. this.infoVisible = true;
  918. },
  919. async getNoClassStudent(type, actualSubjectId,classGroupId) {
  920. const params = {
  921. musicGroupId: this.teamid,
  922. type,
  923. actualSubjectId,
  924. classGroupId
  925. };
  926. await getMusicGroupStuNoClassType(params).then((res) => {
  927. if (res.code == 200) {
  928. this.studentList = res.data;
  929. // }
  930. }
  931. });
  932. },
  933. // 删除学生 调整
  934. removeStudent(item) {
  935. // 这里做判断如果是线上基础技能班 学生人数不能少于3人
  936. if (
  937. this.activeType == "HIGH_ONLINE" &&
  938. this.activeListStudent.length <= 3
  939. ) {
  940. this.$message.error("线上基础技能课不能小于3人");
  941. return;
  942. }
  943. removeStudents({
  944. classGroupId: this.activeClass,
  945. userId: item.userId,
  946. }).then((res) => {
  947. if (res.code == 200) {
  948. this.$message.success("删除成功");
  949. item.isVisible = false;
  950. // 这里刷新 this.studentList this.activeListStudent
  951. this.getList(this.activeMixClass);
  952. getClassAllStudent({ classGroupId: this.activeClass }).then((res) => {
  953. if (res.code == 200) {
  954. this.activeListStudent = res.data;
  955. }
  956. });
  957. this.getNoClassStudent(this.activeType,null,this.activeClass);
  958. // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
  959. // if (res.code == 200) {
  960. // this.$message.success('删除成功');
  961. // this.studentList = res.data.map(item => {
  962. // item.isVisible = false;
  963. // return item;
  964. // });
  965. // }
  966. // })
  967. }
  968. });
  969. },
  970. // 批量添加学生
  971. addSomeStudent() {
  972. // 获取勾选的学生
  973. let arr = this.chioseStudent.map((item) => {
  974. return item.userId;
  975. });
  976. if (arr.length <= 0) {
  977. if (this.isNewClass) {
  978. this.$message.error("至少添加一名学员");
  979. return;
  980. } else {
  981. this.studentVisible = false;
  982. return;
  983. }
  984. }
  985. if (this.activeType == "HIGH_ONLINE") {
  986. superFindClassGroups({ classGroupId: this.activeClass }).then((res) => {
  987. if (res.code == 200) {
  988. if (
  989. this.activeListStudent.length + this.chioseStudent.length > 5 ||
  990. this.activeListStudent.length + this.chioseStudent.length < 3
  991. ) {
  992. this.$message.error("线上技能班必须为3-5人");
  993. return;
  994. } else {
  995. addStudents({
  996. classGroupId: this.activeClass,
  997. userIdsStr: arr.join(","),
  998. }).then((res) => {
  999. if (res.code == 200) {
  1000. this.studentVisible = false;
  1001. this.$message.success("添加成功");
  1002. this.getList();
  1003. return;
  1004. }
  1005. });
  1006. }
  1007. }
  1008. });
  1009. } else {
  1010. addStudents({
  1011. classGroupId: this.activeClass,
  1012. userIdsStr: arr.join(","),
  1013. }).then((res) => {
  1014. if (res.code == 200) {
  1015. this.studentVisible = false;
  1016. this.$message.success("添加成功");
  1017. this.getList();
  1018. }
  1019. });
  1020. }
  1021. },
  1022. SelectionMix(val) {
  1023. this.activeSingleLists = val;
  1024. },
  1025. removeSiginforMix(item) {
  1026. for (let k in this.activeSingleLists) {
  1027. if (this.activeSingleLists[k].id == item.id) {
  1028. this.$refs["mixList"].toggleRowSelection(item, false);
  1029. }
  1030. }
  1031. },
  1032. temporaryRemoveStudent(item) {
  1033. // 列表中删除
  1034. for (let i in this.activeListStudent) {
  1035. if (this.activeListStudent[i].userId == item.userId) {
  1036. this.activeListStudent.splice(i, 1);
  1037. }
  1038. }
  1039. // 查询列表中的项 取消勾选 temporaryStudentList toggleRowSelection
  1040. // 循环列表 找到相应的行取消勾选
  1041. for (let k in this.studentList) {
  1042. if (this.studentList[k].userId == item.userId) {
  1043. this.$refs["temporaryStudentList"].toggleRowSelection(item, false);
  1044. }
  1045. }
  1046. // this.$refs['temporaryStudentList'].toggleRowSelection(row, selected);
  1047. },
  1048. // 对象数组去重
  1049. objArrayRemoval(arr, attr) {
  1050. let obj = {};
  1051. let result = [];
  1052. for (let x in arr) {
  1053. if (!obj[arr[x][attr]]) {
  1054. result.push(arr[x]);
  1055. obj[arr[x][attr]] = true;
  1056. }
  1057. }
  1058. return result;
  1059. },
  1060. setInfoMsg() {
  1061. // 判断班级名称是否输入
  1062. if (!this.className) {
  1063. this.$message.error("请输入班级名称");
  1064. return;
  1065. }
  1066. // 判断有没有勾选学生
  1067. if (this.activeListStudent.length <= 0) {
  1068. // 没有勾学生
  1069. this.$message.error("班级里至少要有一名学生");
  1070. return;
  1071. }
  1072. if (this.activeType == "HIGH_ONLINE") {
  1073. if (
  1074. this.activeListStudent.length > 5 ||
  1075. this.activeListStudent.length < 3
  1076. ) {
  1077. this.$message.error("线上技能班必须为3-5人");
  1078. return;
  1079. }
  1080. this.teacherForm.expectStudentNum = this.activeListStudent.length;
  1081. }
  1082. this.infoVisible = true;
  1083. },
  1084. addWeek() {
  1085. // 添加循环周期
  1086. this.weekList.push({
  1087. dayOfWeek: "",
  1088. startClassTime: "",
  1089. endClassTime: "",
  1090. time: this.courseTime,
  1091. id: new Date().getTime(),
  1092. });
  1093. },
  1094. // 删除循环周
  1095. removeWeek(item) {
  1096. for (let i in this.weekList) {
  1097. if (this.weekList[i].id == item.id) {
  1098. this.weekList.splice(i, 1);
  1099. }
  1100. }
  1101. },
  1102. // 提交临时班的信息
  1103. submitTemporary(type) {
  1104. // 参数是一样 type为1 新增临时班
  1105. // type为2 新增单技班
  1106. // type为3 修改班级信息
  1107. if (type == 1) {
  1108. this.isTemporary = true;
  1109. } else {
  1110. this.isTemporary = false;
  1111. }
  1112. this.$refs["teacherForm"].validate((item) => {
  1113. if (item) {
  1114. let week = this.weekList;
  1115. if (this.teacherForm.isAdd != "onlyUpdateTeacher") {
  1116. if (
  1117. !week[0] ||
  1118. !week[0].startClassTime ||
  1119. !week[0].endClassTime ||
  1120. !week[0].dayOfWeek
  1121. ) {
  1122. this.$message.error("至少排一节课");
  1123. return;
  1124. }
  1125. }
  1126. // 这里代表排课成功 发请求 新增临时班
  1127. let classGroupName = this.className;
  1128. let classGroupTeacherMapperList = [
  1129. { userId: this.teacherForm.coreTeacher, teacherRole: "BISHOP" },
  1130. ];
  1131. for (let i in this.teacherForm.assistant) {
  1132. classGroupTeacherMapperList.push({
  1133. userId: this.teacherForm.assistant[i],
  1134. teacherRole: "TEACHING",
  1135. });
  1136. }
  1137. // let mixClassGroupId = this.teacherForm.mixClassGroupId;
  1138. let musicGroupId = this.teamid;
  1139. let startDate = this.teacherForm.courseTime;
  1140. let courseType = this.teacherForm.courseType;
  1141. let courseTimes = this.teacherForm.courseNum;
  1142. if (
  1143. courseTimes <= 0 &&
  1144. this.teacherForm.isAdd != "onlyUpdateTeacher"
  1145. ) {
  1146. this.$message.error("请至少排一节课");
  1147. return;
  1148. } else if (courseTimes > this.maxMun) {
  1149. this.$message.error(`一次最多排${this.maxMun}节课`);
  1150. return;
  1151. }
  1152. let students = this.activeListStudent.map((item) => {
  1153. return item.userId;
  1154. });
  1155. let holiday = this.teacherForm.checked;
  1156. let courseList = [];
  1157. for (let i in this.weekList) {
  1158. courseList.push(this.weekList[i]);
  1159. }
  1160. if (
  1161. courseList.length <= 0 &&
  1162. this.teacherForm.isAdd != "onlyUpdateTeacher"
  1163. ) {
  1164. this.$message.error("新增班级至少排一节课");
  1165. return;
  1166. }
  1167. if (this.teacherForm.isAdd == "onlyUpdateTeacher") {
  1168. startDate = null;
  1169. courseType = null;
  1170. students = null;
  1171. holiday = null;
  1172. courseTimes = null;
  1173. (courseList = null), (mineType = null);
  1174. }
  1175. // mixClassGroupId,
  1176. let mineType = this.activeType;
  1177. let obj = {
  1178. classGroupName,
  1179. classGroupTeacherMapperList,
  1180. musicGroupId,
  1181. startDate,
  1182. courseType,
  1183. students,
  1184. holiday,
  1185. courseTimes,
  1186. courseTimeDtoList: courseList,
  1187. type: mineType,
  1188. courseAddType: this.teacherForm.isAdd,
  1189. };
  1190. if (type == 1) {
  1191. // 新增临时班级
  1192. revisionClassGroup(obj).then((res) => {
  1193. if (res.code == 200) {
  1194. // 提示修改成功
  1195. this.$message.success("修改成功");
  1196. this.infoVisible = false;
  1197. this.studentVisible = false;
  1198. this.getList();
  1199. }
  1200. });
  1201. } else if (type == 2) {
  1202. (obj.subjectId = this.teacherForm.sound),
  1203. (obj.expectStudentNum = this.teacherForm.expectStudentNum);
  1204. // 新增单技班
  1205. revisionAddClassGroup(obj).then((res) => {
  1206. if (res.code == 200) {
  1207. // 修改成功
  1208. this.$message.success("修改成功");
  1209. this.infoVisible = false;
  1210. this.studentVisible = false;
  1211. this.getList();
  1212. }
  1213. });
  1214. } else if (type == 3) {
  1215. // 乐团修改
  1216. obj.classGroupId = this.activeClass;
  1217. classGroupUpdate(obj).then((res) => {
  1218. if (res.code == 200) {
  1219. this.$message.success("修改成功");
  1220. this.infoVisible = false;
  1221. this.getList();
  1222. }
  1223. });
  1224. }
  1225. } else {
  1226. this.$message.error("请填写必要信息");
  1227. return;
  1228. }
  1229. });
  1230. },
  1231. // 新建基础技能班
  1232. newClassHight() {
  1233. this.$refs["newClassForm"].validate((res) => {
  1234. if (res) {
  1235. let obj = {};
  1236. obj.musicGroupId = this.teamid;
  1237. obj.name = this.newClassForm.className;
  1238. obj.type = this.newClassForm.type;
  1239. obj.groupType = "MUSIC";
  1240. // if (this.newClassForm.memo.length > 0) {
  1241. // obj.memo = this.newClassForm.memo.join(',')
  1242. // } else {
  1243. // obj.memo = null
  1244. // }
  1245. obj.expectStudentNum = this.newClassForm.expectStudentNum;
  1246. obj.teacherMapperList = [];
  1247. obj.teacherMapperList.push({
  1248. userId: this.newClassForm.bishop,
  1249. teacherRole: "BISHOP",
  1250. });
  1251. let subjectIdList;
  1252. if (this.newClassForm.type == "HIGH_ONLINE") {
  1253. subjectIdList = this.newClassForm.subjectId;
  1254. if (this.newClassForm.memo.length > 0) {
  1255. obj.memo = this.newClassForm.memo.join(",");
  1256. }
  1257. } else {
  1258. subjectIdList =
  1259. this.newClassForm.subjectIdList.length > 0
  1260. ? this.newClassForm.subjectIdList.join(",")
  1261. : null;
  1262. for (let i in this.newClassForm.teaching) {
  1263. obj.teacherMapperList.push({
  1264. userId: this.newClassForm.teaching[i],
  1265. teacherRole: "TEACHING",
  1266. });
  1267. }
  1268. obj.memo = null;
  1269. }
  1270. obj.subjectIdList = subjectIdList;
  1271. createClass(obj).then((res) => {
  1272. if (res.code == 200) {
  1273. this.$message.success("创建成功");
  1274. this.getList();
  1275. this.newClassVisible = false;
  1276. }
  1277. });
  1278. }
  1279. });
  1280. },
  1281. setAssistant1(val) {
  1282. for (let i in val) {
  1283. if (val[i] == this.newClassForm.bishop) {
  1284. val.splice(i, 1);
  1285. }
  1286. }
  1287. },
  1288. handleSelectionChange(val) {
  1289. if (val.length > 0) {
  1290. this.classGroupIds = val
  1291. .map((item) => {
  1292. return item.id;
  1293. })
  1294. .join(",");
  1295. } else {
  1296. this.classGroupIds = null;
  1297. }
  1298. },
  1299. chkstu(row, index) {
  1300. return (
  1301. (row.type == "HIGH_ONLINE" && row.totalClassTimes <= 0) ||
  1302. (row.type == "HIGH" && row.totalClassTimes <= 0)
  1303. );
  1304. },
  1305. startRegest() {
  1306. if (!this.classGroupIds) {
  1307. this.$message.error("请至少选择1个基础技能班");
  1308. return;
  1309. }
  1310. this.$confirm("是否开启报名?", "提示", {
  1311. confirmButtonText: "确定",
  1312. cancelButtonText: "取消",
  1313. type: "warning",
  1314. })
  1315. .then(() => {
  1316. pushMessage({
  1317. classGroupIds: this.classGroupIds,
  1318. musicGroupId: this.teamid,
  1319. }).then((res) => {
  1320. if (res.code == 200) {
  1321. this.$message.success(`开启成功,已推送${res.data}名学生`);
  1322. this.getList();
  1323. }
  1324. });
  1325. })
  1326. .catch(() => {});
  1327. },
  1328. toggleSelection(rows) {
  1329. if (rows) {
  1330. rows.forEach((row) => {
  1331. this.$refs.multipleTable.toggleRowSelection(row);
  1332. });
  1333. } else {
  1334. this.$refs.multipleTable.clearSelection();
  1335. }
  1336. },
  1337. chioseHightype(val) {
  1338. if (val == "HIGH_ONLINE") {
  1339. this.newClassForm.teaching = [];
  1340. this.$set(this.newClassForm, "subjectIdList", []);
  1341. } else {
  1342. this.newClassForm.memo = [];
  1343. this.newClassForm.subjectId = "";
  1344. }
  1345. },
  1346. changeStartClassTime(item) {
  1347. // item.endClassTime = ''
  1348. this.$set(item, "endClassTime", "");
  1349. },
  1350. changeEndClassTime(item, val) {
  1351. this.$set(item, "endClassTime", val);
  1352. },
  1353. changeCourseType(val) {
  1354. console.log(val);
  1355. if (val) {
  1356. this.classTimeList.forEach((item) => {
  1357. if (item.value == val) {
  1358. this.courseTime = item.label;
  1359. }
  1360. });
  1361. // courseTime
  1362. this.weekList = [
  1363. {
  1364. week: "",
  1365. startTime: "",
  1366. endTime: "",
  1367. time: this.courseTime,
  1368. id: new Date().getTime(),
  1369. },
  1370. ];
  1371. } else {
  1372. this.courseTime = null;
  1373. this.weekList = [];
  1374. }
  1375. // if (val === 'HIGH_ONLINE' || val === 'HIGH' || val === 'MUSIC_NETWORK') {
  1376. // this.step = '00:05'
  1377. // } else {
  1378. // this.step = '00:15'
  1379. // }
  1380. },
  1381. changeStartTimes(val, item) {
  1382. if (val && item.time) {
  1383. let str = dayjs(new Date()).format("YYYY-MM-DD");
  1384. this.$set(
  1385. item,
  1386. "endClassTime",
  1387. addTimerFormMinute(str, val, item.time)
  1388. );
  1389. } else {
  1390. this.$set(item, "endClassTime", "");
  1391. this.$message.error("请先设置课程时间");
  1392. }
  1393. if (!item.endClassTime) {
  1394. this.$set(item, "startClassTime", "");
  1395. }
  1396. },
  1397. setItem(item, index) {
  1398. // console.log(item, index)
  1399. this.weekList[index].startClassTime = "";
  1400. this.weekList[index].endClassTime = "";
  1401. console.log();
  1402. },
  1403. closeStudentReset() {
  1404. this.studentResetVisiable = false;
  1405. },
  1406. },
  1407. watch: {
  1408. "newClassForm.type"() {
  1409. if (this.newClassForm.type === "HIGH_ONLINE") {
  1410. this.$set(this.newClassForm, "expectStudentNum", 5);
  1411. }
  1412. },
  1413. infoVisible(val) {
  1414. if (!val) {
  1415. this.teacherForm = {
  1416. isAdd: null,
  1417. coreTeacher: "",
  1418. assistant: [],
  1419. courseType: "",
  1420. courseTime: "",
  1421. checked: true,
  1422. courseNum: "",
  1423. mixClassGroupId: "",
  1424. sound: "",
  1425. expectStudentNum: "",
  1426. };
  1427. this.infoDetail = null;
  1428. // this.$refs["teacherForm"].resetFields();
  1429. this.weekList = [];
  1430. }
  1431. },
  1432. newClassVisible(val) {
  1433. if (!val) {
  1434. this.newClassForm = {
  1435. className: null,
  1436. type: null,
  1437. subjectIdList: [],
  1438. expectStudentNum: null,
  1439. bishop: null,
  1440. teaching: null,
  1441. memo: [],
  1442. };
  1443. }
  1444. },
  1445. },
  1446. };
  1447. </script>
  1448. <style lang="scss" scoped>
  1449. .floor {
  1450. padding-right: 20px;
  1451. display: flex;
  1452. flex-direction: row;
  1453. justify-content: space-between;
  1454. width: 100%;
  1455. height: 48px;
  1456. line-height: 48px;
  1457. background: rgba(237, 238, 240, 1);
  1458. font-size: 14px;
  1459. color: #444;
  1460. align-items: center;
  1461. position: relative;
  1462. z-index: 1;
  1463. .right {
  1464. display: flex;
  1465. flex-direction: row;
  1466. justify-content: flex-start;
  1467. .remove {
  1468. width: 98px;
  1469. height: 32px;
  1470. background: rgba(248, 80, 67, 1);
  1471. border-radius: 3px;
  1472. color: #fff;
  1473. line-height: 32px;
  1474. text-align: center;
  1475. margin-left: 164px;
  1476. cursor: pointer;
  1477. }
  1478. }
  1479. .add {
  1480. width: auto;
  1481. padding: 0 10px;
  1482. height: 32px;
  1483. background: rgba(20, 146, 138, 1);
  1484. border-radius: 3px;
  1485. color: #fff;
  1486. line-height: 32px;
  1487. text-align: center;
  1488. margin-left: 20px;
  1489. cursor: pointer;
  1490. }
  1491. }
  1492. .studentMask {
  1493. display: flex;
  1494. flex-direction: row;
  1495. justify-content: flex-start;
  1496. .left {
  1497. width: 200px;
  1498. margin-right: 20px;
  1499. .wrap {
  1500. margin-bottom: 20px;
  1501. }
  1502. h4 {
  1503. font-size: 16px;
  1504. color: #444;
  1505. line-height: 38px;
  1506. }
  1507. .chioseStudentList {
  1508. height: 500px;
  1509. overflow-y: auto;
  1510. border: 1px solid #ccc;
  1511. .studentItem {
  1512. padding-left: 10px;
  1513. line-height: 25px;
  1514. }
  1515. }
  1516. }
  1517. .right {
  1518. width: calc(100% - 200px);
  1519. .tableList {
  1520. max-height: 500px;
  1521. overflow-y: auto;
  1522. }
  1523. }
  1524. }
  1525. .resetClassForm {
  1526. /deep/.el-date-editor.el-input,
  1527. /deep/.el-date-editor.el-input__inner {
  1528. width: 180px !important;
  1529. }
  1530. }
  1531. // /deep/.el-date-editor.el-input,
  1532. // /deep/.el-date-editor.el-input__inner {
  1533. // width: 100px !important;
  1534. // }
  1535. .higheSelect {
  1536. /deep/.el-input__inner {
  1537. height: 40px !important;
  1538. }
  1539. }
  1540. /deep/ .el-alert__content {
  1541. display: block;
  1542. width: 100%;
  1543. }
  1544. .alert-content {
  1545. display: flex;
  1546. justify-content: space-between;
  1547. > strong {
  1548. cursor: pointer;
  1549. }
  1550. }
  1551. </style>