综合办公系统
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

detail.vue 2.5KB

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