examRegistrationReview.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true" @submit.native.prevent>
  6. <el-form-item label="报名时间">
  7. <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
  8. end-placeholder="结束日期" size="small">
  9. </el-date-picker>
  10. </el-form-item>
  11. <el-form-item label="姓名">
  12. <el-input v-model="nameKeyword" placeholder="请输入姓名" clearable size="small"></el-input>
  13. </el-form-item>
  14. <el-form-item label="课程">
  15. <el-input v-model="courseKeyword" placeholder="请输入课程名称" clearable size="small"></el-input>
  16. </el-form-item>
  17. <el-form-item>
  18. <el-button type="primary" @click="searchList" size="small">搜索</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </el-col>
  22. <!--列表-->
  23. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;"
  24. @selection-change="handleSelectionChange">
  25. <el-table-column type="selection" width="55" align="center"></el-table-column>
  26. <el-table-column prop="parentCourseName" label="考试课程" min-width="240"></el-table-column>
  27. <el-table-column prop="name" label="姓名" width="100" align="center"></el-table-column>
  28. <el-table-column prop="sex" label="性别" width="80" align="center"></el-table-column>
  29. <el-table-column prop="school" label="工作单位" min-width="150" align="center"></el-table-column>
  30. <el-table-column prop="phone" label="手机号码" width="120" align="center"></el-table-column>
  31. <el-table-column prop="idType" label="证件类型" width="100" align="center"></el-table-column>
  32. <el-table-column prop="idNumber" label="证件号码" width="180" align="center"></el-table-column>
  33. <el-table-column prop="email" label="邮箱" width="180" align="center"></el-table-column>
  34. <el-table-column prop="invoiceType" label="发票类型" width="140" align="center"></el-table-column>
  35. <el-table-column prop="isIndivdual" label="开票主体" width="140" align="center"></el-table-column>
  36. <el-table-column prop="invoiceHeader" label="开票名称" width="140" align="center"></el-table-column>
  37. <el-table-column prop="invoiceDate" label="开票日期" width="120" align="center"></el-table-column>
  38. <el-table-column prop="taxCode" label="税号" width="150" align="center"></el-table-column>
  39. <el-table-column prop="address" label="联系地址" min-width="340"></el-table-column>
  40. <el-table-column label="证件照" width="120" align="center" fixed="right">
  41. <template slot-scope="scope">
  42. <img v-if="scope.row.portraitUrl" :src="scope.row.portraitUrl" class="id-photo"
  43. @click="previewImage(scope.row.portraitUrl)" />
  44. <span v-else>无照片</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="操作" width="180" class-name="btns" header-align="center" fixed="right">
  48. <template slot-scope="scope">
  49. <el-button size="small" type="success" @click="approve(scope.row)">通过</el-button>
  50. <el-button size="small" type="danger" @click="reject(scope.row)">驳回</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <!--工具条-->
  55. <el-col :span="24" class="toolbar">
  56. <el-button type="success" @click="batchApprove" :disabled="selectedIds.length === 0"
  57. size="small">全部通过</el-button>
  58. <el-button type="danger" @click="batchReject" :disabled="selectedIds.length === 0"
  59. size="small">全部驳回</el-button>
  60. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  61. :page-sizes="[10, 20, 50, 100]" :page-size="size" layout="total, sizes, prev, pager, next"
  62. :total="total" style="float:right;"></el-pagination>
  63. </el-col>
  64. <!-- 驳回弹窗 -->
  65. <el-dialog title="驳回原因" :visible.sync="rejectDialogVisible" width="30%">
  66. <el-form ref="rejectForm" :model="rejectData" label-width="0px">
  67. <el-form-item>
  68. <el-input type="textarea" :rows="4" v-model="rejectData.reason" placeholder="请输入驳回原因"></el-input>
  69. </el-form-item>
  70. </el-form>
  71. <div slot="footer" class="dialog-footer">
  72. <el-button @click="rejectDialogVisible = false">取 消</el-button>
  73. <el-button type="primary" :disabled="!rejectData.reason" @click="submitReject">确 定</el-button>
  74. </div>
  75. </el-dialog>
  76. </section>
  77. </template>
  78. <script>
  79. import { post, checkAndAddUpload } from '../../api'
  80. import { fixedDataGender, fixedDataCertificateType, fixedDataOrNot, fixedDataInvoiceSubject, fixedDatainvoiceType } from '../../common/js/fixedData'
  81. export default {
  82. data() {
  83. return {
  84. // 搜索条件
  85. dateRange: [],
  86. nameKeyword: '',
  87. courseKeyword: '',
  88. // 表格相关
  89. tableHeight: 0,
  90. listLoading: false,
  91. total: 0,
  92. page: 1,
  93. size: 20,
  94. list: [],
  95. selectedIds: [],
  96. // 弹窗
  97. rejectDialogVisible: false,
  98. rejectData: {
  99. idString: '',
  100. reason: ''
  101. }
  102. }
  103. },
  104. methods: {
  105. // 搜索列表
  106. searchList() {
  107. this.page = 1;
  108. this.getList();
  109. },
  110. // 图片预览
  111. previewImage(url) {
  112. this.$viewerApi({
  113. images: [url],
  114. options: {
  115. initialViewIndex: 0,
  116. toolbar: {
  117. zoomIn: 1,
  118. zoomOut: 1,
  119. oneToOne: 1,
  120. reset: 1,
  121. prev: 1,
  122. next: 1,
  123. rotateLeft: 1,
  124. rotateRight: 1,
  125. flipHorizontal: 1,
  126. flipVertical: 1
  127. }
  128. }
  129. })
  130. },
  131. // 获取列表
  132. getList() {
  133. this.listLoading = true;
  134. post(`/exam-check/getAuditList`, { pageSize: this.size, pageIndex: this.page }).then(res => {
  135. const { records = [], total = 0 } = res.data
  136. this.total = total
  137. this.list = records.map(item => {
  138. const { courseId, courseName, id, examStatus, isOnlineCourse } = item
  139. const { sex, idType, invoiceType, isIndivdual } = item.userExamInfo || {}
  140. return {
  141. ...item.userExamInfo,
  142. parenCourseId: courseId,
  143. parentCourseName: courseName,
  144. parentId: id,
  145. parentExamStatus: examStatus,
  146. parentIsOnlineCourse: isOnlineCourse,
  147. sex: fixedDataGender.find(val => val.value == (sex ? 1 : 0)).label,
  148. idType: fixedDataCertificateType.find(val => val.value == idType).label,
  149. invoiceType: fixedDatainvoiceType.find(val => val.value == invoiceType).label,
  150. isIndivdual: fixedDataInvoiceSubject.find(val => val.value == (isIndivdual ? 1 : 0)).label,
  151. }
  152. })
  153. }).finally(() => {
  154. this.listLoading = false;
  155. })
  156. },
  157. // 分页相关
  158. handleCurrentChange(val) {
  159. this.page = val;
  160. this.getList();
  161. },
  162. handleSizeChange(val) {
  163. this.page = 1;
  164. this.size = val;
  165. this.getList();
  166. },
  167. // 选择变化
  168. handleSelectionChange(val) {
  169. this.selectedIds = val.map(item => item.parentId);
  170. },
  171. // 通过单个
  172. approve(row) {
  173. this.$confirm('确认通过该报名申请?', '提示', {
  174. confirmButtonText: '确定',
  175. cancelButtonText: '取消',
  176. type: 'warning'
  177. }).then(() => {
  178. post('/exam-check/approve', { idString: row.parentId }).then(res => {
  179. this.$message({
  180. message: '操作成功',
  181. type: 'success'
  182. });
  183. this.getList();
  184. })
  185. });
  186. },
  187. // 驳回单个
  188. reject(row) {
  189. console.log('row:', row);
  190. this.$confirm('确认驳回该报名申请?', '提示', {
  191. confirmButtonText: '确定',
  192. cancelButtonText: '取消',
  193. type: 'warning'
  194. }).then(() => {
  195. this.rejectData = {
  196. idString: row.parentId,
  197. reason: ''
  198. }
  199. this.rejectDialogVisible = true
  200. });
  201. },
  202. // 批量通过
  203. batchApprove() {
  204. if (this.selectedIds.length === 0) return;
  205. this.$confirm(`确认通过选中的${this.selectedIds.length}条报名申请?`, '提示', {
  206. confirmButtonText: '确定',
  207. cancelButtonText: '取消',
  208. type: 'warning'
  209. }).then(() => {
  210. post('/exam-check/approve', { idString: this.selectedIds.join(',') }).then(res => {
  211. this.$message({
  212. message: '操作成功',
  213. type: 'success'
  214. });
  215. this.getList();
  216. })
  217. });
  218. },
  219. // 批量驳回
  220. batchReject() {
  221. if (this.selectedIds.length === 0) return;
  222. this.$confirm(`确认驳回选中的${this.selectedIds.length}条报名申请?`, '提示', {
  223. confirmButtonText: '确定',
  224. cancelButtonText: '取消',
  225. type: 'warning'
  226. }).then(() => {
  227. this.rejectData = {
  228. idString: this.selectedIds.join(','),
  229. reason: ''
  230. }
  231. this.rejectDialogVisible = true
  232. });
  233. },
  234. // 确定驳回
  235. submitReject() {
  236. post('/exam-check/deny', { ...this.rejectData }).then(res => {
  237. this.$message({
  238. message: '驳回成功',
  239. type: 'success'
  240. });
  241. this.getList()
  242. this.rejectDialogVisible = false
  243. })
  244. }
  245. },
  246. created() {
  247. let height = window.innerHeight;
  248. this.tableHeight = height - 195;
  249. const that = this;
  250. window.onresize = function temp() {
  251. that.tableHeight = window.innerHeight - 195;
  252. };
  253. },
  254. mounted() {
  255. this.getList();
  256. }
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .toolbar {
  261. padding-bottom: 10px;
  262. }
  263. .btns .el-button {
  264. margin-left: 10px;
  265. margin-bottom: 5px;
  266. }
  267. .id-photo {
  268. width: 40px;
  269. height: 40px;
  270. object-fit: cover;
  271. border-radius: 10px;
  272. cursor: pointer;
  273. }
  274. </style>