teamCourseList.vue 37 KB

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