teamCourseList.vue 32 KB

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