index.vue 24 KB

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