diff --git a/yudao-admin-ui/src/api/bpm/processInstance.js b/yudao-admin-ui/src/api/bpm/processInstance.js index 2340356f8..54feaedea 100644 --- a/yudao-admin-ui/src/api/bpm/processInstance.js +++ b/yudao-admin-ui/src/api/bpm/processInstance.js @@ -26,3 +26,10 @@ export function cancelProcessInstance(id, reason) { } }) } + +export function getMyProcessInstance(id) { + return request({ + url: '/bpm/process-instance/get?id=' + id, + method: 'get', + }) +} diff --git a/yudao-admin-ui/src/api/bpm/task.js b/yudao-admin-ui/src/api/bpm/task.js index 3b4dc305f..8a5704884 100644 --- a/yudao-admin-ui/src/api/bpm/task.js +++ b/yudao-admin-ui/src/api/bpm/task.js @@ -39,3 +39,4 @@ export function rejectTask(data) { data: data }) } + diff --git a/yudao-admin-ui/src/views/bpm/processInstance/create.vue b/yudao-admin-ui/src/views/bpm/processInstance/create.vue index d265bc9ee..1d3c09651 100644 --- a/yudao-admin-ui/src/views/bpm/processInstance/create.vue +++ b/yudao-admin-ui/src/views/bpm/processInstance/create.vue @@ -32,7 +32,7 @@
- {{ selectProcessInstance.name }} + 申请信息【{{ selectProcessInstance.name }}】 选择其它流程
@@ -58,10 +58,11 @@ import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {getForm} from "@/api/bpm/form"; import {decodeFields} from "@/utils/formGenerator"; import Parser from '@/components/parser/Parser' -import {createProcessInstance} from "@/api/bpm/processInstance"; +import {createProcessInstance, getMyProcessInstancePage} from "@/api/bpm/processInstance"; +// 流程实例的发起 export default { - name: "processDefinition", + name: "ProcessInstanceCreate", components: { Parser }, @@ -109,28 +110,25 @@ export default { }, /** 处理选择流程的按钮操作 **/ handleSelect(row) { - // 如果无表单,则无法发起流程 - if (!row.formId) { - this.$message.error('该流程未绑定表单,无法发起流程!请重新选择你要发起的流程'); - return; - } // 设置选择的流程 this.selectProcessInstance = row; - // 加载对应的表单 - getForm(row.formId).then(response => { - // 设置值 - const data = response.data + // 流程表单 + if (row.formId) { + // 设置对应的表单 this.detailForm = { - ...JSON.parse(data.conf), - fields: decodeFields(data.fields) + ...JSON.parse(row.formConf), + fields: decodeFields(row.formFields) } - }); - // 加载流程图 - getProcessDefinitionBpmnXML(row.id).then(response => { - this.bpmnXML = response.data - }) + // 加载流程图 + getProcessDefinitionBpmnXML(row.id).then(response => { + this.bpmnXML = response.data + }) + } else if (row.formCustomCreatePath) { + this.$router.push({ path: row.formCustomCreatePath}); + // 这里暂时无需加载流程图,因为跳出到另外个 Tab; + } }, /** 提交按钮 */ submitForm(params) { diff --git a/yudao-admin-ui/src/views/bpm/processInstance/detail.vue b/yudao-admin-ui/src/views/bpm/processInstance/detail.vue new file mode 100644 index 000000000..1365e57c4 --- /dev/null +++ b/yudao-admin-ui/src/views/bpm/processInstance/detail.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/yudao-admin-ui/src/views/bpm/processInstance/index.vue b/yudao-admin-ui/src/views/bpm/processInstance/index.vue index a339ffdb7..851ffec04 100644 --- a/yudao-admin-ui/src/views/bpm/processInstance/index.vue +++ b/yudao-admin-ui/src/views/bpm/processInstance/index.vue @@ -129,7 +129,7 @@ import { import {deleteErrorCode} from "@/api/system/errorCode"; export default { - name: "ProcessInstanceExt", + name: "ProcessInstance", components: { }, data() {