teamCourseList.vue 33 KB

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