index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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
  110. align="center"
  111. prop="organName"
  112. label="分部"
  113. ></el-table-column>
  114. <el-table-column
  115. align="center"
  116. prop="groupName"
  117. label="乐团"
  118. ></el-table-column>
  119. <el-table-column align="center" label="布置时间">
  120. <template slot-scope="scope">
  121. <div>
  122. {{
  123. scope.row.createTime ? scope.row.createTime.substr(0, 16) : ""
  124. }}
  125. </div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column
  129. align="center"
  130. prop="actualTeacherName"
  131. label="布置老师"
  132. ></el-table-column>
  133. <!-- <el-table-column align="center" prop="actualTeacherName" label="是否学练宝布置">
  134. <template slot-scope="scope">
  135. <div>
  136. {{ scope.row.musicScoreId ? "是" : "否" }}
  137. </div>
  138. </template>
  139. </el-table-column> -->
  140. <el-table-column
  141. align="center"
  142. prop="expectNum"
  143. label="应交人数"
  144. ></el-table-column>
  145. <el-table-column
  146. align="center"
  147. prop="completedNum"
  148. label="完成人数"
  149. ></el-table-column>
  150. <!-- <el-table-column
  151. align="center"
  152. prop="repliedNum"
  153. label="已回复数"
  154. ></el-table-column> -->
  155. <el-table-column align="center" prop="studentId" label="操作">
  156. <template slot-scope="scope">
  157. <div>
  158. <auth auths="/teamCourseListDetailWorkList/attendanceList">
  159. <el-button type="text" @click="lookDetail(scope.row)"
  160. >查看</el-button
  161. >
  162. </auth>
  163. </div>
  164. </template>
  165. </el-table-column>
  166. </el-table>
  167. <pagination
  168. sync
  169. :total.sync="rules.total"
  170. :page.sync="rules.page"
  171. :limit.sync="rules.limit"
  172. :page-sizes="rules.page_size"
  173. @pagination="getList"
  174. />
  175. <el-dialog
  176. title="详情"
  177. :visible.sync="classVisible"
  178. width="1000px"
  179. v-if="classVisible"
  180. >
  181. <studentWork
  182. v-if="activeRow.versionTag == 'v1'"
  183. :courseScheduleId="activeRow.courseScheduleId"
  184. ></studentWork>
  185. <courseWorkeDetail
  186. v-else
  187. :courseScheduleId="activeRow.courseScheduleId"
  188. />
  189. </el-dialog>
  190. </div>
  191. </div>
  192. </div>
  193. </template>
  194. <script>
  195. import pagination from "@/components/Pagination/index";
  196. import { courseListType } from "@/utils/searchArray";
  197. import studentWork from "@/views/teamDetail/componentCourse/studentWork";
  198. import { getHomePageList } from "./api.js";
  199. import { getTimes } from "@/utils";
  200. import courseWorkeDetail from "@/views/attendanceManager/attendanceList/components/courseWorkeDetail.vue";
  201. export default {
  202. components: { pagination, studentWork, courseWorkeDetail },
  203. data() {
  204. return {
  205. courseListType,
  206. searchForm: {
  207. search: null,
  208. organId: null,
  209. groupType: "MUSIC",
  210. courseTimer: []
  211. },
  212. teacherList: [],
  213. tableList: [],
  214. organList: [],
  215. rules: {
  216. // 分页规则
  217. limit: 10, // 限制显示条数
  218. page: 1, // 当前页
  219. total: 0, // 总条数
  220. page_size: [10, 20, 40, 50] // 选择限制显示条数
  221. },
  222. activeRow: null,
  223. classVisible: false
  224. };
  225. },
  226. //生命周期 - 创建完成(可以访问当前this实例)
  227. created() {},
  228. //生命周期 - 挂载完成(可以访问DOM元素)
  229. mounted() {
  230. // getEmployeeOrgan().then((res) => {
  231. // if (res.code == 200) {
  232. // this.organList = res.data;
  233. // }
  234. // });
  235. // 获取分部
  236. this.$store.dispatch("setBranchs");
  237. this.init();
  238. },
  239. activated() {
  240. this.init();
  241. },
  242. methods: {
  243. init() {
  244. this.getList();
  245. },
  246. getList() {
  247. // let date = this.searchForm;
  248. // let classStartDate, classEndDate;
  249. // if (this.courseTimer?.length > 0) {
  250. // classStartDate = this.courseTimer[0];
  251. // classEndDate = this.courseTimer[1];
  252. // } else {
  253. // classStartDate = null;
  254. // classEndDate = null;
  255. // }
  256. // date.classStartDate = classStartDate;
  257. // date.classEndDate = classEndDate;
  258. // date.page = this.rules.page;
  259. // date.rows = this.rules.limit;
  260. let { courseTimer, ...rest } = this.searchForm;
  261. let params = {
  262. ...rest,
  263. page: this.rules.page,
  264. rows: this.rules.limit,
  265. ...getTimes(courseTimer, ["classStartDate", "classEndDate"])
  266. };
  267. getHomePageList(params).then(res => {
  268. if (res.code == 200) {
  269. this.tableList = res.data.rows;
  270. this.rules.total = res.data.total;
  271. }
  272. });
  273. },
  274. search() {
  275. this.rules.page = 1;
  276. this.getList();
  277. },
  278. onReSet() {
  279. this.searchForm = {
  280. search: null,
  281. organId: null,
  282. groupType: "MUSIC",
  283. courseTimer: [],
  284. cloudHomeworkFlag: ""
  285. };
  286. // this.courseTimer = [];
  287. this.search();
  288. },
  289. lookDetail(row) {
  290. this.activeRow = row;
  291. this.classVisible = true;
  292. }
  293. }
  294. };
  295. </script>
  296. <style lang="scss" scoped>
  297. .search {
  298. // width: 220px!important;
  299. ::v-deep .el-input__inner {
  300. width: 260px !important;
  301. }
  302. }
  303. </style>