ApplyContent.vue 22 KB

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