teamCourseList.vue 34 KB

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