teamCourseList.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>课表列表
  5. </h2>
  6. <div class="m-core">
  7. <!-- 搜索类型 -->
  8. <save-form :inline="true"
  9. class="searchForm"
  10. ref="searchForm"
  11. :model.sync="searchForm">
  12. <el-form-item>
  13. <el-input v-model.trim="searchForm.search"
  14. @keyup.enter.native="search"
  15. placeholder="课程(组)编号/课程名称" />
  16. </el-form-item>
  17. <el-form-item>
  18. <el-select v-model.trim="searchForm.schoolId"
  19. clearable
  20. filterable
  21. placeholder="请选择教学点">
  22. <el-option v-for="(item, index) in selects.schools"
  23. :key="index"
  24. :value="item.id"
  25. :label="item.name"></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-select v-model.trim="searchForm.teacherIdList"
  30. clearable
  31. filterable
  32. placeholder="请选择老师">
  33. <el-option v-for="(item, index) in selects.teachers"
  34. :key="index"
  35. :value="item.id"
  36. :label="item.realName"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-select class="multiple"
  41. v-model.trim="searchForm.organIdList"
  42. filterable
  43. clearable
  44. placeholder="请选择分部">
  45. <el-option v-for="(item,index) in selects.branchs"
  46. :key="index"
  47. :label="item.name"
  48. :value="item.id"></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item>
  52. <el-select v-model.trim="searchForm.groupType"
  53. clearable
  54. filterable
  55. placeholder="课程组类型">
  56. <el-option v-for="(item, index) in courseListType"
  57. :key="index"
  58. :value="item.value"
  59. :label="item.label"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item>
  63. <el-select v-model.trim="searchForm.courseType"
  64. clearable
  65. filterable
  66. placeholder="课程类型">
  67. <el-option v-for="(item, index) in courseType"
  68. :key="index"
  69. :value="item.value"
  70. :label="item.label"></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item>
  74. <el-select v-model.trim="searchForm.teachMode"
  75. clearable
  76. filterable
  77. placeholder="教学模式">
  78. <el-option label="线上课"
  79. value="ONLINE"></el-option>
  80. <el-option label="线下课"
  81. value="OFFLINE"></el-option>
  82. </el-select>
  83. </el-form-item>
  84. <el-form-item>
  85. <el-select v-model.trim="searchForm.courseStatus"
  86. clearable
  87. filterable
  88. placeholder="课程状态">
  89. <el-option label="未开始"
  90. value="NOT_START"></el-option>
  91. <el-option label="进行中"
  92. value="UNDERWAY"></el-option>
  93. <el-option label="已结束"
  94. value="OVER"></el-option>
  95. </el-select>
  96. </el-form-item>
  97. <el-form-item>
  98. <el-select v-model.trim="searchForm.teachType"
  99. clearable
  100. filterable
  101. placeholder="老师类型">
  102. <el-option v-for="item in workTypeOptions" :key="item.label" :label="item.label" :value="item.value"></el-option>
  103. </el-select>
  104. </el-form-item>
  105. <el-form-item>
  106. <el-select v-model.trim="searchForm.isCallNames"
  107. clearable
  108. filterable
  109. placeholder="是否点名">
  110. <el-option label="是"
  111. value="1"></el-option>
  112. <el-option label="否"
  113. value="0"></el-option>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item>
  117. <el-date-picker v-model.trim="searchForm.timer"
  118. type="daterange"
  119. value-format="yyyy-MM-dd"
  120. range-separator="至"
  121. start-placeholder="上课开始日期"
  122. end-placeholder="上课结束日期"
  123. :picker-options="{
  124. firstDayOfWeek: 1
  125. }"></el-date-picker>
  126. </el-form-item>
  127. <el-form-item>
  128. <el-date-picker v-model.trim="searchForm.creatTimer"
  129. type="daterange"
  130. value-format="yyyy-MM-dd"
  131. range-separator="至"
  132. start-placeholder="创建开始日期"
  133. end-placeholder="创建结束日期"
  134. :picker-options="{
  135. firstDayOfWeek: 1
  136. }"></el-date-picker>
  137. </el-form-item>
  138. <el-row type="flex" justify="space-around">
  139. <el-col>
  140. <el-button
  141. @click="search"
  142. type="primary"
  143. >搜索</el-button>
  144. <el-button
  145. @click="reset"
  146. type="danger"
  147. >重置</el-button>
  148. <el-button
  149. v-permission="'export/superFindCourseSchedules'"
  150. @click="onCourseExport"
  151. type="primary"
  152. >导出课表</el-button>
  153. </el-col>
  154. </el-row>
  155. </save-form>
  156. <div class="btnWraps"></div>
  157. <!-- 列表 -->
  158. <div class="tableWrap" style="margin-top: 20px">
  159. <el-table :data="tableList"
  160. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  161. <el-table-column align="center"
  162. prop="organName"
  163. label="分部名称"></el-table-column>
  164. <el-table-column align="center"
  165. width="130px"
  166. prop="musicGroupId"
  167. label="乐团/课程组编号"></el-table-column>
  168. <el-table-column align="center"
  169. prop="id"
  170. label="课程编号"></el-table-column>
  171. <el-table-column align="center"
  172. width="200px"
  173. label="上课时间">
  174. <template slot-scope="scope">{{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 16) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(11,5) : ''}}</template>
  175. </el-table-column>
  176. <el-table-column align="center"
  177. prop="subjectName"
  178. label="声部"></el-table-column>
  179. <el-table-column align="center"
  180. prop="name"
  181. label="课程名称"></el-table-column>
  182. <el-table-column align="center"
  183. width="150px"
  184. label="课程类型">
  185. <template slot-scope="scope">
  186. <div>{{ scope.row.type | coursesType}}</div>
  187. </template>
  188. </el-table-column>
  189. <el-table-column align="center"
  190. label="教学模式">
  191. <template slot-scope="scope">
  192. <div>{{ scope.row.teachMode | teachMode}}</div>
  193. </template>
  194. </el-table-column>
  195. <el-table-column align="center"
  196. prop="schoolName"
  197. label="教学点">
  198. <template slot-scope="scope">
  199. <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
  200. </template>
  201. </el-table-column>
  202. <el-table-column align="center"
  203. prop="courseScheduleStatus"
  204. label="课程状态">
  205. <template slot-scope="scope">
  206. <div>{{ scope.row.status | coursesStatus }}</div>
  207. </template>
  208. </el-table-column>
  209. <el-table-column align="center"
  210. label="考勤申诉">
  211. <template slot-scope="scope">
  212. <div>{{ scope.row.isComplaints==1?'是':'否'}}</div>
  213. </template>
  214. </el-table-column>
  215. <el-table-column align="center"
  216. prop="isLock"
  217. label="是否冻结">
  218. <template slot-scope="scope">{{ scope.row.isLock ? '是' : '否' }}</template>
  219. </el-table-column>
  220. <el-table-column align="center"
  221. prop="newCourseId"
  222. label="是否被合并"
  223. width="130px">
  224. <template slot-scope="scope">{{ scope.row.newCourseId > 0 ? '是' : '否' }}</template>
  225. </el-table-column>
  226. <el-table-column align="center"
  227. prop="isCallNames"
  228. label="是否点名"
  229. fixed="right">
  230. <template slot-scope="scope">{{ scope.row.isCallNames ? '是' : '否' }}</template>
  231. </el-table-column>
  232. <el-table-column align="center"
  233. label="详情"
  234. fixed="right"
  235. width="220px">
  236. <template slot-scope="scope">
  237. <div>
  238. <el-button type="text"
  239. v-if="permission('teamCourseList/details')"
  240. @click="lookDetail(scope.row)">详情</el-button>
  241. <el-button type="text"
  242. v-if="permission('courseSchedule/classStartDateAdjust?hight') && (!scope.row.isLock || scope.row.newCourseId > 0)"
  243. @click="resetClass(scope.row)">调整</el-button>
  244. <el-button type="text" @click="common(scope.row)" v-if="scope.row.newCourseId > 0">
  245. 合并课
  246. </el-button>
  247. <el-button type="text"
  248. @click="addCompound(scope.row)"
  249. v-if="(scope.row.groupType=='MUSIC'&&scope.row.type!='MUSIC_NETWORK'&&scope.row.type!='HIGH_ONLINE'&&scope.row.status=='NOT_START'&&!isAddCom(scope.row)&&permission('courseSchedule/courseMerge')&&scope.row.newCourseId <= 0&&!scope.row.beMerged)">添加合课</el-button>
  250. <el-button type="text"
  251. v-if="isAddCom(scope.row)&&permission('courseSchedule/courseMerge')"
  252. @click="cancleCompound(scope.row)">取消合课</el-button>
  253. <el-button type="text"
  254. v-if="
  255. scope.row.status=='OVER'
  256. &&
  257. !scope.row.isSettlement
  258. &&permission('courseSchedule/cleanAttendance')"
  259. @click="clearAttend(scope.row)">清除考勤</el-button>
  260. </div>
  261. </template>
  262. </el-table-column>
  263. </el-table>
  264. <pagination :total.sync="rules.total"
  265. :page.sync="rules.page"
  266. :limit.sync="rules.limit"
  267. :page-sizes="rules.page_size"
  268. @pagination="getList"
  269. sync />
  270. </div>
  271. </div>
  272. <el-dialog title="课表详情"
  273. :visible.sync="classVisible"
  274. width="1000px">
  275. <el-form :model="maskForm"
  276. :inline="true">
  277. <el-form-item label="老师姓名">
  278. <!-- <el-input v-model.trim="maskForm.teacherName"
  279. disabled></el-input>-->
  280. <div class="inputStyle">{{maskForm.teacherName}}</div>
  281. </el-form-item>
  282. <el-form-item label="课程模式">
  283. <!-- <el-input :value="maskForm.teachMode | teachMode"
  284. disabled></el-input>-->
  285. <div class="inputStyle">{{maskForm.teachMode| teachMode}}</div>
  286. <!-- <span>{{maskForm.teachMode }}</span> -->
  287. </el-form-item>
  288. <el-form-item label="课程类型">
  289. <!-- <el-input :value="maskForm.type |classType"
  290. disabled></el-input>-->
  291. <div class="inputStyle">{{maskForm.type|coursesType}}</div>
  292. </el-form-item>
  293. <!-- courseScheduleStatus -->
  294. <el-form-item label="课程状态">
  295. <!-- <el-input :value="maskForm.type |classType"
  296. disabled></el-input>-->
  297. <div class="inputStyle">{{maskForm.status | coursesStatus}}</div>
  298. </el-form-item>
  299. <!-- <el-form-item label="签到时间">
  300. <div class="inputStyle">{{maskForm.signInTime | dateForMinFormat}}</div>
  301. </el-form-item>
  302. <el-form-item label="签退时间">
  303. <div class="inputStyle">{{maskForm.signOutTime | dateForMinFormat}}</div>
  304. </el-form-item> -->
  305. <el-form-item label="是否点名">
  306. <!-- <el-input :value="maskForm.isCallNames | isCall"
  307. disabled></el-input>-->
  308. <div class="inputStyle">{{maskForm.isCallNames | isCall}}</div>
  309. </el-form-item>
  310. <!-- <el-form-item label="签到状态">
  311. <div class="inputStyle"
  312. :class="maskForm.isSignIn==1?'':'red'">{{ maskForm.isSignIn | attendanceType}}</div>
  313. </el-form-item>
  314. <el-form-item label="签退状态">
  315. <div class="inputStyle"
  316. :class="maskForm.isSignIn==1?'':'red'">{{ maskForm.isSignOut | attendanceOutType}}</div>
  317. </el-form-item> -->
  318. <el-form-item label="上课时间">
  319. {{ maskForm.startClassTime ? maskForm.startClassTime.substr(0, 16) : '' }}-{{ maskForm.endClassTime ? maskForm.endClassTime.substr(11,5) : ''}}
  320. </el-form-item>
  321. <el-form-item label="上课时长">
  322. <div class="inputStyle"
  323. :class=" (maskForm.attendClassTime <= 120)?'':'red'">{{ (maskForm.attendClassTime>=0?maskForm.attendClassTime:0)}}分钟 <el-tooltip placement="top"
  324. popper-class="mTooltip">
  325. <div slot="content">
  326. 学员和老师同时在教室里的时长。
  327. </div>
  328. <!-- <img :src="imageIcon" class="micon el-tooltip" style="width:8px height:8px" alt /> -->
  329. <i class="el-icon-question micon el-tooltip"
  330. style="font-size: 18px; color: #F56C6C"
  331. v-permission="'export/teacherSalary'"></i>
  332. </el-tooltip>
  333. </div>
  334. </el-form-item>
  335. </el-form>
  336. <!-- v-if="maskForm.status != 'NOT_START'" -->
  337. <el-tabs v-model.trim="activeName"
  338. type="card"
  339. @tab-click="handleClick">
  340. <el-tab-pane label="学员列表"
  341. name="first">
  342. <div v-if="activeName == 'first'">
  343. <!-- studentRollCall -->
  344. <studentRollCall :courseScheduleId="maskForm.id"></studentRollCall>
  345. </div>
  346. </el-tab-pane>
  347. <!-- <el-tab-pane label="GPS定位"
  348. v-if="maskForm.teachMode == 'OFFLINE'"
  349. name="second">
  350. <div v-if="activeName == 'second'">
  351. <gpsLoction :courseScheduleId="maskForm.id"></gpsLoction>
  352. </div>
  353. </el-tab-pane> -->
  354. <el-tab-pane label="老师列表"
  355. name="second">
  356. <div v-if="activeName == 'second'">
  357. <teacherList :courseScheduleId="maskForm.id"
  358. :teachMode='maskForm.teachMode'></teacherList>
  359. </div>
  360. </el-tab-pane>
  361. <!-- v-if="maskForm.teachMode != 'OFFLINE'" -->
  362. <el-tab-pane label="作业"
  363. name="third">
  364. <div v-if="activeName == 'third'">
  365. <studentWork :courseScheduleId="maskForm.id"></studentWork>
  366. </div>
  367. </el-tab-pane>
  368. <!-- v-if="maskForm.type == 'VIP' || maskForm.type == 'PRACTICE'" -->
  369. <el-tab-pane label="评论"
  370. name="four">
  371. <div v-if="activeName == 'four'">
  372. <courseEvaluate :courseScheduleId="maskForm.id"></courseEvaluate>
  373. </div>
  374. </el-tab-pane>
  375. <el-tab-pane label="调整记录"
  376. v-if="permission('courseSchedule/queryCourseAdjustDetail')"
  377. name="five">
  378. <div v-if="activeName == 'five'">
  379. <infoMsg :courseScheduleId="maskForm.id"></infoMsg>
  380. </div>
  381. </el-tab-pane>
  382. <!-- infoMsg -->
  383. </el-tabs>
  384. </el-dialog>
  385. <el-dialog :visible.sync="show"
  386. width="400px">
  387. <resetClass :show="show"
  388. v-if="show"
  389. @closeReset='closeReset'
  390. @getList='getList'
  391. :id='id' />
  392. </el-dialog>
  393. <addCompound :compoundList='compoundList' v-if="permission('courseSchedule/courseMerge')"
  394. @clearCom='clearCom'
  395. @getList='getList'
  396. @cancleCompound='cancleCompound' />
  397. </div>
  398. </template>
  399. <script>
  400. import pagination from "@/components/Pagination/index";
  401. import {
  402. getTeacher,
  403. getMusicGroupAllClass,
  404. superFindCourseSchedules,
  405. getEmployeeOrgan,
  406. cleanAttendance
  407. } from "@/api/buildTeam";
  408. import { workType } from '@/constant'
  409. import { objectToOptions, getTimes } from '@/utils'
  410. import { getTeacherPersonalAttendanceDetail } from "@/api/teacherManager";
  411. import { getSchool } from "@/api/systemManage";
  412. import { courseType, courseListType } from "@/utils/searchArray";
  413. import studentRollCall from "./componentCourse/studentRollCall";
  414. import gpsLoction from "./componentCourse/gpsLocation";
  415. import studentWork from "./componentCourse/studentWork";
  416. import courseEvaluate from "./componentCourse/courseEvaluate";
  417. import { permission } from "@/utils/directivePage";
  418. import axios from "axios";
  419. import { getToken } from "@/utils/auth";
  420. import load from "@/utils/loading";
  421. import resetClass from './componentCourse/resetClass'
  422. import teacherList from './componentCourse/teacherList'
  423. import addCompound from './componentCourse/addCompound'
  424. import infoMsg from './componentCourse/infoMsg'
  425. let nowTime = new Date();
  426. nowTime =
  427. nowTime.getFullYear() +
  428. "-" +
  429. (nowTime.getMonth() + 1) +
  430. "-" +
  431. nowTime.getDate();
  432. const initSearch = {
  433. teachMode: null, // 教学模式
  434. organIdList: null,
  435. courseStatus: null,
  436. courseType: null,
  437. timer: [nowTime, nowTime], // 时间
  438. class: null,
  439. teachType: null,
  440. isCallNames: null, // 是否点名
  441. search: null, // 乐团名称 编号 vip课名称
  442. teacherIdList: null, // 老师编号
  443. schoolId: null, // 教学点编号
  444. creatTimer: []
  445. }
  446. export default {
  447. data () {
  448. return {
  449. classVisible: false,
  450. timerVisible: false,
  451. courseVisible: false,
  452. courseType: courseType,
  453. courseListType: courseListType,
  454. searchForm: {...initSearch},
  455. tableList: [],
  456. searchLsit: [],
  457. organList: [],
  458. rules: {
  459. // 分页规则
  460. limit: 10, // 限制显示条数
  461. page: 1, // 当前页
  462. total: 0, // 总条数
  463. page_size: [10, 20, 40, 50] // 选择限制显示条数
  464. },
  465. teacherList: [],
  466. schoolList: [],
  467. maskForm: {},
  468. activeName: "first",
  469. id: null,
  470. show: false,
  471. compoundList: []
  472. };
  473. },
  474. components: {
  475. pagination,
  476. studentRollCall,
  477. gpsLoction,
  478. studentWork,
  479. courseEvaluate,
  480. resetClass,
  481. teacherList,
  482. addCompound,
  483. infoMsg
  484. },
  485. activated () {
  486. this.init();
  487. },
  488. computed: {
  489. workTypeOptions() {
  490. return objectToOptions(workType)
  491. }
  492. },
  493. mounted () {
  494. this.$store.dispatch('setBranchs')
  495. this.$store.dispatch('setTeachers')
  496. this.$store.dispatch('setSchools')
  497. this.init();
  498. },
  499. methods: {
  500. init () {
  501. this.getList();
  502. },
  503. permission (str, parent) {
  504. return permission(str, parent);
  505. },
  506. reset() {
  507. this.searchForm = {...initSearch}
  508. this.search()
  509. },
  510. search () {
  511. this.rules.page = 1;
  512. this.$refs.searchForm.save(this.searchForm)
  513. this.getList();
  514. },
  515. common(row) {
  516. this.searchForm = {
  517. ...initSearch,
  518. timer: [],
  519. search: row.newCourseId,
  520. }
  521. this.search()
  522. },
  523. getSearchForm() {
  524. let searchForm = this.searchForm;
  525. if (!searchForm.timer || searchForm.timer.length <= 0) {
  526. searchForm.timer = [];
  527. // this.$message.error("请选择时间段");
  528. // return;
  529. }
  530. if (!searchForm.creatTimer || searchForm.creatTimer.length <= 0) {
  531. searchForm.creatTimer = []
  532. }
  533. let count = 0
  534. for (let item in searchForm) {
  535. if (searchForm[item] && !Array.isArray(searchForm[item])) {
  536. count++
  537. } else if (Array.isArray(searchForm[item]) && searchForm[item].length > 0) {
  538. count++
  539. }
  540. }
  541. if (count <= 0) {
  542. this.$message.error('请至少选择一个搜索条件')
  543. return
  544. }
  545. const { creatTimer, timer, ...rest } = searchForm
  546. return {
  547. ...rest,
  548. page: this.rules.page,
  549. rows: this.rules.limit,
  550. ...getTimes(creatTimer, ['createStartDate', 'createEndDate']),
  551. ...getTimes(timer, ['startTime', 'endTime']),
  552. }
  553. },
  554. onCourseExport () {
  555. // 课表导出
  556. let url = "/api-web/export/superFindCourseSchedules";
  557. const options = {
  558. method: "get",
  559. headers: {
  560. Authorization: getToken()
  561. },
  562. params: this.getSearchForm(),
  563. url,
  564. responseType: "blob"
  565. };
  566. this.$confirm("您确定导出报表", "提示", {
  567. confirmButtonText: "确定",
  568. cancelButtonText: "取消",
  569. type: "warning"
  570. })
  571. .then(() => {
  572. load.startLoading();
  573. axios(options)
  574. .then(res => {
  575. let blob = new Blob([res.data], {
  576. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  577. type: "application/vnd.ms-excel;charset=utf-8"
  578. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  579. });
  580. let text = new Response(blob).text();
  581. text.then(res => {
  582. // 判断是否报错
  583. if (res.indexOf("code") != -1) {
  584. let json = JSON.parse(res);
  585. this.$message.error(json.msg);
  586. } else {
  587. let objectUrl = URL.createObjectURL(blob);
  588. let link = document.createElement("a");
  589. let fname = "课表列表" + new Date().getTime(); //下载文件的名字
  590. link.href = objectUrl;
  591. link.setAttribute("download", fname);
  592. document.body.appendChild(link);
  593. link.click();
  594. }
  595. });
  596. load.endLoading();
  597. })
  598. .catch(error => {
  599. this.$message.error("导出数据失败,请联系管理员");
  600. load.endLoading();
  601. });
  602. })
  603. .catch(() => { });
  604. },
  605. getList () {
  606. superFindCourseSchedules(this.getSearchForm()).then(res => {
  607. if (res.code == 200) {
  608. this.tableList = res.data.rows;
  609. this.rules.total = res.data.total;
  610. }
  611. });
  612. },
  613. lookDetail (row) {
  614. // this.maskForm = row;
  615. // 发请求 获取详情 row.id
  616. this.maskForm = row;
  617. this.activeName = "first";
  618. this.classVisible = true;
  619. getTeacherPersonalAttendanceDetail({ courseScheduleId: row.id }).then(res => {
  620. if (res.code == 200) {
  621. this.maskForm = { ...this.maskForm, ...res.data };
  622. this.maskForm.id = row.id;
  623. this.activeName = "first";
  624. this.classVisible = true;
  625. }
  626. })
  627. },
  628. handleClick (tab, event) {
  629. // console.log(tab, event);
  630. },
  631. resetClass (row) {
  632. console.log(row)
  633. this.id = row.id
  634. this.show = true
  635. },
  636. closeReset () {
  637. this.show = false
  638. },
  639. clearAttend (row) {
  640. this.$confirm("是否清除考勤记录?", "提示", {
  641. confirmButtonText: "确定",
  642. cancelButtonText: "取消",
  643. type: "warning"
  644. })
  645. .then(() => {
  646. cleanAttendance({ courseScheduleIds: row.id }).then(
  647. res => {
  648. if (res.code == 200) {
  649. this.$message.success("清除成功");
  650. this.getList();
  651. } else {
  652. this.$message.error(res.msg);
  653. }
  654. }
  655. );
  656. })
  657. .catch(() => { });
  658. },
  659. addCompound (row) {
  660. this.compoundList.push(row)
  661. this.compoundList = [...new Set(this.compoundList)]
  662. },
  663. isAddCom (row) {
  664. let flag = false
  665. this.compoundList.forEach(com => {
  666. if (com.id == row.id) {
  667. flag = true
  668. }
  669. })
  670. return flag
  671. },
  672. cancleCompound (row) {
  673. let indexNum = null
  674. this.compoundList.forEach((com, index) => {
  675. if (com.id == row.id) {
  676. indexNum = index
  677. }
  678. })
  679. if (indexNum + '') {
  680. this.compoundList.splice(indexNum, 1)
  681. }
  682. },
  683. clearCom () {
  684. this.compoundList = []
  685. }
  686. },
  687. filters: {
  688. isCall (val) {
  689. if (val == 0) {
  690. return "未点名";
  691. } else if (val == 1) {
  692. return "已点名";
  693. }
  694. }
  695. },
  696. watch: {
  697. classVisible (val) {
  698. if (!val) {
  699. this.activeName = null;
  700. }
  701. }
  702. }
  703. };
  704. </script>
  705. <style lang="scss" scoped>
  706. .visible {
  707. visibility: hidden;
  708. }
  709. .cl-container {
  710. .topFrom {
  711. margin: 20px 30px 0;
  712. .classlist {
  713. display: flex;
  714. flex-direction: row;
  715. justify-content: flex-start;
  716. align-items: center;
  717. ul {
  718. li {
  719. list-style: none;
  720. }
  721. }
  722. }
  723. }
  724. .searchForm {
  725. margin: 0 30px;
  726. }
  727. }
  728. .btnWraps {
  729. display: flex;
  730. flex-direction: row;
  731. justify-content: flex-start;
  732. div {
  733. margin-right: 20px;
  734. }
  735. }
  736. .inputStyle {
  737. width: 180px;
  738. }
  739. .red {
  740. color: red;
  741. }
  742. .exportBtn {
  743. background: #13817a;
  744. }
  745. </style>