综合办公系统
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 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view>
  3. <!-- 动态加载表单组件 -->
  4. <component :is="currentForm" :taskForm="taskForm" :taskName="taskName" :startUserName="startUserName" />
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. getProcessVariables
  10. } from "@/api/flowable/definition";
  11. import Declare from './components/declare/declare.vue';
  12. export default {
  13. components: {
  14. Declare,
  15. },
  16. data() {
  17. return {
  18. procDefName: '', // 流程名称
  19. taskName: '', // 当前节点
  20. startUserName: '', // 流程发起人
  21. formId: '',
  22. taskForm: {},
  23. currentForm: null // 当前加载的表单组件
  24. };
  25. },
  26. onLoad(options) {
  27. // 接收传递的参数
  28. this.procDefName = options.procDefName;
  29. this.taskName = options.taskName;
  30. this.startUserName = options.startUserName;
  31. // 根据流程名称加载不同的表单组件
  32. getProcessVariables(options.taskId).then(res => {
  33. this.taskForm = res.data;
  34. this.loadForm();
  35. })
  36. },
  37. methods: {
  38. loadForm() {
  39. switch (this.procDefName) {
  40. case '工作填报':
  41. this.currentForm = 'Declare';
  42. break;
  43. case '流程B':
  44. this.currentForm = 'ProcessBForm';
  45. break;
  46. default:
  47. console.log('未知流程');
  48. break;
  49. }
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. </style>