academicPerformance.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!-- 学习情况 -->
  2. <template>
  3. <div class="page-container academicPerformance-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="passStatus">
  8. <el-select v-model="queryParams.passStatus" placeholder="是否完成" style="width: 120px">
  9. <el-option label="已完成" value="1"/>
  10. <el-option label="未完成" value="0"/>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="" prop="deptId">
  14. <el-cascader
  15. style="width: 180px"
  16. v-model="queryParams.deptId"
  17. :options="optionListA"
  18. :props="{
  19. emitPath:false,
  20. checkStrictly: true,
  21. value: 'deptId',
  22. label: 'deptName',
  23. children: 'child',
  24. }"
  25. :show-all-levels="false"
  26. filterable
  27. placeholder="学院单位"
  28. ></el-cascader>
  29. </el-form-item>
  30. <el-form-item label="" prop="searchValue">
  31. <el-input
  32. maxLength="30"
  33. v-model="queryParams.searchValue"
  34. placeholder="姓名/学工号"
  35. style="width: 140px"
  36. />
  37. </el-form-item>
  38. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  39. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  40. <p class="page-add-common-style-button" style="float: right;" @click="exportButton()">导出</p>
  41. </el-form>
  42. </div>
  43. <div class="page-content-box">
  44. <el-table class="table-box" v-loading="loading" border :data="dataList">
  45. <el-table-column label="姓名" prop="userName" show-overflow-tooltip/>
  46. <el-table-column label="学工号" prop="account" width="140" show-overflow-tooltip/>
  47. <el-table-column label="学院单位" prop="deptName" width="240" show-overflow-tooltip/>
  48. <el-table-column label="完成时间" prop="submitTime" width="200" show-overflow-tooltip>
  49. <template slot-scope="scope">
  50. <span>{{ parseTime(scope.row.submitTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="学时" prop="durationText" width="200" show-overflow-tooltip/>
  54. <el-table-column label="积分" prop="score" width="200" show-overflow-tooltip/>
  55. <el-table-column label="是否完成" prop="resultStatus" width="200" show-overflow-tooltip>
  56. <template slot-scope="scope">
  57. <span v-if="scope.row.resultStatus == 0">已完成</span>
  58. <span v-if="scope.row.resultStatus == 1">未完成</span>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <pagination :page-sizes="[20, 30, 40, 50]"
  63. v-show="total>0"
  64. :total="total"
  65. :page.sync="queryParams.page"
  66. :limit.sync="queryParams.pageSize"
  67. @pagination="getList"
  68. />
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import {
  74. systemUserGetCategories,systemUserGetAcademicYear,
  75. examElExamResultScorePage,examElDisciplineTypeList,systemDeptCurrentDept,
  76. } from "@/api/safetyEducationExaminationNew/index";
  77. export default {
  78. name: 'addPage',
  79. props: {
  80. drawerPropsData: {}
  81. },
  82. data() {
  83. return {
  84. //页面遮罩
  85. loading:false,
  86. //下拉列表数据
  87. optionListA:[],
  88. //查询条件
  89. queryParams:{
  90. page:1,
  91. pageSize:20,
  92. deptId:null,
  93. academicYear :null,
  94. disciplineId :null,
  95. userType :null,
  96. passStatus :null,
  97. searchValue :'',
  98. },
  99. //列表数据
  100. dataList:[],
  101. //数据数量
  102. total:0,
  103. }
  104. },
  105. created() {
  106. },
  107. mounted() {
  108. this.getList();
  109. this.systemDeptCurrentDept();
  110. },
  111. methods: {
  112. //导出
  113. exportButton(){
  114. let self = this;
  115. self.$confirm(`确认导出数据?`, "提示", {
  116. confirmButtonText: "确定",
  117. cancelButtonText: "取消",
  118. type: "warning"
  119. }).then(async () => {
  120. let obj = JSON.parse(JSON.stringify(this.queryParams))
  121. if(this.dateRange[0]){
  122. obj.startTime = this.dateRange[0]+'T00:00:00'
  123. obj.endTime = this.dateRange[1]+'T23:59:59'
  124. }else{
  125. obj.startTime = "";
  126. obj.endTime = "";
  127. }
  128. self.download('/exam/elExamResult/score-export/', {...obj}, '学习情况-'+this.drawerPropsData.examName+'.xlsx')
  129. }).catch(() => {})
  130. },
  131. //查询按钮
  132. handleQuery(){
  133. this.$set(this.queryParams,'page',1);
  134. this.getList();
  135. },
  136. //重置按钮
  137. resetQuery(){
  138. this.$set(this,'queryParams',{
  139. page:1,
  140. pageSize:20,
  141. deptId:null,
  142. academicYear :null,
  143. disciplineId :null,
  144. userType :null,
  145. passStatus :null,
  146. searchValue :'',
  147. });
  148. this.getList();
  149. },
  150. //获取数据列表
  151. getList(){
  152. console.log('drawerPropsData',this.drawerPropsData)
  153. this.$set(this,'loading',true);
  154. let obj = JSON.parse(JSON.stringify(this.queryParams))
  155. obj.examId = this.drawerPropsData.examId
  156. examElExamResultScorePage(obj).then(response => {
  157. this.$set(this,'loading',false);
  158. this.$set(this,'dataList',response.data.records);
  159. this.$set(this,'total',response.data.total);
  160. });
  161. },
  162. //学院列表
  163. systemDeptCurrentDept(){
  164. systemDeptCurrentDept({}).then(response => {
  165. const list = response.data || [];
  166. this.formatTreeData(list);
  167. this.$set(this,'optionListA',list);
  168. });
  169. },
  170. }
  171. }
  172. </script>
  173. <style scoped lang="scss">
  174. .academicPerformance-addPage {
  175. flex:1;
  176. display: flex;
  177. flex-direction: column;
  178. overflow: hidden;
  179. }
  180. </style>