courseList.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985
  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' && 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="scope.row.courseScheduleStatus == 'OVER' && !scope.row.settlementTime &&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">
  258. <template slot="append">分钟</template>
  259. </el-input> -->
  260. <el-select v-model="maskForm.timer" @change="changeTime">
  261. <el-option v-for="(item,index) in typeTimeList"
  262. :key="index"
  263. :value="parseInt(item)"
  264. :label="item"></el-option>
  265. </el-select>
  266. </el-form-item>
  267. <el-form-item label="开始时间"
  268. v-if="courseVisible"
  269. prop="startTime">
  270. <el-time-picker placeholder="起始时间"
  271. v-model.trim="maskForm.startTime"
  272. @change="changeStartTime"
  273. format='HH:mm'
  274. value-format='HH:mm'
  275. :picker-options="{
  276. selectableRange: '04:30:00 - 23:30:00'
  277. }"></el-time-picker>
  278. </el-form-item>
  279. <el-form-item label="结束时间"
  280. v-if="courseVisible"
  281. prop="endTime">
  282. <el-time-select placeholder="结束时间"
  283. v-model.trim="maskForm.endTime"
  284. disabled
  285. :picker-options="{
  286. start: '04:30',
  287. step: '00:05',
  288. end: '23:30',
  289. minTime: maskForm.startTime
  290. }"></el-time-select>
  291. </el-form-item>
  292. <el-form-item label="教学地点"
  293. prop="schoolId"
  294. v-if="maskForm.courseScheduleType != 'HIGH_ONLINE'&&maskForm.courseScheduleType != 'MUSIC_NETWORK'">
  295. <el-select v-model.trim="
  296. maskForm.schoolId"
  297. style="width:220px!important"
  298. filterable
  299. clearable>
  300. <el-option v-for="(item,index) in schoolList"
  301. :key="index"
  302. :value="item.id"
  303. :label="item.name"></el-option>
  304. </el-select>
  305. </el-form-item>
  306. </el-form>
  307. <div slot="footer"
  308. class="dialog-footer">
  309. <el-button @click="courseVisible = false">取 消</el-button>
  310. <el-button type="primary"
  311. @click="submitResetClass">确 定</el-button>
  312. </div>
  313. </el-dialog>
  314. <el-dialog title="修改时间"
  315. width="400px"
  316. :before-close="handleCloseTimer"
  317. :visible.sync="timerVisible">
  318. <el-form :model="timerMask">
  319. <el-form-item label="上课日期"
  320. :rules=" [{ required: true, message: '请选择日期', trigger: 'blur' },]">
  321. <el-date-picker v-model.trim="timerMask.timer"
  322. type="date"
  323. format="yyyy-MM-dd"
  324. value-format="yyyy-MM-dd"
  325. :picker-options="{
  326. firstDayOfWeek:1
  327. }"
  328. placeholder="选择日期"></el-date-picker>
  329. </el-form-item>
  330. </el-form>
  331. <div slot="footer"
  332. class="dialog-footer">
  333. <el-button @click="timerVisible = false">取 消</el-button>
  334. <el-button type="primary"
  335. @click="batchAdjustmentTime">确 定</el-button>
  336. </div>
  337. </el-dialog>
  338. <el-dialog title="补考勤"
  339. width="400px"
  340. :visible.sync="markAttendance.status">
  341. <el-form>
  342. <el-form-item label="签到状态">{{ markAttendance.dataInfo.signInStatus | attendanceType }}</el-form-item>
  343. <el-form-item label="签到时间">{{ markAttendance.dataInfo.signInTime}}</el-form-item>
  344. <el-form-item label="签退状态">{{ markAttendance.dataInfo.signOutStatus | attendanceOutType }}</el-form-item>
  345. <el-form-item label="签退时间">{{ markAttendance.dataInfo.signOutTime}}</el-form-item>
  346. </el-form>
  347. <div slot="footer"
  348. class="dialog-footer">
  349. <el-button @click="markAttendance.status = false">取 消</el-button>
  350. <el-button type="primary"
  351. :disabled="markAttendance.dataInfo.signOutStatus == 1 && markAttendance.dataInfo.signInStatus == 1 ? true : false"
  352. @click="batchAdjustmentTime">确定补卡</el-button>
  353. </div>
  354. </el-dialog>
  355. <el-dialog title="点名表"
  356. width="800px"
  357. :visible.sync="rollCall.status">
  358. <el-table :data="rollCall.gridData">
  359. <el-table-column align="center"
  360. property="userName"
  361. label="学员姓名"></el-table-column>
  362. <el-table-column align="center"
  363. property="phone"
  364. label="手机号"></el-table-column>
  365. <el-table-column align="center"
  366. property="subjectName"
  367. label="学员声部"></el-table-column>
  368. <el-table-column align="center"
  369. label="到课状态">
  370. <template slot-scope="scope">{{ scope.row.status | studentCallName }}</template>
  371. </el-table-column>
  372. <el-table-column align="center"
  373. v-if="!rollCall.selectItem.settlementTime"
  374. label="操作"
  375. width="240px">
  376. <template slot-scope="scope">
  377. <el-button size="small"
  378. @click="onChangeRollCall('TRUANT', scope.row)"
  379. type="primary"
  380. round>未到</el-button>
  381. <el-button size="small"
  382. @click="onChangeRollCall('LEAVE', scope.row)"
  383. type="warning"
  384. round>请假</el-button>
  385. <el-button size="small"
  386. @click="onChangeRollCall('NORMAL', scope.row)"
  387. type="success"
  388. round>到课</el-button>
  389. </template>
  390. </el-table-column>
  391. </el-table>
  392. <pagination :total="rollCall.total"
  393. :page.sync="rollCall.page"
  394. :limit.sync="rollCall.limit"
  395. :page-sizes="rollCall.page_size"
  396. @pagination="getCallName" />
  397. </el-dialog>
  398. <el-dialog title="类型修改"
  399. width="400px"
  400. :visible.sync="typeVisible">
  401. <el-form :model="typeForm"
  402. ref="typeForm"
  403. :rules="typeRules"
  404. label-position="right"
  405. label-width="80px;"
  406. :inline="true">
  407. <el-form-item label="课程类型"
  408. prop="type">
  409. <el-select v-model.trim="typeForm.type"
  410. clearable
  411. filterable>
  412. <el-option v-for="(item,index) in courseType"
  413. :key="index"
  414. :value="item.value"
  415. :label="item.label"></el-option>
  416. </el-select>
  417. </el-form-item>
  418. </el-form>
  419. <div slot="footer"
  420. class="dialog-footer">
  421. <el-button @click="typeVisible = false">取 消</el-button>
  422. <el-button type="primary"
  423. @click="submitResetType">确定</el-button>
  424. </div>
  425. </el-dialog>
  426. </div>
  427. </template>
  428. <script>
  429. import dayjs from 'dayjs'
  430. import pagination from "@/components/Pagination/index";
  431. import { bathDelete } from "@/api/vipSeting";
  432. import {
  433. getCourseList,
  434. findMusicGroupClassTeacher,
  435. resetCourse,
  436. getTeacher,
  437. getMusicGroupAllClass,
  438. getCourseSchedule,
  439. batchAdjustment,
  440. updateTeacherAttendance,
  441. findAttendanceStudentByCourseWithPage,
  442. updateStudentAttendances,
  443. cleanAttendance,
  444. getOrganCourseDurationSettings
  445. } from "@/api/buildTeam";
  446. import { permission } from "@/utils/directivePage";
  447. import { diffTimerFormMinute, addTimerFormMinute } from '@/utils/date'
  448. import { classTimeList } from "@/utils/searchArray";
  449. import { getSchool } from "@/api/systemManage"
  450. import cleanDeep from 'clean-deep'
  451. export default {
  452. name: "tcourseList",
  453. data () {
  454. return {
  455. classTimeList,
  456. courseType: [
  457. { value: "SINGLE", label: "单技课" },
  458. { value: "MIX", label: "合奏课" },
  459. { value: "TRAINING_SINGLE", label: "集训单技课" },
  460. { value: "TRAINING_MIX", label: "集训合奏课" },
  461. { value: "HIGH", label: "基础技能课" },
  462. { value: "COMPREHENSIVE", label: "综合课" },
  463. { value: "CLASSROOM", label: "课堂课" },
  464. // { value: "HIGH_ONLINE", label: "线上基础技能课" },
  465. // { value: "MUSIC_NETWORK", label: "乐团网管课" },
  466. ],
  467. typeVisible: false,
  468. timerVisible: false,
  469. courseVisible: false,
  470. searchForm: {
  471. courseStatus: "", // 课程类型
  472. classStatus: "", // 课程状态
  473. timer: [], // 时间
  474. class: "",
  475. isSettlement: ""
  476. },
  477. tableList: [],
  478. searchLsit: [],
  479. rules: {
  480. // 分页规则
  481. limit: 10, // 限制显示条数
  482. page: 1, // 当前页
  483. total: 0, // 总条数
  484. page_size: [10, 20, 40, 50] // 选择限制显示条数
  485. },
  486. maskForm: {
  487. teacher: "",
  488. assistant: "",
  489. date: "",
  490. id: "",
  491. startTime: "",
  492. endTime: "",
  493. type: "",
  494. timer: '',
  495. courseScheduleType: null,
  496. address: '',
  497. teachMode: '',
  498. schoolId: ''
  499. },
  500. typeForm: {
  501. teacher: "",
  502. assistant: "",
  503. date: "",
  504. startTime: "",
  505. endTime: "",
  506. type: null,
  507. id: null
  508. },
  509. maskRules: {
  510. schoolId: [
  511. { required: true, message: "请选教学地点", trigger: "blur" }
  512. ],
  513. teacher: [
  514. { required: true, message: "请选择主教老师名称", trigger: "blur" }
  515. ],
  516. date: [{ required: true, message: "请选择上课时间", trigger: "blur" }]
  517. // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  518. // endTime: [{ required: true, message: '请选择上课结束时间', trigger: 'blur' },],
  519. },
  520. typeRules: {
  521. type: [{ required: true, message: "请选择课程类型", trigger: "blur" }]
  522. },
  523. teacherList: [],
  524. classList: [],
  525. activeCourseList: [],
  526. timerMask: {
  527. timer: ""
  528. },
  529. markAttendance: {
  530. // 考勤状态
  531. status: false,
  532. dataInfo: {}
  533. },
  534. rollCall: {
  535. // 点名表
  536. status: false,
  537. gridData: [],
  538. selectItem: {}, // 选中状态
  539. limit: 10, // 限制显示条数
  540. page: 1, // 当前页
  541. total: 0, // 总条数
  542. page_size: [10, 20, 40, 50] // 选择限制显示条数
  543. },
  544. organId: '',
  545. schoolList: [],
  546. courseTimeList:{},
  547. typeTimeList:[]
  548. };
  549. },
  550. components: {
  551. pagination
  552. },
  553. mounted () {
  554. this.init();
  555. getSchool({ organId: this.$route.query.organId }).then(res => {
  556. if (res.code == 200) {
  557. this.schoolList = res.data;
  558. }
  559. })
  560. },
  561. activated () {
  562. this.init();
  563. },
  564. methods: {
  565. async init () {
  566. this.teamid = this.$route.query.id;
  567. this.organId = this.$route.query.organId
  568. try{
  569. const res = await getOrganCourseDurationSettings({organId:this.organId})
  570. this.courseTimeList = res.data
  571. }catch{}
  572. // MusicStore.dispatch('getBaseInfo', {
  573. // data: { musicGroupId: this.teamid }
  574. // }).then((res) => {
  575. // console.log(res)
  576. // })
  577. this.getList();
  578. // 获取所有老师
  579. // findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
  580. // if (res.code == 200) {
  581. // this.teacherList = res.data;
  582. // }
  583. // })
  584. getTeacher().then(res => {
  585. if (res.code == 200) {
  586. this.teacherList = res.data;
  587. }
  588. });
  589. // 获取班级列表
  590. getMusicGroupAllClass({ musicGroupId: this.teamid }).then(res => {
  591. if (res.code == 200) {
  592. this.classList = res.data;
  593. }
  594. });
  595. },
  596. onMarkAttendance (item) {
  597. // 补考勤
  598. this.markAttendance = {
  599. status: true,
  600. dataInfo: item
  601. };
  602. },
  603. onCallName (item) {
  604. // 点名表
  605. this.rollCall.page = 1;
  606. this.rollCall.selectItem = item;
  607. this.getCallName();
  608. },
  609. getCallName () {
  610. let rollCall = this.rollCall;
  611. let params = {
  612. page: rollCall.page,
  613. rows: rollCall.limit,
  614. courseScheduleId: rollCall.selectItem.courseScheduleId
  615. };
  616. findAttendanceStudentByCourseWithPage(params).then(res => {
  617. let result = res.data;
  618. rollCall.status = true;
  619. if (res.code == 200) {
  620. rollCall.gridData = result.rows;
  621. rollCall.total = result.total;
  622. }
  623. });
  624. },
  625. onChangeRollCall (type, row) {
  626. let rollCall = this.rollCall;
  627. let params = {
  628. courseScheduleId: rollCall.selectItem.courseScheduleId,
  629. studentAttendances: [
  630. {
  631. userId: row.studentId,
  632. status: type
  633. }
  634. ]
  635. };
  636. updateStudentAttendances(params).then(res => {
  637. if (res.code == 200) {
  638. this.$message.success("修改成功");
  639. row.status = type;
  640. this.getList();
  641. } else {
  642. this.$message.error(res.msg);
  643. }
  644. });
  645. },
  646. permission (str, parent) {
  647. return permission(str, parent);
  648. },
  649. search () {
  650. this.rules.page = 1;
  651. this.getList();
  652. },
  653. getList () {
  654. let searchForm = this.searchForm;
  655. if (!searchForm.timer) {
  656. searchForm.timer = [];
  657. }
  658. let obj = {
  659. classScheduleStatus: searchForm.classStatus || null,
  660. classScheduleType: searchForm.courseStatus || null,
  661. musicGroupId: this.teamid,
  662. startTime: searchForm.timer[0] || null,
  663. endTime: searchForm.timer[1] || null,
  664. page: this.rules.page,
  665. rows: this.rules.limit,
  666. classGroupId: searchForm.class || null,
  667. isSettlement: searchForm.isSettlement || null
  668. };
  669. getCourseSchedule(obj).then(res => {
  670. if (res.code == 200) {
  671. this.tableList = res.data.rows;
  672. this.rules.total = res.data.total;
  673. }
  674. });
  675. },
  676. resetClass (row) {
  677. this.maskForm.teacher = parseInt(row.masterTeacherId);
  678. this.maskForm.courseScheduleType = row.courseScheduleType;
  679. // this.courseTimeList
  680. for(let key in this.courseTimeList){
  681. if(key == row.courseScheduleType){
  682. this.typeTimeList = this.courseTimeList[key].split(',')
  683. }
  684. }
  685. console.log(this.typeTimeList)
  686. // this.maskForm.type = row.courseScheduleType;
  687. this.maskForm.assistant = [];
  688. for (let i in row.teachingTeachers) {
  689. if (row.teachingTeachers[i].teacherRole == "TEACHING") {
  690. this.maskForm.assistant.push(row.teachingTeachers[i].userId);
  691. }
  692. }
  693. this.maskForm.date = row.classDate;
  694. this.$set(
  695. this.maskForm,
  696. "startTime",
  697. row.startClassTimeStr.substring(0, 5)
  698. );
  699. let time = diffTimerFormMinute(row.classDate, row.startClassTimeStr, row.endClassTimeStr)
  700. this.maskForm.timer = time;
  701. this.maskForm.endTime = addTimerFormMinute(row.classDate, row.startClassTimeStr, time)
  702. // this.maskForm.endTime = row.endClassTimeStr.substring(0, 5);
  703. this.maskForm.id = row.courseScheduleId;
  704. this.maskForm.schoolId = row.schoolId
  705. this.courseVisible = true;
  706. // 修改课时
  707. // let obj = {
  708. // actualTeacherId: this.maskForm.teacher,
  709. // classDate: this.maskForm.date,
  710. // classGroupId: row.id
  711. // }
  712. },
  713. removeSingleClass (row) {
  714. this.$confirm("是否删除该课程?", "提示", {
  715. confirmButtonText: "确定",
  716. cancelButtonText: "取消",
  717. type: "warning"
  718. })
  719. .then(() => {
  720. let courseScheduleIds = row.courseScheduleId;
  721. bathDelete({ courseScheduleIds }).then(res => {
  722. if (res.code == 200) {
  723. this.$message.success("删除成功");
  724. this.getList();
  725. }
  726. });
  727. })
  728. .catch(() => { });
  729. },
  730. removeCourses () {
  731. // 批量删除
  732. if (this.activeCourseList.length < 1) {
  733. this.$message.error("请至少选择一节课");
  734. return;
  735. }
  736. let arr = [];
  737. arr = this.activeCourseList.map(item => {
  738. return item.courseScheduleId;
  739. });
  740. this.$confirm("是否删除该课程?", "提示", {
  741. confirmButtonText: "确定",
  742. cancelButtonText: "取消",
  743. type: "warning"
  744. })
  745. .then(() => {
  746. let courseScheduleIds = arr.join(",");
  747. bathDelete({ courseScheduleIds }).then(res => {
  748. if (res.code == 200) {
  749. this.$message.success("删除成功");
  750. this.getList();
  751. }
  752. });
  753. })
  754. .catch(() => { });
  755. },
  756. submitResetClass () {
  757. let maskForm = this.maskForm;
  758. if (!maskForm.startTime || !maskForm.endTime) {
  759. this.$message.error("请填写开始时间或结束时间");
  760. return;
  761. }
  762. this.$confirm("是否确定?", "提示", {
  763. confirmButtonText: "确定",
  764. cancelButtonText: "取消",
  765. type: "warning"
  766. })
  767. .then(() => {
  768. let teachingTeacherIdList = maskForm.assistant.join(",");
  769. if (teachingTeacherIdList.length <= 0) {
  770. let teachingTeacherIdList = null;
  771. }
  772. let obj = {
  773. actualTeacherId: maskForm.teacher,
  774. startClassTimeStr: maskForm.startTime,
  775. endClassTimeStr: maskForm.endTime,
  776. id: maskForm.id,
  777. teachingTeacherIdList,
  778. classDate: maskForm.date,
  779. type: maskForm.type,
  780. groupType: 'MUSIC',
  781. schoolId: maskForm.schoolId
  782. };
  783. resetCourse(cleanDeep(obj)).then(res => {
  784. if (res.code == 200) {
  785. this.$message.success("修改成功");
  786. this.getList();
  787. this.courseVisible = false;
  788. }
  789. });
  790. })
  791. .catch(() => { });
  792. },
  793. handleClose () {
  794. this.courseVisible = false;
  795. (this.maskForm = {
  796. teacher: "",
  797. assistant: "",
  798. date: "",
  799. id: "",
  800. startTime: "",
  801. endTime: ""
  802. }),
  803. this.$refs["maskForm"].resetFields();
  804. },
  805. handleSelectionChange (val) {
  806. this.activeCourseList = val;
  807. },
  808. checkSelectable (val) {
  809. return val.courseScheduleStatus == "NOT_START";
  810. // return true;
  811. },
  812. batchAdjustmentTime () {
  813. let tempData = this.markAttendance.dataInfo;
  814. let params = {
  815. teacherId: tempData.masterTeacherId,
  816. courseScheduleId: tempData.courseScheduleId,
  817. signInStatus: 1,
  818. signOutStatus: 1
  819. };
  820. updateTeacherAttendance(params).then(res => {
  821. if (res.code == 200) {
  822. this.$message.success("补卡成功");
  823. this.markAttendance.status = false;
  824. this.getList();
  825. } else {
  826. this.$message.error(res.msg);
  827. }
  828. });
  829. },
  830. handleCloseTimer () {
  831. this.timerVisible = false;
  832. this.timerMask.timer = "";
  833. },
  834. resetTimer () {
  835. if (this.activeCourseList.length < 1) {
  836. this.$message.error("请至少选择一节课");
  837. return;
  838. }
  839. this.timerVisible = true;
  840. },
  841. resetType (row) {
  842. this.typeForm.type = row.courseScheduleType;
  843. this.typeForm.id = row.courseScheduleId;
  844. this.typeForm.teacher = parseInt(row.masterTeacherId);
  845. // this.maskForm.type = row.courseScheduleType;
  846. this.typeForm.assistant = [];
  847. for (let i in row.teachingTeachers) {
  848. if (row.teachingTeachers[i].teacherRole == "TEACHING") {
  849. this.typeForm.assistant.push(row.teachingTeachers[i].userId);
  850. }
  851. }
  852. this.typeForm.date = row.classDate;
  853. this.$set(
  854. this.typeForm,
  855. "startTime",
  856. row.startClassTimeStr.substring(0, 5)
  857. );
  858. this.typeForm.endTime = row.endClassTimeStr.substring(0, 5);
  859. // console.log(row.type)
  860. this.typeVisible = true;
  861. },
  862. submitResetType () {
  863. this.$refs.typeForm.validate(res => {
  864. if (res) {
  865. let teachingTeacherIdList = this.typeForm.assistant.join(",");
  866. if (teachingTeacherIdList.length <= 0) {
  867. let teachingTeacherIdList = null;
  868. }
  869. let obj = {
  870. actualTeacherId: this.typeForm.teacher,
  871. startClassTimeStr: this.typeForm.startTime,
  872. endClassTimeStr: this.typeForm.endTime,
  873. id: this.typeForm.id,
  874. type: this.typeForm.type,
  875. teachingTeacherIdList,
  876. classDate: this.typeForm.date,
  877. };
  878. resetCourse(obj).then(res => {
  879. if (res.code == 200) {
  880. this.$message.success("修改成功");
  881. this.getList();
  882. this.typeVisible = false;
  883. }
  884. });
  885. }
  886. });
  887. },
  888. // 清除考勤
  889. clearAttend (row) {
  890. this.$confirm("是否清除考勤记录?", "提示", {
  891. confirmButtonText: "确定",
  892. cancelButtonText: "取消",
  893. type: "warning"
  894. })
  895. .then(() => {
  896. cleanAttendance({ courseScheduleIds: row.courseScheduleId }).then(
  897. res => {
  898. if (res.code == 200) {
  899. this.$message.success("清除成功");
  900. this.getList();
  901. } else {
  902. this.$message.error(res.msg);
  903. }
  904. }
  905. );
  906. })
  907. .catch(() => { });
  908. },
  909. changeStartTime (val) {
  910. this.$nextTick(res => {
  911. this.maskForm.endTime = addTimerFormMinute(this.maskForm.date, val, this.maskForm.timer);
  912. })
  913. },
  914. changeTime(val){
  915. this.$nextTick(res => {
  916. this.maskForm.endTime = addTimerFormMinute(this.maskForm.date,this.maskForm.startTime ,val );
  917. })
  918. }
  919. },
  920. filters: {
  921. studentCallName: value => {
  922. let template = {
  923. NORMAL: "到课",
  924. TRUANT: "未到",
  925. LEAVE: "请假",
  926. DROP_OUT: "退学",
  927. "": "未到"
  928. };
  929. return template[value];
  930. }
  931. }, watch: {
  932. 'maskForm.timer' (val) {
  933. this.maskForm.endTime = addTimerFormMinute(this.maskForm.date, this.maskForm.startTime, val);
  934. }
  935. }
  936. };
  937. </script>
  938. <style lang="scss" scoped>
  939. .cl-container {
  940. .topFrom {
  941. margin: 20px 30px 0;
  942. .classlist {
  943. display: flex;
  944. flex-direction: row;
  945. justify-content: flex-start;
  946. align-items: center;
  947. ul {
  948. li {
  949. list-style: none;
  950. }
  951. }
  952. }
  953. }
  954. // .searchForm {
  955. // // margin: 0 30px;
  956. // }
  957. }
  958. .btnWraps {
  959. display: flex;
  960. flex-direction: row;
  961. justify-content: flex-start;
  962. div {
  963. margin-right: 20px;
  964. }
  965. }
  966. .maskForm {
  967. /deep/.el-input {
  968. width: 220px;
  969. }
  970. }
  971. </style>