综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

detail.vue 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-02-06 09:48:52
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-04-11 15:37:23
  6. -->
  7. <template>
  8. <view>
  9. <!-- 动态加载表单组件 -->
  10. <component :is="currentForm" :taskForm="taskForm" :taskName="taskName" :startUserName="startUserName"
  11. @goBack="goBack" v-if="!isEmpty" />
  12. <component :is="'EmptyBox'" v-if="isEmpty" />
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. getProcessVariables
  18. } from "@/api/flowable/definition";
  19. import Declare from '@/pages/form/declare/declare.vue';
  20. import Borrow from "@/pages/form/borrow/borrow.vue";
  21. import Device from "@/pages/form/device/device.vue";
  22. import EmptyBox from "../../emptyBox.vue";
  23. export default {
  24. components: {
  25. Declare,
  26. EmptyBox,
  27. Borrow,
  28. Device
  29. },
  30. data() {
  31. return {
  32. procDefName: '', // 流程名称
  33. taskName: '', // 当前节点
  34. startUserName: '', // 流程发起人
  35. formId: '',
  36. taskForm: {
  37. returnTaskShow: false, // 是否展示回退表单
  38. delegateTaskShow: false, // 是否展示回退表单
  39. defaultTaskShow: true, // 默认处理
  40. comment: "", // 意见内容
  41. procInsId: "", // 流程实例编号
  42. instanceId: "", // 流程实例编号
  43. deployId: "", // 流程定义编号
  44. taskId: "",// 流程任务编号
  45. procDefId: "", // 流程编号
  46. targetKey: "",
  47. variables: {
  48. variables: {}
  49. },
  50. },
  51. currentForm: null, // 当前加载的表单组件
  52. isEmpty: false,
  53. };
  54. },
  55. onLoad(options) {
  56. const params = JSON.parse(decodeURIComponent(options.params));
  57. // 接收传递的参数
  58. this.procDefName = params.procDefName;
  59. this.taskName = params.taskName;
  60. this.startUserName = params.startUserName;
  61. this.taskForm.taskId = params.taskId;
  62. this.taskForm.deployId = params.deployId;
  63. this.taskForm.procInsId = params.procInsId;
  64. this.taskForm.executionId = params.executionId;
  65. this.taskForm.instanceId = params.procInsId;
  66. getProcessVariables(params.taskId).then(res => {
  67. this.taskForm.formId = res.data.formId;
  68. // 根据流程名称加载不同的表单组件
  69. this.loadForm();
  70. })
  71. },
  72. methods: {
  73. loadForm() {
  74. this.isEmpty = false;
  75. switch (this.procDefName) {
  76. case '工作填报':
  77. this.currentForm = 'Declare';
  78. break;
  79. case '借款审批':
  80. this.currentForm = 'Borrow';
  81. break;
  82. case '设备审批':
  83. this.currentForm = 'Device';
  84. break;
  85. default:
  86. console.log('未知流程');
  87. this.isEmpty = true;
  88. break;
  89. }
  90. },
  91. goBack() {
  92. uni.navigateTo({
  93. url: '/pages/message/apply/apply'
  94. })
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss"></style>