viewGrades.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <!-- 查看成绩 -->
  2. <template>
  3. <div class="page-container viewGrades-addPage">
  4. <div class="page-form-title-box">
  5. <el-form :model="queryParams" class="form-box" ref="queryForm"
  6. :inline="true" style="width:100%;">
  7. <el-form-item label="" prop="deptId">
  8. <el-cascader
  9. style="width: 180px"
  10. v-model="queryParams.deptId"
  11. :options="optionListA"
  12. :props="{
  13. emitPath:false,
  14. checkStrictly: true,
  15. value: 'deptId',
  16. label: 'deptName',
  17. children: 'child',
  18. }"
  19. :show-all-levels="false"
  20. filterable
  21. placeholder="学院单位"
  22. ></el-cascader>
  23. </el-form-item>
  24. <el-form-item label="" prop="academicYear">
  25. <el-select v-model="queryParams.academicYear" placeholder="年级" style="width: 120px">
  26. <el-option
  27. v-for="dict in optionListB"
  28. :key="dict.gradeNumber"
  29. :label="dict.gradeNumber"
  30. :value="dict.gradeNumber"
  31. />
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item label="" prop="disciplineId">
  35. <el-select v-model="queryParams.disciplineId" placeholder="专业" style="width: 140px">
  36. <el-option
  37. v-for="dict in optionListC"
  38. :key="dict.disciplineId"
  39. :label="dict.disciplineName"
  40. :value="dict.disciplineId"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="" prop="userType">
  45. <el-select v-model="queryParams.userType" placeholder="用户类别" style="width: 120px">
  46. <el-option
  47. v-for="dict in optionListD"
  48. :key="dict.value"
  49. :label="dict.label"
  50. :value="dict.value"
  51. />
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="" prop="passStatus">
  55. <el-select v-model="queryParams.passStatus" placeholder="是否通过" style="width: 120px">
  56. <el-option label="通过" value="1"/>
  57. <el-option label="不通过" value="0"/>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item label="" prop="searchValue">
  61. <el-input
  62. maxLength="30"
  63. v-model="queryParams.searchValue"
  64. placeholder="姓名/学工号"
  65. style="width: 140px"
  66. />
  67. </el-form-item>
  68. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  69. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  70. <p class="page-add-common-style-button" style="float: right;" @click="exportButton()">导出</p>
  71. </el-form>
  72. </div>
  73. <div class="page-content-box">
  74. <el-table class="table-box" border :data="dataList">
  75. <el-table-column label="姓名" prop="userName" show-overflow-tooltip/>
  76. <el-table-column label="学工号" prop="account" width="140" show-overflow-tooltip/>
  77. <el-table-column label="专业" prop="disciplineName" width="200" show-overflow-tooltip/>
  78. <el-table-column label="学年" prop="academicYear" width="140" show-overflow-tooltip/>
  79. <el-table-column label="学院单位" prop="deptName" width="240" show-overflow-tooltip/>
  80. <el-table-column label="交卷时间" prop="submitTime" width="200" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. <span>{{ parseTime(scope.row.submitTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="用时" prop="durationText" width="140" show-overflow-tooltip/>
  86. <el-table-column label="成绩" prop="score" width="140" show-overflow-tooltip/>
  87. <el-table-column label="结果" prop="resultStatus" width="140" show-overflow-tooltip>
  88. <template slot-scope="scope">
  89. <span v-if="scope.row.resultStatus == 0">未开始</span>
  90. <span v-if="scope.row.resultStatus == 1">考试中</span>
  91. <span class="colorA" v-if="scope.row.resultStatus == 2">通过</span>
  92. <span class="colorB" v-if="scope.row.resultStatus == 3">未通过</span>
  93. <span class="colorC" v-if="scope.row.resultStatus == 4">缺考</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="操作" width="200" show-overflow-tooltip>
  97. <template slot-scope="scope">
  98. <div class="table-button-box">
  99. <p class="table-button-null"></p>
  100. <p class="table-button-p"
  101. @click="lockExam(scope.row)"
  102. >查看答卷</p>
  103. <p class="table-button-null"></p>
  104. </div>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. <pagination :page-sizes="[20, 30, 40, 50]"
  109. v-show="total>0"
  110. :total="total"
  111. :page.sync="queryParams.page"
  112. :limit.sync="queryParams.pageSize"
  113. @pagination="getList"
  114. />
  115. </div>
  116. <el-drawer
  117. size="100%"
  118. custom-class="viewGrades-addPage-drawer"
  119. :append-to-body="true"
  120. :title="drawerTitle"
  121. ref="drawer"
  122. :visible.sync="drawer"
  123. direction="rtl">
  124. <examDetails v-if="drawer" :examDetailsPropsData="examDetailsPropsData"></examDetails>
  125. </el-drawer>
  126. </div>
  127. </template>
  128. <script>
  129. import {
  130. systemUserGetCategories,systemUserGetAcademicYear,
  131. examElExamResultScorePage,examElExamResultScorePageType,systemDeptCurrentDept,
  132. } from "@/api/safetyEducationExaminationNew/index";
  133. import examDetails from '@/views/safetyEducationExaminationNew/components/examDetails.vue'
  134. export default {
  135. name: 'addPage',
  136. components: {
  137. examDetails
  138. },
  139. props: {
  140. drawerPropsData: {}
  141. },
  142. data() {
  143. return {
  144. //下拉列表数据
  145. optionListA:[],
  146. optionListB:[],
  147. optionListC:[],
  148. optionListD:[],
  149. optionListE:[],
  150. //查询条件
  151. queryParams:{
  152. page:1,
  153. pageSize:20,
  154. deptId:null,
  155. academicYear :null,
  156. disciplineId :null,
  157. userType :null,
  158. passStatus :null,
  159. searchValue :'',
  160. },
  161. //列表数据
  162. dataList:[],
  163. //数据数量
  164. total:0,
  165. //弹窗相关
  166. drawerTitle: '',
  167. drawerType: '',
  168. drawer: false,
  169. examDetailsPropsData:{},
  170. }
  171. },
  172. created() {
  173. },
  174. mounted() {
  175. this.getList();
  176. this.examElExamResultScorePageType();
  177. this.systemDeptCurrentDept();
  178. this.systemUserGetCategories();
  179. this.systemUserGetAcademicYear();
  180. },
  181. methods: {
  182. //导出
  183. exportButton(){
  184. let self = this;
  185. self.$confirm(`确认导出数据?`, "提示", {
  186. confirmButtonText: "确定",
  187. cancelButtonText: "取消",
  188. type: "warning"
  189. }).then(async () => {
  190. let obj = JSON.parse(JSON.stringify(self.queryParams))
  191. obj.examId = self.drawerPropsData.examId
  192. self.download('/exam/elExamResult/score-export', {...obj}, '查看成绩-'+self.drawerPropsData.examName+'.xlsx')
  193. }).catch(() => {})
  194. },
  195. lockExam(row){
  196. this.$set(this, 'drawerTitle', '试卷详情')
  197. this.$set(this, 'drawerType', 2)
  198. this.$set(this, 'drawer', true)
  199. let obj = {
  200. attemptId:row.attemptId,
  201. showType:true,
  202. }
  203. this.$set(this,'examDetailsPropsData',obj);//attemptId
  204. },
  205. //查询按钮
  206. handleQuery(){
  207. this.$set(this.queryParams,'page',1);
  208. this.getList();
  209. },
  210. //重置按钮
  211. resetQuery(){
  212. this.$set(this,'queryParams',{
  213. page:1,
  214. pageSize:20,
  215. deptId:null,
  216. academicYear :null,
  217. disciplineId :null,
  218. userType :null,
  219. passStatus :null,
  220. searchValue :'',
  221. });
  222. this.getList();
  223. },
  224. //获取数据列表
  225. getList(){
  226. let obj = JSON.parse(JSON.stringify(this.queryParams))
  227. obj.examId = this.drawerPropsData.examId
  228. examElExamResultScorePage(obj).then(response => {
  229. this.$set(this,'dataList',response.data.records);
  230. this.$set(this,'total',response.data.total);
  231. });
  232. },
  233. //查询全部专业类别
  234. examElExamResultScorePageType(){
  235. examElExamResultScorePageType({examId:this.drawerPropsData.examId}).then(response => {
  236. this.$set(this,'optionListC',response.data);
  237. });
  238. },
  239. //学院列表
  240. systemDeptCurrentDept(){
  241. systemDeptCurrentDept({}).then(response => {
  242. const list = response.data || [];
  243. this.formatTreeData(list);
  244. this.$set(this,'optionListA',list);
  245. });
  246. },
  247. //学年下拉列表
  248. systemUserGetAcademicYear(){
  249. systemUserGetAcademicYear({}).then(response => {
  250. this.$set(this,'optionListB',response.data);
  251. });
  252. },
  253. //用户类别下拉列表
  254. systemUserGetCategories(){
  255. systemUserGetCategories({}).then(response => {
  256. this.$set(this,'optionListD',response.data);
  257. });
  258. },
  259. }
  260. }
  261. </script>
  262. <style scoped lang="scss">
  263. .viewGrades-addPage {
  264. flex:1;
  265. display: flex;
  266. flex-direction: column;
  267. overflow: hidden;
  268. .colorA{
  269. color:#41C599;
  270. }
  271. .colorB{
  272. color:#EF98A2;
  273. }
  274. .colorC{
  275. color:#F6A53C;
  276. }
  277. }
  278. </style>