reexamine.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <el-container>
  3. <el-main class="el-main-padding">
  4. <commonFormVue :form="form" :getExamCondition="getExamCondition">
  5. </commonFormVue>
  6. <el-col :span="6">
  7. <el-button
  8. @click="search('clickSelectBtn')"
  9. size="small"
  10. type="primary"
  11. icon="el-icon-search"
  12. >查询
  13. </el-button>
  14. <el-button size="small" icon="el-icon-refresh" @click="resetForm">
  15. 重置
  16. </el-button>
  17. </el-col>
  18. <el-row class="margin-top-10"
  19. ><el-col :span="24">
  20. <el-table
  21. v-loading="tableLoading"
  22. element-loading-text="数据加载中"
  23. ref="multipleTable"
  24. @selection-change="handleSelectionChange"
  25. :data="tableData"
  26. border
  27. >
  28. <el-table-column sortable label="学习中心" prop="orgName">
  29. </el-table-column>
  30. <el-table-column sortable label="姓名" prop="studentName">
  31. </el-table-column>
  32. <el-table-column sortable label="身份证号" prop="identityNumber">
  33. </el-table-column>
  34. <el-table-column sortable label="学号" prop="studentCode">
  35. </el-table-column>
  36. <el-table-column sortable label="课程" prop="courseName">
  37. </el-table-column>
  38. <el-table-column sortable label="课程层次" prop="courseLevel">
  39. </el-table-column>
  40. <el-table-column label="操作" width="120">
  41. <template slot-scope="scope">
  42. <el-button
  43. size="mini"
  44. type="primary"
  45. @click="openReexamineDialog(scope.row.examStudentId)"
  46. icon="el-icon-refresh"
  47. >设置重考
  48. </el-button>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. <div class="block pull-right">
  53. <el-pagination
  54. @size-change="handleSizeChange"
  55. @current-change="handleCurrentChange"
  56. :current-page.sync="form.pageNo"
  57. :page-sizes="[10, 20, 50, 100, 200, 300]"
  58. :page-size="form.pageSize"
  59. layout="total, sizes, prev, pager, next, jumper"
  60. :total="total"
  61. >
  62. </el-pagination></div></el-col
  63. ></el-row>
  64. <el-dialog
  65. title="设置重考"
  66. :visible.sync="dialogFormVisible"
  67. @closed="reexamineDialogClosed"
  68. >
  69. <el-form :model="reexamineForm" ref="reexamineForm">
  70. <el-form-item
  71. prop="reexamineType"
  72. label="重考理由"
  73. :rules="[
  74. { required: true, message: '请选择重考理由', trigger: 'change' }
  75. ]"
  76. >
  77. <el-select
  78. v-model="reexamineForm.reexamineType"
  79. placeholder="请选择"
  80. >
  81. <el-option
  82. v-for="item in reexamineTypeList"
  83. :key="item.name"
  84. :label="item.desc"
  85. :value="item.name"
  86. >
  87. </el-option>
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item label="详情描述" style="margin-top:15px;">
  91. <el-input
  92. v-model="reexamineForm.reexamineDetail"
  93. type="textarea"
  94. :autosize="{ minRows: 6, maxRows: 10 }"
  95. placeholder="请输入内容"
  96. >
  97. </el-input>
  98. </el-form-item>
  99. <div class="dialog-footer margin-top-10 text-center">
  100. <el-button type="primary" @click="doSetReexamine">确 定</el-button>
  101. <el-button @click="dialogFormVisible = false">取 消</el-button>
  102. </div>
  103. </el-form>
  104. </el-dialog>
  105. </el-main>
  106. </el-container>
  107. </template>
  108. <script>
  109. import { mapState } from "vuex";
  110. import commonFormVue from "../component/commonForm.vue";
  111. export default {
  112. components: { commonFormVue },
  113. data() {
  114. return {
  115. dialogFormVisible: false,
  116. total: 0,
  117. tableLoading: false,
  118. form: {
  119. examRecordDataId: null,
  120. hasStranger: null,
  121. courseId: null,
  122. courseLevel: null,
  123. examId: null,
  124. examRecordId: null,
  125. faceSuccessPercentLower: null,
  126. faceSuccessPercentUpper: null,
  127. livenessSuccessPercentLower: null,
  128. livenessSuccessPercentUpper: null,
  129. identityNumber: null,
  130. orgId: null,
  131. studentCode: null,
  132. studentName: null,
  133. isWarn: null,
  134. pageNo: 1,
  135. pageSize: 10
  136. },
  137. reexamineForm: {
  138. examStudentId: "",
  139. reexamineType: "",
  140. reexamineDetail: ""
  141. },
  142. getExamCondition: {
  143. params: {
  144. name: "",
  145. examTypes: "ONLINE"
  146. },
  147. filterCondition: ""
  148. },
  149. tableData: [],
  150. reexamineTypeList: [
  151. { desc: "断电", name: "POWER_FAILURE" },
  152. { desc: "机器故障", name: "MACHINE_STOPPAGE" },
  153. { desc: "其他", name: "OTHER" }
  154. ]
  155. };
  156. },
  157. computed: {
  158. ...mapState({ user: state => state.user })
  159. },
  160. methods: {
  161. resetForm() {
  162. this.form = {
  163. examRecordDataId: null,
  164. hasStranger: null,
  165. courseId: null,
  166. courseLevel: null,
  167. examId: null,
  168. examRecordId: null,
  169. faceSuccessPercentLower: null,
  170. faceSuccessPercentUpper: null,
  171. livenessSuccessPercentLower: null,
  172. livenessSuccessPercentUpper: null,
  173. identityNumber: null,
  174. orgId: null,
  175. studentCode: null,
  176. studentName: null,
  177. isWarn: null,
  178. pageNo: 1,
  179. pageSize: 10
  180. };
  181. },
  182. search(type) {
  183. if (!this.form.examId) {
  184. this.$notify({
  185. title: "警告",
  186. message: "请选择考试批次",
  187. type: "warning",
  188. duration: 1000
  189. });
  190. return false;
  191. }
  192. if (type && type == "clickSelectBtn") {
  193. this.form.pageNo = 1;
  194. }
  195. this.tableLoading = true;
  196. this.$http
  197. .post("/api/ecs_oe_admin/exam/student/reexamine/list", this.form)
  198. .then(response => {
  199. if (response.data) {
  200. this.tableData = response.data.content;
  201. this.total = response.data.totalElements;
  202. } else {
  203. this.tableData = [];
  204. }
  205. this.tableLoading = false;
  206. });
  207. },
  208. selectable(row) {
  209. return row.isWarn;
  210. },
  211. handleSelectionChange(val) {
  212. this.multipleSelection = val;
  213. },
  214. /**
  215. * pagesize改变时触发
  216. */
  217. handleSizeChange(val) {
  218. this.form.pageSize = val;
  219. this.search();
  220. },
  221. /**
  222. * 当前页改变时触发
  223. */
  224. handleCurrentChange() {
  225. this.search();
  226. },
  227. openReexamineDialog(examStudentId) {
  228. this.dialogFormVisible = true;
  229. this.reexamineForm = {
  230. examStudentId: examStudentId,
  231. reexamineType: "",
  232. reexamineDetail: ""
  233. };
  234. },
  235. doSetReexamine() {
  236. this.$refs["reexamineForm"].validate(valid => {
  237. if (valid) {
  238. var param = new URLSearchParams({
  239. examStudentId: this.reexamineForm.examStudentId
  240. });
  241. this.$http
  242. .post("/api/ecs_oe_admin/exam/student/reexamine", param)
  243. .then(() => {
  244. this.$notify({
  245. title: "成功",
  246. message: "操作成功",
  247. type: "success"
  248. });
  249. this.dialogFormVisible = false;
  250. this.search();
  251. });
  252. } else {
  253. return false;
  254. }
  255. });
  256. },
  257. reexamineDialogClosed() {
  258. this.$refs["reexamineForm"].resetFields();
  259. }
  260. },
  261. created() {}
  262. };
  263. </script>
  264. <style scoped src="../style/common.css"></style>