index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 课表列表
  7. </h2>
  8. <div class="m-core">
  9. <save-form
  10. :inline="true"
  11. :model="searchForm"
  12. @submit="search"
  13. @reset="onReSet"
  14. ref="searchForm"
  15. >
  16. <!-- <el-form-item prop="organId">
  17. <el-select
  18. class="multiple"
  19. v-model.trim="searchForm.organId"
  20. filterable
  21. clearable
  22. placeholder="请选择分部"
  23. >
  24. <el-option
  25. v-for="(item, index) in selects.branchs"
  26. :key="index"
  27. :label="item.name"
  28. :value="item.id"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item> -->
  32. <el-form-item prop="teacherIdList">
  33. <remote-search
  34. :commit="'setTeachers'"
  35. v-model="searchForm.teacherIdList"
  36. :demissionFlag="true"
  37. :isForzenWithQueryCondition="true"
  38. />
  39. </el-form-item>
  40. <el-form-item prop="courseStatus">
  41. <el-select
  42. v-model.trim="searchForm.courseStatus"
  43. clearable
  44. filterable
  45. placeholder="课程状态"
  46. >
  47. <el-option label="未开始" value="NOT_START"></el-option>
  48. <el-option label="进行中" value="UNDERWAY"></el-option>
  49. <el-option label="已结束" value="OVER"></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item prop="teachMode">
  53. <el-select
  54. style="width: 180px !important"
  55. v-model.trim="searchForm.teachMode"
  56. clearable
  57. filterable
  58. placeholder="教学模式"
  59. >
  60. <el-option label="线上课" value="ONLINE"></el-option>
  61. <el-option label="线下课" value="OFFLINE"></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item prop="timer">
  65. <el-date-picker
  66. v-model.trim="searchForm.timer"
  67. type="daterange"
  68. value-format="yyyy-MM-dd"
  69. range-separator="-"
  70. start-placeholder="开始日期"
  71. end-placeholder="结束日期"
  72. :picker-options="{
  73. firstDayOfWeek: 1,
  74. }"
  75. ></el-date-picker>
  76. </el-form-item>
  77. <el-form-item>
  78. <el-button native-type="submit" type="primary">搜索</el-button>
  79. <el-button native-type="reset" type="danger">重置</el-button>
  80. </el-form-item>
  81. </save-form>
  82. <div class="tableWrap">
  83. <el-table
  84. style="width: 100%"
  85. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  86. :data="tableList"
  87. >
  88. <el-table-column
  89. align="center"
  90. prop="id"
  91. label="课程名称"
  92. >
  93. <template slot-scope="scope">
  94. <copy-text>{{ scope.row.courseName }}</copy-text>
  95. </template>
  96. </el-table-column>
  97. <!-- <el-table-column
  98. align="center"
  99. prop="organName"
  100. label="分部"
  101. >
  102. <template slot-scope="scope">
  103. <copy-text>{{ scope.row.organName }}</copy-text>
  104. </template>
  105. </el-table-column> -->
  106. <el-table-column
  107. align="center"
  108. prop="teacherName"
  109. label="老师姓名"
  110. >
  111. <template slot-scope="scope">
  112. <copy-text>{{ scope.row.teacherName }}</copy-text>
  113. </template>
  114. </el-table-column>
  115. <el-table-column
  116. align="center"
  117. prop="courseType"
  118. label="课程类型"
  119. >
  120. <template slot-scope="scope">
  121. <copy-text>{{ scope.row.courseType | coursesType }}</copy-text>
  122. </template>
  123. </el-table-column>
  124. <el-table-column
  125. align="center"
  126. prop="phone"
  127. label="教学模式"
  128. >
  129. <template slot-scope="scope">
  130. {{ scope.row.teachMode | teachMode }}
  131. </template>
  132. </el-table-column>
  133. <el-table-column
  134. align="center"
  135. prop="courseStatus"
  136. label="课程状态"
  137. >
  138. <template slot-scope="scope">
  139. {{ scope.row.courseStatus | coursesStatus }}
  140. </template>
  141. </el-table-column>
  142. <el-table-column
  143. align="center"
  144. prop="studentId"
  145. label="课程时间"
  146. >
  147. <template slot-scope="scope">
  148. <div>
  149. {{ scope.row.classDate|formatTimer}} {{scope.row.classTime}}
  150. </div>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <pagination
  155. sync
  156. :total.sync="pageInfo.total"
  157. :page.sync="pageInfo.page"
  158. :limit.sync="pageInfo.limit"
  159. :page-sizes="pageInfo.page_size"
  160. @pagination="getList"
  161. />
  162. </div>
  163. </div>
  164. </div>
  165. </template>
  166. <script>
  167. import axios from "axios";
  168. import { getToken } from "@/utils/auth";
  169. import pagination from "@/components/Pagination/index";
  170. import { getCourseSchedule } from "@/api/businessManager";
  171. import { getInstrument } from "@/api/buildTeam";
  172. import { getTimes } from "@/utils";
  173. import load from "@/utils/loading";
  174. export default {
  175. components: { pagination },
  176. data() {
  177. return {
  178. searchForm: {
  179. search: null,
  180. organId:'',
  181. teacherIdList:'',
  182. timer:[],
  183. courseStatus:'',
  184. teachMode:''
  185. },
  186. soundLists: [],
  187. organList: [],
  188. tableList:[],
  189. pageInfo: {
  190. // 分页规则
  191. limit: 10, // 限制显示条数
  192. page: 1, // 当前页
  193. total: 0, // 总条数
  194. page_size: [10, 20, 40, 50], // 选择限制显示条数
  195. },
  196. categoryList:[]
  197. };
  198. },
  199. //生命周期 - 创建完成(可以访问当前this实例)
  200. created() {},
  201. //生命周期 - 挂载完成(可以访问DOM元素)
  202. mounted() {
  203. // 获取分部
  204. this.$store.dispatch("setBranchs");
  205. this.init();
  206. this.getList()
  207. },
  208. methods: {
  209. init() {
  210. },
  211. search() {
  212. this.pageInfo.page = 1;
  213. this.getList()
  214. },
  215. onReSet() {
  216. this.pageInfo.page = 1;
  217. this.searchForm= {
  218. search: null,
  219. organId:'',
  220. teacherIdList:'',
  221. timer:[],
  222. courseStatus:'',
  223. teachMode:''
  224. }
  225. this.getList()
  226. },
  227. async getList() {
  228. try{
  229. const { timer, ...rest } = this.searchForm;
  230. let obj = {
  231. page: this.pageInfo.page,
  232. rows: this.pageInfo.limit,
  233. ...rest,
  234. ...getTimes(timer, ["createStartDate", "createEndDate"]),
  235. }
  236. const res = await getCourseSchedule(obj)
  237. this.tableList = res.data.rows
  238. this.pageInfo.total = res.data.total
  239. }catch(e){
  240. console.log(e)
  241. }
  242. },
  243. lookRepair(row){
  244. this.$router.push({path:'/otherManager/repairList',query:{hasExemptionAmount:'1',studentInstrumentId:row.id}})
  245. }
  246. },
  247. };
  248. </script>
  249. <style lang='scss' scoped>
  250. </style>