userListPage.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <!-- 分级考试人员明细 -->
  2. <template>
  3. <div class="page-container dataReportUserListPage-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="academicYear">
  8. <el-select v-model="queryParams.academicYear" style="width:160px">
  9. <el-option
  10. v-for="dict in optionList"
  11. :key="dict.value"
  12. :label="dict.label"
  13. :value="dict.value"
  14. />
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="" prop="category">
  18. <div class="table-top-button-box">
  19. <div>
  20. <p @click="queryParams.category = 'EXAMED'" :class="queryParams.category == 'EXAMED'?'check-table-button':''">已考人员</p>
  21. <p @click="queryParams.category = 'NOT_EXAMED'" :class="queryParams.category == 'NOT_EXAMED'?'check-table-button':''">未考人员</p>
  22. </div>
  23. </div>
  24. </el-form-item>
  25. <el-form-item label="" prop="personType">
  26. <div class="table-top-button-box-1">
  27. <div>
  28. <p @click="queryParams.personType = 3" :class="queryParams.personType == 3?'check-table-button':''">本科</p>
  29. <p @click="queryParams.personType = 2" :class="queryParams.personType == 2?'check-table-button':''">硕士研究生</p>
  30. <p @click="queryParams.personType = 4" :class="queryParams.personType == 4?'check-table-button':''">博士研究生</p>
  31. <p @click="queryParams.personType = 1" :class="queryParams.personType == 1?'check-table-button':''">教职工</p>
  32. </div>
  33. </div>
  34. </el-form-item>
  35. <el-form-item label="" prop="deptId">
  36. <el-select v-if="adminType == 1"
  37. v-model="queryParams.deptId"
  38. placeholder="学院"
  39. style="width: 160px">
  40. <el-option
  41. v-for="dict in optionListA"
  42. :key="dict.deptId"
  43. :label="dict.deptName"
  44. :value="dict.deptId"
  45. />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="" prop="examTypeId">
  49. <el-select
  50. @change="checkExamType"
  51. v-model="queryParams.examTypeId"
  52. placeholder="考试类型"
  53. style="width: 150px">
  54. <el-option
  55. v-for="dict in optionListB"
  56. :key="dict.id"
  57. :label="dict.examTypeName"
  58. :value="dict.id"
  59. />
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="" prop="levelIdClassifyTypeId" v-if="examTypeCode == 'CLASSIFIED'">
  63. <el-cascader
  64. v-model="queryParams.levelIdClassifyTypeId"
  65. placeholder="分级分类"
  66. :options="optionListC"
  67. :props="{ checkStrictly: true,expandTrigger: 'hover' }"
  68. style="width: 150px"
  69. ></el-cascader>
  70. </el-form-item>
  71. <el-form-item label="" prop="examResult">
  72. <el-select
  73. v-model="queryParams.examResult"
  74. placeholder="考试结果"
  75. style="width: 130px">
  76. <el-option key="1" label="已通过" value="1"/>
  77. <el-option key="0" label="未通过" value="0"/>
  78. </el-select>
  79. </el-form-item>
  80. <el-form-item label="" prop="makeupResult">
  81. <el-select
  82. v-model="queryParams.makeupResult"
  83. placeholder="补考结果"
  84. style="width: 130px">
  85. <el-option key="1" label="已通过" value="1"/>
  86. <el-option key="0" label="未通过" value="0"/>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item label="" prop="account">
  90. <el-input
  91. maxLength="30"
  92. v-model="queryParams.account"
  93. placeholder="搜索姓名/学工号"
  94. style="width: 150px"
  95. />
  96. </el-form-item>
  97. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  98. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  99. <el-form-item>
  100. <export-component :exportConfig="exportConfig" style="margin-left:10px;"></export-component>
  101. </el-form-item>
  102. </el-form>
  103. </div>
  104. <div class="page-content-box">
  105. <el-table class="table-box" border :data="dataList"
  106. @selection-change="handleSelectionChange" :row-key="getRowKeys">
  107. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  108. <el-table-column label="姓名" prop="userName" show-overflow-tooltip/>
  109. <el-table-column label="学工号" prop="account" width="140" show-overflow-tooltip/>
  110. <el-table-column label="学院" prop="deptName" width="240" show-overflow-tooltip/>
  111. <!--<el-table-column label="用户类别" prop="deptName" width="160" show-overflow-tooltip/>-->
  112. <el-table-column label="考试类型" prop="examTypeName" width="160" show-overflow-tooltip>
  113. <template slot-scope="scope">
  114. <span v-if="scope.row.examTypeCode=='CLASSIFIED'">{{scope.row.levelName}}-{{scope.row.classifyTypeName}}</span>
  115. <span v-else>{{scope.row.examTypeName}}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="学习情况" prop="learningStatus" width="160" show-overflow-tooltip/>
  119. <el-table-column label="考试成绩" prop="examScore" width="160" show-overflow-tooltip>
  120. <template slot-scope="scope">{{scope.row.examScore?scope.row.examScore:'-'}}</template>
  121. </el-table-column>
  122. <el-table-column label="考试结果" prop="examResult" width="160" show-overflow-tooltip>
  123. <template slot-scope="scope">
  124. <span :class="scope.row.examResult == 0 ?'':(scope.row.examResult == 1 ?'colorA':(scope.row.examResult == 2 ?'colorB':''))">
  125. {{scope.row.examResult == 0 ?'-':(scope.row.examResult == 1 ?'通过':(scope.row.examResult == 2 ?'未通过':''))}}
  126. </span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="补考成绩" prop="makeupScore" width="160" show-overflow-tooltip>
  130. <template slot-scope="scope">{{scope.row.makeupScore?scope.row.makeupScore:'-'}}</template>
  131. </el-table-column>
  132. <el-table-column label="补考结果" prop="makeupResult" width="160" show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. <span :class="scope.row.makeupResult == 0 ?'':(scope.row.makeupResult == 1 ?'colorA':(scope.row.makeupResult == 2 ?'colorB':''))">
  135. {{scope.row.makeupResult == 0 ?'-':(scope.row.makeupResult == 1 ?'通过':(scope.row.makeupResult == 2 ?'未通过':''))}}
  136. </span>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <pagination :page-sizes="[20, 30, 40, 50]"
  141. v-show="total>0"
  142. :total="total"
  143. :page.sync="queryParams.page"
  144. :limit.sync="queryParams.pageSize"
  145. @pagination="getList"
  146. />
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import {
  152. laboratoryClassTypeGetList,laboratoryLevelConfigGetLevelTitleList,
  153. } from "@/api/commonality/permission";
  154. import {
  155. examElExamTypeList,systemDeptCurrentDept,examElStatisticsGetAcademicYear,examElStatisticsExamGroupedChartDetail,
  156. } from "@/api/safetyEducationExaminationNew/index";
  157. import exportComponent from "@/views/safetyEducationExaminationNew/dataStatistics/components/exportComponent/exportComponent.vue";
  158. export default {
  159. name: 'addPage',
  160. components: {
  161. exportComponent,
  162. },
  163. props: {
  164. drawerPropsData: {}
  165. },
  166. data() {
  167. return {
  168. exportConfig:{
  169. api:'/exam/elStatistics/exam/grouped/chart-detail-export',
  170. userIds:'',
  171. fileName:'数据报表-人员明细',
  172. customKey:null,
  173. customValue:null,
  174. allData:{},
  175. screenData:{},
  176. type:1,
  177. },
  178. adminType:0,
  179. optionList:[],
  180. optionListA:[],
  181. optionListB:[],
  182. optionListC:[],
  183. //查询条件
  184. queryParams:{
  185. page:1,
  186. pageSize:20,
  187. academicYear:'',
  188. category:'EXAMED',
  189. personType:'3',
  190. deptId:'',
  191. examTypeId:'',
  192. levelIdClassifyTypeId:[],
  193. account:'',
  194. examResult:'',
  195. makeupResult:'',
  196. },
  197. examTypeCode:'',
  198. //列表数据
  199. dataList:[],
  200. //数据数量
  201. total:0,
  202. }
  203. },
  204. created() {
  205. },
  206. mounted() {
  207. this.initialize()
  208. },
  209. methods: {
  210. // 初始化
  211. initialize() {
  212. this.$set(this,'adminType',this.drawerPropsData.adminType);
  213. this.$set(this.queryParams,'academicYear',this.drawerPropsData.valueYear);
  214. this.$set(this.queryParams,'personType',this.drawerPropsData.personType);
  215. this.$set(this.queryParams,'deptId',this.drawerPropsData.deptId);
  216. this.$set(this.queryParams,'examTypeId',this.drawerPropsData.examTypeId);
  217. this.examElExamTypeList();
  218. this.systemDeptCurrentDept();
  219. this.laboratoryLevelConfigGetLevelTitleList();
  220. this.examElStatisticsGetAcademicYear();
  221. this.getList();
  222. },
  223. // 多选框选中数据
  224. handleSelectionChange(selection) {
  225. this.$set(this.exportConfig,'userIds',selection.map(item => item.userId));
  226. },
  227. getRowKeys(row) {
  228. return row.userId
  229. },
  230. //查询按钮
  231. handleQuery(){
  232. this.$set(this.queryParams,'page',1);
  233. this.getList();
  234. },
  235. //重置按钮
  236. resetQuery(){
  237. this.$set(this,'queryParams',{
  238. page:1,
  239. pageSize:20,
  240. academicYear:this.drawerPropsData.valueYear,
  241. category:'EXAMED',
  242. personType:this.drawerPropsData.personType,
  243. deptId:this.drawerPropsData.deptId,
  244. examTypeId:this.drawerPropsData.examTypeId,
  245. levelIdClassifyTypeId:[],
  246. account:'',
  247. examResult:'',
  248. makeupResult:'',
  249. });
  250. this.checkExamType(this.drawerPropsData.examTypeId)
  251. this.getList();
  252. },
  253. getList(){
  254. let obj = {
  255. page:this.queryParams.page,
  256. pageSize:this.queryParams.pageSize,
  257. academicYear:this.queryParams.academicYear,
  258. category:this.queryParams.category,
  259. personType:this.queryParams.personType,
  260. examTypeId:this.queryParams.examTypeId,
  261. account:this.queryParams.account,
  262. examResult:this.queryParams.examResult,
  263. makeupResult:this.queryParams.makeupResult,
  264. }
  265. if(this.queryParams.levelIdClassifyTypeId[0]){
  266. obj.levelId = this.queryParams.levelIdClassifyTypeId[0];
  267. }
  268. if(this.queryParams.levelIdClassifyTypeId[1]){
  269. obj.classifyTypeId = this.queryParams.levelIdClassifyTypeId[1];
  270. }
  271. if(this.adminType == 1){
  272. obj.deptId = this.queryParams.deptId;
  273. }else{
  274. obj.deptId = localStorage.getItem('deptId');
  275. }
  276. this.setExportConfig();
  277. examElStatisticsExamGroupedChartDetail(obj).then(response => {
  278. this.$set(this,'dataList',response.data.records);
  279. this.$set(this,'total',response.data.total);
  280. })
  281. },
  282. setExportConfig(){
  283. //全部条件
  284. this.exportConfig.allData = {
  285. academicYear:this.queryParams.academicYear,
  286. examTypeId:this.queryParams.examTypeId,
  287. deptId:this.adminType == 1?this.queryParams.deptId:localStorage.getItem('deptId'),
  288. };
  289. //筛选条件
  290. this.exportConfig.screenData = {
  291. academicYear:this.queryParams.academicYear,
  292. category:this.queryParams.category,
  293. personType:this.queryParams.personType,
  294. examTypeId:this.queryParams.examTypeId,
  295. account:this.queryParams.account,
  296. examResult:this.queryParams.examResult,
  297. makeupResult:this.queryParams.makeupResult,
  298. };
  299. if(this.queryParams.levelIdClassifyTypeId[0]){
  300. this.exportConfig.screenData.levelId = this.queryParams.levelIdClassifyTypeId[0];
  301. }
  302. if(this.queryParams.levelIdClassifyTypeId[1]){
  303. this.exportConfig.screenData.classifyTypeId = this.queryParams.levelIdClassifyTypeId[1];
  304. }
  305. if(this.adminType == 1){
  306. this.exportConfig.screenData.deptId = this.queryParams.deptId;
  307. }else{
  308. this.exportConfig.screenData.deptId = localStorage.getItem('deptId');
  309. }
  310. },
  311. //选中考试类型
  312. checkExamType(val){
  313. let self = this;
  314. let num = 0;
  315. for(let i=0;i<self.optionListB.length;i++){
  316. if(self.optionListB[i].id == val){
  317. num++
  318. self.$set(self,'examTypeCode',self.optionListB[i].examTypeCode);
  319. }
  320. }
  321. if(num == 0){
  322. self.$set(self,'examTypeCode','');
  323. }
  324. this.$set(this.queryParams,'levelIdClassifyTypeId',[]);
  325. },
  326. //查询全部考试类型
  327. examElExamTypeList(){
  328. examElExamTypeList({}).then(response => {
  329. let list = [];
  330. for(let i=0;i<response.data.length;i++){
  331. if(response.data[i].examTypeCode == 'CLASSIFIED' || response.data[i].examTypeCode == 'yzyh' || response.data[i].examTypeCode == 'STUDENT'){
  332. list.push(response.data[i]);
  333. }
  334. }
  335. this.$set(this,'optionListB',list);
  336. this.checkExamType(this.drawerPropsData.examTypeId)
  337. });
  338. },
  339. //学院列表
  340. systemDeptCurrentDept(){
  341. systemDeptCurrentDept({}).then(response => {
  342. const list = response.data || [];
  343. this.formatTreeData(list);
  344. if(list[0]){
  345. this.$set(this,'optionListA',list[0].child);
  346. this.optionListA.unshift({ deptName:'全部学院', deptId:'' })
  347. }else{
  348. this.$set(this,'optionListA',[]);
  349. }
  350. });
  351. },
  352. //学院列表
  353. laboratoryLevelConfigGetLevelTitleList(){
  354. laboratoryLevelConfigGetLevelTitleList({}).then(responseA => {
  355. laboratoryClassTypeGetList({}).then(responseB => {
  356. let list = []
  357. for(let i=0;i<responseA.data.length;i++){
  358. let obj = {
  359. value:responseA.data[i].levelId,
  360. label:responseA.data[i].titleName,
  361. children:[],
  362. }
  363. for(let o=0;o<responseB.data.length;o++){
  364. obj.children.push({
  365. value:responseB.data[o].typeId,
  366. label:responseB.data[o].typeName,
  367. })
  368. }
  369. list.push(obj)
  370. }
  371. this.$set(this,'optionListC',list);
  372. });
  373. });
  374. },
  375. //学年列表
  376. examElStatisticsGetAcademicYear(){
  377. examElStatisticsGetAcademicYear({}).then(response => {
  378. this.$set(this,'optionList',response.data);
  379. });
  380. },
  381. }
  382. }
  383. </script>
  384. <style scoped lang="scss">
  385. .dataReportUserListPage-addPage {
  386. height:100%;
  387. display: flex;
  388. flex-direction: column;
  389. overflow: hidden;
  390. .page-form-title-box {
  391. /* 分组筛选按钮 */
  392. .table-top-button-box {
  393. display: inline-block;
  394. vertical-align: top;
  395. div {
  396. display: flex;
  397. p {
  398. border: 1px solid #DCDFE6;
  399. width: 80px;
  400. text-align: center;
  401. height: 40px;
  402. line-height: 40px;
  403. cursor: pointer;
  404. font-size: 14px;
  405. &:nth-child(1) { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
  406. &:nth-child(2) { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
  407. }
  408. .check-table-button{
  409. border: 1px solid #0183fa!important;
  410. background-color: #0183fa!important;;
  411. color:#fff!important;;
  412. }
  413. }
  414. }
  415. .table-top-button-box-1 {
  416. display: inline-block;
  417. vertical-align: top;
  418. div {
  419. display: flex;
  420. p {
  421. border: 1px solid #DCDFE6;
  422. width: 80px;
  423. text-align: center;
  424. height: 40px;
  425. line-height: 40px;
  426. cursor: pointer;
  427. font-size: 14px;
  428. &:nth-child(1) { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
  429. &:nth-child(2) { border-left: none; border-right: none; }
  430. &:nth-child(3) { border-right: none; }
  431. &:nth-child(4) { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
  432. }
  433. .check-table-button{
  434. border: 1px solid #0183fa!important;
  435. background-color: #0183fa!important;;
  436. color:#fff!important;;
  437. }
  438. }
  439. }
  440. }
  441. .page-content-box{
  442. .colorA{
  443. display: inline-block;
  444. text-align: center;
  445. width:60px;
  446. border-radius:4px;
  447. color:#28a47c;
  448. background-color:#e9f8f1;
  449. }
  450. .colorB{
  451. display: inline-block;
  452. text-align: center;
  453. width:60px;
  454. border-radius:4px;
  455. color:#df555f;
  456. background-color:#fff0f1;
  457. }
  458. .colorC{
  459. display: inline-block;
  460. text-align: center;
  461. width:60px;
  462. border-radius:4px;
  463. color:#999;
  464. background-color:#dedede;
  465. }
  466. }
  467. }
  468. </style>