courseList.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  1. <template>
  2. <div class="cl-container">
  3. <!-- 搜索类型 -->
  4. <save-form
  5. :inline="true"
  6. save-key="teamDetails-courseList"
  7. class="searchForm"
  8. ref="searchForm"
  9. :model="searchForm"
  10. @submit="search"
  11. @reset="onReSet"
  12. >
  13. <el-form-item prop="courseStatus">
  14. <el-select
  15. v-model.trim="searchForm.courseStatus"
  16. clearable
  17. filterable
  18. placeholder="课程类型"
  19. >
  20. <el-option
  21. v-for="(item, index) in courseArray"
  22. :key="index"
  23. :label="item.label"
  24. :value="item.value"
  25. ></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item prop="classStatus">
  29. <el-select
  30. v-model.trim="searchForm.classStatus"
  31. clearable
  32. filterable
  33. placeholder="课程状态"
  34. >
  35. <el-option label="未开始" value="NOT_START"></el-option>
  36. <el-option label="进行中" value="UNDERWAY"></el-option>
  37. <el-option label="已结束" value="OVER"></el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item prop="class">
  41. <!-- getMusicGroupAllClass -->
  42. <el-select
  43. v-model.trim="searchForm.class"
  44. placeholder="班级名称"
  45. filterable
  46. clearable
  47. >
  48. <el-option
  49. v-for="(item, index) in classList"
  50. :key="index"
  51. :value="item.id"
  52. :label="item.name"
  53. ></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item prop="isSettlement">
  57. <el-select
  58. v-model.trim="searchForm.isSettlement"
  59. placeholder="是否结算"
  60. filterable
  61. clearable
  62. >
  63. <el-option value="0" label="未结算"></el-option>
  64. <el-option value="1" label="已结算"></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item prop="homeworkFlag">
  68. <el-select
  69. v-model.trim="searchForm.homeworkFlag"
  70. placeholder="是否布置作业"
  71. filterable
  72. clearable
  73. >
  74. <el-option :value="false" label="未布置"></el-option>
  75. <el-option :value="true" label="已布置"></el-option>
  76. </el-select>
  77. </el-form-item>
  78. <el-form-item prop="serviceFlag">
  79. <el-select
  80. v-model.trim="searchForm.serviceFlag"
  81. placeholder="是否服务"
  82. filterable
  83. clearable
  84. >
  85. <el-option :value="true" label="是"></el-option>
  86. <el-option :value="false" label="否"></el-option>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item prop="timer">
  90. <el-date-picker
  91. v-model.trim="searchForm.timer"
  92. style="width: 420px"
  93. type="daterange"
  94. value-format="yyyy-MM-dd"
  95. range-separator="至"
  96. start-placeholder="课程开始日期"
  97. end-placeholder="课程结束日期"
  98. :picker-options="{
  99. firstDayOfWeek: 1,
  100. }"
  101. ></el-date-picker>
  102. </el-form-item>
  103. <el-form-item>
  104. <el-button native-type="submit" type="danger">搜索</el-button>
  105. <el-button type="primary" native-type="reset">重置</el-button>
  106. <el-button type="primary" v-if="
  107. permission('export/exportMusicGroupCourseScheduleDetail')
  108. " @click="exportCourse">导出</el-button>
  109. </el-form-item>
  110. </save-form>
  111. <div class="btnWraps"></div>
  112. <div style="font-size: 14px; padding-bottom: 10px">
  113. 总出勤率:<span style="color: #f85043; font-weight: 600">{{
  114. detail.attendanceRate
  115. }}</span>
  116. &nbsp;&nbsp;&nbsp;&nbsp;总达标率:<span
  117. style="color: #f85043; font-weight: 600"
  118. >{{ detail.standardRate }}</span
  119. >
  120. &nbsp;&nbsp;&nbsp;&nbsp; 总作业提交率:<span
  121. style="color: #f85043; font-weight: 600"
  122. >{{ detail.homeworkCommitRate }}</span
  123. >
  124. </div>
  125. <!-- 列表 -->
  126. <div class="tableWrap">
  127. <el-table
  128. :data="tableList"
  129. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  130. >
  131. <!-- <el-table-column type="selection"
  132. width="55"
  133. :selectable="checkSelectable"></el-table-column> -->
  134. <el-table-column
  135. align="center"
  136. prop="courseScheduleId"
  137. label="课程编号"
  138. ></el-table-column>
  139. <el-table-column align="center" width="180px" label="时间">
  140. <template slot-scope="scope"
  141. >{{ scope.row.classDate }}
  142. {{
  143. scope.row.startClassTime
  144. ? scope.row.startClassTime.substr(0, 5)
  145. : ""
  146. }}-{{
  147. scope.row.endClassTime ? scope.row.endClassTime.substr(0, 5) : ""
  148. }}</template
  149. >
  150. </el-table-column>
  151. <el-table-column
  152. align="center"
  153. prop="courseScheduleName"
  154. label="课程名称"
  155. ></el-table-column>
  156. <el-table-column
  157. align="center"
  158. prop="courseScheduleType"
  159. label="课程类型"
  160. >
  161. <template slot-scope="scope">
  162. <div>{{ scope.row.courseScheduleType | coursesType }}</div>
  163. </template>
  164. </el-table-column>
  165. <el-table-column
  166. align="center"
  167. prop="courseScheduleStatus"
  168. label="课程状态"
  169. >s
  170. <template slot-scope="scope">
  171. <div>{{ scope.row.courseScheduleStatus | coursesStatus }}</div>
  172. </template>
  173. </el-table-column>
  174. <el-table-column align="center" label="老师签到">
  175. <template slot-scope="scope">
  176. <div v-if="scope.row.courseScheduleStatus != 'NOT_START'">
  177. {{ scope.row.signInStatus | attendanceType }}
  178. </div>
  179. </template>
  180. </el-table-column>
  181. <el-table-column align="center" label="老师签退">
  182. <template slot-scope="scope">
  183. <div v-if="scope.row.courseScheduleStatus != 'NOT_START'">
  184. {{ scope.row.signOutStatus | attendanceOutType }}
  185. </div>
  186. </template>
  187. </el-table-column>
  188. <el-table-column
  189. align="center"
  190. prop="masterTeacherName"
  191. label="指导老师"
  192. ></el-table-column>
  193. <el-table-column align="center" label="结算状态">
  194. <template slot-scope="scope">{{
  195. scope.row.settlementTime ? "已结算" : "未结算"
  196. }}</template>
  197. </el-table-column>
  198. <el-table-column align="center" prop="remark" label="是否点名">
  199. <template slot-scope="scope">
  200. <div v-if="scope.row.courseScheduleStatus != 'NOT_START'">
  201. {{ scope.row.isCallNames ? "已点名" : "未点名" }}
  202. </div>
  203. </template>
  204. </el-table-column>
  205. <el-table-column align="center" prop="attendanceRate" label="出勤率">
  206. <template slot-scope="scope">
  207. <div>
  208. {{
  209. scope.row.courseScheduleStatistics.attendanceRate
  210. ? scope.row.courseScheduleStatistics.attendanceRate
  211. : "--"
  212. }}
  213. </div>
  214. </template>
  215. </el-table-column>
  216. <el-table-column align="center" prop="standardRate" label="达标率">
  217. <template slot-scope="scope">
  218. <div>
  219. {{
  220. scope.row.courseScheduleStatistics.standardRate
  221. ? scope.row.courseScheduleStatistics.standardRate
  222. : "--"
  223. }}
  224. </div>
  225. </template>
  226. </el-table-column>
  227. <el-table-column align="center" prop="remark" label="是否服务">
  228. <template slot-scope="scope">
  229. <div>
  230. {{ scope.row.courseScheduleStatistics.serviceFlag ? "是" : "否" }}
  231. </div>
  232. </template>
  233. </el-table-column>
  234. <el-table-column align="center" prop="remark" label="是否布置课后作业">
  235. <template slot-scope="scope">
  236. <div>
  237. {{
  238. scope.row.courseScheduleStatistics.homeworkFlag
  239. ? "已布置"
  240. : "未布置"
  241. }}
  242. </div>
  243. </template>
  244. </el-table-column>
  245. <el-table-column align="center" prop="remark" label="作业提交率">
  246. <template slot-scope="scope">
  247. <div>
  248. {{
  249. scope.row.courseScheduleStatistics.homeworkCommitRate
  250. ? scope.row.courseScheduleStatistics.homeworkCommitRate
  251. : "--"
  252. }}
  253. </div>
  254. </template>
  255. </el-table-column>
  256. <el-table-column
  257. align="center"
  258. prop="remark"
  259. label="备注"
  260. ></el-table-column>
  261. <el-table-column
  262. align="center"
  263. width="280px"
  264. label="操作"
  265. fixed="right"
  266. >
  267. <template slot-scope="scope">
  268. <div>
  269. <!-- {child: 'teacherAttendance/updateTeacherAttendance', parent: '/teamDetails/courseList'} -->
  270. <el-button
  271. v-if="
  272. scope.row.courseScheduleStatus == 'OVER' &&
  273. !scope.row.settlementTime &&
  274. permission('teacherAttendance/updateTeacherAttendance?t=568')
  275. "
  276. type="text"
  277. @click="onMarkAttendance(scope.row)"
  278. >补考勤</el-button
  279. >
  280. <el-button
  281. v-if="
  282. scope.row.courseScheduleStatus == 'OVER' &&
  283. permission('studentAttendance/updateStudentAttendances?t=570')
  284. "
  285. type="text"
  286. @click="onCallName(scope.row)"
  287. >点名表</el-button
  288. >
  289. <!-- OVER -->
  290. <!-- <el-button
  291. v-if="scope.row.courseScheduleStatus == 'OVER' && permission('courseSchedule/classStartDateAdjust1')"
  292. type="text"
  293. @click="resetClass(scope.row)"
  294. >调整</el-button>-->
  295. <el-button
  296. v-if="
  297. !scope.row.settlementTime &&
  298. permission(
  299. 'courseSchedule/classStartDateAdjust/teamCourseListInfo'
  300. )
  301. "
  302. type="text"
  303. @click="resetClass(scope.row)"
  304. >调整</el-button
  305. >
  306. <!-- <el-button v-if="scope.row.courseScheduleStatus == 'NOT_START' && permission('courseSchedule/batchDelete')"
  307. type="text"
  308. @click="removeSingleClass(scope.row)">删除</el-button> -->
  309. <!-- v-if="scope.row.courseScheduleStatus == 'NOT_START' && permission('courseSchedule/batchDelete')" teamDetail/resetTpye-->
  310. <!-- <el-button type="text"
  311. @click="resetType(scope.row)"
  312. v-if="permission('teamDetail/resetTpye')&&scope.row.courseScheduleType!='HIGH_ONLINE'&&scope.row.courseScheduleType!='MUSIC_NETWORK'">类型调整</el-button> -->
  313. <el-button
  314. type="text"
  315. v-if="
  316. scope.row.courseScheduleStatus == 'OVER' &&
  317. !scope.row.settlementTime &&
  318. permission(
  319. 'courseSchedule/cleanAttendancecourseSchedule/classStartDateAdjust/teamCourseListInfo'
  320. )
  321. "
  322. @click="clearAttend(scope.row)"
  323. >清除考勤</el-button
  324. >
  325. </div>
  326. </template>
  327. </el-table-column>
  328. </el-table>
  329. <pagination
  330. save-key="teamDetails-courseList"
  331. sync
  332. :total.sync="rules.total"
  333. :page.sync="rules.page"
  334. :limit.sync="rules.limit"
  335. :page-sizes="rules.page_size"
  336. @pagination="getList"
  337. />
  338. </div>
  339. <el-dialog
  340. title="课程调整"
  341. width="400px"
  342. :before-close="handleClose"
  343. :visible.sync="courseVisible"
  344. >
  345. <el-form
  346. :model="maskForm"
  347. v-if="courseVisible"
  348. class="maskForm"
  349. ref="maskForm"
  350. :rules="maskRules"
  351. label-position="right"
  352. label-width="120px"
  353. :inline="true"
  354. >
  355. <el-form-item label="主教老师" prop="teacher">
  356. <remote-search
  357. :commit="'setTeachers'"
  358. v-model="maskForm.teacher"
  359. :width="220"
  360. />
  361. </el-form-item>
  362. <el-form-item
  363. label="助教老师"
  364. v-if="
  365. maskForm.courseScheduleType != 'MUSIC_NETWORK' &&
  366. maskForm.courseScheduleType != 'HIGH_ONLINE'
  367. "
  368. prop="assistant"
  369. >
  370. <remote-search
  371. :commit="'setTeachers'"
  372. v-model="maskForm.assistant"
  373. :width="220"
  374. :multiple="true"
  375. />
  376. </el-form-item>
  377. <el-form-item label="上课日期" prop="date">
  378. <el-date-picker
  379. v-model.trim="maskForm.date"
  380. type="date"
  381. :picker-options="beginDate()"
  382. value-format="yyyy-MM-dd"
  383. placeholder="选择日期"
  384. ></el-date-picker>
  385. </el-form-item>
  386. <el-form-item label="课程时长" v-if="courseVisible" prop="timer">
  387. <el-select v-model="maskForm.timer" @change="changeTime">
  388. <el-option
  389. v-for="(item, index) in typeTimeList"
  390. :key="index"
  391. :value="parseInt(item)"
  392. :label="item"
  393. ></el-option>
  394. </el-select>
  395. </el-form-item>
  396. <el-form-item label="开始时间" v-if="courseVisible" prop="startTime">
  397. <el-time-picker
  398. placeholder="起始时间"
  399. v-model.trim="maskForm.startTime"
  400. @change="changeStartTime"
  401. format="HH:mm"
  402. value-format="HH:mm"
  403. :picker-options="{
  404. selectableRange: `${nowTime} - 23:30:00`,
  405. }"
  406. ></el-time-picker>
  407. </el-form-item>
  408. <el-form-item label="结束时间" v-if="courseVisible" prop="endTime">
  409. <el-time-select
  410. placeholder="结束时间"
  411. v-model.trim="maskForm.endTime"
  412. disabled
  413. :picker-options="{
  414. start: '04:30',
  415. step: '00:05',
  416. end: '23:30',
  417. minTime: maskForm.startTime,
  418. }"
  419. ></el-time-select>
  420. </el-form-item>
  421. <el-form-item
  422. label="教学地点"
  423. prop="schoolId"
  424. v-if="
  425. maskForm.courseScheduleType != 'HIGH_ONLINE' &&
  426. maskForm.courseScheduleType != 'MUSIC_NETWORK'
  427. "
  428. >
  429. <el-select
  430. v-model.trim="maskForm.schoolId"
  431. style="width: 220px !important"
  432. filterable
  433. clearable
  434. >
  435. <el-option
  436. v-for="(item, index) in schoolList"
  437. :key="index"
  438. :value="item.id"
  439. :label="item.name"
  440. ></el-option>
  441. </el-select>
  442. </el-form-item>
  443. </el-form>
  444. <div slot="footer" class="dialog-footer">
  445. <el-button @click="courseVisible = false">取 消</el-button>
  446. <el-button type="primary" @click="submitResetClass">确 定</el-button>
  447. </div>
  448. </el-dialog>
  449. <el-dialog
  450. title="修改时间"
  451. width="400px"
  452. :before-close="handleCloseTimer"
  453. :visible.sync="timerVisible"
  454. >
  455. <el-form :model="timerMask">
  456. <el-form-item
  457. label="上课日期"
  458. :rules="[{ required: true, message: '请选择日期', trigger: 'blur' }]"
  459. >
  460. <el-date-picker
  461. v-model.trim="timerMask.timer"
  462. type="date"
  463. format="yyyy-MM-dd"
  464. value-format="yyyy-MM-dd"
  465. :picker-options="{
  466. firstDayOfWeek: 1,
  467. }"
  468. placeholder="选择日期"
  469. ></el-date-picker>
  470. </el-form-item>
  471. </el-form>
  472. <div slot="footer" class="dialog-footer">
  473. <el-button @click="timerVisible = false">取 消</el-button>
  474. <el-button type="primary" @click="batchAdjustmentTime">确 定</el-button>
  475. </div>
  476. </el-dialog>
  477. <el-dialog
  478. title="补考勤"
  479. width="400px"
  480. :visible.sync="markAttendance.status"
  481. >
  482. <el-form>
  483. <el-form-item label="签到状态">{{
  484. markAttendance.dataInfo.signInStatus | attendanceType
  485. }}</el-form-item>
  486. <el-form-item label="签到时间">{{
  487. markAttendance.dataInfo.signInTime
  488. }}</el-form-item>
  489. <el-form-item label="签退状态">{{
  490. markAttendance.dataInfo.signOutStatus | attendanceOutType
  491. }}</el-form-item>
  492. <el-form-item label="签退时间">{{
  493. markAttendance.dataInfo.signOutTime
  494. }}</el-form-item>
  495. </el-form>
  496. <div slot="footer" class="dialog-footer">
  497. <el-button @click="markAttendance.status = false">取 消</el-button>
  498. <el-button
  499. type="primary"
  500. :disabled="
  501. markAttendance.dataInfo.signOutStatus == 1 &&
  502. markAttendance.dataInfo.signInStatus == 1
  503. ? true
  504. : false
  505. "
  506. @click="batchAdjustmentTime"
  507. >确定补卡</el-button
  508. >
  509. </div>
  510. </el-dialog>
  511. <el-dialog title="点名表" width="800px" :visible.sync="rollCall.status">
  512. <el-table :data="rollCall.gridData">
  513. <el-table-column
  514. align="center"
  515. property="userName"
  516. label="学员姓名"
  517. ></el-table-column>
  518. <el-table-column
  519. align="center"
  520. property="phone"
  521. label="手机号"
  522. ></el-table-column>
  523. <el-table-column
  524. align="center"
  525. property="subjectName"
  526. label="学员声部"
  527. ></el-table-column>
  528. <el-table-column align="center" label="到课状态">
  529. <template slot-scope="scope">{{
  530. scope.row.status | studentCallName
  531. }}</template>
  532. </el-table-column>
  533. <el-table-column
  534. align="center"
  535. v-if="!rollCall.selectItem.settlementTime"
  536. label="操作"
  537. width="240px"
  538. >
  539. <template slot-scope="scope">
  540. <el-button
  541. size="mini"
  542. @click="onChangeRollCall('TRUANT', scope.row)"
  543. type="primary"
  544. round
  545. >未到</el-button
  546. >
  547. <el-button
  548. size="mini"
  549. @click="onChangeRollCall('LEAVE', scope.row)"
  550. type="warning"
  551. round
  552. >请假</el-button
  553. >
  554. <el-button
  555. size="mini"
  556. @click="onChangeRollCall('NORMAL', scope.row)"
  557. type="success"
  558. round
  559. >到课</el-button
  560. >
  561. </template>
  562. </el-table-column>
  563. </el-table>
  564. <pagination
  565. sync
  566. :total.sync="rollCall.total"
  567. :page.sync="rollCall.page"
  568. :limit.sync="rollCall.limit"
  569. :page-sizes="rollCall.page_size"
  570. @pagination="getCallName"
  571. />
  572. </el-dialog>
  573. </div>
  574. </template>
  575. <script>
  576. import dayjs from "dayjs";
  577. import pagination from "@/components/Pagination/index";
  578. import { bathDelete } from "@/api/vipSeting";
  579. import {
  580. resetCourse,
  581. getMusicGroupAllClass,
  582. getCourseSchedule,
  583. updateTeacherAttendance,
  584. findAttendanceStudentByCourseWithPage,
  585. updateStudentAttendances,
  586. cleanAttendance,
  587. getOrganCourseDurationSettings,
  588. } from "@/api/buildTeam";
  589. import { permission } from "@/utils/directivePage";
  590. import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
  591. import { classTimeList, musicCourseType } from "@/utils/searchArray";
  592. import { getSchool } from "@/api/systemManage";
  593. import cleanDeep from "clean-deep";
  594. import { Export } from "@/utils/downLoadFile";
  595. import { getMusicGroupCourseScheduleStatistics } from "../api";
  596. let that;
  597. export default {
  598. name: "tcourseList",
  599. data() {
  600. return {
  601. classTimeList,
  602. courseArray: musicCourseType,
  603. typeVisible: false,
  604. timerVisible: false,
  605. courseVisible: false,
  606. searchForm: {
  607. courseStatus: "", // 课程类型
  608. classStatus: "", // 课程状态
  609. timer: [], // 时间
  610. class: "",
  611. isSettlement: "",
  612. homeworkFlag: "",
  613. serviceFlag: "",
  614. },
  615. tableList: [],
  616. searchLsit: [],
  617. rules: {
  618. // 分页规则
  619. limit: 10, // 限制显示条数
  620. page: 1, // 当前页
  621. total: 0, // 总条数
  622. page_size: [10, 20, 40, 50], // 选择限制显示条数
  623. },
  624. maskForm: {
  625. teacher: "",
  626. assistant: "",
  627. date: "",
  628. id: "",
  629. startTime: "",
  630. endTime: "",
  631. type: "",
  632. timer: "",
  633. courseScheduleType: null,
  634. address: "",
  635. teachMode: "",
  636. schoolId: "",
  637. },
  638. typeForm: {
  639. teacher: "",
  640. assistant: "",
  641. date: "",
  642. startTime: "",
  643. endTime: "",
  644. type: null,
  645. id: null,
  646. },
  647. maskRules: {
  648. schoolId: [
  649. { required: true, message: "请选教学地点", trigger: "blur" },
  650. ],
  651. teacher: [
  652. { required: true, message: "请选择主教老师名称", trigger: "blur" },
  653. ],
  654. date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
  655. // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  656. // endTime: [{ required: true, message: '请选择上课结束时间', trigger: 'blur' },],
  657. },
  658. typeRules: {
  659. type: [{ required: true, message: "请选择课程类型", trigger: "blur" }],
  660. },
  661. teacherList: [],
  662. classList: [],
  663. activeCourseList: [],
  664. timerMask: {
  665. timer: "",
  666. },
  667. markAttendance: {
  668. // 考勤状态
  669. status: false,
  670. dataInfo: {},
  671. },
  672. rollCall: {
  673. // 点名表
  674. status: false,
  675. gridData: [],
  676. selectItem: {}, // 选中状态
  677. limit: 10, // 限制显示条数
  678. page: 1, // 当前页
  679. total: 0, // 总条数
  680. page_size: [10, 20, 40, 50], // 选择限制显示条数
  681. },
  682. organId: "",
  683. schoolList: [],
  684. courseTimeList: {},
  685. typeTimeList: [],
  686. detail: {
  687. attendanceRate: "0.00%",
  688. homeworkCommitRate: "0.00%",
  689. standardRate: "0.00%",
  690. },
  691. };
  692. },
  693. components: {
  694. pagination,
  695. },
  696. created() {
  697. that = this;
  698. },
  699. mounted() {
  700. this.init();
  701. getSchool({ organId: this.$route.query.organId }).then((res) => {
  702. if (res.code == 200) {
  703. this.schoolList = res.data;
  704. }
  705. });
  706. },
  707. activated() {
  708. this.init();
  709. },
  710. methods: {
  711. async init() {
  712. this.teamid = this.$route.query.id;
  713. this.organId = this.$route.query.organId;
  714. try {
  715. const res = await getOrganCourseDurationSettings({
  716. organId: this.organId,
  717. });
  718. this.courseTimeList = res.data;
  719. } catch {}
  720. // MusicStore.dispatch('getBaseInfo', {
  721. // data: { musicGroupId: this.teamid }
  722. // }).then((res) => {
  723. // console.log(res)
  724. // })
  725. this.getList();
  726. // 获取所有老师
  727. // findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
  728. // if (res.code == 200) {
  729. // this.teacherList = res.data;
  730. // }
  731. // })
  732. // getTeacher().then(res => {
  733. // if (res.code == 200) {
  734. // this.teacherList = res.data;
  735. // }
  736. // });
  737. // 获取班级列表
  738. getMusicGroupAllClass({ musicGroupId: this.teamid }).then((res) => {
  739. if (res.code == 200) {
  740. this.classList = res.data;
  741. }
  742. });
  743. },
  744. onMarkAttendance(item) {
  745. // 补考勤
  746. this.markAttendance = {
  747. status: true,
  748. dataInfo: item,
  749. };
  750. },
  751. onCallName(item) {
  752. // 点名表
  753. this.rollCall.page = 1;
  754. this.rollCall.selectItem = item;
  755. this.getCallName();
  756. },
  757. getCallName() {
  758. let rollCall = this.rollCall;
  759. let params = {
  760. page: rollCall.page,
  761. rows: rollCall.limit,
  762. courseScheduleId: rollCall.selectItem.courseScheduleId,
  763. };
  764. findAttendanceStudentByCourseWithPage(params).then((res) => {
  765. let result = res.data;
  766. rollCall.status = true;
  767. if (res.code == 200) {
  768. rollCall.gridData = result.rows;
  769. rollCall.total = result.total;
  770. }
  771. });
  772. },
  773. onChangeRollCall(type, row) {
  774. let rollCall = this.rollCall;
  775. let params = {
  776. courseScheduleId: rollCall.selectItem.courseScheduleId,
  777. studentAttendances: [
  778. {
  779. userId: row.studentId,
  780. status: type,
  781. },
  782. ],
  783. };
  784. updateStudentAttendances(params).then((res) => {
  785. if (res.code == 200) {
  786. this.$message.success("修改成功");
  787. row.status = type;
  788. this.getList();
  789. } else {
  790. this.$message.error(res.msg);
  791. }
  792. });
  793. },
  794. permission(str, parent) {
  795. return permission(str, parent);
  796. },
  797. search() {
  798. this.rules.page = 1;
  799. this.getList();
  800. },
  801. async getList() {
  802. let searchForm = this.searchForm;
  803. if (!searchForm.timer) {
  804. searchForm.timer = [];
  805. }
  806. let obj = {
  807. classScheduleStatus: searchForm.classStatus || null,
  808. classScheduleType: searchForm.courseStatus || null,
  809. musicGroupId: this.teamid,
  810. startTime: searchForm.timer[0] || null,
  811. endTime: searchForm.timer[1] || null,
  812. page: this.rules.page,
  813. rows: this.rules.limit,
  814. classGroupId: searchForm.class || null,
  815. isSettlement: searchForm.isSettlement || null,
  816. homeworkFlag: searchForm.homeworkFlag,
  817. serviceFlag: searchForm.serviceFlag,
  818. };
  819. getCourseSchedule(obj).then((res) => {
  820. if (res.code == 200) {
  821. this.tableList = res.data.rows;
  822. this.rules.total = res.data.total;
  823. }
  824. });
  825. try {
  826. const res = await getMusicGroupCourseScheduleStatistics({ ...obj });
  827. if(res.data){
  828. this.detail = { ...res.data };
  829. }
  830. } catch (e) {
  831. console.log(e);
  832. }
  833. },
  834. async exportCourse(){
  835. // 导出
  836. let searchForm = this.searchForm;
  837. if (!searchForm.timer) {
  838. searchForm.timer = [];
  839. }
  840. let obj = {
  841. classScheduleStatus: searchForm.classStatus || null,
  842. classScheduleType: searchForm.courseStatus || null,
  843. musicGroupId: this.teamid,
  844. startTime: searchForm.timer[0] || null,
  845. endTime: searchForm.timer[1] || null,
  846. page: this.rules.page,
  847. rows: this.rules.limit,
  848. classGroupId: searchForm.class || null,
  849. isSettlement: searchForm.isSettlement || null,
  850. homeworkFlag: searchForm.homeworkFlag,
  851. serviceFlag: searchForm.serviceFlag,
  852. };
  853. Export(
  854. this,
  855. {
  856. url: "/api-web/export/exportMusicGroupCourseScheduleDetail",
  857. fileName: "乐团课表详情.xls",
  858. method: "get",
  859. params: {
  860. ...obj
  861. },
  862. },
  863. "您确定导出乐团课表详情?"
  864. );
  865. },
  866. resetClass(row) {
  867. this.maskForm.teacher = parseInt(row.masterTeacherId);
  868. this.maskForm.courseScheduleType = row.courseScheduleType;
  869. // this.courseTimeList
  870. for (let key in this.courseTimeList) {
  871. if (key == row.courseScheduleType) {
  872. this.typeTimeList = this.courseTimeList[key].split(",");
  873. }
  874. }
  875. // this.maskForm.type = row.courseScheduleType;
  876. this.maskForm.assistant = [];
  877. for (let i in row.teachingTeachers) {
  878. if (row.teachingTeachers[i].teacherRole == "TEACHING") {
  879. this.maskForm.assistant.push(row.teachingTeachers[i].userId);
  880. }
  881. }
  882. this.maskForm.date = row.classDate;
  883. this.$set(
  884. this.maskForm,
  885. "startTime",
  886. row.startClassTimeStr.substring(0, 5)
  887. );
  888. let time = diffTimerFormMinute(
  889. row.classDate,
  890. row.startClassTimeStr,
  891. row.endClassTimeStr
  892. );
  893. this.maskForm.timer = time;
  894. this.maskForm.endTime = addTimerFormMinute(
  895. row.classDate,
  896. row.startClassTimeStr,
  897. time
  898. );
  899. // this.maskForm.endTime = row.endClassTimeStr.substring(0, 5);
  900. this.maskForm.id = row.courseScheduleId;
  901. this.maskForm.schoolId = row.schoolId;
  902. this.courseVisible = true;
  903. // 修改课时
  904. // let obj = {
  905. // actualTeacherId: this.maskForm.teacher,
  906. // classDate: this.maskForm.date,
  907. // classGroupId: row.id
  908. // }
  909. },
  910. removeSingleClass(row) {
  911. this.$confirm("是否删除该课程?", "提示", {
  912. confirmButtonText: "确定",
  913. cancelButtonText: "取消",
  914. type: "warning",
  915. })
  916. .then(() => {
  917. let courseScheduleIds = row.courseScheduleId;
  918. bathDelete({ courseScheduleIds }).then((res) => {
  919. if (res.code == 200) {
  920. this.$message.success("删除成功");
  921. this.getList();
  922. }
  923. });
  924. })
  925. .catch(() => {});
  926. },
  927. removeCourses() {
  928. // 批量删除
  929. if (this.activeCourseList.length < 1) {
  930. this.$message.error("请至少选择一节课");
  931. return;
  932. }
  933. let arr = [];
  934. arr = this.activeCourseList.map((item) => {
  935. return item.courseScheduleId;
  936. });
  937. this.$confirm("是否删除该课程?", "提示", {
  938. confirmButtonText: "确定",
  939. cancelButtonText: "取消",
  940. type: "warning",
  941. })
  942. .then(() => {
  943. let courseScheduleIds = arr.join(",");
  944. bathDelete({ courseScheduleIds }).then((res) => {
  945. if (res.code == 200) {
  946. this.$message.success("删除成功");
  947. this.getList();
  948. }
  949. });
  950. })
  951. .catch(() => {});
  952. },
  953. submitResetClass() {
  954. let maskForm = this.maskForm;
  955. let diff = dayjs(maskForm.date + " " + maskForm.startTime).diff(
  956. new Date(),
  957. "second"
  958. );
  959. if (diff <= 0) {
  960. this.$message.error("课程开始时间必须大于当前时间");
  961. return;
  962. }
  963. if (!maskForm.startTime || !maskForm.endTime) {
  964. this.$message.error("请填写开始时间或结束时间");
  965. return;
  966. }
  967. this.$confirm("是否确定?", "提示", {
  968. confirmButtonText: "确定",
  969. cancelButtonText: "取消",
  970. type: "warning",
  971. })
  972. .then(() => {
  973. let teachingTeacherIdList = maskForm.assistant.join(",");
  974. if (teachingTeacherIdList.length <= 0) {
  975. let teachingTeacherIdList = null;
  976. }
  977. let obj = {
  978. actualTeacherId: maskForm.teacher,
  979. startClassTimeStr: maskForm.startTime,
  980. endClassTimeStr: maskForm.endTime,
  981. id: maskForm.id,
  982. teachingTeacherIdList,
  983. classDate: maskForm.date,
  984. type: maskForm.type,
  985. groupType: "MUSIC",
  986. schoolId: maskForm.schoolId,
  987. };
  988. resetCourse(cleanDeep(obj)).then((res) => {
  989. if (res.code == 200) {
  990. this.$message.success("修改成功");
  991. this.getList();
  992. this.courseVisible = false;
  993. }
  994. if (res.code == 206) {
  995. this.$confirm(`当前课程课酬预计为0,是否继续`, "提示", {
  996. confirmButtonText: "确定",
  997. cancelButtonText: "取消",
  998. type: "warning",
  999. }).then((res) => {
  1000. obj.allowZeroSalary = true;
  1001. resetCourse(cleanDeep(obj)).then((res) => {
  1002. if (res.code == 200) {
  1003. this.$message.success("修改成功");
  1004. this.getList();
  1005. this.courseVisible = false;
  1006. }
  1007. });
  1008. });
  1009. }
  1010. });
  1011. })
  1012. .catch(() => {});
  1013. },
  1014. handleClose() {
  1015. this.courseVisible = false;
  1016. (this.maskForm = {
  1017. teacher: "",
  1018. assistant: "",
  1019. date: "",
  1020. id: "",
  1021. startTime: "",
  1022. endTime: "",
  1023. schoolId: null,
  1024. }),
  1025. this.$refs["maskForm"].resetFields();
  1026. },
  1027. handleSelectionChange(val) {
  1028. this.activeCourseList = val;
  1029. },
  1030. checkSelectable(val) {
  1031. return val.courseScheduleStatus == "NOT_START";
  1032. // return true;
  1033. },
  1034. batchAdjustmentTime() {
  1035. let tempData = this.markAttendance.dataInfo;
  1036. let params = {
  1037. teacherId: tempData.masterTeacherId,
  1038. courseScheduleId: tempData.courseScheduleId,
  1039. signInStatus: 1,
  1040. signOutStatus: 1,
  1041. };
  1042. updateTeacherAttendance(params).then((res) => {
  1043. if (res.code == 200) {
  1044. this.$message.success("补卡成功");
  1045. this.markAttendance.status = false;
  1046. this.getList();
  1047. } else {
  1048. this.$message.error(res.msg);
  1049. }
  1050. });
  1051. },
  1052. handleCloseTimer() {
  1053. this.timerVisible = false;
  1054. this.timerMask.timer = "";
  1055. },
  1056. resetTimer() {
  1057. if (this.activeCourseList.length < 1) {
  1058. this.$message.error("请至少选择一节课");
  1059. return;
  1060. }
  1061. this.timerVisible = true;
  1062. },
  1063. resetType(row) {
  1064. this.typeForm.type = row.courseScheduleType;
  1065. this.typeForm.id = row.courseScheduleId;
  1066. this.typeForm.teacher = parseInt(row.masterTeacherId);
  1067. // this.maskForm.type = row.courseScheduleType;
  1068. this.typeForm.assistant = [];
  1069. for (let i in row.teachingTeachers) {
  1070. if (row.teachingTeachers[i].teacherRole == "TEACHING") {
  1071. this.typeForm.assistant.push(row.teachingTeachers[i].userId);
  1072. }
  1073. }
  1074. this.typeForm.date = row.classDate;
  1075. this.$set(
  1076. this.typeForm,
  1077. "startTime",
  1078. row.startClassTimeStr.substring(0, 5)
  1079. );
  1080. this.typeForm.endTime = row.endClassTimeStr.substring(0, 5);
  1081. // console.log(row.type)
  1082. this.typeVisible = true;
  1083. },
  1084. submitResetType() {
  1085. this.$refs.typeForm.validate((res) => {
  1086. if (res) {
  1087. let teachingTeacherIdList = this.typeForm.assistant.join(",");
  1088. if (teachingTeacherIdList.length <= 0) {
  1089. let teachingTeacherIdList = null;
  1090. }
  1091. let obj = {
  1092. actualTeacherId: this.typeForm.teacher,
  1093. startClassTimeStr: this.typeForm.startTime,
  1094. endClassTimeStr: this.typeForm.endTime,
  1095. id: this.typeForm.id,
  1096. type: this.typeForm.type,
  1097. teachingTeacherIdList,
  1098. classDate: this.typeForm.date,
  1099. };
  1100. resetCourse(obj).then((res) => {
  1101. if (res.code == 200) {
  1102. this.$message.success("修改成功");
  1103. this.getList();
  1104. this.typeVisible = false;
  1105. }
  1106. });
  1107. }
  1108. });
  1109. },
  1110. // 清除考勤
  1111. clearAttend(row) {
  1112. this.$confirm("是否清除考勤记录?", "提示", {
  1113. confirmButtonText: "确定",
  1114. cancelButtonText: "取消",
  1115. type: "warning",
  1116. })
  1117. .then(() => {
  1118. cleanAttendance({ courseScheduleIds: row.courseScheduleId }).then(
  1119. (res) => {
  1120. if (res.code == 200) {
  1121. this.$message.success("清除成功");
  1122. this.getList();
  1123. } else {
  1124. this.$message.error(res.msg);
  1125. }
  1126. }
  1127. );
  1128. })
  1129. .catch(() => {});
  1130. },
  1131. changeStartTime(val) {
  1132. this.$nextTick((res) => {
  1133. this.maskForm.endTime = addTimerFormMinute(
  1134. this.maskForm.date,
  1135. val,
  1136. this.maskForm.timer
  1137. );
  1138. });
  1139. },
  1140. changeTime(val) {
  1141. this.$nextTick((res) => {
  1142. this.maskForm.endTime = addTimerFormMinute(
  1143. this.maskForm.date,
  1144. this.maskForm.startTime,
  1145. val
  1146. );
  1147. });
  1148. },
  1149. onReSet() {
  1150. this.$refs.searchForm.resetFields();
  1151. this.search();
  1152. },
  1153. beginDate() {
  1154. return {
  1155. firstDayOfWeek: 1,
  1156. disabledDate(time) {
  1157. return time.getTime() + 86400000 <= new Date().getTime();
  1158. //开始时间不选时,结束时间最大值小于等于当天
  1159. },
  1160. };
  1161. },
  1162. },
  1163. filters: {
  1164. studentCallName: (value) => {
  1165. let template = {
  1166. NORMAL: "到课",
  1167. TRUANT: "未到",
  1168. LEAVE: "请假",
  1169. DROP_OUT: "退学",
  1170. LATE: "迟到",
  1171. "": "未到",
  1172. };
  1173. return template[value];
  1174. },
  1175. },
  1176. watch: {
  1177. "maskForm.timer"(val) {
  1178. this.maskForm.endTime = addTimerFormMinute(
  1179. this.maskForm.date,
  1180. this.maskForm.startTime,
  1181. val
  1182. );
  1183. },
  1184. },
  1185. computed: {
  1186. nowTime() {
  1187. // console.log(that.maskForm.date)
  1188. let str = "04:30:00";
  1189. if (that.maskForm.date == dayjs(new Date()).format("YYYY-MM-DD")) {
  1190. str = dayjs(new Date()).format("HH:mm:ss");
  1191. }
  1192. return str;
  1193. },
  1194. },
  1195. };
  1196. </script>
  1197. <style lang="scss" scoped>
  1198. .cl-container {
  1199. .topFrom {
  1200. margin: 20px 30px 0;
  1201. .classlist {
  1202. display: flex;
  1203. flex-direction: row;
  1204. justify-content: flex-start;
  1205. align-items: center;
  1206. ul {
  1207. li {
  1208. list-style: none;
  1209. }
  1210. }
  1211. }
  1212. }
  1213. // .searchForm {
  1214. // // margin: 0 30px;
  1215. // }
  1216. }
  1217. .btnWraps {
  1218. display: flex;
  1219. flex-direction: row;
  1220. justify-content: flex-start;
  1221. div {
  1222. margin-right: 20px;
  1223. }
  1224. }
  1225. .maskForm {
  1226. /deep/.el-input {
  1227. width: 220px;
  1228. }
  1229. }
  1230. </style>