index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  1. <template>
  2. <ele-modal
  3. :before-close="handleClose"
  4. :visible.sync="dialogVisible"
  5. :close-on-click-modal="false"
  6. :append-to-body="true"
  7. width="80%"
  8. title="处理"
  9. :maxable="true"
  10. >
  11. <div class="app-container">
  12. <!-- 申请信息 -->
  13. <el-card class="box-card" v-loading="processInstanceLoading">
  14. <div slot="header" class="clearfix">
  15. <span class="el-icon-document"
  16. >申请信息【{{ processInstance.name }}】 申请人:【{{
  17. processInstance.startUser?.nickname
  18. }}】</span
  19. >
  20. </div>
  21. <div v-if="processInstance.processDefinition">
  22. <async-biz-form-component
  23. :taskId="listData?.taskId"
  24. :businessId="listData?.businessId"
  25. :id="listData?.id"
  26. :processDefinitionId="processInstance.processDefinition.id"
  27. :taskDefinitionKey="listData?.taskDefinitionKey"
  28. @activeCompChange="activeCompChange"
  29. @handleClose="handleClose"
  30. ref="bziRef"
  31. ></async-biz-form-component>
  32. </div>
  33. </el-card>
  34. <div style="display: flex">
  35. <!-- 审批信息 -->
  36. <el-card
  37. style="min-width: 500px"
  38. class="box-card"
  39. v-loading="processInstanceLoading"
  40. v-for="(item, index) in runningTasks"
  41. :key="index"
  42. >
  43. <div slot="header" class="clearfix">
  44. <span class="el-icon-picture-outline">审批任务</span>
  45. </div>
  46. <div v-if="processInstance.processDefinition">
  47. <async-sub-form-component
  48. :taskId="listData?.taskId"
  49. :businessId="listData?.businessId"
  50. :id="listData?.id"
  51. :taskDefinitionKey="listData?.taskDefinitionKey"
  52. :fromUser="processInstance.startUser?.nickname"
  53. @handleAudit="handleAudit"
  54. @getTableValue="getTableValue"
  55. @handleUpdateAssignee="handleUpdateAssignee(item)"
  56. @handleBackList="handleBackList(item)"
  57. @submit="submit"
  58. @handleClose="handleClose"
  59. ref="subForm"
  60. ></async-sub-form-component>
  61. </div>
  62. <!-- <div> </div> -->
  63. <!-- <el-col :span="16" :offset="6">
  64. <el-form
  65. :ref="'form' + index"
  66. :model="auditForms[index]"
  67. :rules="auditRule"
  68. label-width="100px"
  69. >
  70. <el-form-item
  71. label="审批建议"
  72. prop="reason"
  73. style="margin-bottom: 20px"
  74. >
  75. <el-input
  76. type="textarea"
  77. v-model="auditForms[index].reason"
  78. placeholder="请输入审批建议"
  79. />
  80. </el-form-item>
  81. </el-form>
  82. <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
  83. <el-button
  84. icon="el-icon-edit-outline"
  85. type="success"
  86. size="mini"
  87. @click="handleAudit(item, true)"
  88. >通过
  89. </el-button>
  90. <el-button
  91. icon="el-icon-circle-close"
  92. type="danger"
  93. size="mini"
  94. @click="handleAudit(item, false)"
  95. >不通过
  96. </el-button>
  97. <el-button
  98. icon="el-icon-edit-outline"
  99. type="primary"
  100. size="mini"
  101. @click="handleUpdateAssignee(item)"
  102. >转办
  103. </el-button>
  104. <el-button
  105. icon="el-icon-edit-outline"
  106. type="primary"
  107. size="mini"
  108. @click="handleDelegate(item)"
  109. >委派
  110. </el-button>
  111. <el-button
  112. icon="el-icon-refresh-left"
  113. type="warning"
  114. size="mini"
  115. @click="handleBackList(item)"
  116. >退回
  117. </el-button>
  118. </div>
  119. </el-col> -->
  120. </el-card>
  121. <!-- 审批记录 -->
  122. <el-card
  123. class="box-card"
  124. style="flex: 1; min-width: 540px; margin-top: 0; margin-left: 10px"
  125. v-loading="processInstanceLoading"
  126. >
  127. <div slot="header" class="clearfix">
  128. <span class="el-icon-picture-outline">审批记录</span>
  129. </div>
  130. <div style="overflow-y: auto; height: 120px">
  131. <el-timeline>
  132. <el-timeline-item
  133. v-for="(item, index) in tasks"
  134. :key="index"
  135. :icon="getTimelineItemIcon(item)"
  136. :type="getTimelineItemType(item)"
  137. >
  138. <p style="font-weight: 500; margin-top: 5px"
  139. >任务:{{ item.name }}</p
  140. >
  141. <label
  142. v-if="item.assigneeUser"
  143. style="font-weight: normal; margin-right: 30px"
  144. >
  145. {{ index == 0 ? ' 审批人' : '发起人' }}:{{
  146. item.assigneeUser.nickname
  147. }}
  148. <el-tag type="info" size="mini">{{
  149. item.assigneeUser.deptName
  150. }}</el-tag>
  151. </label>
  152. <label
  153. v-if="item.endTime"
  154. style="margin-left: 10px; font-weight: normal"
  155. >审批时间:</label
  156. >
  157. <label
  158. v-if="item.endTime"
  159. style="color: #8a909c; font-weight: normal"
  160. >
  161. {{ item.endTime }}</label
  162. >
  163. <div>
  164. <label v-if="item.reason" style="font-weight: normal"
  165. >审批意见:</label
  166. >
  167. <label
  168. v-if="item.reason"
  169. style="color: #8a909c; font-weight: normal"
  170. >
  171. {{ item.reason }}</label
  172. >
  173. </div>
  174. </el-timeline-item>
  175. </el-timeline>
  176. </div>
  177. </el-card>
  178. </div>
  179. <!-- 对话框(转办审批人) -->
  180. <el-dialog
  181. title="转办审批人"
  182. :visible.sync="updateAssignee.open"
  183. width="500px"
  184. append-to-body
  185. >
  186. <el-form
  187. ref="updateAssigneeForm"
  188. :model="updateAssignee.form"
  189. :rules="updateAssignee.rules"
  190. label-width="110px"
  191. >
  192. <el-form-item label="新审批人" prop="assigneeUserId">
  193. <el-select
  194. v-model="updateAssignee.form.assigneeUserId"
  195. clearable
  196. style="width: 100%"
  197. :filterable="true"
  198. >
  199. <el-option
  200. v-for="item in userOptions"
  201. :key="item.id"
  202. :label="item.name"
  203. :value="item.id"
  204. />
  205. </el-select>
  206. </el-form-item>
  207. </el-form>
  208. <div slot="footer" class="dialog-footer">
  209. <el-button type="primary" @click="submitUpdateAssigneeForm"
  210. >确 定
  211. </el-button>
  212. <el-button @click="cancelUpdateAssigneeForm">取 消</el-button>
  213. </div>
  214. </el-dialog>
  215. <!-- 对话框(委派审批人) -->
  216. <el-dialog
  217. title="委派审批人"
  218. :visible.sync="updateDelegate.open"
  219. width="500px"
  220. append-to-body
  221. >
  222. <el-form
  223. ref="updateDelegateForm"
  224. :model="updateDelegate.form"
  225. :rules="updateDelegate.rules"
  226. label-width="110px"
  227. >
  228. <el-form-item label="新审批人" prop="assigneeUserId">
  229. <el-select
  230. v-model="updateDelegate.form.delegateUserId"
  231. clearable
  232. style="width: 100%"
  233. :filterable="true"
  234. >
  235. <el-option
  236. v-for="item in userOptions"
  237. :key="item.id"
  238. :label="item.name"
  239. :value="item.id"
  240. />
  241. </el-select>
  242. </el-form-item>
  243. <el-form-item label="委派理由" prop="reason">
  244. <el-input
  245. v-model="updateDelegate.form.reason"
  246. clearable
  247. placeholder="请输入委派理由"
  248. />
  249. </el-form-item>
  250. </el-form>
  251. <div slot="footer" class="dialog-footer">
  252. <el-button type="primary" @click="submitUpdateDelegateForm"
  253. >确 定
  254. </el-button>
  255. <el-button @click="cancelUpdateDelegateForm">取 消</el-button>
  256. </div>
  257. </el-dialog>
  258. <!--退回流程-->
  259. <el-dialog
  260. title="退回流程"
  261. :visible.sync="returnOpen"
  262. width="40%"
  263. append-to-body
  264. >
  265. <el-form
  266. ref="formRef"
  267. v-loading="formLoading"
  268. :model="formData"
  269. :rules="formRules"
  270. label-width="110px"
  271. >
  272. <el-form-item label="退回节点" prop="targetDefinitionKey">
  273. <el-select
  274. v-model="formData.targetDefinitionKey"
  275. clearable
  276. style="width: 100%"
  277. >
  278. <el-option
  279. v-for="item in returnList"
  280. :key="item.definitionKey"
  281. :label="item.name"
  282. :value="item.definitionKey"
  283. />
  284. </el-select>
  285. </el-form-item>
  286. <el-form-item label="回退理由" prop="reason">
  287. <el-input
  288. v-model="formData.reason"
  289. clearable
  290. placeholder="请输入回退理由"
  291. />
  292. </el-form-item>
  293. </el-form>
  294. <span slot="footer" class="dialog-footer">
  295. <el-button @click="returnOpen = false">取 消</el-button>
  296. <el-button
  297. :disabled="formLoading"
  298. type="primary"
  299. @click="submitReturn"
  300. >确 定</el-button
  301. >
  302. </span>
  303. </el-dialog>
  304. </div>
  305. </ele-modal>
  306. </template>
  307. <script>
  308. // import { getProcessDefinitionBpmnXML } from '@/api/bpm/definition';
  309. import store from '@/store';
  310. // import {decodeFields} from "@/utils/formGenerator";
  311. // import Parser from '@/components/parser/Parser'
  312. import { getProcessInstance } from '@/api/bpm/processInstance';
  313. import { listAllUserBind } from '@/api/system/organization';
  314. import Vue from 'vue';
  315. import {
  316. delegateTask,
  317. getReturnList,
  318. getTaskListByProcessInstanceId,
  319. returnTask,
  320. updateTaskAssignee
  321. } from '@/api/bpm/task';
  322. import { getProcessDefinitionBpmnXML } from '@/api/bpm/definition';
  323. import { getActivityList } from '@/api/bpm/activity';
  324. // import { getDate } from '@/utils/dateUtils';
  325. // 流程实例的详情页,可用于审批
  326. export default {
  327. name: 'ProcessInstanceDetail',
  328. components: {
  329. },
  330. data() {
  331. return {
  332. fullscreen:false,
  333. // 遮罩层
  334. processInstanceLoading: true,
  335. dialogVisible: false,
  336. // 流程实例
  337. listData: {
  338. id: undefined, // 流程实例的编号
  339. pcHandleRouter: '',
  340. pcViewRouter: '',
  341. businessId: '', // 业务id
  342. taskDefinitionKey: '',
  343. taskId: '' //任务编码
  344. },
  345. processInstance: {},
  346. formLoading: false,
  347. // 流程表单详情
  348. detailForm: {
  349. fields: []
  350. },
  351. //回退列表数据
  352. returnList: [],
  353. formData: {
  354. id: '',
  355. targetDefinitionKey: undefined,
  356. reason: ''
  357. },
  358. formRules: {
  359. targetDefinitionKey: [
  360. { required: true, message: '必须选择回退节点', trigger: 'change' }
  361. ],
  362. reason: [
  363. { required: true, message: '回退理由不能为空', trigger: 'blur' }
  364. ]
  365. },
  366. returnOpen: false,
  367. activityList: [],
  368. tasks: [],
  369. // 审批表单
  370. runningTasks: [],
  371. auditForms: [],
  372. auditRule: {
  373. reason: [
  374. { required: true, message: '审批建议不能为空', trigger: 'blur' }
  375. ]
  376. },
  377. // 转派审批人
  378. userOptions: [],
  379. updateAssignee: {
  380. open: false,
  381. form: {
  382. assigneeUserId: undefined
  383. },
  384. rules: {
  385. assigneeUserId: [
  386. { required: true, message: '新审批人不能为空', trigger: 'change' }
  387. ]
  388. }
  389. },
  390. updateDelegate: {
  391. open: false,
  392. form: {
  393. delegateUserId: undefined,
  394. reason: ''
  395. },
  396. rules: {
  397. delegateUserId: [
  398. { required: true, message: '新审批人不能为空', trigger: 'change' }
  399. ],
  400. reason: [
  401. { required: true, message: '委派理由不能为空', trigger: 'blur' }
  402. ]
  403. }
  404. }
  405. };
  406. },
  407. created() {
  408. // this.id = this.$route.query.id;
  409. // if (!this.id) {
  410. // this.$message.error('未传递 id 参数,无法查看流程信息');
  411. // return;
  412. // }
  413. // this.getDetail();
  414. // 获得用户列表
  415. this.userOptions = [];
  416. listAllUserBind().then((data) => {
  417. this.userOptions.push(...data);
  418. });
  419. },
  420. methods: {
  421. submit(data) {
  422. this.$refs.bziRef.save(data);
  423. },
  424. open(data) {
  425. this.listData = data;
  426. console.log('实例流程~~~~~~', data);
  427. this.dialogVisible = true;
  428. this.getDetail();
  429. // this.getTasksRecordDetail();
  430. },
  431. activeCompChange(activeComp) {
  432. this.$refs.subForm[0].activeCompChange(activeComp);
  433. },
  434. /** 获得流程实例 */
  435. getDetail() {
  436. // 获得流程实例相关
  437. this.processInstanceLoading = true;
  438. getProcessInstance(this.listData.id).then((response) => {
  439. if (!response) {
  440. this.$message.error('查询不到流程信息!');
  441. return;
  442. }
  443. // 设置流程信息
  444. this.processInstance = response;
  445. // //将业务表单,注册为动态组件
  446. // let formCustomCreatePath = JSON.parse(
  447. // this.processInstance.processDefinition.formCustomCreatePath
  448. // );
  449. // const bizpath = formCustomCreatePath.pcView;
  450. // const subpath = formCustomCreatePath.pcHandle;
  451. Vue.component('async-biz-form-component', (resolve) => {
  452. console.log(this.listData.pcViewRouter,'111111');
  453. require([`@/views${this.listData.pcViewRouter}`], resolve);
  454. });
  455. Vue.component('async-sub-form-component', (resolve) => {
  456. console.log(this.listData.pcHandleRouter,'22222');
  457. require([`@/views${this.listData.pcHandleRouter}`], resolve);
  458. });
  459. // // 设置表单信息
  460. // if (this.processInstance.processDefinition.formType === 10) {
  461. // this.detailForm = {
  462. // ...JSON.parse(this.processInstance.processDefinition.formConf),
  463. // disabled: true, // 表单禁用
  464. // formBtns: false, // 按钮隐藏
  465. // fields: decodeFields(this.processInstance.processDefinition.formFields)
  466. // }
  467. // // 设置表单的值
  468. // this.detailForm.fields.forEach(item => {
  469. // const val = this.processInstance.formVariables[item.__vModel__]
  470. // if (val) {
  471. // item.__config__.defaultValue = val
  472. // }
  473. // });
  474. // }
  475. // 取消加载中
  476. this.processInstanceLoading = false;
  477. });
  478. this.runningTasks = [];
  479. this.auditForms = [];
  480. getTaskListByProcessInstanceId(this.listData.id).then((response) => {
  481. console.log(response, 'response');
  482. // 审批记录
  483. this.tasks = [];
  484. // 移除已取消的审批
  485. response.forEach((task) => {
  486. if (task.result !== 4) {
  487. this.tasks.push(task);
  488. }
  489. });
  490. // 排序,将未完成的排在前面,已完成的排在后面;
  491. this.tasks.sort((a, b) => {
  492. // 有已完成的情况,按照完成时间倒序
  493. if (a.endTime && b.endTime) {
  494. return b.endTime - a.endTime;
  495. } else if (a.endTime) {
  496. return 1;
  497. } else if (b.endTime) {
  498. return -1;
  499. // 都是未完成,按照创建时间倒序
  500. } else {
  501. return b.createTime - a.createTime;
  502. }
  503. });
  504. // 需要审核的记录
  505. const userId = store.getters.user.info.userId;
  506. if (this.tasks.some((item) => item.result == 7)) {
  507. let taskItem = this.tasks.find((item) => item.result == 7);
  508. const stack = [];
  509. let task = [];
  510. stack.push(taskItem.children);
  511. while (stack.length > 0) {
  512. const node = stack.pop();
  513. console.log(node, '-----');
  514. node.forEach((n) => {
  515. if (n.children?.length === 0) {
  516. task.push(n);
  517. } else {
  518. task = [];
  519. stack.push(n.children);
  520. }
  521. });
  522. }
  523. task.forEach((task) => {
  524. if (task.result !== 1 && task.result !== 6) {
  525. // 只有待处理才需要
  526. return;
  527. }
  528. if (!task.assigneeUser || task.assigneeUser.id !== userId) {
  529. // 自己不是处理人
  530. return;
  531. }
  532. if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
  533. // 不是当前流程的
  534. return;
  535. }
  536. this.runningTasks.push({ ...task });
  537. this.auditForms.push({
  538. reason: ''
  539. });
  540. });
  541. } else {
  542. this.tasks.forEach((task) => {
  543. if (task.result !== 1 && task.result !== 6) {
  544. // 只有待处理才需要
  545. return;
  546. }
  547. if (!task.assigneeUser || task.assigneeUser.id !== userId) {
  548. // 自己不是处理人
  549. return;
  550. }
  551. if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
  552. // 不是当前流程的
  553. return;
  554. }
  555. this.runningTasks.push({ ...task });
  556. this.auditForms.push({
  557. reason: ''
  558. });
  559. });
  560. }
  561. });
  562. },
  563. getTimelineItemIcon(item) {
  564. if (item.result === 1) {
  565. return 'el-icon-time';
  566. }
  567. if (item.result === 2) {
  568. return 'el-icon-check';
  569. }
  570. if (item.result === 3) {
  571. return 'el-icon-close';
  572. }
  573. if (item.result === 4) {
  574. return 'el-icon-remove-outline';
  575. }
  576. if (item.result === 5) {
  577. return 'el-icon-back';
  578. }
  579. return '';
  580. },
  581. getTimelineItemType(item) {
  582. if (item.result === 1) {
  583. return 'primary';
  584. }
  585. if (item.result === 2) {
  586. return 'success';
  587. }
  588. if (item.result === 3) {
  589. return 'danger';
  590. }
  591. if (item.result === 4) {
  592. return 'info';
  593. }
  594. if (item.result === 5) {
  595. return 'warning';
  596. }
  597. if (item.result === 6) {
  598. return 'default';
  599. }
  600. return '';
  601. },
  602. /** 处理审批通过和不通过的操作 */
  603. handleAudit(data) {
  604. let text = data.status === 1 ? '通过' : '不通过';
  605. this.$message.success(`审批${data.title || text}成功!`);
  606. this.handleClose(); // 获得最新详情
  607. // const index = this.runningTasks.indexOf(task);
  608. // this.$refs['form' + index][0].validate((valid) => {
  609. // if (!valid) {
  610. // return;
  611. // }
  612. // const data = {
  613. // id: task.id,
  614. // reason: this.auditForms[index].reason
  615. // };
  616. // if (pass) {
  617. // approveTask(data).then((response) => {
  618. // this.$message.success('审批通过成功!');
  619. // this.handleClose(); // 获得最新详情
  620. // });
  621. // } else {
  622. // rejectTask(data).then((response) => {
  623. // this.$message.success('审批不通过成功!');
  624. // this.handleClose(); // 获得最新详情
  625. // });
  626. // }
  627. // });
  628. },
  629. /** 处理转办审批人 */
  630. handleUpdateAssignee(task) {
  631. // 设置表单
  632. this.resetUpdateAssigneeForm();
  633. this.updateAssignee.form.id = task.id;
  634. // 设置为打开
  635. this.updateAssignee.open = true;
  636. },
  637. /** 提交转办审批人 */
  638. submitUpdateAssigneeForm() {
  639. this.$refs['updateAssigneeForm'].validate((valid) => {
  640. if (!valid) {
  641. return;
  642. }
  643. if (this.$refs.subForm[0].formUpdate) {
  644. this.$refs.subForm[0].formUpdate();
  645. }
  646. updateTaskAssignee(this.updateAssignee.form).then((response) => {
  647. this.$message.success('转办任务成功!');
  648. this.updateAssignee.open = false;
  649. this.handleClose(); // 获得最新详情
  650. });
  651. });
  652. },
  653. /** 取消转办审批人 */
  654. cancelUpdateAssigneeForm() {
  655. this.updateAssignee.open = false;
  656. this.resetUpdateAssigneeForm();
  657. },
  658. /** 重置转办审批人 */
  659. resetUpdateAssigneeForm() {
  660. this.updateAssignee.form = {
  661. id: undefined,
  662. assigneeUserId: undefined
  663. };
  664. this.resetForm('updateAssigneeForm');
  665. },
  666. /** 处理审批委派的操作 */
  667. handleDelegate(task) {
  668. //this.$modal.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
  669. this.resetUpdateDelegateForm();
  670. this.updateDelegate.form.id = task.id;
  671. // 设置为打开
  672. this.updateDelegate.open = true;
  673. },
  674. /** 提交委派审批人 */
  675. submitUpdateDelegateForm() {
  676. this.$refs['updateDelegateForm'].validate((valid) => {
  677. if (!valid) {
  678. return;
  679. }
  680. delegateTask(this.updateDelegate.form).then((response) => {
  681. this.$message.success('委派任务成功!');
  682. this.updateDelegate.open = false;
  683. this.handleClose(); // 获得最新详情
  684. });
  685. });
  686. },
  687. /** 取消委派审批人 */
  688. cancelUpdateDelegateForm() {
  689. this.updateDelegate.open = false;
  690. this.resetUpdateDelegateForm();
  691. },
  692. /** 重置委派审批人 */
  693. resetUpdateDelegateForm() {
  694. this.updateDelegate.form = {
  695. id: undefined,
  696. delegateUserId: undefined
  697. };
  698. this.resetForm('updateDelegateForm');
  699. },
  700. /** 处理审批退回的操作 */
  701. /** 返回退回节点列表 */
  702. handleBackList(task) {
  703. // 可参考 http://blog.wya1.com/article/636697030/details/7296
  704. getReturnList(task.id).then((response) => {
  705. this.returnList = response.data.data;
  706. if (this.returnList.length == 0) {
  707. this.$message.error('当前没有可回退的节点!');
  708. return;
  709. }
  710. this.formData.id = task.id;
  711. this.returnOpen = true;
  712. });
  713. },
  714. /** 提交退回任务 */
  715. submitReturn() {
  716. if (!this.formData.targetDefinitionKey) {
  717. this.$message.error('请选择退回节点!');
  718. }
  719. this.$refs['formRef'].validate((valid) => {
  720. if (!valid) {
  721. return;
  722. }
  723. returnTask(this.formData).then((res) => {
  724. if (res.data) {
  725. this.$message.success('回退成功!');
  726. this.returnOpen = false;
  727. this.handleClose(); // 获得最新详情
  728. }
  729. });
  730. });
  731. },
  732. handleClose() {
  733. this.$emit('reload');
  734. this.dialogVisible = false;
  735. },
  736. getTableValue(fn) {
  737. fn(this.$refs.bziRef.getTableValue());
  738. }
  739. }
  740. };
  741. </script>
  742. <style lang="scss">
  743. .my-process-designer {
  744. height: calc(100vh - 200px);
  745. }
  746. .box-card {
  747. width: 100%;
  748. margin-bottom: 20px;
  749. }
  750. </style>