awaitingAudit.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  1. <template>
  2. <el-container>
  3. <el-main class="el-main-padding">
  4. <commonFormVue :form="form" :get-exam-condition="getExamCondition">
  5. <el-row v-show="showAllCondition">
  6. <el-col :span="6">
  7. <el-form-item label="考试ID">
  8. <el-input
  9. v-model="form.examRecordDataId"
  10. class="form_search_width"
  11. size="small"
  12. placeholder="考试ID"
  13. ></el-input>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="6">
  17. <el-form-item label="需要审核">
  18. <el-select
  19. v-model="form.isWarn"
  20. class="form_search_width"
  21. size="small"
  22. clearable
  23. placeholder="全部"
  24. >
  25. <el-option value="true" label="是"></el-option>
  26. <el-option value="false" label="否"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6">
  31. <el-form-item label="陌生人脸">
  32. <el-select
  33. v-model="form.hasStranger"
  34. class="form_search_width"
  35. size="small"
  36. clearable
  37. placeholder="全部"
  38. >
  39. <el-option value="true" label="有"></el-option>
  40. <el-option value="false" label="无"></el-option>
  41. </el-select>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="6">
  45. <el-form-item label="人脸比对">
  46. <el-input
  47. v-model="form.faceSuccessPercentLower"
  48. class="form_search_width_50"
  49. size="small"
  50. placeholder="下限"
  51. ></el-input>
  52. <span>-</span>
  53. <el-input
  54. v-model="form.faceSuccessPercentUpper"
  55. class="form_search_width_50"
  56. size="small"
  57. placeholder="上限"
  58. ></el-input>
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="6">
  62. <el-form-item label="真实性">
  63. <el-row>
  64. <el-input
  65. v-model="form.livenessSuccessPercentLower"
  66. class="form_search_width_50"
  67. size="small"
  68. placeholder="下限"
  69. ></el-input>
  70. <span>-</span>
  71. <el-input
  72. v-model="form.livenessSuccessPercentUpper"
  73. class="form_search_width_50"
  74. size="small"
  75. placeholder="上限"
  76. ></el-input>
  77. </el-row>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6">
  81. <el-form-item label="虚拟设备">
  82. <el-select
  83. v-model="form.hasVirtual"
  84. class="form_search_width"
  85. size="small"
  86. clearable
  87. placeholder="全部"
  88. >
  89. <el-option value="true" label="有"></el-option>
  90. <el-option value="false" label="无"></el-option>
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="12">
  95. <el-form-item label="开考时间">
  96. <el-date-picker
  97. v-model="startExamDatetimeRange"
  98. class="input"
  99. type="datetimerange"
  100. start-placeholder="开始日期"
  101. range-separator="至"
  102. end-placeholder="结束日期"
  103. value-format="yyyy/MM/dd HH:mm:ss"
  104. :clearable="false"
  105. size="small"
  106. @change="changeStartExamDatetimeRange"
  107. ></el-date-picker>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="12">
  111. <el-form-item label="交卷时间">
  112. <el-date-picker
  113. v-model="endExamDatetimeRange"
  114. class="input"
  115. type="datetimerange"
  116. start-placeholder="开始日期"
  117. range-separator="至"
  118. end-placeholder="结束日期"
  119. value-format="yyyy/MM/dd HH:mm:ss"
  120. :clearable="false"
  121. size="small"
  122. @change="changeEndExamDatetimeRange"
  123. ></el-date-picker>
  124. </el-form-item>
  125. </el-col>
  126. <!-- <el-col :span="6">
  127. <el-form-item label="Ip">
  128. <el-input
  129. v-model="form.ip"
  130. class="form_search_width"
  131. size="small"
  132. placeholder="Ip"
  133. ></el-input>
  134. </el-form-item>
  135. </el-col>-->
  136. </el-row>
  137. </commonFormVue>
  138. <el-col :span="24">
  139. <el-button
  140. size="small"
  141. type="primary"
  142. icon="el-icon-search"
  143. @click="search('clickSelectBtn')"
  144. >查询</el-button
  145. >
  146. <el-button
  147. v-if="!showAllCondition"
  148. size="small"
  149. type="primary"
  150. icon="el-icon-more"
  151. @click="showMoreCondition"
  152. >高级查询</el-button
  153. >
  154. <el-button
  155. v-if="showAllCondition"
  156. size="small"
  157. type="primary"
  158. @click="showSimpleCondition"
  159. >简单查询</el-button
  160. >
  161. <el-button
  162. size="small"
  163. icon="el-icon-refresh"
  164. class="margin-bottom-10"
  165. @click="resetForm"
  166. >重置</el-button
  167. >
  168. </el-col>
  169. <el-row>
  170. <el-col v-show="currentPagePrivileges.PANEING_BATCHAUDIT">
  171. <div class="block-seperator"></div>
  172. <span>操作:</span>
  173. <el-dropdown class="button_left">
  174. <el-button size="small" type="primary">
  175. 批量审核
  176. <i class="el-icon-arrow-down el-icon--right"></i>
  177. </el-button>
  178. <el-dropdown-menu slot="dropdown">
  179. <el-dropdown-item>
  180. <el-button
  181. size="mini"
  182. type="success"
  183. :disabled="batchAuditBtnDisabled"
  184. @click="batchAudit('pass')"
  185. >
  186. <i class="el-icon-success"></i> 通 &nbsp;&nbsp;过
  187. </el-button>
  188. </el-dropdown-item>
  189. <el-dropdown-item>
  190. <el-button
  191. size="mini"
  192. type="danger"
  193. :disabled="batchAuditBtnDisabled"
  194. @click="openBatchAudit()"
  195. >
  196. <i class="el-icon-error"></i> 不通过
  197. </el-button>
  198. </el-dropdown-item>
  199. </el-dropdown-menu>
  200. </el-dropdown>
  201. </el-col>
  202. </el-row>
  203. <el-row class="margin-top-10">
  204. <el-col :span="24">
  205. <el-table
  206. ref="multipleTable"
  207. v-loading="tableLoading"
  208. element-loading-text="数据加载中"
  209. :data="tableData"
  210. border
  211. resizable
  212. stripe
  213. @selection-change="handleSelectionChange"
  214. >
  215. <el-table-column
  216. type="selection"
  217. width="55"
  218. :selectable="selectable"
  219. ></el-table-column>
  220. <el-table-column label="考试ID">
  221. <template slot-scope="scope">
  222. <el-button
  223. v-show="currentPagePrivileges.SNAPSHOT_DETAILS"
  224. type="text"
  225. @click="gotoCaptureDetail(scope.row)"
  226. >{{ scope.row.dataId }}</el-button
  227. >
  228. <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">
  229. {{ scope.row.dataId }}
  230. </span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. sortable
  235. label="姓名"
  236. prop="studentName"
  237. ></el-table-column>
  238. <el-table-column
  239. sortable
  240. label="身份证号"
  241. prop="identityNumber"
  242. width="120"
  243. ></el-table-column>
  244. <el-table-column
  245. sortable
  246. label="学号"
  247. prop="studentCode"
  248. ></el-table-column>
  249. <el-table-column
  250. sortable
  251. label="学习中心"
  252. prop="orgName"
  253. width="120"
  254. ></el-table-column>
  255. <el-table-column
  256. sortable
  257. label="课程"
  258. prop="courseName"
  259. width="150"
  260. ></el-table-column>
  261. <el-table-column
  262. sortable
  263. label="客观题总分"
  264. prop="objectiveTotalScore"
  265. width="120"
  266. ></el-table-column>
  267. <el-table-column
  268. sortable
  269. label="课程层次"
  270. prop="courseLevel"
  271. width="120"
  272. ></el-table-column>
  273. <el-table-column
  274. sortable
  275. label="虚拟设备"
  276. prop="virtualCameraNames"
  277. width="120"
  278. ></el-table-column>
  279. <el-table-column
  280. sortable
  281. label="校验次数"
  282. prop="faceTotalCount"
  283. width="120"
  284. ></el-table-column>
  285. <el-table-column
  286. sortable
  287. label="成功次数"
  288. prop="faceSuccessCount"
  289. width="120"
  290. ></el-table-column>
  291. <el-table-column
  292. sortable
  293. label="陌生人记录"
  294. prop="faceStrangerCount"
  295. width="120"
  296. ></el-table-column>
  297. <el-table-column
  298. sortable
  299. label="人脸识别成功率(%)"
  300. prop="faceSuccessPercent"
  301. width="180"
  302. ></el-table-column>
  303. <el-table-column
  304. sortable
  305. label="开考时间"
  306. prop="paperStartTime"
  307. width="120"
  308. ></el-table-column>
  309. <el-table-column
  310. sortable
  311. label="交卷时间"
  312. prop="paperSubmitTime"
  313. width="120"
  314. ></el-table-column>
  315. <el-table-column
  316. sortable
  317. label="人脸真实性比率(%)"
  318. prop="baiduFaceLivenessSuccessPercent"
  319. width="180"
  320. ></el-table-column>
  321. <el-table-column
  322. sortable
  323. label="Ip"
  324. prop="ip"
  325. width="180"
  326. ></el-table-column>
  327. <el-table-column
  328. v-if="currentPagePrivileges.PENDING_OPERATE"
  329. :context="_self"
  330. label="操作"
  331. fixed="right"
  332. width="120"
  333. >
  334. <div slot-scope="scope">
  335. <el-row
  336. v-if="scope.row.examType != 'OFFLINE'"
  337. class="operateRow"
  338. >
  339. <el-col :span="24">
  340. <el-button
  341. size="mini"
  342. type="primary"
  343. icon="el-icon-view"
  344. @click="examPaperDetail(scope.row)"
  345. >调卷</el-button
  346. >
  347. </el-col>
  348. </el-row>
  349. <el-row v-if="scope.row.isWarn" class="operateRow">
  350. <el-col :span="24">
  351. <el-dropdown>
  352. <el-button
  353. size="mini"
  354. icon="el-icon-arrow-down"
  355. type="primary"
  356. plain
  357. >审核</el-button
  358. >
  359. <el-dropdown-menu slot="dropdown">
  360. <el-dropdown-item>
  361. <el-button
  362. v-if="scope.row.isWarn"
  363. size="mini"
  364. type="success"
  365. icon="el-icon-success"
  366. @click="auditPass(scope.row.dataId, false)"
  367. >通&nbsp;&nbsp;&nbsp;&nbsp;过</el-button
  368. >
  369. </el-dropdown-item>
  370. <el-dropdown-item>
  371. <el-button
  372. v-if="scope.row.isWarn"
  373. size="mini"
  374. type="danger"
  375. icon="el-icon-error"
  376. @click="openAuditDialog(scope.row.dataId, false)"
  377. >不通过</el-button
  378. >
  379. </el-dropdown-item>
  380. </el-dropdown-menu>
  381. </el-dropdown>
  382. </el-col>
  383. </el-row>
  384. </div>
  385. </el-table-column>
  386. </el-table>
  387. <div class="block pull-right">
  388. <el-pagination
  389. :current-page.sync="form.pageNo"
  390. :page-sizes="[10, 20, 50, 100, 200, 300]"
  391. :page-size="form.pageSize"
  392. layout="total, sizes, prev, pager, next, jumper"
  393. :total="total"
  394. @size-change="handleSizeChange"
  395. @current-change="handleCurrentChange"
  396. ></el-pagination>
  397. </div>
  398. </el-col>
  399. </el-row>
  400. <el-dialog
  401. title="审核"
  402. width="400px"
  403. :visible.sync="dialogFormVisible"
  404. @closed="auditDialogClosed"
  405. >
  406. <el-form ref="auditForm" :model="auditForm">
  407. <el-form-item
  408. label="违纪类型"
  409. prop="illegallyTypeId"
  410. :rules="[
  411. { required: true, message: '请选择违纪类型', trigger: 'change' },
  412. ]"
  413. >
  414. <el-select
  415. v-model="auditForm.illegallyTypeId"
  416. filterable
  417. remote
  418. :remote-method="getDisciplineTypeList"
  419. clearable
  420. placeholder="请选择"
  421. size="small"
  422. @clear="getDisciplineTypeList"
  423. >
  424. <el-option
  425. v-for="item in disciplineTypeList"
  426. :key="item.id"
  427. :label="item.name"
  428. :value="item.id"
  429. ></el-option>
  430. </el-select>
  431. </el-form-item>
  432. <el-form-item label="详情描述" style="margin-top: 15px">
  433. <el-input
  434. v-model="auditForm.disciplineDetail"
  435. type="textarea"
  436. :autosize="{ minRows: 3, maxRows: 5 }"
  437. placeholder="请输入内容"
  438. ></el-input>
  439. </el-form-item>
  440. <div class="dialog-footer margin-top-10 text-center">
  441. <el-button type="primary" @click="doAudit">确 定</el-button>
  442. <el-button @click="dialogFormVisible = false">取 消</el-button>
  443. </div>
  444. </el-form>
  445. </el-dialog>
  446. <el-dialog
  447. title="批量审核"
  448. width="400px"
  449. :visible.sync="dialogBatchFormVisible"
  450. @closed="batchAuditDialogClosed"
  451. >
  452. <el-form ref="batchAuditForm" :model="batchAuditForm">
  453. <el-form-item
  454. label="违纪类型"
  455. prop="illegallyTypeId"
  456. :rules="[
  457. { required: true, message: '请选择违纪类型', trigger: 'change' },
  458. ]"
  459. >
  460. <el-select
  461. v-model="batchAuditForm.illegallyTypeId"
  462. filterable
  463. remote
  464. :remote-method="getDisciplineTypeList"
  465. clearable
  466. placeholder="请选择"
  467. size="small"
  468. @clear="getDisciplineTypeList"
  469. >
  470. <el-option
  471. v-for="item in disciplineTypeList"
  472. :key="item.id"
  473. :label="item.name"
  474. :value="item.id"
  475. ></el-option>
  476. </el-select>
  477. </el-form-item>
  478. <el-form-item label="详情描述" style="margin-top: 15px">
  479. <el-input
  480. v-model="batchAuditForm.disciplineDetail"
  481. type="textarea"
  482. :autosize="{ minRows: 3, maxRows: 5 }"
  483. placeholder="请输入内容"
  484. ></el-input>
  485. </el-form-item>
  486. <div class="dialog-footer margin-top-10 text-center">
  487. <el-button type="primary" @click="doBatchAudit">确 定</el-button>
  488. <el-button @click="dialogBatchFormVisible = false">取 消</el-button>
  489. </div>
  490. </el-form>
  491. </el-dialog>
  492. <el-dialog
  493. title="考试记录详情"
  494. width="1250px"
  495. :visible.sync="examRecordDataDialog"
  496. @close="examRecordDataDialogClose"
  497. >
  498. <ExamRecordDetail
  499. :exam-record-data-id="curSelectedExamRecordDataId"
  500. :show-audit-button="curSelectedShowAuditButton"
  501. @changeExamRecordData="changeExamRecordData"
  502. @auditExamRecordData="auditExamRecordData"
  503. ></ExamRecordDetail>
  504. </el-dialog>
  505. </el-main>
  506. </el-container>
  507. </template>
  508. <script>
  509. import { mapState } from "vuex";
  510. import pagePrivilege from "../mixin/pagePrivilege.js";
  511. import commonFormVue from "../component/commonForm.vue";
  512. import _ from "lodash";
  513. export default {
  514. components: { commonFormVue },
  515. mixins: [pagePrivilege],
  516. // beforeRouteEnter(to, from, next) {
  517. // next((vm) => {
  518. // if (from.params?.checkedRows) {
  519. // const unwatch = vm.$watch("tableData", (tableData = []) => {
  520. // tableData.forEach((d) => {
  521. // vm.$refs["multipleTable"]?.toggleRowSelection(
  522. // d,
  523. // from.params.checkedRows.includes(d.dataId)
  524. // );
  525. // });
  526. // if (unwatch) {
  527. // unwatch();
  528. // }
  529. // });
  530. // }
  531. // });
  532. // },
  533. // beforeRouteLeave(to, from, next) {
  534. // to.params.checkedRows = this.routeSelectedIds;
  535. // next();
  536. // },
  537. data() {
  538. return {
  539. curSelectedExamRecordDataId: null,
  540. curSelectedShowAuditButton: false,
  541. examRecordDataDialog: false,
  542. toNext: false,
  543. curTotalPages: 0,
  544. routeSelectedIds: [],
  545. total: 0,
  546. tableLoading: false,
  547. exportLoading: false,
  548. dialogBatchFormVisible: false,
  549. dialogFormVisible: false,
  550. showAllCondition: false,
  551. form: {
  552. examRecordDataId: null,
  553. hasStranger: null,
  554. courseId: null,
  555. courseLevel: null,
  556. examId: null,
  557. examStageId: null,
  558. faceSuccessPercentLower: null,
  559. faceSuccessPercentUpper: null,
  560. livenessSuccessPercentLower: null,
  561. livenessSuccessPercentUpper: null,
  562. identityNumber: null,
  563. orgId: null,
  564. studentCode: null,
  565. studentName: null,
  566. isWarn: null,
  567. pageNo: 1,
  568. pageSize: 10,
  569. ORG_FIND_ALL: false, //查询所有机构
  570. hasVirtual: null,
  571. startTime: null, //开考时间起
  572. endTime: null, //开考时间止
  573. submitStartTime: null, //交卷时间起
  574. submitEndTime: null, //交卷时间止
  575. ip: null, //Ip
  576. },
  577. auditForm: {
  578. examRecordDataId: null,
  579. illegallyTypeId: null,
  580. disciplineDetail: "",
  581. isPass: null,
  582. },
  583. batchAuditForm: {
  584. examRecordDataIds: null,
  585. illegallyTypeId: null,
  586. disciplineDetail: "",
  587. isPass: null,
  588. },
  589. getExamCondition: {
  590. params: {
  591. name: "",
  592. examTypes: "ONLINE#ONLINE_HOMEWORK",
  593. propertyKeys: "IS_FACE_ENABLE",
  594. },
  595. filterCondition: "IS_FACE_ENABLE",
  596. },
  597. tableData: [],
  598. multipleSelection: [],
  599. batchAuditBtnDisabled: true,
  600. currentPagePrivileges: {
  601. PANEING_BATCHAUDIT: false,
  602. PENDING_OPERATE: false,
  603. SNAPSHOT_DETAILS: false,
  604. },
  605. disciplineTypeList: [],
  606. startExamDatetimeRange: [],
  607. endExamDatetimeRange: [],
  608. };
  609. },
  610. computed: {
  611. ...mapState({ user: (state) => state.user }),
  612. },
  613. watch: {
  614. multipleSelection: function () {
  615. this.batchAuditBtnDisabled = !(this.multipleSelection.length > 0);
  616. },
  617. },
  618. created() {
  619. // this.backFill();
  620. this.getDisciplineTypeList("");
  621. },
  622. methods: {
  623. getDisciplineTypeList(name) {
  624. if (!name) {
  625. name = "";
  626. }
  627. this.$http
  628. .get("/api/ecs_oe_admin/illegallyType/queryByNameLike", {
  629. params: { name, queryScope: "audit" },
  630. })
  631. .then((response) => {
  632. this.disciplineTypeList = response.data;
  633. });
  634. },
  635. resetForm() {
  636. this.form = {
  637. examRecordDataId: null,
  638. hasStranger: null,
  639. courseId: null,
  640. courseLevel: null,
  641. examId: null,
  642. examStageId: null,
  643. faceSuccessPercentLower: null,
  644. faceSuccessPercentUpper: null,
  645. livenessSuccessPercentLower: null,
  646. livenessSuccessPercentUpper: null,
  647. identityNumber: null,
  648. orgId: this.form.ORG_FIND_ALL ? null : this.form.orgId,
  649. studentCode: null,
  650. studentName: null,
  651. isWarn: null,
  652. pageNo: 1,
  653. pageSize: 10,
  654. ORG_FIND_ALL: this.form.ORG_FIND_ALL,
  655. startTime: null, //开考时间起
  656. endTime: null, //开考时间止
  657. submitStartTime: null, //交卷时间起
  658. submitEndTime: null, //交卷时间止
  659. };
  660. this.startExamDatetimeRange = [];
  661. this.endExamDatetimeRange = [];
  662. },
  663. showMoreCondition() {
  664. this.showAllCondition = true;
  665. },
  666. showSimpleCondition() {
  667. this.$notify({
  668. title: "提示",
  669. message: "高级查询条件值已重置",
  670. type: "info",
  671. duration: 2000,
  672. });
  673. this.resetForm();
  674. this.showAllCondition = false;
  675. },
  676. search(type) {
  677. if (!this.form.examId) {
  678. this.$notify({
  679. title: "警告",
  680. message: "请选择考试",
  681. type: "warning",
  682. duration: 2000,
  683. });
  684. return false;
  685. }
  686. if (type && type == "clickSelectBtn") {
  687. this.form.pageNo = 1;
  688. }
  689. this.tableLoading = true;
  690. var params = JSON.parse(JSON.stringify(this.form));
  691. this.$http
  692. .post("/api/ecs_oe_admin/exam/record/waiting/audit/list", params)
  693. .then((response) => {
  694. if (response.data) {
  695. this.tableData = response.data.content;
  696. this.total = response.data.totalElements;
  697. this.form.pageNo = response.data.number + 1;
  698. this.curTotalPages = response.data.totalPages;
  699. } else {
  700. this.tableData = [];
  701. }
  702. this.tableLoading = false;
  703. // this.$router.push({
  704. // path: "/oe/awaitingAudit?" + new URLSearchParams(params),
  705. // });
  706. });
  707. },
  708. formatVirtualCameraName(row) {
  709. if (row.virtualCameraNames === "") {
  710. return ";";
  711. } else {
  712. return row.virtualCameraNames;
  713. }
  714. },
  715. selectable(row) {
  716. return row.isWarn;
  717. },
  718. handleSelectionChange(val) {
  719. this.multipleSelection = val;
  720. },
  721. /**
  722. * pagesize改变时触发
  723. */
  724. handleSizeChange(val) {
  725. this.form.pageSize = val;
  726. this.search();
  727. },
  728. /**
  729. * 当前页改变时触发
  730. */
  731. handleCurrentChange(val) {
  732. this.form.pageNo = val;
  733. this.search();
  734. },
  735. batchAudit(operate) {
  736. var isPass = operate == "pass" ? true : false;
  737. this.$confirm("确定执行?", "提示", {
  738. confirmButtonText: "确定",
  739. cancelButtonText: "取消",
  740. type: "warning",
  741. })
  742. .then(() => {
  743. var examRecordDataIds = [];
  744. for (var i = 0; i < this.multipleSelection.length; i++) {
  745. examRecordDataIds.push(this.multipleSelection[i].dataId);
  746. }
  747. var param = new URLSearchParams({
  748. examRecordDataIds: examRecordDataIds,
  749. isPass: isPass,
  750. });
  751. this.$http
  752. .post("/api/ecs_oe_admin/exam/audit/batch/audit", param)
  753. .then(() => {
  754. this.$notify({
  755. title: "成功",
  756. message: "操作成功",
  757. type: "success",
  758. duration: 5000,
  759. });
  760. // this.search();
  761. });
  762. })
  763. .catch(() => {});
  764. },
  765. openAuditDialog(examRecordDataId, toNext) {
  766. this.toNext = toNext;
  767. this.dialogFormVisible = true;
  768. this.auditForm = {
  769. examRecordDataId: examRecordDataId,
  770. illegallyTypeId: null,
  771. disciplineDetail: "",
  772. isPass: false,
  773. };
  774. },
  775. examPaperDetail(row) {
  776. window.open(
  777. "/admin/oe/examPaperDetail/" + row.courseId + "/" + row.dataId
  778. );
  779. },
  780. openBatchAudit() {
  781. this.dialogBatchFormVisible = true;
  782. var examRecordDataIds = [];
  783. for (var i = 0; i < this.multipleSelection.length; i++) {
  784. examRecordDataIds.push(this.multipleSelection[i].dataId);
  785. }
  786. this.batchAuditForm = {
  787. examRecordDataIds: examRecordDataIds,
  788. illegallyTypeId: null,
  789. disciplineDetail: "",
  790. isPass: false,
  791. };
  792. },
  793. doAudit() {
  794. this.$refs["auditForm"].validate((valid) => {
  795. if (valid) {
  796. var param = new URLSearchParams(this.auditForm);
  797. this.$http
  798. .post("/api/ecs_oe_admin/exam/audit/single/audit", param)
  799. .then(() => {
  800. this.$notify({
  801. title: "成功",
  802. message: "操作成功",
  803. type: "success",
  804. duration: 5000,
  805. });
  806. this.dialogFormVisible = false;
  807. // this.search();
  808. if (this.toNext) {
  809. this.changeExamRecordData(true);
  810. }
  811. });
  812. } else {
  813. return false;
  814. }
  815. });
  816. },
  817. doBatchAudit() {
  818. this.$refs["batchAuditForm"].validate((valid) => {
  819. if (valid) {
  820. this.$confirm("确定执行?", "提示", {
  821. confirmButtonText: "确定",
  822. cancelButtonText: "取消",
  823. type: "warning",
  824. }).then(() => {
  825. var param = new URLSearchParams(this.batchAuditForm);
  826. this.$http
  827. .post("/api/ecs_oe_admin/exam/audit/batch/audit", param)
  828. .then(() => {
  829. this.$notify({
  830. title: "成功",
  831. message: "操作成功",
  832. type: "success",
  833. duration: 5000,
  834. });
  835. this.dialogBatchFormVisible = false;
  836. // this.search();
  837. });
  838. });
  839. } else {
  840. return false;
  841. }
  842. });
  843. },
  844. auditDialogClosed() {
  845. this.$refs["auditForm"].resetFields();
  846. },
  847. batchAuditDialogClosed() {
  848. this.$refs["batchAuditForm"].resetFields();
  849. },
  850. /**
  851. * 审核通过
  852. */
  853. auditPass(examRecordDataId, toNext) {
  854. var auditParams = {
  855. examRecordDataId: examRecordDataId,
  856. isPass: true,
  857. };
  858. var param = new URLSearchParams(auditParams);
  859. this.$http
  860. .post("/api/ecs_oe_admin/exam/audit/single/audit", param)
  861. .then(() => {
  862. this.$notify({
  863. title: "成功",
  864. message: "操作成功",
  865. type: "success",
  866. duration: 5000,
  867. });
  868. // this.search();
  869. if (toNext) {
  870. this.changeExamRecordData(true);
  871. }
  872. });
  873. },
  874. curSelectedRow(examRecordDataId) {
  875. for (let n = 0; n < this.tableData.length; n++) {
  876. let row = this.tableData[n];
  877. if (examRecordDataId === row.dataId) {
  878. this.$refs["multipleTable"]?.toggleRowSelection(row, true);
  879. } else {
  880. this.$refs["multipleTable"]?.toggleRowSelection(row, false);
  881. }
  882. }
  883. },
  884. examRecordDataDialogClose() {
  885. this.examRecordDataDialog = false;
  886. },
  887. examRecordDataDialogOpen(examRecordDataId, showAuditButton) {
  888. this.examRecordDataDialog = true;
  889. this.curSelectedShowAuditButton = showAuditButton;
  890. this.curSelectedExamRecordDataId = examRecordDataId;
  891. this.curSelectedRow(examRecordDataId);
  892. },
  893. changeExamRecordData(isNext) {
  894. // console.log("isNext:" + isNext);
  895. let curId = null;
  896. let isFirst = false;
  897. let isLast = false;
  898. let rowSize = this.tableData.length;
  899. for (let n = 0; n < rowSize; n++) {
  900. isFirst = n === 0;
  901. isLast = n === rowSize - 1;
  902. let row = this.tableData[n];
  903. if (this.curSelectedExamRecordDataId === row.dataId) {
  904. curId = row.dataId;
  905. if (isNext) {
  906. if (!isLast) {
  907. curId = this.tableData[n + 1].dataId;
  908. } else {
  909. // if (this.form.pageNo < this.curTotalPages) {
  910. // // 跳到下一页
  911. // curId = null;
  912. // this.handleCurrentChange(this.form.pageNo + 1);
  913. // }
  914. this.$message({
  915. message: "当前数据为最后一条!",
  916. type: "warning",
  917. showClose: true,
  918. });
  919. }
  920. } else {
  921. if (!isFirst) {
  922. curId = this.tableData[n - 1].dataId;
  923. } else {
  924. // if (this.form.pageNo > 1) {
  925. // // 跳到上一页
  926. // curId = null;
  927. // this.handleCurrentChange(this.form.pageNo - 1);
  928. // }
  929. this.$message({
  930. message: "当前数据为第一条!",
  931. type: "warning",
  932. showClose: true,
  933. });
  934. }
  935. }
  936. break;
  937. }
  938. }
  939. if (curId) {
  940. this.curSelectedExamRecordDataId = curId;
  941. this.curSelectedRow(curId);
  942. } else {
  943. this.examRecordDataDialogClose();
  944. }
  945. },
  946. auditExamRecordData(isPass) {
  947. console.log("isPass:" + isPass);
  948. if (isPass) {
  949. this.auditPass(this.curSelectedExamRecordDataId, true);
  950. } else {
  951. this.openAuditDialog(this.curSelectedExamRecordDataId, true);
  952. }
  953. },
  954. gotoCaptureDetail(row) {
  955. if (!this.form.examId) {
  956. this.$notify({
  957. title: "警告",
  958. message: "请选择考试",
  959. type: "warning",
  960. duration: 2000,
  961. });
  962. return false;
  963. }
  964. let pendingOperate = this.currentPagePrivileges.PENDING_OPERATE;
  965. this.examRecordDataDialogOpen(row.dataId, pendingOperate);
  966. // this.routeSelectedIds = [];
  967. // this.routeSelectedIds.push(row.dataId);
  968. // this.$refs["multipleTable"]?.toggleRowSelection(row, true);
  969. // let searchParam = JSON.stringify(this.form);
  970. // this.$nextTick(() => {
  971. // /** checkbox UI选中状态延迟 */
  972. // setTimeout(() => {
  973. // this.$router.push({
  974. // path: "/oe/captureDetail/" + row.dataId + "/awaitingAudit",
  975. // query: { pendingOperate, searchParam },
  976. // });
  977. // }, 200);
  978. // });
  979. },
  980. backFill() {
  981. var formData = this.$route.query;
  982. if (formData && formData.examId) {
  983. for (var attr in formData) {
  984. var value = formData[attr];
  985. if (value && value != "null") {
  986. //是数字 且 长度小于15
  987. if (!isNaN(value) && value.toString().length < 15) {
  988. value = _.toNumber(value);
  989. }
  990. this.form[attr] = value;
  991. }
  992. }
  993. this.search();
  994. }
  995. },
  996. changeStartExamDatetimeRange(e) {
  997. if (e && e.length > 0) {
  998. this.form.startTime = e[0];
  999. this.form.endTime = e[1];
  1000. } else {
  1001. this.form.startTime = "";
  1002. this.form.endTime = "";
  1003. }
  1004. },
  1005. changeEndExamDatetimeRange(e) {
  1006. if (e && e.length > 0) {
  1007. this.form.submitStartTime = e[0];
  1008. this.form.submitEndTime = e[1];
  1009. } else {
  1010. this.form.submitStartTime = "";
  1011. this.form.submitEndTime = "";
  1012. }
  1013. },
  1014. },
  1015. };
  1016. </script>
  1017. <style scoped src="../style/common.css"></style>