teamCourseList.vue 29 KB

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