index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <!-- 考试结果 -->
  2. <template>
  3. <div class="app-container examinationResult">
  4. <div class="page-container examinationResultPage" v-if="pageType === 1">
  5. <div class="page-form-title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm"
  7. :inline="true" style="width:100%;">
  8. <el-form-item label="" prop="academicYear">
  9. <el-select v-model="queryParams.academicYear" placeholder="学年" style="width: 140px">
  10. <el-option
  11. v-for="dict in optionListA"
  12. :key="dict.gradeNumber"
  13. :label="dict.gradeNumber"
  14. :value="dict.gradeNumber"
  15. />
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="" prop="deptId">
  19. <el-cascader
  20. style="width: 180px"
  21. v-model="queryParams.deptId"
  22. :options="optionListB"
  23. :props="{
  24. emitPath:false,
  25. checkStrictly: true,
  26. value: 'deptId',
  27. label: 'deptName',
  28. children: 'child',
  29. }"
  30. :show-all-levels="false"
  31. filterable
  32. placeholder="学院单位"
  33. ></el-cascader>
  34. </el-form-item>
  35. <el-form-item label="" prop="examTypeId">
  36. <el-select v-model="queryParams.examTypeId" placeholder="考试类型" style="width: 160px">
  37. <el-option
  38. v-for="dict in optionListC"
  39. :key="dict.id"
  40. :label="dict.examTypeName"
  41. :value="dict.id"
  42. />
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="" prop="makeup">
  46. <el-select v-model="queryParams.makeup" placeholder="是否补考" style="width: 140px">
  47. <el-option label="补考" value="1"/>
  48. <el-option label="不补考" value="0"/>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="" prop="searchValue">
  52. <el-input
  53. maxLength="30"
  54. v-model="queryParams.searchValue"
  55. placeholder="考试名称"
  56. style="width: 200px"
  57. />
  58. </el-form-item>
  59. <el-form-item label="" prop="state">
  60. <el-date-picker
  61. :clearable="false"
  62. v-model="dateRange"
  63. size="small"
  64. style="width: 240px"
  65. value-format="yyyy-MM-dd"
  66. type="daterange"
  67. range-separator="-"
  68. start-placeholder="开始日期"
  69. end-placeholder="结束日期"
  70. ></el-date-picker>
  71. </el-form-item>
  72. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  73. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  74. <p class="page-add-common-style-button"
  75. v-hasPermiRouter="['exam:elExamResult:export']"
  76. style="float: right;" @click="exportButton()">导出</p>
  77. </el-form>
  78. </div>
  79. <div class="page-content-box">
  80. <el-table class="table-box" border :data="dataList">
  81. <el-table-column label="考试名称" prop="examName" show-overflow-tooltip/>
  82. <el-table-column label="考试类型" prop="examTypeName" width="200" show-overflow-tooltip/>
  83. <el-table-column label="考试时间" prop="startTime" width="290" show-overflow-tooltip>
  84. <template slot-scope="scope">
  85. <span>{{ parseTime(scope.row.startTime,"{y}-{m}-{d} {h}:{i}") }} 至 {{ parseTime(scope.row.endTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="参加人数" prop="participantCount" width="140" show-overflow-tooltip/>
  89. <el-table-column label="合格人数" prop="passedCount" width="140" show-overflow-tooltip/>
  90. <el-table-column label="缺考人数" prop="absentCount" width="140" show-overflow-tooltip/>
  91. <el-table-column label="补考人数" prop="makeupCount" width="140" show-overflow-tooltip/>
  92. <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
  93. <template slot-scope="scope">
  94. <div class="table-button-box">
  95. <p class="table-button-null"></p>
  96. <p class="table-button-p"
  97. v-hasPermiRouter="['exam:elExamResult:scorePage']"
  98. @click="tableButton(1,scope.row)"
  99. >查看成绩</p>
  100. <p class="table-button-p"
  101. v-hasPermiRouter="['exam:elExamResult:rewardPage']"
  102. @click="tableButton(2,scope.row)"
  103. >学习情况</p>
  104. <p class="table-button-null"></p>
  105. </div>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <pagination :page-sizes="[20, 30, 40, 50]"
  110. v-show="total>0"
  111. :total="total"
  112. :page.sync="queryParams.page"
  113. :limit.sync="queryParams.pageSize"
  114. @pagination="getList"
  115. />
  116. </div>
  117. </div>
  118. <el-drawer
  119. size="100%"
  120. custom-class="examinationResult-index-drawer"
  121. :append-to-body="true"
  122. :title="drawerTitle"
  123. ref="drawer"
  124. :visible.sync="drawer"
  125. direction="rtl">
  126. <viewGrades v-if="drawerType==1&&drawer" :drawerPropsData="drawerPropsData"></viewGrades>
  127. <academicPerformance v-if="drawerType==2&&drawer" :drawerPropsData="drawerPropsData"></academicPerformance>
  128. </el-drawer>
  129. </div>
  130. </template>
  131. <script>
  132. //import { getDicts } from "@/api/commonality/noPermission";
  133. //import { systemUserSelect } from "@/api/commonality/permission";
  134. //import { getInfo } from "@/api/basicsModules/index";
  135. import viewGrades from "./viewGrades.vue";
  136. import academicPerformance from "./academicPerformance.vue";
  137. import {
  138. systemUserGetAcademicYear,
  139. examElExamResultPage,examElExamTypeList,systemDeptCurrentDept,
  140. } from "@/api/safetyEducationExaminationNew/index";
  141. export default {
  142. name: 'index',
  143. components: {
  144. viewGrades,
  145. academicPerformance,
  146. },
  147. data () {
  148. return {
  149. tableButtonType:this.hasPermiDom(['exam:elExamResult:scorePage','exam:elExamResult:rewardPage',]),
  150. //页面状态
  151. pageType:1,
  152. //下拉列表数据
  153. optionListA:[],
  154. optionListB:[],
  155. optionListC:[],
  156. //查询条件
  157. queryParams:{
  158. page:1,
  159. pageSize:20,
  160. academicYear:null,
  161. deptId :null,
  162. examTypeId :null,
  163. makeup :null,
  164. searchValue :'',
  165. },
  166. //时间数据
  167. dateRange:[],
  168. //列表数据
  169. dataList:[],
  170. //数据数量
  171. total:0,
  172. //组件传参
  173. propsData:{},
  174. //弹窗相关
  175. drawerTitle: '',
  176. drawerType: '',
  177. drawer: false,
  178. drawerPropsData:{},
  179. }
  180. },
  181. created () {
  182. },
  183. mounted () {
  184. this.getList();
  185. this.examElExamTypeList();
  186. this.systemDeptCurrentDept();
  187. this.systemUserGetAcademicYear();
  188. },
  189. methods: {
  190. //导出
  191. exportButton(){
  192. let self = this;
  193. self.$confirm(`确认导出数据?`, "提示", {
  194. confirmButtonText: "确定",
  195. cancelButtonText: "取消",
  196. type: "warning"
  197. }).then(async () => {
  198. let obj = JSON.parse(JSON.stringify(this.queryParams))
  199. if(this.dateRange[0]){
  200. obj.startTime = this.dateRange[0]+'T00:00:00'
  201. obj.endTime = this.dateRange[1]+'T23:59:59'
  202. }else{
  203. obj.startTime = "";
  204. obj.endTime = "";
  205. }
  206. self.download('/exam/elExamResult/export', {...obj}, '考试结果.xlsx')
  207. }).catch(() => {})
  208. },
  209. //弹窗返回
  210. drawerReturnButton(){
  211. this.$refs.drawer.closeDrawer();
  212. },
  213. //弹窗确定
  214. drawerConfirmButton(){
  215. this.$refs.drawer.closeDrawer();
  216. },
  217. //查询按钮
  218. handleQuery(){
  219. this.$set(this.queryParams,'page',1);
  220. this.getList();
  221. },
  222. //重置按钮
  223. resetQuery(){
  224. this.$set(this,'dateRange',[])
  225. this.$set(this,'queryParams',{
  226. page:1,
  227. pageSize:20,
  228. academicYear:null,
  229. deptId :null,
  230. examTypeId :null,
  231. makeup :null,
  232. searchValue :'',
  233. });
  234. this.getList();
  235. },
  236. //获取数据列表
  237. getList(){
  238. let obj = JSON.parse(JSON.stringify(this.queryParams))
  239. if(this.dateRange[0]){
  240. obj.startTime = this.dateRange[0]+'T00:00:00'
  241. obj.endTime = this.dateRange[1]+'T23:59:59'
  242. }else{
  243. obj.startTime = "";
  244. obj.endTime = "";
  245. }
  246. examElExamResultPage(obj).then(response => {
  247. this.$set(this,'dataList',response.data.records);
  248. this.$set(this,'total',response.data.total);
  249. });
  250. },
  251. //操作按钮
  252. tableButton(type,row){
  253. let self = this;
  254. if(type == 1){
  255. // TODO: 查看成绩
  256. this.$set(this, 'drawerTitle', '查看成绩-'+row.examName)
  257. this.$set(this, 'drawerType', 1)
  258. this.$set(this, 'drawer', true)
  259. this.$set(this, 'drawerPropsData', row)
  260. }else if(type == 2){
  261. // TODO: 学习情况
  262. this.$set(this, 'drawerTitle', '学习情况-'+row.examName)
  263. this.$set(this, 'drawerType', 2)
  264. this.$set(this, 'drawer', true)
  265. this.$set(this, 'drawerPropsData', row)
  266. }
  267. },
  268. //学年下拉列表
  269. systemUserGetAcademicYear(){
  270. systemUserGetAcademicYear({}).then(response => {
  271. this.$set(this,'optionListA',response.data);
  272. });
  273. },
  274. //查询全部考试类型
  275. examElExamTypeList(){
  276. examElExamTypeList({}).then(response => {
  277. this.$set(this,'optionListC',response.data);
  278. });
  279. },
  280. //学院列表
  281. systemDeptCurrentDept(){
  282. systemDeptCurrentDept({}).then(response => {
  283. const list = response.data || [];
  284. this.formatTreeData(list);
  285. this.$set(this,'optionListB',list);
  286. });
  287. },
  288. },
  289. }
  290. </script>
  291. <style scoped lang="scss">
  292. .examinationResult{
  293. .examinationResultPage{
  294. }
  295. }
  296. </style>
  297. <style lang="scss">
  298. .examinationResult-index-drawer{
  299. .el-drawer__body{
  300. padding:0;
  301. }
  302. .el-drawer__header{
  303. margin:0;
  304. }
  305. }
  306. </style>