examination.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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. @change="onBranchChange"
  39. >
  40. <el-option
  41. v-for="(item, index) in selects.branchs"
  42. :key="index"
  43. :label="item.name"
  44. :value="item.id"
  45. ></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item>
  49. <el-select
  50. :disabled="!searchForm.organId || teamList.length <= 0"
  51. v-model.trim="searchForm.musicGroupId"
  52. clearable
  53. filterable
  54. placeholder="请选择乐团"
  55. @change="changeMusicGroup"
  56. >
  57. <el-option
  58. v-for="(item, index) in teamList"
  59. :key="index"
  60. :value="item.id"
  61. :label="item.name"
  62. ></el-option>
  63. </el-select>
  64. </el-form-item>
  65. <!-- <el-form-item>
  66. <el-select
  67. v-model.trim="searchForm.groupType"
  68. class="organSelect"
  69. filterable
  70. placeholder="请选择课程类型"
  71. >
  72. <el-option
  73. v-for="(item, index) in courseListType"
  74. :key="index"
  75. :label="item.label"
  76. :value="item.value"
  77. ></el-option>
  78. </el-select>
  79. </el-form-item> -->
  80. <!-- <el-form-item>
  81. <el-select
  82. v-model.trim="searchForm.cloudHomeworkFlag"
  83. class="organSelect"
  84. clearable
  85. filterable
  86. placeholder="是否学练宝布置"
  87. >
  88. <el-option label="是" :value="true"></el-option>
  89. <el-option label="否" :value="false"></el-option>
  90. </el-select>
  91. </el-form-item> -->
  92. <!-- <el-form-item>
  93. <el-date-picker
  94. v-model.trim="searchForm.courseTimer"
  95. style="width: 420px"
  96. type="daterange"
  97. value-format="yyyy-MM-dd"
  98. range-separator="至"
  99. start-placeholder="上课开始日期"
  100. end-placeholder="上课结束日期"
  101. :picker-options="{
  102. firstDayOfWeek: 1,
  103. }"
  104. ></el-date-picker>
  105. </el-form-item> -->
  106. <el-form-item>
  107. <el-button native-type="submit" type="danger">搜索</el-button>
  108. <el-button native-type="reset" type="primary">重置</el-button>
  109. </el-form-item>
  110. </save-form>
  111. <div class="tableWrap">
  112. <el-table
  113. style="width: 100%"
  114. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  115. :data="tableList"
  116. >
  117. <el-table-column
  118. align="center"
  119. prop="organName"
  120. label="分部"
  121. ></el-table-column>
  122. <!-- <el-table-column
  123. align="center"
  124. prop="musicGroupName"
  125. label="乐团"
  126. ></el-table-column>
  127. <el-table-column
  128. align="center"
  129. prop="courseScheduleName"
  130. label="班级"
  131. ></el-table-column> -->
  132. <el-table-column
  133. align="center"
  134. prop="teacherName"
  135. label="布置老师"
  136. ></el-table-column>
  137. <el-table-column align="center" label="布置时间">
  138. <template slot-scope="scope">
  139. <div>
  140. {{
  141. scope.row.createTime ? scope.row.createTime.substr(0, 16) : ""
  142. }}
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column align="center" label="截止时间">
  147. <template slot-scope="scope">
  148. <div>
  149. {{
  150. scope.row.expireDate ? scope.row.expireDate.substr(0, 16) : ""
  151. }}
  152. </div>
  153. </template>
  154. </el-table-column>
  155. <!-- <el-table-column align="center" prop="actualTeacherName" label="是否学练宝布置">
  156. <template slot-scope="scope">
  157. <div>
  158. {{ scope.row.musicScoreId ? "是" : "否" }}
  159. </div>
  160. </template>
  161. </el-table-column> -->
  162. <el-table-column
  163. align="center"
  164. prop="expectNum"
  165. label="应交人数"
  166. ></el-table-column>
  167. <el-table-column
  168. align="center"
  169. prop="trainingNum"
  170. label="完成人数"
  171. ></el-table-column>
  172. <el-table-column
  173. align="center"
  174. prop="standardNum"
  175. label="合格人数"
  176. ></el-table-column>
  177. <el-table-column align="center" prop="studentId" label="操作">
  178. <template slot-scope="scope">
  179. <div>
  180. <auth auths="/teamCourseListDetailWorkList/attendanceList">
  181. <el-button type="text" @click="lookDetail(scope.row)"
  182. >查看</el-button
  183. >
  184. </auth>
  185. </div>
  186. </template>
  187. </el-table-column>
  188. </el-table>
  189. <pagination
  190. sync
  191. :total.sync="rules.total"
  192. :page.sync="rules.page"
  193. :limit.sync="rules.limit"
  194. :page-sizes="rules.page_size"
  195. @pagination="getList"
  196. />
  197. <el-dialog
  198. title="详情"
  199. :visible.sync="classVisible"
  200. width="1000px"
  201. v-if="classVisible"
  202. >
  203. <examinationDetail
  204. :courseScheduleId="activeRow.id"
  205. :type="activeRow.type"
  206. />
  207. </el-dialog>
  208. </div>
  209. </div>
  210. </div>
  211. </template>
  212. <script>
  213. import pagination from "@/components/Pagination/index";
  214. import { courseListType } from "@/utils/searchArray";
  215. import studentWork from "@/views/teamDetail/componentCourse/studentWork";
  216. import { getLessonExamination } from "./api.js";
  217. import { getTimes } from "@/utils";
  218. import examinationDetail from "./components/examinationDetail.vue";
  219. import { getTeamListNoLoading } from "@/api/teamServer";
  220. export default {
  221. components: { pagination, studentWork, examinationDetail },
  222. data() {
  223. return {
  224. courseListType,
  225. searchForm: {
  226. search: null,
  227. organId: null,
  228. musicGroupId: "",
  229. groupType: "MUSIC",
  230. courseTimer: []
  231. },
  232. teacherList: [],
  233. tableList: [],
  234. organList: [],
  235. rules: {
  236. // 分页规则
  237. limit: 10, // 限制显示条数
  238. page: 1, // 当前页
  239. total: 0, // 总条数
  240. page_size: [10, 20, 40, 50] // 选择限制显示条数
  241. },
  242. teamList: [],
  243. activeRow: null,
  244. classVisible: false
  245. };
  246. },
  247. //生命周期 - 创建完成(可以访问当前this实例)
  248. created() {},
  249. //生命周期 - 挂载完成(可以访问DOM元素)
  250. mounted() {
  251. // getEmployeeOrgan().then((res) => {
  252. // if (res.code == 200) {
  253. // this.organList = res.data;
  254. // }
  255. // });
  256. // 获取分部
  257. this.$store.dispatch("setBranchs");
  258. this.init();
  259. },
  260. activated() {
  261. this.init();
  262. },
  263. methods: {
  264. init() {
  265. if (this.searchForm.organId) {
  266. this.onBranchChange(this.searchForm.organId);
  267. }
  268. this.getList();
  269. },
  270. getList() {
  271. // let date = this.searchForm;
  272. // let classStartDate, classEndDate;
  273. // if (this.courseTimer?.length > 0) {
  274. // classStartDate = this.courseTimer[0];
  275. // classEndDate = this.courseTimer[1];
  276. // } else {
  277. // classStartDate = null;
  278. // classEndDate = null;
  279. // }
  280. // date.classStartDate = classStartDate;
  281. // date.classEndDate = classEndDate;
  282. // date.page = this.rules.page;
  283. // date.rows = this.rules.limit;
  284. let { courseTimer, ...rest } = this.searchForm;
  285. let params = {
  286. ...rest,
  287. page: this.rules.page,
  288. rows: this.rules.limit,
  289. ...getTimes(courseTimer, ["classStartDate", "classEndDate"])
  290. };
  291. getLessonExamination(params).then(res => {
  292. if (res.code == 200) {
  293. this.tableList = res.data.rows;
  294. this.rules.total = res.data.total;
  295. }
  296. });
  297. },
  298. search() {
  299. this.rules.page = 1;
  300. this.getList();
  301. },
  302. onReSet() {
  303. this.searchForm = {
  304. search: null,
  305. organId: null,
  306. groupType: "MUSIC",
  307. courseTimer: [],
  308. cloudHomeworkFlag: "",
  309. musicGroupId: ""
  310. };
  311. // this.courseTimer = [];
  312. this.search();
  313. },
  314. lookDetail(row) {
  315. this.activeRow = row;
  316. this.classVisible = true;
  317. },
  318. changeMusicGroup() {
  319. this.$forceUpdate();
  320. },
  321. async onBranchChange(val) {
  322. this.searchForm.musicGroupId = "";
  323. if (val) {
  324. let organId = val;
  325. try {
  326. await getTeamListNoLoading({ organId, page: 1, rows: 9999 }).then(
  327. res => {
  328. if (res.code == 200) {
  329. this.$set(this, "teamList", res.data.rows);
  330. // this.teamList = res.data.rows;
  331. }
  332. }
  333. );
  334. } catch (e) {
  335. console.log(e);
  336. }
  337. }
  338. }
  339. }
  340. };
  341. </script>
  342. <style lang="scss" scoped>
  343. .search {
  344. // // width: 220px!important;
  345. // ::v-deep .el-input__inner {
  346. // width: 260px !important;
  347. // }
  348. }
  349. </style>