index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. >
  15. <el-form-item>
  16. <el-input
  17. class="search"
  18. v-model.trim="searchForm.search"
  19. clearable
  20. @keyup.enter.native="search"
  21. placeholder="课程编号、名称、乐团名称、老师"
  22. ></el-input>
  23. </el-form-item>
  24. <el-form-item prop="organId">
  25. <el-select
  26. class="multiple"
  27. filterable
  28. v-model.trim="searchForm.organId"
  29. clearable
  30. placeholder="请选择分部"
  31. >
  32. <el-option
  33. v-for="(item, index) in selects.branchs"
  34. :key="index"
  35. :label="item.name"
  36. :value="item.id"
  37. ></el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-select
  42. v-model.trim="searchForm.groupType"
  43. class="organSelect"
  44. style="margin-left: 15px; width: 100%"
  45. filterable
  46. placeholder="请选择课程类型"
  47. >
  48. <el-option
  49. v-for="(item, index) in courseListType"
  50. :key="index"
  51. :label="item.label"
  52. :value="item.value"
  53. ></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item>
  57. <el-date-picker
  58. v-model.trim="searchForm.courseTimer"
  59. style="width: 420px"
  60. type="daterange"
  61. value-format="yyyy-MM-dd"
  62. range-separator="至"
  63. start-placeholder="上课开始日期"
  64. end-placeholder="上课结束日期"
  65. :picker-options="{
  66. firstDayOfWeek: 1,
  67. }"
  68. ></el-date-picker>
  69. </el-form-item>
  70. <el-form-item>
  71. <el-button native-type="submit" type="danger">搜索</el-button>
  72. <el-button native-type="reset" type="primary">重置</el-button>
  73. </el-form-item>
  74. </save-form>
  75. <div class="tableWrap">
  76. <el-table
  77. style="width: 100%"
  78. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  79. :data="tableList"
  80. >
  81. <el-table-column
  82. align="center"
  83. prop="courseScheduleId"
  84. label="课程编号"
  85. ></el-table-column>
  86. <el-table-column
  87. align="center"
  88. prop="courseScheduleName"
  89. label="课程名称"
  90. ></el-table-column>
  91. <el-table-column
  92. align="center"
  93. prop="organName"
  94. label="分部"
  95. ></el-table-column>
  96. <el-table-column
  97. align="center"
  98. prop="groupName"
  99. label="课程组名称"
  100. ></el-table-column>
  101. <el-table-column align="center" label="布置时间">
  102. <template slot-scope="scope">
  103. <div>
  104. {{
  105. scope.row.createTime ? scope.row.createTime.substr(0, 16) : ""
  106. }}
  107. </div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column
  111. align="center"
  112. prop="actualTeacherName"
  113. label="布置老师"
  114. ></el-table-column>
  115. <el-table-column
  116. align="center"
  117. prop="expectNum"
  118. label="应交人数"
  119. ></el-table-column>
  120. <el-table-column
  121. align="center"
  122. prop="completedNum"
  123. label="已交人数"
  124. ></el-table-column>
  125. <el-table-column
  126. align="center"
  127. prop="repliedNum"
  128. label="已回复数"
  129. ></el-table-column>
  130. <el-table-column align="center" prop="studentId" label="操作">
  131. <template slot-scope="scope">
  132. <div>
  133. <auth auths='/teamCourseListDetailWorkList/attendanceList'>
  134. <el-button
  135. type="text"
  136. @click="lookDetail(scope.row)"
  137. >查看</el-button
  138. >
  139. </auth>
  140. </div>
  141. </template>
  142. </el-table-column>
  143. </el-table>
  144. <pagination
  145. sync
  146. :total.sync="rules.total"
  147. :page.sync="rules.page"
  148. :limit.sync="rules.limit"
  149. :page-sizes="rules.page_size"
  150. @pagination="getList"
  151. />
  152. <el-dialog title="训练详情" :visible.sync="classVisible" width="1000px" v-if="classVisible">
  153. <studentWork
  154. v-if="activeRow"
  155. :courseScheduleId="activeRow.courseScheduleId"
  156. ></studentWork>
  157. </el-dialog>
  158. </div>
  159. </div>
  160. </div>
  161. </template>
  162. <script>
  163. import pagination from "@/components/Pagination/index";
  164. import { courseListType } from "@/utils/searchArray";
  165. import studentWork from "@/views/teamDetail/componentCourse/studentWork";
  166. import { getHomePageList } from "./api.js";
  167. import { getTimes } from "@/utils";
  168. export default {
  169. components: { pagination, studentWork },
  170. data() {
  171. return {
  172. courseListType,
  173. searchForm: {
  174. search: null,
  175. organId: null,
  176. groupType: "MUSIC",
  177. courseTimer: [],
  178. },
  179. teacherList: [],
  180. tableList: [],
  181. organList: [],
  182. rules: {
  183. // 分页规则
  184. limit: 10, // 限制显示条数
  185. page: 1, // 当前页
  186. total: 0, // 总条数
  187. page_size: [10, 20, 40, 50], // 选择限制显示条数
  188. },
  189. activeRow: null,
  190. classVisible: false,
  191. };
  192. },
  193. //生命周期 - 创建完成(可以访问当前this实例)
  194. created() {},
  195. //生命周期 - 挂载完成(可以访问DOM元素)
  196. mounted() {
  197. // getEmployeeOrgan().then((res) => {
  198. // if (res.code == 200) {
  199. // this.organList = res.data;
  200. // }
  201. // });
  202. // 获取分部
  203. this.$store.dispatch('setBranchs')
  204. this.init();
  205. },
  206. activated() {
  207. this.init();
  208. },
  209. methods: {
  210. init() {
  211. this.getList();
  212. },
  213. getList() {
  214. // let date = this.searchForm;
  215. // let classStartDate, classEndDate;
  216. // if (this.courseTimer?.length > 0) {
  217. // classStartDate = this.courseTimer[0];
  218. // classEndDate = this.courseTimer[1];
  219. // } else {
  220. // classStartDate = null;
  221. // classEndDate = null;
  222. // }
  223. // date.classStartDate = classStartDate;
  224. // date.classEndDate = classEndDate;
  225. // date.page = this.rules.page;
  226. // date.rows = this.rules.limit;
  227. let { courseTimer, ...rest } = this.searchForm;
  228. let params = {
  229. ...rest,
  230. page: this.rules.page,
  231. rows: this.rules.limit,
  232. ...getTimes(courseTimer, ["classStartDate", "classEndDate"]),
  233. };
  234. getHomePageList(params).then((res) => {
  235. if (res.code == 200) {
  236. this.tableList = res.data.rows;
  237. this.rules.total = res.data.total;
  238. }
  239. });
  240. },
  241. search() {
  242. this.rules.page = 1;
  243. this.getList();
  244. },
  245. onReSet() {
  246. this.searchForm = {
  247. search: null,
  248. organId: null,
  249. groupType: "MUSIC",
  250. courseTimer:[]
  251. };
  252. // this.courseTimer = [];
  253. this.search();
  254. },
  255. lookDetail(row) {
  256. this.activeRow = row;
  257. this.classVisible = true;
  258. },
  259. },
  260. };
  261. </script>
  262. <style lang='scss' scoped>
  263. .search {
  264. // width: 220px!important;
  265. /deep/.el-input__inner {
  266. width: 260px!important;
  267. }
  268. }
  269. </style>