PreviewBusinessDetail.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div class="preview-business-detail">
  3. <el-dialog
  4. :visible.sync="modalIsShow"
  5. title="详情数据"
  6. top="10px"
  7. width="940px"
  8. :close-on-click-modal="false"
  9. :close-on-press-escape="false"
  10. append-to-body
  11. @open="visibleChange"
  12. >
  13. <div class="part-box part-box-pad part-box-border part-box-gray">
  14. <el-form ref="modalFormComp" class="form-info" label-width="100px">
  15. <el-row>
  16. <el-col :span="12">
  17. <el-form-item label="印刷计划:">
  18. <span>{{ modalForm.printPlanName }}</span>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="12">
  22. <el-form-item label="卷袋号:">
  23. <span>{{ modalForm.packageCode }}</span>
  24. </el-form-item>
  25. </el-col>
  26. </el-row>
  27. <el-row>
  28. <el-col :span="12">
  29. <el-form-item label="考试日期:">
  30. <span>{{ modalForm.examDate }}</span>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="12">
  34. <el-form-item label="考试时间:">
  35. <span>{{ modalForm.examTime }}</span>
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. <el-row>
  40. <el-col :span="12">
  41. <el-form-item label="考点:">
  42. <span>{{ modalForm.examPlace }}</span>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="12">
  46. <el-form-item label="考场:">
  47. <span>{{ modalForm.examRoom }}</span>
  48. </el-form-item>
  49. </el-col>
  50. </el-row>
  51. <el-row>
  52. <el-col :span="12">
  53. <el-form-item label="课程(代码):">
  54. <span>{{ modalForm.courseNameCode }}</span>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="12">
  58. <el-form-item label="试卷编号:">
  59. <span>{{ modalForm.paperNumber }}</span>
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. </el-form>
  64. </div>
  65. <div class="part-box">
  66. <div class="box-justify mb-2">
  67. <el-button type="primary" @click="toPage(1)">查询</el-button>
  68. <el-button type="primary" @click="toAdd">新增</el-button>
  69. </div>
  70. <el-table border ref="TableList" :data="dataList">
  71. <el-table-column
  72. type="index"
  73. label="序号"
  74. width="50"
  75. :index="indexMethod"
  76. ></el-table-column>
  77. <el-table-column prop="courseNameCode" label="课程(代码)">
  78. </el-table-column>
  79. <el-table-column
  80. prop="paperNumber"
  81. label="试卷编码"
  82. ></el-table-column>
  83. <el-table-column prop="examPlace" label="考点"> </el-table-column>
  84. <el-table-column prop="examRoom" label="考场"> </el-table-column>
  85. <el-table-column prop="studentCode" label="学号"> </el-table-column>
  86. <el-table-column prop="studentName" label="姓名"> </el-table-column>
  87. <el-table-column class-name="action-column" label="操作" width="120">
  88. <template slot-scope="scope">
  89. <el-button
  90. class="btn-primary"
  91. type="text"
  92. @click="toPreview(scope.row)"
  93. >查看详情</el-button
  94. >
  95. <el-button
  96. class="btn-danger"
  97. type="text"
  98. @click="toDelete(scope.row)"
  99. >删除</el-button
  100. >
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. <div class="part-page">
  106. <el-pagination
  107. background
  108. layout="total, sizes, prev, pager, next, jumper"
  109. :pager-count="5"
  110. :current-page="current"
  111. :total="total"
  112. :page-size="size"
  113. @current-change="toPage"
  114. @size-change="pageSizeChange"
  115. >
  116. </el-pagination>
  117. </div>
  118. <div slot="footer"></div>
  119. </el-dialog>
  120. <!-- PreviewBusinessStudentDetail -->
  121. <preview-business-student-detail
  122. :instance="curRow"
  123. ref="PreviewBusinessStudentDetail"
  124. ></preview-business-student-detail>
  125. <!-- ModifyBusinessStudent -->
  126. <modify-business-student
  127. ref="ModifyBusinessStudent"
  128. :instance="curRow"
  129. @modified="getList"
  130. ></modify-business-student>
  131. </div>
  132. </template>
  133. <script>
  134. import { businessDataDetailListPageById, businessDeleteStudent } from "../api";
  135. import PreviewBusinessStudentDetail from "./PreviewBusinessStudentDetail";
  136. import ModifyBusinessStudent from "./ModifyBusinessStudent.vue";
  137. const initModalForm = {
  138. id: "",
  139. courseNameCode: "",
  140. examDetailCourseIds: "",
  141. examEndTime: "",
  142. examStartTime: "",
  143. examDate: "",
  144. examTime: "",
  145. examPlace: "",
  146. examRoom: "",
  147. packageCode: null,
  148. paperNumber: "",
  149. printPlanId: "",
  150. printPlanName: "",
  151. totalSubjects: 0,
  152. };
  153. export default {
  154. name: "preview-business-detail",
  155. components: { PreviewBusinessStudentDetail, ModifyBusinessStudent },
  156. props: {
  157. instance: {
  158. type: Object,
  159. default() {
  160. return {};
  161. },
  162. },
  163. },
  164. data() {
  165. return {
  166. modalIsShow: false,
  167. isSubmit: false,
  168. modalForm: {},
  169. current: 1,
  170. size: this.GLOBAL.pageSize,
  171. total: 0,
  172. dataList: [],
  173. curRow: {},
  174. };
  175. },
  176. methods: {
  177. visibleChange() {
  178. if (this.instance.id !== this.modalForm.id) this.toPage(1);
  179. this.modalForm = this.$objAssign(initModalForm, this.instance);
  180. },
  181. async getList() {
  182. const datas = {
  183. examDetailId: this.instance.id,
  184. pageNumber: this.current,
  185. pageSize: this.size,
  186. };
  187. const data = await businessDataDetailListPageById(datas);
  188. this.dataList = data.records;
  189. this.total = data.total;
  190. },
  191. toPage(page) {
  192. this.current = page;
  193. this.getList();
  194. },
  195. toAdd() {
  196. this.curRow = { examDetailId: this.instance.id };
  197. this.$refs.ModifyBusinessStudent.open();
  198. },
  199. async toDelete(row) {
  200. const confirm = await this.$confirm(
  201. `确定要删除考生【${row.studentName}】吗?`,
  202. "提示",
  203. {
  204. type: "warning",
  205. }
  206. ).catch(() => {});
  207. if (confirm !== "confirm") return;
  208. await businessDeleteStudent(row.id);
  209. this.$message.success("删除成功!");
  210. this.deletePageLastItem();
  211. },
  212. cancel() {
  213. this.modalIsShow = false;
  214. },
  215. open() {
  216. this.modalIsShow = true;
  217. },
  218. toPreview(row) {
  219. this.curRow = row;
  220. this.$refs.PreviewBusinessStudentDetail.open();
  221. },
  222. },
  223. };
  224. </script>