index.vue 8.4 KB

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