scoreStatistics.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <template>
  2. <el-container>
  3. <el-main class="el-main-padding">
  4. <commonFormVue :form="form" :getExamCondition="getExamCondition">
  5. <el-col :span="6">
  6. <el-form-item label="是否缺考">
  7. <el-select
  8. class="form_search_width"
  9. size="small"
  10. v-model="form.finished"
  11. clearable
  12. placeholder="全部"
  13. >
  14. <el-option value="false" label="是"></el-option>
  15. <el-option value="true" label="否"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. </el-col>
  19. </commonFormVue>
  20. <el-row>
  21. <el-col :span="24">
  22. <el-button
  23. @click="search('clickSelectBtn')"
  24. size="small"
  25. type="primary"
  26. icon="el-icon-search"
  27. >查询
  28. </el-button>
  29. <el-button size="small" icon="el-icon-refresh" @click="resetForm">
  30. 重置
  31. </el-button>
  32. </el-col>
  33. </el-row>
  34. <el-row>
  35. <el-col :span="24" v-show="currentPagePrivileges.SCORE_STATICS_EXPORT">
  36. <div class="block-seperator"></div>
  37. <span>操作:</span>
  38. <el-button
  39. type="primary"
  40. size="small"
  41. icon="el-icon-download"
  42. @click="openExportDialog"
  43. v-show="!exportLoading"
  44. >
  45. 导出
  46. </el-button>
  47. <el-button
  48. size="small"
  49. icon="el-icon-download"
  50. :loading="true"
  51. v-show="exportLoading"
  52. >导出数据中...
  53. </el-button>
  54. </el-col>
  55. </el-row>
  56. <el-row class="margin-top-10">
  57. <el-col :span="24">
  58. <el-table
  59. v-loading="tableLoading"
  60. element-loading-text="数据加载中"
  61. ref="multipleTable"
  62. @selection-change="handleSelectionChange"
  63. :data="tableData"
  64. border
  65. >
  66. <el-table-column
  67. sortable
  68. label="学习中心"
  69. prop="orgName"
  70. width="120"
  71. >
  72. </el-table-column>
  73. <el-table-column
  74. sortable
  75. label="姓名"
  76. prop="studentName"
  77. width="120"
  78. >
  79. </el-table-column>
  80. <el-table-column
  81. sortable
  82. label="身份证号"
  83. prop="identityNumber"
  84. width="120"
  85. >
  86. </el-table-column>
  87. <el-table-column
  88. sortable
  89. label="学号"
  90. prop="studentCode"
  91. width="120"
  92. >
  93. </el-table-column>
  94. <el-table-column
  95. sortable
  96. label="课程"
  97. prop="courseNameAndCode"
  98. width="120"
  99. >
  100. </el-table-column>
  101. <el-table-column
  102. sortable
  103. label="课程层次"
  104. prop="courseLevel"
  105. width="120"
  106. >
  107. </el-table-column>
  108. <el-table-column sortable label="年级" prop="grade" width="120">
  109. </el-table-column>
  110. <el-table-column
  111. sortable
  112. label="采集人"
  113. prop="infoCollector"
  114. width="120"
  115. >
  116. </el-table-column>
  117. <el-table-column
  118. sortable
  119. label="专业"
  120. prop="specialtyName"
  121. width="120"
  122. >
  123. </el-table-column>
  124. <el-table-column
  125. sortable
  126. label="违纪次数"
  127. prop="disciplineCount"
  128. width="120"
  129. >
  130. </el-table-column>
  131. <el-table-column
  132. sortable
  133. label="正常交卷次数"
  134. prop="submitCount"
  135. width="150"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. sortable
  140. label="剩余考试次数"
  141. prop="leftExamTimes"
  142. width="150"
  143. >
  144. </el-table-column>
  145. <el-table-column
  146. sortable
  147. label="是否缺考"
  148. prop="isAbsent"
  149. width="120"
  150. >
  151. </el-table-column>
  152. <el-table-column
  153. sortable
  154. label="最终成绩"
  155. prop="finalExamScore"
  156. width="120"
  157. >
  158. </el-table-column>
  159. <el-table-column
  160. sortable
  161. label="成绩统计时间"
  162. prop="startTime"
  163. width="155"
  164. >
  165. </el-table-column>
  166. </el-table>
  167. <div class="block pull-right">
  168. <el-pagination
  169. @size-change="handleSizeChange"
  170. @current-change="handleCurrentChange"
  171. :current-page.sync="form.pageNo"
  172. :page-sizes="[10, 20, 50, 100]"
  173. :page-size="form.pageSize"
  174. layout="total, sizes, prev, pager, next, jumper"
  175. :total="total"
  176. >
  177. </el-pagination></div></el-col
  178. ></el-row>
  179. <el-dialog title="导出方式选择" :visible.sync="dialogExportTypeVisible">
  180. <el-row>
  181. <el-col :span="24">
  182. <el-radio v-model="exportType" label="ALL">全部导出</el-radio>
  183. <el-radio v-model="exportType" label="BATCH">分批导出</el-radio>
  184. </el-col>
  185. </el-row>
  186. <el-row class="margin-top-10" v-show="exportType == 'BATCH'">
  187. <el-col :span="4">导出区间</el-col>
  188. <el-col :span="9">
  189. <el-input
  190. size="small"
  191. v-model="form.startLimit"
  192. placeholder="下限"
  193. ></el-input>
  194. </el-col>
  195. <el-col :span="2" style="text-align:center;color:#c0c4cc;">——</el-col>
  196. <el-col :span="9">
  197. <el-input
  198. size="small"
  199. v-model="form.endLimit"
  200. placeholder="上限"
  201. ></el-input>
  202. </el-col>
  203. </el-row>
  204. <el-row class="margin-top-20">
  205. <el-col :span="24">
  206. <el-button type="primary" plain @click="exportData">确定</el-button>
  207. <el-button plain @click="dialogExportTypeVisible = false">
  208. 取消
  209. </el-button>
  210. </el-col>
  211. </el-row>
  212. </el-dialog>
  213. </el-main>
  214. </el-container>
  215. </template>
  216. <script>
  217. import { mapState } from "vuex";
  218. import commonFormVue from "../component/commonForm.vue";
  219. //import commonExportVue from "../component/commonExport.vue";
  220. import { DISCIPLINE_TYPE_LIST } from "../constants/constants";
  221. import pagePrivilege from "../mixin/pagePrivilege.js";
  222. export default {
  223. components: { commonFormVue },
  224. mixins: [pagePrivilege],
  225. data() {
  226. return {
  227. disciplineTypeList: DISCIPLINE_TYPE_LIST,
  228. total: 0,
  229. tableLoading: false,
  230. dialogExportTypeVisible: false,
  231. exportLoading: false,
  232. form: {
  233. examRecordDataId: null,
  234. hasStranger: null,
  235. courseId: null,
  236. courseLevel: null,
  237. examId: null,
  238. examRecordId: null,
  239. faceSuccessPercentLower: null,
  240. faceSuccessPercentUpper: null,
  241. livenessSuccessPercentLower: null,
  242. livenessSuccessPercentUpper: null,
  243. identityNumber: null,
  244. orgId: null,
  245. studentCode: null,
  246. studentName: null,
  247. isWarn: null,
  248. pageNo: 1,
  249. pageSize: 10,
  250. finished: "",
  251. startLimit: "",
  252. endLimit: ""
  253. },
  254. getExamCondition: {
  255. params: {
  256. name: "",
  257. examTypes: "ONLINE#OFFLINE"
  258. },
  259. filterCondition: ""
  260. },
  261. tableData: [],
  262. exportUrl: "/api/ecs_oe_admin/exam/score/statistic/list/export",
  263. exportFileName: "成绩统计",
  264. currentPagePrivileges: {
  265. SCORE_STATICS_EXPORT: false //导出
  266. },
  267. exportType: "ALL"
  268. };
  269. },
  270. computed: {
  271. ...mapState({ user: state => state.user })
  272. },
  273. methods: {
  274. resetForm() {
  275. this.form = {
  276. examRecordDataId: null,
  277. hasStranger: null,
  278. courseId: null,
  279. courseLevel: null,
  280. examId: null,
  281. examRecordId: null,
  282. faceSuccessPercentLower: null,
  283. faceSuccessPercentUpper: null,
  284. livenessSuccessPercentLower: null,
  285. livenessSuccessPercentUpper: null,
  286. identityNumber: null,
  287. orgId: null,
  288. studentCode: null,
  289. studentName: null,
  290. isWarn: null,
  291. pageNo: 1,
  292. pageSize: 10,
  293. finished: "",
  294. startLimit: "",
  295. endLimit: ""
  296. };
  297. },
  298. search(type) {
  299. if (!this.form.examId) {
  300. this.$notify({
  301. title: "警告",
  302. message: "请选择考试批次",
  303. type: "warning",
  304. duration: 1000
  305. });
  306. return false;
  307. }
  308. if (type && type == "clickSelectBtn") {
  309. this.form.pageNo = 1;
  310. }
  311. this.tableLoading = true;
  312. this.$http
  313. .post("/api/ecs_oe_admin/exam/score/statistic/list", this.form)
  314. .then(response => {
  315. if (response.data) {
  316. this.tableData = response.data.content;
  317. this.total = response.data.totalElements;
  318. } else {
  319. this.tableData = [];
  320. }
  321. this.tableLoading = false;
  322. });
  323. },
  324. handleSelectionChange(val) {
  325. this.multipleSelection = val;
  326. },
  327. /**
  328. * pagesize改变时触发
  329. */
  330. handleSizeChange(val) {
  331. this.form.pageSize = val;
  332. this.search();
  333. },
  334. /**
  335. * 当前页改变时触发
  336. */
  337. handleCurrentChange() {
  338. this.search();
  339. },
  340. openExportDialog() {
  341. if (!this.form.examId) {
  342. this.$notify({
  343. title: "警告",
  344. message: "请选择考试批次",
  345. type: "warning",
  346. duration: 1000
  347. });
  348. return false;
  349. }
  350. this.dialogExportTypeVisible = true;
  351. this.exportType = "ALL";
  352. this.form.startLimit = "";
  353. this.form.endLimit = "";
  354. },
  355. exportData() {
  356. this.$http
  357. .post("/api/ecs_oe_admin/exam/record/detail/check", this.form)
  358. .then(response => {
  359. if (response.data > 0) {
  360. this.$confirm("成绩统计存在待审数据,是否继续导出?", "提示", {
  361. confirmButtonText: "确定",
  362. cancelButtonText: "取消",
  363. type: "warning"
  364. }).then(() => {
  365. this.dialogExportTypeVisible = false;
  366. this._exportData();
  367. });
  368. } else {
  369. this.dialogExportTypeVisible = false;
  370. this._exportData();
  371. }
  372. });
  373. },
  374. _exportData() {
  375. this.exportLoading = true;
  376. this.$http
  377. .get(this.exportUrl, {
  378. params: {
  379. query: this.form
  380. },
  381. responseType: "arraybuffer",
  382. timeout: 20 * 60 * 1000 //限时20分钟
  383. })
  384. .then(response => {
  385. if (response.data) {
  386. var blob = new Blob([response.data], {
  387. type:
  388. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  389. });
  390. var url = URL.createObjectURL(blob);
  391. var a = document.createElement("a");
  392. a.href = url;
  393. a.download = this.exportFileName + ".xlsx";
  394. a.target = "_blank";
  395. a.click();
  396. URL.revokeObjectURL(url);
  397. }
  398. this.exportLoading = false;
  399. });
  400. }
  401. },
  402. created() {}
  403. };
  404. </script>
  405. <style scoped src="../style/common.css"></style>