courseList.vue 38 KB

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