courseList.vue 32 KB

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