scoreStatistics.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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="specialtyName"
  114. width="120"
  115. >
  116. </el-table-column>
  117. <el-table-column
  118. sortable
  119. label="违纪次数"
  120. prop="disciplineCount"
  121. width="120"
  122. >
  123. </el-table-column>
  124. <el-table-column
  125. sortable
  126. label="正常交卷次数"
  127. prop="submitCount"
  128. width="150"
  129. >
  130. </el-table-column>
  131. <el-table-column
  132. sortable
  133. label="剩余考试次数"
  134. prop="leftExamTimes"
  135. width="150"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. sortable
  140. label="是否缺考"
  141. prop="isAbsent"
  142. width="120"
  143. >
  144. </el-table-column>
  145. <el-table-column
  146. sortable
  147. label="最终成绩"
  148. prop="finalExamScore"
  149. width="120"
  150. >
  151. </el-table-column>
  152. <el-table-column
  153. sortable
  154. label="成绩统计时间"
  155. prop="startTime"
  156. width="155"
  157. >
  158. </el-table-column>
  159. </el-table>
  160. <div class="block pull-right">
  161. <el-pagination
  162. @size-change="handleSizeChange"
  163. @current-change="handleCurrentChange"
  164. :current-page.sync="form.pageNo"
  165. :page-sizes="[10, 20, 50, 100]"
  166. :page-size="form.pageSize"
  167. layout="total, sizes, prev, pager, next, jumper"
  168. :total="total"
  169. >
  170. </el-pagination></div></el-col
  171. ></el-row>
  172. <el-dialog title="导出方式选择" :visible.sync="dialogExportTypeVisible">
  173. <el-row>
  174. <el-col :span="24">
  175. <el-radio v-model="exportType" label="ALL">全部导出</el-radio>
  176. <el-radio v-model="exportType" label="BATCH">分批导出</el-radio>
  177. </el-col>
  178. </el-row>
  179. <el-row class="margin-top-10" v-show="exportType == 'BATCH'">
  180. <el-col :span="4">导出区间</el-col>
  181. <el-col :span="9">
  182. <el-input
  183. size="small"
  184. v-model="form.startLimit"
  185. placeholder="下限"
  186. ></el-input>
  187. </el-col>
  188. <el-col :span="2" style="text-align:center;color:#c0c4cc;">——</el-col>
  189. <el-col :span="9">
  190. <el-input
  191. size="small"
  192. v-model="form.endLimit"
  193. placeholder="上限"
  194. ></el-input>
  195. </el-col>
  196. </el-row>
  197. <el-row class="margin-top-20">
  198. <el-col :span="24">
  199. <el-button type="primary" plain @click="exportData">确定</el-button>
  200. <el-button plain @click="dialogExportTypeVisible = false">
  201. 取消
  202. </el-button>
  203. </el-col>
  204. </el-row>
  205. </el-dialog>
  206. </el-main>
  207. </el-container>
  208. </template>
  209. <script>
  210. import { mapState } from "vuex";
  211. import commonFormVue from "../component/commonForm.vue";
  212. //import commonExportVue from "../component/commonExport.vue";
  213. import { DISCIPLINE_TYPE_LIST } from "../constants/constants";
  214. import pagePrivilege from "../mixin/pagePrivilege.js";
  215. export default {
  216. components: { commonFormVue },
  217. mixins: [pagePrivilege],
  218. data() {
  219. return {
  220. disciplineTypeList: DISCIPLINE_TYPE_LIST,
  221. total: 0,
  222. tableLoading: false,
  223. dialogExportTypeVisible: false,
  224. exportLoading: false,
  225. form: {
  226. examRecordDataId: null,
  227. hasStranger: null,
  228. courseId: null,
  229. courseLevel: null,
  230. examId: null,
  231. examRecordId: null,
  232. faceSuccessPercentLower: null,
  233. faceSuccessPercentUpper: null,
  234. livenessSuccessPercentLower: null,
  235. livenessSuccessPercentUpper: null,
  236. identityNumber: null,
  237. orgId: null,
  238. studentCode: null,
  239. studentName: null,
  240. isWarn: null,
  241. pageNo: 1,
  242. pageSize: 10,
  243. finished: "",
  244. startLimit: "",
  245. endLimit: ""
  246. },
  247. getExamCondition: {
  248. params: {
  249. name: "",
  250. examTypes: "ONLINE"
  251. },
  252. filterCondition: ""
  253. },
  254. tableData: [],
  255. exportUrl: "/api/ecs_oe_admin/exam/score/statistic/list/export",
  256. exportFileName: "成绩统计",
  257. currentPagePrivileges: {
  258. SCORE_STATICS_EXPORT: false //导出
  259. },
  260. exportType: "ALL"
  261. };
  262. },
  263. computed: {
  264. ...mapState({ user: state => state.user })
  265. },
  266. methods: {
  267. resetForm() {
  268. this.form = {
  269. examRecordDataId: null,
  270. hasStranger: null,
  271. courseId: null,
  272. courseLevel: null,
  273. examId: null,
  274. examRecordId: null,
  275. faceSuccessPercentLower: null,
  276. faceSuccessPercentUpper: null,
  277. livenessSuccessPercentLower: null,
  278. livenessSuccessPercentUpper: null,
  279. identityNumber: null,
  280. orgId: null,
  281. studentCode: null,
  282. studentName: null,
  283. isWarn: null,
  284. pageNo: 1,
  285. pageSize: 10,
  286. finished: "",
  287. startLimit: "",
  288. endLimit: ""
  289. };
  290. },
  291. search(type) {
  292. if (!this.form.examId) {
  293. this.$notify({
  294. title: "警告",
  295. message: "请选择考试批次",
  296. type: "warning",
  297. duration: 1000
  298. });
  299. return false;
  300. }
  301. if (type && type == "clickSelectBtn") {
  302. this.form.pageNo = 1;
  303. }
  304. this.tableLoading = true;
  305. this.$http
  306. .post("/api/ecs_oe_admin/exam/score/statistic/list", this.form)
  307. .then(response => {
  308. if (response.data) {
  309. this.tableData = response.data.content;
  310. this.total = response.data.totalElements;
  311. } else {
  312. this.tableData = [];
  313. }
  314. this.tableLoading = false;
  315. });
  316. },
  317. handleSelectionChange(val) {
  318. this.multipleSelection = val;
  319. },
  320. /**
  321. * pagesize改变时触发
  322. */
  323. handleSizeChange(val) {
  324. this.form.pageSize = val;
  325. this.search();
  326. },
  327. /**
  328. * 当前页改变时触发
  329. */
  330. handleCurrentChange() {
  331. this.search();
  332. },
  333. openExportDialog() {
  334. if (!this.form.examId) {
  335. this.$notify({
  336. title: "警告",
  337. message: "请选择考试批次",
  338. type: "warning",
  339. duration: 1000
  340. });
  341. return false;
  342. }
  343. this.dialogExportTypeVisible = true;
  344. this.exportType = "ALL";
  345. this.form.startLimit = "";
  346. this.form.endLimit = "";
  347. },
  348. exportData() {
  349. this.$http
  350. .post("/api/ecs_oe_admin/exam/record/detail/check", this.form)
  351. .then(response => {
  352. if (response.data > 0) {
  353. this.$confirm("成绩统计存在待审数据,是否继续导出?", "提示", {
  354. confirmButtonText: "确定",
  355. cancelButtonText: "取消",
  356. type: "warning"
  357. }).then(() => {
  358. this.dialogExportTypeVisible = false;
  359. this._exportData();
  360. });
  361. } else {
  362. this.dialogExportTypeVisible = false;
  363. this._exportData();
  364. }
  365. });
  366. },
  367. _exportData() {
  368. this.exportLoading = true;
  369. this.$http
  370. .get(this.exportUrl, {
  371. params: {
  372. query: this.form
  373. },
  374. responseType: "arraybuffer"
  375. })
  376. .then(response => {
  377. if (response.data) {
  378. var blob = new Blob([response.data], {
  379. type:
  380. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  381. });
  382. var url = URL.createObjectURL(blob);
  383. var a = document.createElement("a");
  384. a.href = url;
  385. a.download = this.exportFileName + ".xlsx";
  386. a.target = "_blank";
  387. a.click();
  388. URL.revokeObjectURL(url);
  389. }
  390. this.exportLoading = false;
  391. });
  392. }
  393. },
  394. created() {}
  395. };
  396. </script>
  397. <style scoped src="../style/common.css"></style>