CreateTaskApply.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. <template>
  2. <el-dialog
  3. class="create-task-apply"
  4. :visible.sync="modalIsShow"
  5. title="新增命题申请"
  6. top="10px"
  7. width="1000px"
  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">
  14. <el-form
  15. ref="examTaskComp"
  16. :model="examTask"
  17. :rules="rules"
  18. label-width="120px"
  19. >
  20. <el-row>
  21. <el-col :span="12">
  22. <el-form-item prop="teachingRoomId" label="教研室:">
  23. <teaching-room-select
  24. v-model="examTask.teachingRoomId"
  25. @change="clearCard"
  26. ></teaching-room-select>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="12">
  30. <el-form-item prop="courseCode" label="课程(代码):">
  31. <course-select
  32. v-model="examTask.courseCode"
  33. @change="courseChange"
  34. ></course-select>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. <el-row>
  39. <el-col :span="12">
  40. <el-form-item prop="cardRuleId" label="题卡规则:">
  41. <card-rule-select
  42. ref="CardRuleSelect"
  43. v-model.trim="examTask.cardRuleId"
  44. placeholder="请选择"
  45. clearable
  46. @change="clearCard"
  47. ></card-rule-select>
  48. <p class="tips-info">
  49. 说明:若选择全部通卡,则命题老师只能选择通卡,若选择题卡规则,则专卡和通卡均可选择
  50. </p>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="12">
  54. <el-form-item label="试卷编号:">
  55. <el-input
  56. v-model.trim="examTask.paperNumber"
  57. placeholder="请输入试卷编号"
  58. clearable
  59. ></el-input>
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="12">
  65. <el-form-item label="拟卷教师:">
  66. <el-input
  67. v-model.trim="examTask.teacherName"
  68. placeholder="请输入拟卷教师"
  69. clearable
  70. ></el-input>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="12">
  74. <el-form-item label="主讲教师:">
  75. <el-input
  76. v-model.trim="examTask.lecturerName"
  77. placeholder="请输入主讲教师"
  78. clearable
  79. ></el-input>
  80. </el-form-item>
  81. </el-col>
  82. </el-row>
  83. </el-form>
  84. </div>
  85. <div class="mb-4" v-if="flows.length">
  86. <el-steps align-center>
  87. <el-step
  88. v-for="flow in flows"
  89. :key="flow.taskKey"
  90. :title="flow.taskName"
  91. :status="flow.status"
  92. >
  93. <div slot="description">
  94. <p class="step-desc">{{ flow.desc }}</p>
  95. <div class="step-info" v-if="flow.firstUser">
  96. <span>{{ flow.firstUser }}</span>
  97. <el-popover
  98. v-if="flow.moreUser"
  99. placement="top-start"
  100. width="300"
  101. trigger="hover"
  102. :content="flow.moreUser"
  103. >
  104. <span slot="reference">更多</span>
  105. </el-popover>
  106. </div>
  107. </div>
  108. </el-step>
  109. </el-steps>
  110. </div>
  111. <div
  112. class="part-box part-box-pad part-box-border apply-content task-detail"
  113. v-if="modalIsShow"
  114. >
  115. <p class="tips-info tips-dark mb-2">
  116. 提示:多卷型试卷由于会绑定一个答题卡模板,因此试卷结构必须相同。多卷型试卷之间客观题要求试题内容相同,可允许大题内的小题题序不同。
  117. </p>
  118. <div class="task-body">
  119. <div class="mb-2 text-right">
  120. <el-button
  121. type="primary"
  122. icon="el-icon-circle-plus-outline"
  123. @click="addAtachment"
  124. >增加卷型</el-button
  125. >
  126. </div>
  127. <table class="table">
  128. <tr>
  129. <th>试卷类型</th>
  130. <th>试卷文件</th>
  131. <th>答题卡创建方式</th>
  132. <th>答题卡</th>
  133. <th>操作</th>
  134. </tr>
  135. <tr v-for="(attachment, index) in paperAttachments" :key="index">
  136. <td>{{ attachment.name }}卷</td>
  137. <td class="td-link">
  138. <span @click="toUpload(attachment)" title="点击上传试卷">
  139. <i
  140. :class="[
  141. 'icon',
  142. attachment.attachmentId ? 'icon-files-act' : 'icon-files'
  143. ]"
  144. ></i
  145. >{{
  146. attachment.attachmentId
  147. ? attachment.filename
  148. : "点击上传试卷文件"
  149. }}
  150. </span>
  151. </td>
  152. <td :rowspan="paperAttachments.length" v-if="index === 0">
  153. {{ createCardTypeName }}
  154. </td>
  155. <td
  156. class="td-link"
  157. :rowspan="paperAttachments.length"
  158. v-if="index === 0"
  159. >
  160. <span @click="toCreateOrViewCard"
  161. ><i class="icon icon-plus-act"></i>{{ cardTodoName }}</span
  162. >
  163. <el-button
  164. v-if="examTaskDetail.makeMethod"
  165. size="mini"
  166. type="primary"
  167. @click="changeCreateCardType"
  168. >切换题卡创建方式</el-button
  169. >
  170. </td>
  171. <td>
  172. <el-button
  173. class="btn-primary"
  174. type="text"
  175. icon="icon icon-delete"
  176. title="删除"
  177. @click="deleteAttachment(index)"
  178. ></el-button>
  179. </td>
  180. </tr>
  181. </table>
  182. <el-form>
  183. <el-form-item label="单次抽卷卷型数量:" label-width="150">
  184. <el-input-number
  185. v-model="examTaskDetail.drawCount"
  186. :min="1"
  187. :max="maxFetchCount"
  188. :step="1"
  189. step-strictly
  190. :controls="false"
  191. ></el-input-number>
  192. </el-form-item>
  193. </el-form>
  194. <h4 class="mb-2">备注说明:</h4>
  195. <el-input
  196. class="mb-2"
  197. v-model="examTaskDetail.remark"
  198. type="textarea"
  199. resize="none"
  200. :rows="2"
  201. :maxlength="100"
  202. clearable
  203. show-word-limit
  204. placeholder="建议不超过100个字"
  205. ></el-input>
  206. <h4 class="mb-2">上传入库审核表(最多4张)</h4>
  207. <div class="image-list">
  208. <div
  209. class="image-item"
  210. v-for="(img, index) in paperConfirmAttachments"
  211. :key="index"
  212. >
  213. <img
  214. :src="img.url"
  215. :alt="img.filename"
  216. title="点击查看大图"
  217. @click="toPreview(index)"
  218. />
  219. <div class="image-delete">
  220. <i
  221. class="el-icon-delete-solid"
  222. @click="deletePaperConfirmAttachment(index)"
  223. ></i>
  224. </div>
  225. </div>
  226. <div
  227. v-if="paperConfirmAttachments.length < 4"
  228. class="image-item image-add"
  229. title="上传入库审核表"
  230. @click="toUploadPaperConfirm"
  231. >
  232. <i class="el-icon-plus"></i>
  233. </div>
  234. </div>
  235. </div>
  236. <div class="task-action">
  237. <el-button type="primary" :disabled="isSubmit" @click="submit"
  238. >确认提交</el-button
  239. >
  240. <el-button
  241. type="primary"
  242. :disabled="isSubmit"
  243. style="width:88px;"
  244. @click="toSave"
  245. >暂存</el-button
  246. >
  247. <el-button @click="cancel">取消</el-button>
  248. </div>
  249. </div>
  250. <div slot="footer"></div>
  251. <!-- upload-paper-dialog -->
  252. <upload-paper-dialog
  253. :paper-attachment="curAttachment"
  254. :upload-type="curUploadType"
  255. @confirm="uploadConfirm"
  256. ref="UploadPaperDialog"
  257. ></upload-paper-dialog>
  258. <!-- card-option-dialog -->
  259. <card-option-dialog
  260. ref="CardOptionDialog"
  261. :data="task"
  262. @upload-sample-over="initData"
  263. @confirm="cardConfirm"
  264. ></card-option-dialog>
  265. <!-- image-preview -->
  266. <simple-image-preview
  267. :cur-image="curImage"
  268. @on-prev="toPrevImage"
  269. @on-next="toNextImage"
  270. ref="SimpleImagePreview"
  271. ></simple-image-preview>
  272. </el-dialog>
  273. </template>
  274. <script>
  275. import { examRuleDetail } from "../../base/api";
  276. import {
  277. teacherCreateTaskApply,
  278. teacherCancelTaskApply,
  279. switchCardCreateMethod,
  280. taskAllApproverPeople
  281. } from "../api";
  282. import UploadPaperDialog from "./UploadPaperDialog";
  283. import CardOptionDialog from "./CardOptionDialog";
  284. import SimpleImagePreview from "@/components/SimpleImagePreview";
  285. import { CARD_SOURCE_TYPE } from "@/constants/enumerate";
  286. const initExamTask = {
  287. id: null,
  288. courseCode: "",
  289. courseName: "",
  290. paperNumber: "",
  291. cardRuleId: "",
  292. teachingRoomId: "",
  293. teacherName: "",
  294. lecturerName: ""
  295. };
  296. const initExamTaskDetail = {
  297. operateType: "STAGE",
  298. paperType: "A",
  299. cardId: "",
  300. paperAttachmentIds: [],
  301. paperConfirmAttachmentIds: [],
  302. drawCount: 2,
  303. remark: "",
  304. makeMethod: "",
  305. // 题卡状态
  306. status: "",
  307. // 考务规则
  308. review: false,
  309. includePaper: false,
  310. customCard: false
  311. };
  312. export default {
  313. name: "create-task-apply",
  314. components: { UploadPaperDialog, CardOptionDialog, SimpleImagePreview },
  315. data() {
  316. return {
  317. modalIsShow: false,
  318. isSubmit: false,
  319. examTask: {},
  320. needReview: false,
  321. task: {},
  322. examRule: {},
  323. flows: [
  324. {
  325. flowId: "160684605807001600",
  326. taskName: "提交试卷(命题老师)",
  327. taskKey: "usertask1",
  328. setup: 1,
  329. status: "process",
  330. desc: "进行中"
  331. },
  332. {
  333. flowId: "160684605807001600",
  334. taskName: "审核试卷(教研室主任)",
  335. taskKey: "usertask2",
  336. setup: 2,
  337. status: "wait",
  338. desc: "待进行"
  339. },
  340. {
  341. flowId: "160684605807001600",
  342. taskName: "审核试卷(教学院长)",
  343. taskKey: "usertask3",
  344. setup: 3,
  345. status: "wait",
  346. desc: "待进行"
  347. }
  348. ],
  349. rules: {
  350. teachingRoomId: [
  351. {
  352. required: true,
  353. message: "请选择教研室",
  354. trigger: "change"
  355. }
  356. ],
  357. courseCode: [
  358. {
  359. required: true,
  360. message: "请选择课程",
  361. trigger: "change"
  362. }
  363. ],
  364. cardRuleId: [
  365. {
  366. required: true,
  367. message: "请选择题卡规则",
  368. trigger: "change"
  369. }
  370. ]
  371. },
  372. // exam-task-detail
  373. examTaskDetail: {},
  374. paperConfirmAttachmentId: { attachmentId: "", filename: "", url: "" },
  375. paperAttachments: [],
  376. paperConfirmAttachments: [],
  377. curAttachment: {},
  378. curUploadType: "paper",
  379. attachmentLimitCount: 26,
  380. abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
  381. // image-preview
  382. curImage: {},
  383. curImageIndex: 0
  384. };
  385. },
  386. computed: {
  387. cardTodoName() {
  388. let name = "创建答题卡";
  389. if (this.examTaskDetail.cardId) {
  390. if (this.examTaskDetail.makeMethod === "SELECT") {
  391. name = "选择题卡";
  392. } else if (this.examTaskDetail.makeMethod === "SELF") {
  393. name = "编辑题卡";
  394. } else {
  395. // 已经审核的题卡可以自行编辑,未审核的题卡只能查看
  396. name =
  397. this.examTaskDetail.status === "SUBMIT" ? "编辑题卡" : "查看题卡";
  398. }
  399. }
  400. return name;
  401. },
  402. createCardTypeName() {
  403. return CARD_SOURCE_TYPE[this.examTaskDetail.makeMethod] || "";
  404. },
  405. maxFetchCount() {
  406. return this.paperAttachments.length < 1
  407. ? 1
  408. : this.paperAttachments.length;
  409. }
  410. },
  411. created() {
  412. this.getExamRule();
  413. },
  414. methods: {
  415. async getExamRule() {
  416. const examRule = await examRuleDetail();
  417. this.examRule = examRule || {};
  418. this.needReview = examRule && examRule.review;
  419. },
  420. initData() {
  421. this.examTask = { ...initExamTask };
  422. this.examTaskDetail = { ...initExamTaskDetail };
  423. this.examTaskDetail.includePaper = this.examRule.includePaper;
  424. this.examTaskDetail.review = this.examRule.review;
  425. this.examTaskDetail.customCard = this.examRule.customCard;
  426. },
  427. visibleChange() {
  428. this.initData();
  429. },
  430. checkData() {
  431. return this.$refs.examTaskComp.validate().catch(() => {});
  432. },
  433. async cancel() {
  434. if (this.examTask.id) {
  435. await teacherCancelTaskApply(this.examTask.id);
  436. this.$message.success("取消命题申请成功!");
  437. }
  438. this.close();
  439. },
  440. close() {
  441. this.modalIsShow = false;
  442. },
  443. open() {
  444. this.modalIsShow = true;
  445. },
  446. // exam-task-detail edit
  447. addAtachment() {
  448. if (this.paperAttachments.length >= this.attachmentLimitCount) return;
  449. const newAttachment = {
  450. name: this.abc[this.paperAttachments.length],
  451. attachmentId: "",
  452. filename: "",
  453. pages: 0
  454. };
  455. this.paperAttachments.push(newAttachment);
  456. },
  457. deleteAttachment(index) {
  458. if (this.paperAttachments.length <= 1) {
  459. this.$message.error("试卷类型数量不得少于1");
  460. return;
  461. }
  462. this.paperAttachments.splice(index, 1);
  463. this.paperAttachments.forEach((item, itemIndex) => {
  464. item.name = this.abc[itemIndex];
  465. });
  466. },
  467. toUpload(attachment) {
  468. this.curUploadType = "paper";
  469. this.curAttachment = {
  470. ...attachment
  471. };
  472. this.$refs.UploadPaperDialog.open();
  473. },
  474. toUploadPaperConfirm() {
  475. if (this.paperConfirmAttachments.length >= 4) return;
  476. this.curUploadType = "paperConfirm";
  477. this.curAttachment = {
  478. ...this.paperConfirmAttachmentId
  479. };
  480. this.$refs.UploadPaperDialog.open();
  481. },
  482. uploadConfirm(attachment, uploadType) {
  483. if (uploadType === "paper") {
  484. const index = this.paperAttachments.findIndex(
  485. item => item.name === attachment.name
  486. );
  487. this.paperAttachments.splice(index, 1, { ...attachment });
  488. } else {
  489. this.paperConfirmAttachments.push(attachment);
  490. }
  491. },
  492. deletePaperConfirmAttachment(index) {
  493. this.paperConfirmAttachments.splice(index, 1);
  494. },
  495. toViewCard() {
  496. window.open(
  497. this.getRouterPath({
  498. name: "CardPreview",
  499. params: {
  500. cardId: this.examTaskDetail.cardId,
  501. viewType: "view"
  502. }
  503. })
  504. );
  505. },
  506. toEditCard() {
  507. this.cachePrepareTcpCard();
  508. this.$router.push({
  509. name: "CardDesign",
  510. params: {
  511. cardId: this.examTaskDetail.cardId
  512. }
  513. });
  514. },
  515. cachePrepareTcpCard() {
  516. this.$ls.set("prepareTcPCard", {
  517. examTaskId: this.examTask.id,
  518. courseCode: this.examTask.courseCode,
  519. courseName: this.examTask.courseName,
  520. makeMethod: this.examTaskDetail.makeMethod,
  521. cardRuleId: this.examTask.cardRuleId,
  522. paperType: this.paperAttachments.map(item => item.name).join(",")
  523. });
  524. },
  525. async toCreateOrViewCard() {
  526. const result = await this.toSave(1);
  527. if (!result) return;
  528. this.task = {
  529. ...this.examTask,
  530. ...this.examTaskDetail,
  531. examTaskId: this.examTask.id
  532. };
  533. if (!this.examTaskDetail.cardId) {
  534. this.$refs.CardOptionDialog.open();
  535. return;
  536. }
  537. if (this.examTaskDetail.makeMethod === "SELECT") {
  538. this.$refs.CardOptionDialog.open();
  539. } else if (this.examTaskDetail.makeMethod === "SELF") {
  540. this.toEditCard();
  541. } else {
  542. // 客服制卡:制作完毕则可以编辑,未制作完毕则可以查看
  543. if (this.examTaskDetail.status === "SUBMIT") {
  544. this.toEditCard();
  545. } else {
  546. this.toViewCard();
  547. }
  548. }
  549. },
  550. cardConfirm(data) {
  551. this.examTaskDetail = this.$objAssign(this.examTaskDetail, data);
  552. },
  553. async changeCreateCardType() {
  554. const h = this.$createElement;
  555. const result = await this.$msgbox({
  556. title: "切换题卡操作说明",
  557. message: h("div", null, [
  558. h("p", null, "1、切换题卡会将之前选择题卡数据删除。"),
  559. h(
  560. "p",
  561. null,
  562. "2、之前选择专卡进行绘制,切换题卡后再次选择专卡,需要重新开始绘制。"
  563. )
  564. ]),
  565. showCancelButton: true,
  566. cancelButtonClass: "el-button--danger is-plain",
  567. confirmButtonClass: "el-button--primary",
  568. type: "warning"
  569. }).catch(() => {});
  570. if (result !== "confirm") return;
  571. await this.clearMakeMethod();
  572. this.toCreateOrViewCard();
  573. },
  574. async clearMakeMethod() {
  575. // 清除后台记录的题卡
  576. if (this.examTask.id && this.examTaskDetail.cardId)
  577. await switchCardCreateMethod(this.examTask.id);
  578. this.examTaskDetail.makeMethod = "";
  579. this.examTaskDetail.cardId = "";
  580. },
  581. courseChange(val) {
  582. this.examTask.courseName = val.name;
  583. this.clearCard();
  584. this.updateApproverPeople();
  585. },
  586. clearCard() {
  587. this.clearMakeMethod();
  588. },
  589. async updateApproverPeople() {
  590. const data = await taskAllApproverPeople({
  591. courseCode: this.examTask.courseCode
  592. });
  593. let approvePeople = {};
  594. data.approveUserList.forEach(item => {
  595. item.users = item.approveUser.map(
  596. user => `${user.realName}(${user.orgName})`
  597. );
  598. item.firstUser = item.users[0];
  599. item.moreUser = item.users.length > 1 ? item.users.join(",") : null;
  600. approvePeople[item.setup] = item;
  601. });
  602. this.flows = this.flows.map(flow => {
  603. return {
  604. ...flow,
  605. ...approvePeople[flow.setup]
  606. };
  607. });
  608. },
  609. getTaskDetailData() {
  610. let data = { ...this.examTaskDetail };
  611. data.paperType = this.paperAttachments.map(item => item.name).join(",");
  612. data.paperAttachmentIds = JSON.stringify(this.paperAttachments, (k, v) =>
  613. k === "url" ? undefined : v
  614. );
  615. data.paperConfirmAttachmentIds = JSON.stringify(
  616. this.paperConfirmAttachments
  617. );
  618. this.examTaskDetail = data;
  619. },
  620. checkDataValid() {
  621. const attachmentValid = !this.paperAttachments.some(
  622. item => !item.attachmentId
  623. );
  624. // 设置了入库强制包含试卷时,校验试卷是否上传。
  625. if (this.examTaskDetail.includePaper && !attachmentValid) {
  626. this.$message.error("请完成试卷文件上传!");
  627. return;
  628. }
  629. // if (!this.paperConfirmAttachments.length) {
  630. // this.$message.error("请上传入库审核表!");
  631. // return;
  632. // }
  633. if (!this.examTaskDetail.cardId) {
  634. this.$message.error("请选择题卡创建方式!");
  635. return;
  636. }
  637. if (
  638. this.examTaskDetail.makeMethod !== "SELECT" &&
  639. this.examTaskDetail.status !== "SUBMIT"
  640. ) {
  641. this.$message.error("请先提交题卡!");
  642. return;
  643. }
  644. return true;
  645. },
  646. async toSave(silent) {
  647. const valid = await this.$refs.examTaskComp.validate().catch(() => {});
  648. if (!valid) return;
  649. if (this.isSubmit) return;
  650. this.isSubmit = true;
  651. this.getTaskDetailData();
  652. const datas = {
  653. examTaskDetail: this.examTaskDetail,
  654. examTask: this.examTask
  655. };
  656. const data = await teacherCreateTaskApply(datas).catch(() => {});
  657. this.isSubmit = false;
  658. if (!data) return;
  659. this.examTask.id = data;
  660. if (!silent) this.$message.success("保存成功!");
  661. return true;
  662. },
  663. async submit() {
  664. const valid = await this.$refs.examTaskComp.validate().catch(() => {});
  665. if (!valid) return;
  666. if (!this.checkDataValid()) return;
  667. this.$confirm(
  668. "任务确定提交后,则不可更改试卷及答题卡内容,确定提交该任务?",
  669. "提示",
  670. {
  671. cancelButtonClass: "el-button--danger is-plain",
  672. confirmButtonClass: "el-button--primary",
  673. type: "warning"
  674. }
  675. )
  676. .then(async () => {
  677. this.getTaskDetailData();
  678. this.examTaskDetail.operateType = "SUBMIT";
  679. const datas = {
  680. examTaskDetail: this.examTaskDetail,
  681. examTask: this.examTask
  682. };
  683. const data = await teacherCreateTaskApply(datas).catch(() => {});
  684. if (!data) return;
  685. this.$message.success("提交成功!");
  686. this.close();
  687. this.$emit("modified");
  688. })
  689. .catch(() => {});
  690. },
  691. // image-preview
  692. toPreview(index) {
  693. this.curImageIndex = index;
  694. this.selectImage(index);
  695. this.$refs.SimpleImagePreview.open();
  696. },
  697. selectImage(index) {
  698. this.curImage = this.paperConfirmAttachments[index];
  699. },
  700. toPrevImage() {
  701. if (this.curImageIndex === 0) {
  702. this.curImageIndex = this.paperConfirmAttachments.length - 1;
  703. } else {
  704. this.curImageIndex--;
  705. }
  706. this.selectImage(this.curImageIndex);
  707. },
  708. toNextImage() {
  709. if (this.curImageIndex === this.paperConfirmAttachments.length - 1) {
  710. this.curImageIndex = 0;
  711. } else {
  712. this.curImageIndex++;
  713. }
  714. this.selectImage(this.curImageIndex);
  715. }
  716. }
  717. };
  718. </script>