ReexamineRecord.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <section class="content">
  3. <div class="box box-info">
  4. <div class="box-body">
  5. <el-form
  6. ref="formSearch"
  7. :model="formSearch"
  8. :inline="true"
  9. label-width="70px"
  10. >
  11. <el-form-item label="考试">
  12. <el-select
  13. v-model="formSearch.examId"
  14. class="input"
  15. filterable
  16. placeholder="请选择"
  17. >
  18. <el-option
  19. v-for="item in examList4Search"
  20. :key="item.id"
  21. :label="item.name"
  22. :value="item.id"
  23. ></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="学习中心">
  27. <el-select
  28. v-model="formSearch.orgId"
  29. class="input"
  30. :remote-method="getOrgList4Search"
  31. :loading="getOrgList4SearchLoading"
  32. remote
  33. filterable
  34. clearable
  35. placeholder="请选择"
  36. >
  37. <el-option
  38. v-for="item in orgList4Search"
  39. :key="item.id"
  40. :label="item.name + ' - ' + item.code"
  41. :value="item.id"
  42. ></el-option>
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="课程">
  46. <el-select
  47. v-model="formSearch.courseId"
  48. class="input"
  49. filterable
  50. clearable
  51. placeholder="请选择"
  52. >
  53. <el-option
  54. v-for="item in courseList4Search"
  55. :key="item.id"
  56. :label="item.name + ' - ' + item.code"
  57. :value="item.id"
  58. ></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="学生姓名">
  62. <el-input v-model="formSearch.studentName" class="input" />
  63. </el-form-item>
  64. <el-form-item label="学号">
  65. <el-input v-model="formSearch.studentCode" class="input" />
  66. </el-form-item>
  67. <el-form-item label="证件号">
  68. <el-input v-model="formSearch.identityNumber" class="input" />
  69. </el-form-item>
  70. <el-form-item>
  71. <el-button
  72. size="small"
  73. type="primary"
  74. icon="el-icon-search"
  75. @click="resetPageAndSearchForm"
  76. >查询</el-button
  77. >
  78. <el-button
  79. size="small"
  80. icon="el-icon-refresh"
  81. @click="resetEcsFormSearch"
  82. >
  83. 重置
  84. </el-button>
  85. </el-form-item>
  86. </el-form>
  87. <div class="block-seperator"></div>
  88. <span>操作:</span>
  89. <el-button
  90. size="small"
  91. type="primary"
  92. icon="el-icon-download"
  93. @click="exportHandler"
  94. >导出</el-button
  95. >
  96. <el-table
  97. :data="tableData"
  98. border
  99. style="width: 100%; text-align: center; margin-top: 10px"
  100. >
  101. <el-table-column
  102. prop="studentName"
  103. width="120"
  104. label="姓名"
  105. ></el-table-column>
  106. <el-table-column prop="studentCode" label="学号"></el-table-column>
  107. <el-table-column
  108. prop="identityNumber"
  109. label="证件号"
  110. ></el-table-column>
  111. <el-table-column prop="orgName" label="学习中心"></el-table-column>
  112. <el-table-column prop="courseName" label="课程"></el-table-column>
  113. <el-table-column
  114. prop="creationTime"
  115. width="140"
  116. label="操作时间"
  117. ></el-table-column>
  118. <el-table-column
  119. prop="operateUserName"
  120. width="140"
  121. label="操作人"
  122. ></el-table-column>
  123. </el-table>
  124. <div class="page pull-right">
  125. <el-pagination
  126. :current-page="currentPage"
  127. :page-size="pageSize"
  128. :page-sizes="[10, 20, 50, 100, 200, 300]"
  129. layout="total, sizes, prev, pager, next, jumper"
  130. :total="total"
  131. @current-change="handleCurrentChange"
  132. @size-change="handleSizeChange"
  133. ></el-pagination>
  134. </div>
  135. </div>
  136. </div>
  137. </section>
  138. </template>
  139. <script>
  140. import { CORE_API, EXAM_WORK_API } from "@/constants/constants.js";
  141. import { mapState } from "vuex";
  142. export default {
  143. name: "ReexamineRecord",
  144. data() {
  145. return {
  146. formSearch: {
  147. examId: "",
  148. orgId: "",
  149. courseId: "",
  150. studentName: "",
  151. studentCode: "",
  152. identityNumber: "",
  153. },
  154. getOrgList4SearchLoading: false,
  155. orgList4Search: [],
  156. tableData: [],
  157. currentPage: 1,
  158. pageSize: 10,
  159. total: 10,
  160. examList4Search: [],
  161. courseList4Search: [],
  162. };
  163. },
  164. computed: {
  165. ...mapState({ user: (state) => state.user }),
  166. },
  167. created() {
  168. this.getOrgList4Search("");
  169. this.queryExams4Search("");
  170. this.getCourses4Search("");
  171. },
  172. methods: {
  173. getCourses4Search(query) {
  174. this.courseLoading4Search = true;
  175. this.$httpWithMsg
  176. .get(CORE_API + "/course/query?name=" + query)
  177. .then((response) => {
  178. this.courseList4Search = response.data;
  179. });
  180. },
  181. getOrgList4Search(orgName) {
  182. this.getOrgList4SearchLoading = true;
  183. let url =
  184. CORE_API +
  185. "/org/query?rootOrgId=" +
  186. this.user.rootOrgId +
  187. "&name=" +
  188. orgName;
  189. this.$httpWithMsg
  190. .get(url)
  191. .then((response) => {
  192. this.getOrgList4SearchLoading = false;
  193. this.orgList4Search = response.data;
  194. })
  195. .catch((response) => {
  196. console.log(response);
  197. this.getOrgList4SearchLoading = false;
  198. });
  199. },
  200. queryExams4Search() {
  201. this.$httpWithMsg
  202. .get(EXAM_WORK_API + "/exam/queryByNameLike?enable=true&name=" + name)
  203. .then((response) => {
  204. this.examList4Search = response.data;
  205. });
  206. },
  207. resetPageAndSearchForm() {
  208. this.currentPage = 1;
  209. this.searchForm();
  210. },
  211. resetEcsFormSearch() {
  212. this.formSearch = {
  213. examId: "",
  214. orgId: "",
  215. courseId: "",
  216. studentName: "",
  217. studentCode: "",
  218. identityNumber: "",
  219. };
  220. },
  221. searchForm() {
  222. if (!this.formSearch.examId) {
  223. this.$notify({
  224. type: "warning",
  225. message: "请选择考试",
  226. });
  227. return;
  228. }
  229. let url = "/api/ecs_oe_admin/reexamine/log/list";
  230. this.$httpWithMsg
  231. .post(url, null, {
  232. params: {
  233. ...this.formSearch,
  234. pageNo: this.currentPage,
  235. pageSize: this.pageSize,
  236. },
  237. headers: {
  238. "content-type": "application/x-www-form-urlencoded",
  239. },
  240. })
  241. .then((response) => {
  242. this.tableData = response.data.content || [];
  243. this.total = response.data.totalElements;
  244. });
  245. },
  246. handleCurrentChange(val) {
  247. this.currentPage = val;
  248. this.searchForm();
  249. },
  250. handleSizeChange(val) {
  251. this.pageSize = val;
  252. this.searchForm();
  253. },
  254. editItem(item) {
  255. this.curRow = item;
  256. this.showEditDialog = true;
  257. },
  258. exportHandler() {
  259. if (!this.formSearch.examId) {
  260. this.$notify({
  261. type: "warning",
  262. message: "请选择考试",
  263. });
  264. return;
  265. }
  266. this.$confirm("确定执行导出?", "提示", {
  267. confirmButtonText: "确定",
  268. cancelButtonText: "取消",
  269. type: "warning",
  270. }).then(() => {
  271. var param = new URLSearchParams(this.formSearch);
  272. window.open(
  273. "/api/ecs_oe_admin/reexamine/log/list/export" +
  274. "?$key=" +
  275. this.user.key +
  276. "&$token=" +
  277. this.user.token +
  278. "&" +
  279. param
  280. );
  281. });
  282. },
  283. },
  284. };
  285. </script>
  286. <style lang="scss" scoped>
  287. .box-body {
  288. .input {
  289. width: 200px !important;
  290. }
  291. }
  292. </style>