courseList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. <template>
  2. <div class="cl-container">
  3. <!-- 搜索类型 -->
  4. <el-form :inline="true"
  5. class="searchForm"
  6. v-model.trim="searchForm">
  7. <el-form-item>
  8. <el-select v-model.trim="searchForm.courseStatus"
  9. clearable
  10. filterable
  11. placeholder="课程类型">
  12. <el-option label="基础技能课"
  13. value="HIGH"></el-option>
  14. <el-option label="综合课"
  15. value="COMPREHENSIVE"></el-option>
  16. <el-option label="课堂课"
  17. value="CLASSROOM"></el-option>
  18. <el-option label="合奏课"
  19. value="MIX"></el-option>
  20. <el-option label="集训合奏课"
  21. value="TRAINING_MIX"></el-option>
  22. <el-option label="集训单技课"
  23. value="TRAINING_SINGLE"></el-option>
  24. <el-option label="单技课"
  25. value="SINGLE"></el-option>
  26. <el-option label="线上基础技能课"
  27. value="HIGH_ONLINE"></el-option>
  28. <el-option label="乐团网管课"
  29. value="MUSIC_NETWORK"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-select v-model.trim="searchForm.classStatus"
  34. clearable
  35. filterable
  36. placeholder="课程状态">
  37. <el-option label="未开始"
  38. value="NOT_START"></el-option>
  39. <el-option label="进行中"
  40. value="UNDERWAY"></el-option>
  41. <el-option label="已结束"
  42. value="OVER"></el-option>
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item>
  46. <!-- getMusicGroupAllClass -->
  47. <el-select v-model.trim="searchForm.class"
  48. placeholder="班级名称"
  49. filterable
  50. clearable>
  51. <el-option v-for="(item,index) in classList"
  52. :key="index"
  53. :value="item.id"
  54. :label="item.name"></el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-select v-model.trim="searchForm.isSettlement"
  59. placeholder="是否结算"
  60. filterable
  61. clearable>
  62. <el-option value="0"
  63. label="未结算"></el-option>
  64. <el-option value="1"
  65. label="已结算"></el-option>
  66. </el-select>
  67. </el-form-item>
  68. <el-form-item>
  69. <el-date-picker v-model.trim="searchForm.timer"
  70. style="width:420px;"
  71. type="daterange"
  72. value-format="yyyy-MM-dd"
  73. range-separator="至"
  74. start-placeholder="课程开始日期"
  75. end-placeholder="课程结束日期"
  76. :picker-options="{
  77. firstDayOfWeek: 1
  78. }"></el-date-picker>
  79. </el-form-item>
  80. <el-form-item>
  81. <div class="searchBtn"
  82. @click="search">搜索</div>
  83. </el-form-item>
  84. </el-form>
  85. <div class="btnWraps">
  86. <div class="newBand"
  87. @click="removeCourses"
  88. v-permission="'courseSchedule/batchDelete'">批量删除</div>
  89. <!-- <div class="newBand"
  90. @click="resetTimer">修改日期</div>-->
  91. </div>
  92. <!-- -->
  93. <!-- 列表 -->
  94. <div class="tableWrap">
  95. <el-table :data="tableList"
  96. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  97. @selection-change="handleSelectionChange">
  98. <el-table-column type="selection"
  99. width="55"
  100. :selectable="checkSelectable"></el-table-column>
  101. <el-table-column align='center'
  102. prop="courseScheduleId"
  103. label="课程编号"></el-table-column>
  104. <el-table-column align="center"
  105. width="180px"
  106. label="时间">
  107. <template slot-scope="scope">{{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(0, 5) : '' }}</template>
  108. </el-table-column>
  109. <el-table-column align="center"
  110. prop="courseScheduleName"
  111. label="课程名称"></el-table-column>
  112. </el-table-column>
  113. <el-table-column align="center"
  114. prop="courseScheduleType"
  115. label="课程类型">
  116. <template slot-scope="scope">
  117. <div>{{ scope.row.courseScheduleType | coursesType}}</div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column align="center"
  121. prop="courseScheduleStatus"
  122. label="课程状态">
  123. <template slot-scope="scope">
  124. <div>{{ scope.row.courseScheduleStatus | coursesStatus }}</div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="center"
  128. label="老师签到">
  129. <template slot-scope="scope">
  130. <div>{{ scope.row.signInStatus | attendanceType}}</div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column align="center"
  134. label="老师签退">
  135. <template slot-scope="scope">
  136. <div>{{ scope.row.signOutStatus | attendanceOutType}}</div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="center"
  140. prop="masterTeacherName"
  141. label="指导老师"></el-table-column>
  142. <el-table-column align="center"
  143. label="结算状态">
  144. <template slot-scope="scope">{{ scope.row.settlementTime ? '已结算' : '未结算' }}</template>
  145. </el-table-column>
  146. <el-table-column align="center"
  147. prop="remark"
  148. label="是否点名">
  149. <template slot-scope="scope">{{ scope.row.isCallNames ? '已点名' : '未点名' }}</template>
  150. </el-table-column>
  151. <el-table-column align="center"
  152. prop="remark"
  153. label="备注"></el-table-column>
  154. <el-table-column align="center"
  155. width="280px"
  156. label="操作"
  157. fixed="right">
  158. <template slot-scope="scope">
  159. <div>
  160. <!-- {child: 'teacherAttendance/updateTeacherAttendance', parent: '/teamDetails/courseList'} -->
  161. <el-button v-if="scope.row.courseScheduleStatus == 'OVER' && !scope.row.settlementTime && permission('teacherAttendance/updateTeacherAttendance?t=568')"
  162. type="text"
  163. @click="onMarkAttendance(scope.row)">补考勤</el-button>
  164. <el-button v-if="scope.row.courseScheduleStatus == 'OVER' && !scope.row.settlementTime && permission('studentAttendance/updateStudentAttendances?t=570')"
  165. type="text"
  166. @click="onCallName(scope.row)">点名表</el-button>
  167. <!-- OVER -->
  168. <!-- <el-button
  169. v-if="scope.row.courseScheduleStatus == 'OVER' && permission('courseSchedule/classStartDateAdjust1')"
  170. type="text"
  171. @click="resetClass(scope.row)"
  172. >调整</el-button>-->
  173. <el-button v-if="!scope.row.settlementTime && permission('courseSchedule/classStartDateAdjust')"
  174. type="text"
  175. @click="resetClass(scope.row)">调整</el-button>
  176. <el-button v-if="scope.row.courseScheduleStatus == 'NOT_START' && permission('courseSchedule/batchDelete')"
  177. type="text"
  178. @click="removeSingleClass(scope.row)">删除</el-button>
  179. <!-- v-if="scope.row.courseScheduleStatus == 'NOT_START' && permission('courseSchedule/batchDelete')" teamDetail/resetTpye-->
  180. <!-- <el-button type="text"
  181. @click="resetType(scope.row)"
  182. v-if="permission('teamDetail/resetTpye')&&scope.row.courseScheduleType!='HIGH_ONLINE'&&scope.row.courseScheduleType!='MUSIC_NETWORK'">类型调整</el-button> -->
  183. <el-button type="text"
  184. v-if="permission('courseSchedule/cleanAttendance')"
  185. @click="clearAttend(scope.row)">清除考勤</el-button>
  186. </div>
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. <pagination :total="rules.total"
  191. :page.sync="rules.page"
  192. :limit.sync="rules.limit"
  193. :page-sizes="rules.page_size"
  194. @pagination="getList" />
  195. </div>
  196. <el-dialog title="课程调整"
  197. width="400px"
  198. :before-close="handleClose"
  199. :visible.sync="courseVisible">
  200. <el-form :model="maskForm"
  201. class="maskForm"
  202. ref="maskForm"
  203. :rules="maskRules"
  204. label-position="right"
  205. label-width="120px"
  206. :inline="true">
  207. <!-- <el-form-item label="课程类型" prop="type">
  208. <el-select v-model.trim="maskForm.type" clearable filterable>
  209. <el-option
  210. v-for="(item,index) in courseType"
  211. :key="index"
  212. :value="item.value"
  213. :label="item.label"
  214. ></el-option>
  215. </el-select>
  216. </el-form-item>-->
  217. <el-form-item label="主教老师"
  218. prop="teacher">
  219. <el-select v-model.trim="maskForm.teacher"
  220. clearable
  221. filterable>
  222. <el-option v-for="(item,index) in teacherList"
  223. :key="index"
  224. :value="item.id"
  225. :label="item.realName"></el-option>
  226. </el-select>
  227. </el-form-item>
  228. <el-form-item label="助教老师"
  229. v-if="maskForm.courseScheduleType != 'MUSIC_NETWORK'&&maskForm.courseScheduleType != 'HIGH_ONLINE'"
  230. prop="assistant">
  231. <el-select v-model.trim="maskForm.assistant"
  232. clearable
  233. filterable
  234. multiple
  235. collapse-tags>
  236. <el-option v-for="(item,index) in teacherList"
  237. :key="index"
  238. :value="item.id"
  239. :label="item.realName"></el-option>
  240. </el-select>
  241. </el-form-item>
  242. <el-form-item label="上课日期"
  243. prop="date">
  244. <el-date-picker v-model.trim="maskForm.date"
  245. type="date"
  246. :picker-options="{
  247. firstDayOfWeek:1
  248. }"
  249. value-format="yyyy-MM-dd"
  250. placeholder="选择日期"></el-date-picker>
  251. </el-form-item>
  252. <el-form-item label="课程时长(分钟)"
  253. v-if="courseVisible"
  254. prop="timer">
  255. <el-input type='number'
  256. disabled
  257. v-model="maskForm.timer"></el-input>
  258. </el-form-item>
  259. <el-form-item label="开始时间"
  260. v-if="courseVisible"
  261. prop="startTime">
  262. <el-time-picker placeholder="起始时间"
  263. v-model.trim="maskForm.startTime"
  264. @change="changeStartTime"
  265. format='HH:mm'
  266. value-format='HH:mm'
  267. :picker-options="{
  268. selectableRange: '04:30:00 - 23:30:00'
  269. }"></el-time-picker>
  270. </el-form-item>
  271. <el-form-item label="结束时间"
  272. v-if="courseVisible"
  273. prop="endTime">
  274. <el-time-select placeholder="结束时间"
  275. v-model.trim="maskForm.endTime"
  276. disabled
  277. :picker-options="{
  278. start: '04:30',
  279. step: '00:05',
  280. end: '23:30',
  281. minTime: maskForm.startTime
  282. }"></el-time-select>
  283. </el-form-item>
  284. </el-form>
  285. <div slot="footer"
  286. class="dialog-footer">
  287. <el-button @click="courseVisible = false">取 消</el-button>
  288. <el-button type="primary"
  289. @click="submitResetClass">确 定</el-button>
  290. </div>
  291. </el-dialog>
  292. <el-dialog title="修改时间"
  293. width="400px"
  294. :before-close="handleCloseTimer"
  295. :visible.sync="timerVisible">
  296. <el-form :model="timerMask">
  297. <el-form-item label="上课日期"
  298. :rules=" [{ required: true, message: '请选择日期', trigger: 'blur' },]">
  299. <el-date-picker v-model.trim="timerMask.timer"
  300. type="date"
  301. format="yyyy-MM-dd"
  302. value-format="yyyy-MM-dd"
  303. :picker-options="{
  304. firstDayOfWeek:1
  305. }"
  306. placeholder="选择日期"></el-date-picker>
  307. </el-form-item>
  308. </el-form>
  309. <div slot="footer"
  310. class="dialog-footer">
  311. <el-button @click="timerVisible = false">取 消</el-button>
  312. <el-button type="primary"
  313. @click="batchAdjustmentTime">确 定</el-button>
  314. </div>
  315. </el-dialog>
  316. <el-dialog title="补考勤"
  317. width="400px"
  318. :visible.sync="markAttendance.status">
  319. <el-form>
  320. <el-form-item label="签到状态">{{ markAttendance.dataInfo.signInStatus | attendanceType }}</el-form-item>
  321. <el-form-item label="签到时间">{{ markAttendance.dataInfo.signInTime}}</el-form-item>
  322. <el-form-item label="签退状态">{{ markAttendance.dataInfo.signOutStatus | attendanceOutType }}</el-form-item>
  323. <el-form-item label="签退时间">{{ markAttendance.dataInfo.signOutTime}}</el-form-item>
  324. </el-form>
  325. <div slot="footer"
  326. class="dialog-footer">
  327. <el-button @click="markAttendance.status = false">取 消</el-button>
  328. <el-button type="primary"
  329. :disabled="markAttendance.dataInfo.signOutStatus == 1 && markAttendance.dataInfo.signInStatus == 1 ? true : false"
  330. @click="batchAdjustmentTime">确定补卡</el-button>
  331. </div>
  332. </el-dialog>
  333. <el-dialog title="点名表"
  334. width="800px"
  335. :visible.sync="rollCall.status">
  336. <el-table :data="rollCall.gridData">
  337. <el-table-column align="center"
  338. property="userName"
  339. label="学员姓名"></el-table-column>
  340. <el-table-column align="center"
  341. property="phone"
  342. label="手机号"></el-table-column>
  343. <el-table-column align="center"
  344. property="subjectName"
  345. label="学员声部"></el-table-column>
  346. <el-table-column align="center"
  347. label="到课状态">
  348. <template slot-scope="scope">{{ scope.row.status | studentCallName }}</template>
  349. </el-table-column>
  350. <el-table-column align="center"
  351. label="操作"
  352. width="240px">
  353. <template slot-scope="scope">
  354. <el-button size="small"
  355. @click="onChangeRollCall('TRUANT', scope.row)"
  356. type="primary"
  357. round>未到</el-button>
  358. <el-button size="small"
  359. @click="onChangeRollCall('LEAVE', scope.row)"
  360. type="warning"
  361. round>请假</el-button>
  362. <el-button size="small"
  363. @click="onChangeRollCall('NORMAL', scope.row)"
  364. type="success"
  365. round>到课</el-button>
  366. </template>
  367. </el-table-column>
  368. </el-table>
  369. <pagination :total="rollCall.total"
  370. :page.sync="rollCall.page"
  371. :limit.sync="rollCall.limit"
  372. :page-sizes="rollCall.page_size"
  373. @pagination="getCallName" />
  374. </el-dialog>
  375. <el-dialog title="类型修改"
  376. width="400px"
  377. :visible.sync="typeVisible">
  378. <el-form :model="typeForm"
  379. ref="typeForm"
  380. :rules="typeRules"
  381. label-position="right"
  382. label-width="80px;"
  383. :inline="true">
  384. <el-form-item label="课程类型"
  385. prop="type">
  386. <el-select v-model.trim="typeForm.type"
  387. clearable
  388. filterable>
  389. <el-option v-for="(item,index) in courseType"
  390. :key="index"
  391. :value="item.value"
  392. :label="item.label"></el-option>
  393. </el-select>
  394. </el-form-item>
  395. </el-form>
  396. <div slot="footer"
  397. class="dialog-footer">
  398. <el-button @click="typeVisible = false">取 消</el-button>
  399. <el-button type="primary"
  400. @click="submitResetType">确定</el-button>
  401. </div>
  402. </el-dialog>
  403. </div>
  404. </template>
  405. <script>
  406. import dayjs from 'dayjs'
  407. import pagination from "@/components/Pagination/index";
  408. import { bathDelete } from "@/api/vipSeting";
  409. import {
  410. getCourseList,
  411. findMusicGroupClassTeacher,
  412. resetCourse,
  413. getTeacher,
  414. getMusicGroupAllClass,
  415. getCourseSchedule,
  416. batchAdjustment,
  417. updateTeacherAttendance,
  418. findAttendanceStudentByCourseWithPage,
  419. updateStudentAttendances,
  420. cleanAttendance
  421. } from "@/api/buildTeam";
  422. import { permission } from "@/utils/directivePage";
  423. import { diffTimerFormMinute, addTimerFormMinute } from '@/utils/date'
  424. import { classTimeList } from "@/utils/searchArray";
  425. import cleanDeep from 'clean-deep'
  426. export default {
  427. name: "tcourseList",
  428. data () {
  429. return {
  430. classTimeList,
  431. courseType: [
  432. { value: "SINGLE", label: "单技课" },
  433. { value: "MIX", label: "合奏课" },
  434. { value: "TRAINING_SINGLE", label: "集训单技课" },
  435. { value: "TRAINING_MIX", label: "集训合奏课" },
  436. { value: "HIGH", label: "基础技能课" },
  437. { value: "COMPREHENSIVE", label: "综合课" },
  438. { value: "CLASSROOM", label: "课堂课" },
  439. // { value: "HIGH_ONLINE", label: "线上基础技能课" },
  440. // { value: "MUSIC_NETWORK", label: "乐团网管课" },
  441. ],
  442. typeVisible: false,
  443. timerVisible: false,
  444. courseVisible: false,
  445. searchForm: {
  446. courseStatus: "", // 课程类型
  447. classStatus: "", // 课程状态
  448. timer: [], // 时间
  449. class: "",
  450. isSettlement: ""
  451. },
  452. tableList: [],
  453. searchLsit: [],
  454. rules: {
  455. // 分页规则
  456. limit: 10, // 限制显示条数
  457. page: 1, // 当前页
  458. total: 0, // 总条数
  459. page_size: [10, 20, 40, 50] // 选择限制显示条数
  460. },
  461. maskForm: {
  462. teacher: "",
  463. assistant: "",
  464. date: "",
  465. id: "",
  466. startTime: "",
  467. endTime: "",
  468. type: "",
  469. timer: '',
  470. courseScheduleType: null,
  471. },
  472. typeForm: {
  473. teacher: "",
  474. assistant: "",
  475. date: "",
  476. startTime: "",
  477. endTime: "",
  478. type: null,
  479. id: null
  480. },
  481. maskRules: {
  482. // type:[
  483. // {required: true, message: "请选择课程类型", trigger: "blur"}
  484. // ],
  485. teacher: [
  486. { required: true, message: "请选择主教老师名称", trigger: "blur" }
  487. ],
  488. date: [{ required: true, message: "请选择上课时间", trigger: "blur" }]
  489. // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  490. // endTime: [{ required: true, message: '请选择上课结束时间', trigger: 'blur' },],
  491. },
  492. typeRules: {
  493. type: [{ required: true, message: "请选择课程类型", trigger: "blur" }]
  494. },
  495. teacherList: [],
  496. classList: [],
  497. activeCourseList: [],
  498. timerMask: {
  499. timer: ""
  500. },
  501. markAttendance: {
  502. // 考勤状态
  503. status: false,
  504. dataInfo: {}
  505. },
  506. rollCall: {
  507. // 点名表
  508. status: false,
  509. gridData: [],
  510. selectItem: {}, // 选中状态
  511. limit: 10, // 限制显示条数
  512. page: 1, // 当前页
  513. total: 0, // 总条数
  514. page_size: [10, 20, 40, 50] // 选择限制显示条数
  515. }
  516. };
  517. },
  518. components: {
  519. pagination
  520. },
  521. mounted () {
  522. this.init();
  523. },
  524. activated () {
  525. this.init();
  526. },
  527. methods: {
  528. init () {
  529. this.teamid = this.$route.query.id;
  530. this.getList();
  531. // 获取所有老师
  532. // findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
  533. // if (res.code == 200) {
  534. // this.teacherList = res.data;
  535. // }
  536. // })
  537. getTeacher().then(res => {
  538. if (res.code == 200) {
  539. this.teacherList = res.data;
  540. }
  541. });
  542. // 获取班级列表
  543. getMusicGroupAllClass({ musicGroupId: this.teamid }).then(res => {
  544. if (res.code == 200) {
  545. this.classList = res.data;
  546. }
  547. });
  548. },
  549. onMarkAttendance (item) {
  550. // 补考勤
  551. this.markAttendance = {
  552. status: true,
  553. dataInfo: item
  554. };
  555. },
  556. onCallName (item) {
  557. // 点名表
  558. this.rollCall.page = 1;
  559. this.rollCall.selectItem = item;
  560. this.getCallName();
  561. },
  562. getCallName () {
  563. let rollCall = this.rollCall;
  564. let params = {
  565. page: rollCall.page,
  566. rows: rollCall.limit,
  567. courseScheduleId: rollCall.selectItem.courseScheduleId
  568. };
  569. findAttendanceStudentByCourseWithPage(params).then(res => {
  570. let result = res.data;
  571. rollCall.status = true;
  572. if (res.code == 200) {
  573. rollCall.gridData = result.rows;
  574. rollCall.total = result.total;
  575. }
  576. });
  577. },
  578. onChangeRollCall (type, row) {
  579. let rollCall = this.rollCall;
  580. let params = {
  581. courseScheduleId: rollCall.selectItem.courseScheduleId,
  582. studentAttendances: [
  583. {
  584. userId: row.studentId,
  585. status: type
  586. }
  587. ]
  588. };
  589. updateStudentAttendances(params).then(res => {
  590. if (res.code == 200) {
  591. this.$message.success("修改成功");
  592. row.status = type;
  593. this.getList();
  594. } else {
  595. this.$message.error(res.msg);
  596. }
  597. });
  598. },
  599. permission (str, parent) {
  600. return permission(str, parent);
  601. },
  602. search () {
  603. this.rules.page = 1;
  604. this.getList();
  605. },
  606. getList () {
  607. let searchForm = this.searchForm;
  608. if (!searchForm.timer) {
  609. searchForm.timer = [];
  610. }
  611. let obj = {
  612. classScheduleStatus: searchForm.classStatus || null,
  613. classScheduleType: searchForm.courseStatus || null,
  614. musicGroupId: this.teamid,
  615. startTime: searchForm.timer[0] || null,
  616. endTime: searchForm.timer[1] || null,
  617. page: this.rules.page,
  618. rows: this.rules.limit,
  619. classGroupId: searchForm.class || null,
  620. isSettlement: searchForm.isSettlement || null
  621. };
  622. getCourseSchedule(obj).then(res => {
  623. if (res.code == 200) {
  624. this.tableList = res.data.rows;
  625. this.rules.total = res.data.total;
  626. }
  627. });
  628. },
  629. resetClass (row) {
  630. this.maskForm.teacher = parseInt(row.masterTeacherId);
  631. this.maskForm.courseScheduleType = row.courseScheduleType;
  632. // this.maskForm.type = row.courseScheduleType;
  633. this.maskForm.assistant = [];
  634. for (let i in row.teachingTeachers) {
  635. if (row.teachingTeachers[i].teacherRole == "TEACHING") {
  636. this.maskForm.assistant.push(row.teachingTeachers[i].userId);
  637. }
  638. }
  639. this.maskForm.date = row.classDate;
  640. this.$set(
  641. this.maskForm,
  642. "startTime",
  643. row.startClassTimeStr.substring(0, 5)
  644. );
  645. let time = diffTimerFormMinute(row.classDate, row.startClassTimeStr, row.endClassTimeStr)
  646. this.maskForm.timer = time;
  647. this.maskForm.endTime = addTimerFormMinute(row.classDate, row.startClassTimeStr, time)
  648. // this.maskForm.endTime = row.endClassTimeStr.substring(0, 5);
  649. this.maskForm.id = row.courseScheduleId;
  650. this.courseVisible = true;
  651. // 修改课时
  652. // let obj = {
  653. // actualTeacherId: this.maskForm.teacher,
  654. // classDate: this.maskForm.date,
  655. // classGroupId: row.id
  656. // }
  657. },
  658. removeSingleClass (row) {
  659. this.$confirm("是否删除该课程?", "提示", {
  660. confirmButtonText: "确定",
  661. cancelButtonText: "取消",
  662. type: "warning"
  663. })
  664. .then(() => {
  665. let courseScheduleIds = row.courseScheduleId;
  666. bathDelete({ courseScheduleIds }).then(res => {
  667. if (res.code == 200) {
  668. this.$message.success("删除成功");
  669. this.getList();
  670. }
  671. });
  672. })
  673. .catch(() => { });
  674. },
  675. removeCourses () {
  676. // 批量删除
  677. if (this.activeCourseList.length < 1) {
  678. this.$message.error("请至少选择一节课");
  679. return;
  680. }
  681. let arr = [];
  682. arr = this.activeCourseList.map(item => {
  683. return item.courseScheduleId;
  684. });
  685. this.$confirm("是否删除该课程?", "提示", {
  686. confirmButtonText: "确定",
  687. cancelButtonText: "取消",
  688. type: "warning"
  689. })
  690. .then(() => {
  691. let courseScheduleIds = arr.join(",");
  692. bathDelete({ courseScheduleIds }).then(res => {
  693. if (res.code == 200) {
  694. this.$message.success("删除成功");
  695. this.getList();
  696. }
  697. });
  698. })
  699. .catch(() => { });
  700. },
  701. submitResetClass () {
  702. let maskForm = this.maskForm;
  703. if (!maskForm.startTime || !maskForm.endTime) {
  704. this.$message.error("请填写开始时间或结束时间");
  705. return;
  706. }
  707. this.$confirm("是否确定?", "提示", {
  708. confirmButtonText: "确定",
  709. cancelButtonText: "取消",
  710. type: "warning"
  711. })
  712. .then(() => {
  713. let teachingTeacherIdList = maskForm.assistant.join(",");
  714. if (teachingTeacherIdList.length <= 0) {
  715. let teachingTeacherIdList = null;
  716. }
  717. let obj = {
  718. actualTeacherId: maskForm.teacher,
  719. startClassTimeStr: maskForm.startTime,
  720. endClassTimeStr: maskForm.endTime,
  721. id: maskForm.id,
  722. teachingTeacherIdList,
  723. classDate: maskForm.date,
  724. type: maskForm.type,
  725. groupType: 'MUSIC'
  726. };
  727. resetCourse(cleanDeep(obj)).then(res => {
  728. if (res.code == 200) {
  729. this.$message.success("修改成功");
  730. this.getList();
  731. this.courseVisible = false;
  732. }
  733. });
  734. })
  735. .catch(() => { });
  736. },
  737. handleClose () {
  738. this.courseVisible = false;
  739. (this.maskForm = {
  740. teacher: "",
  741. assistant: "",
  742. date: "",
  743. id: "",
  744. startTime: "",
  745. endTime: ""
  746. }),
  747. this.$refs["maskForm"].resetFields();
  748. },
  749. handleSelectionChange (val) {
  750. this.activeCourseList = val;
  751. },
  752. checkSelectable (val) {
  753. return val.courseScheduleStatus == "NOT_START";
  754. // return true;
  755. },
  756. batchAdjustmentTime () {
  757. let tempData = this.markAttendance.dataInfo;
  758. let params = {
  759. teacherId: tempData.masterTeacherId,
  760. courseScheduleId: tempData.courseScheduleId,
  761. signInStatus: 1,
  762. signOutStatus: 1
  763. };
  764. updateTeacherAttendance(params).then(res => {
  765. if (res.code == 200) {
  766. this.$message.success("补卡成功");
  767. this.markAttendance.status = false;
  768. this.getList();
  769. } else {
  770. this.$message.error(res.msg);
  771. }
  772. });
  773. },
  774. handleCloseTimer () {
  775. this.timerVisible = false;
  776. this.timerMask.timer = "";
  777. },
  778. resetTimer () {
  779. if (this.activeCourseList.length < 1) {
  780. this.$message.error("请至少选择一节课");
  781. return;
  782. }
  783. this.timerVisible = true;
  784. },
  785. resetType (row) {
  786. this.typeForm.type = row.courseScheduleType;
  787. this.typeForm.id = row.courseScheduleId;
  788. this.typeForm.teacher = parseInt(row.masterTeacherId);
  789. // this.maskForm.type = row.courseScheduleType;
  790. this.typeForm.assistant = [];
  791. for (let i in row.teachingTeachers) {
  792. if (row.teachingTeachers[i].teacherRole == "TEACHING") {
  793. this.typeForm.assistant.push(row.teachingTeachers[i].userId);
  794. }
  795. }
  796. this.typeForm.date = row.classDate;
  797. this.$set(
  798. this.typeForm,
  799. "startTime",
  800. row.startClassTimeStr.substring(0, 5)
  801. );
  802. this.typeForm.endTime = row.endClassTimeStr.substring(0, 5);
  803. // console.log(row.type)
  804. this.typeVisible = true;
  805. },
  806. submitResetType () {
  807. this.$refs.typeForm.validate(res => {
  808. if (res) {
  809. let teachingTeacherIdList = this.typeForm.assistant.join(",");
  810. if (teachingTeacherIdList.length <= 0) {
  811. let teachingTeacherIdList = null;
  812. }
  813. let obj = {
  814. actualTeacherId: this.typeForm.teacher,
  815. startClassTimeStr: this.typeForm.startTime,
  816. endClassTimeStr: this.typeForm.endTime,
  817. id: this.typeForm.id,
  818. type: this.typeForm.type,
  819. teachingTeacherIdList,
  820. classDate: this.typeForm.date,
  821. };
  822. resetCourse(obj).then(res => {
  823. if (res.code == 200) {
  824. this.$message.success("修改成功");
  825. this.getList();
  826. this.typeVisible = false;
  827. }
  828. });
  829. }
  830. });
  831. },
  832. // 清除考勤
  833. clearAttend (row) {
  834. this.$confirm("是否清除考勤记录?", "提示", {
  835. confirmButtonText: "确定",
  836. cancelButtonText: "取消",
  837. type: "warning"
  838. })
  839. .then(() => {
  840. cleanAttendance({ courseScheduleIds: row.courseScheduleId }).then(
  841. res => {
  842. if (res.code == 200) {
  843. this.$message.success("清除成功");
  844. this.getList();
  845. } else {
  846. this.$message.error(res.msg);
  847. }
  848. }
  849. );
  850. })
  851. .catch(() => { });
  852. },
  853. changeStartTime (val) {
  854. this.$nextTick(res => {
  855. this.maskForm.endTime = addTimerFormMinute(this.maskForm.date, val, this.maskForm.timer);
  856. })
  857. },
  858. },
  859. filters: {
  860. studentCallName: value => {
  861. let template = {
  862. NORMAL: "到课",
  863. TRUANT: "未到",
  864. LEAVE: "请假",
  865. DROP_OUT: "退学",
  866. "": "未到"
  867. };
  868. return template[value];
  869. }
  870. }, watch: {
  871. 'maskForm.timer' (val) {
  872. this.maskForm.endTime = addTimerFormMinute(this.maskForm.date, this.maskForm.startTime, val);
  873. }
  874. }
  875. };
  876. </script>
  877. <style lang="scss" scoped>
  878. .cl-container {
  879. .topFrom {
  880. margin: 20px 30px 0;
  881. .classlist {
  882. display: flex;
  883. flex-direction: row;
  884. justify-content: flex-start;
  885. align-items: center;
  886. ul {
  887. li {
  888. list-style: none;
  889. }
  890. }
  891. }
  892. }
  893. .searchForm {
  894. // margin: 0 30px;
  895. }
  896. }
  897. .btnWraps {
  898. display: flex;
  899. flex-direction: row;
  900. justify-content: flex-start;
  901. div {
  902. margin-right: 20px;
  903. }
  904. }
  905. .maskForm {
  906. /deep/.el-input {
  907. width: 220px;
  908. }
  909. }
  910. </style>