BusinessData.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <el-dialog
  3. class="business-data"
  4. :visible.sync="modalIsShow"
  5. title="导入考务数据预览"
  6. top="10vh"
  7. width="840px"
  8. :close-on-click-modal="false"
  9. :close-on-press-escape="false"
  10. append-to-body
  11. @open="visibleChange"
  12. >
  13. <el-table ref="TableList" :data="dataList" border stripe>
  14. <el-table-column
  15. prop="sceneNumberId"
  16. label="场次ID"
  17. width="80"
  18. ></el-table-column>
  19. <el-table-column prop="examSite" label="考点名称"></el-table-column>
  20. <el-table-column prop="examRoom" label="考场名称"></el-table-column>
  21. <el-table-column
  22. prop="courseCodeAndName"
  23. label="科目名称(编码)"
  24. ></el-table-column>
  25. <el-table-column
  26. prop="examTotal"
  27. label="应考科次"
  28. width="100"
  29. ></el-table-column>
  30. </el-table>
  31. <div class="table-tips">
  32. 将导入 <span>{{ total }}</span> 条数据
  33. </div>
  34. <div class="part-page">
  35. <el-pagination
  36. background
  37. layout="prev, pager, next"
  38. :current-page="current"
  39. :total="total"
  40. :page-size="size"
  41. @current-change="toPage"
  42. >
  43. </el-pagination>
  44. </div>
  45. <div slot="footer" style="text-align: right">
  46. <el-button type="primary" @click="cancel">确定</el-button>
  47. </div>
  48. </el-dialog>
  49. </template>
  50. <script>
  51. import { examBusinessData } from "../api";
  52. export default {
  53. name: "business-data",
  54. props: {
  55. examCode: {
  56. type: [String, Number]
  57. }
  58. },
  59. data() {
  60. return {
  61. modalIsShow: false,
  62. current: 1,
  63. size: this.GLOBAL.pageSize,
  64. total: 0,
  65. dataList: [],
  66. res: {
  67. success: true,
  68. msg: ""
  69. }
  70. };
  71. },
  72. methods: {
  73. visibleChange() {
  74. this.toPage(1);
  75. },
  76. async getList() {
  77. if (!this.examCode) return;
  78. const datas = {
  79. examCode: this.examCode,
  80. pageNumber: this.current,
  81. pageSize: this.size
  82. };
  83. const data = await examBusinessData(datas);
  84. this.dataList = data.records;
  85. this.total = data.total;
  86. },
  87. toPage(page) {
  88. this.current = page;
  89. this.getList();
  90. },
  91. cancel() {
  92. this.modalIsShow = false;
  93. },
  94. open() {
  95. this.modalIsShow = true;
  96. },
  97. confirm() {
  98. this.$emit("confirm");
  99. }
  100. }
  101. };
  102. </script>
  103. <style lang="css" scoped>
  104. .table-tips {
  105. color: #888;
  106. float: left;
  107. margin-top: 21px;
  108. }
  109. .table-tips > span {
  110. color: rgba(254, 108, 105, 1);
  111. }
  112. </style>