流程业务表单1:n配置
This commit is contained in:
parent
20358ba86b
commit
99afcd44d5
@ -54,4 +54,12 @@ export const FormProcessMappingApi = {
|
||||
selectProcessKey: async (fullpath: string) => {
|
||||
return await request.get({ url: `/bpm/form-process-mapping/get-process-key?fullpath=` + fullpath })
|
||||
},
|
||||
// 通过流程的formCustomCreatePath得到formCustomViewPath
|
||||
getFormCustomViewPath: async (fullpath: string) => {
|
||||
return await request.get({ url: `/bpm/form-process-mapping/get-form-custom-view-path?formCustomCreatePath=` + fullpath })
|
||||
},
|
||||
// 通过流程的key得到frommapping的List
|
||||
getListByProcessKey: async (key: string) => {
|
||||
return await request.get({ url: `/bpm/form-process-mapping/get-by-process-key?processKey=` + key })
|
||||
},
|
||||
}
|
||||
|
@ -25,7 +25,10 @@ export const ProcessInstanceTodoApi = {
|
||||
getProcessInstanceTodo: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/process-instance-todo/get?id=` + id })
|
||||
},
|
||||
|
||||
//通过流程实例的id得到流程业务表单
|
||||
getProcessInstanceFormCreatePath: async (processInstanceId: number) => {
|
||||
return await request.get({ url: `/bpm/process-instance-todo/get-form-custom-create-path?processInstanceId=` + processInstanceId })
|
||||
},
|
||||
// 新增BPM 流程实例信息
|
||||
createProcessInstanceTodo: async (data: ProcessInstanceTodoVO) => {
|
||||
return await request.post({ url: `/bpm/process-instance-todo/create`, data })
|
||||
@ -45,4 +48,4 @@ export const ProcessInstanceTodoApi = {
|
||||
exportProcessInstanceTodo: async (params) => {
|
||||
return await request.download({ url: `/bpm/process-instance-todo/export-excel`, params })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -169,6 +169,9 @@ const submitForm = async () => {
|
||||
}
|
||||
|
||||
const curFullPath = currentRoute.value.fullPath
|
||||
if( curFullPath ) {
|
||||
data.curfullpath = curFullPath
|
||||
}
|
||||
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
|
||||
if ( processKey) {
|
||||
data.processDefinitionKey = processKey
|
||||
|
@ -227,14 +227,18 @@ const handleSelect = async (row, formVariables) => {
|
||||
})
|
||||
// 这里暂时无需加载流程图,因为跳出到另外个 Tab;
|
||||
} else {
|
||||
//console.log(row.key,"row.key")
|
||||
console.log(row.key,"row.key")
|
||||
const process_key = row.key
|
||||
const formCustomCreatePath = await FormProcessMappingApi.getFormCreatePath(process_key)
|
||||
// console.log(formCustomCreatePath,"formCustomCreatePath")
|
||||
if (formCustomCreatePath != "") {
|
||||
console.log(formCustomCreatePath.length,"formCustomCreatePath.length")
|
||||
if (formCustomCreatePath.length == 1) {
|
||||
await push({
|
||||
path: formCustomCreatePath
|
||||
path: formCustomCreatePath[0]
|
||||
})
|
||||
}else {
|
||||
console.log("else..............")
|
||||
const formMappingList = await FormProcessMappingApi.getListByProcessKey(process_key)
|
||||
console.log(formMappingList,"formMappingList")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="流程图" name="flowChart">
|
||||
<!-- 高亮流程图 -->
|
||||
<ProcessInstanceBpmnViewerNoHeader
|
||||
<ProcessInstanceBpmnViewer
|
||||
:id="`${id}`"
|
||||
:bpmn-xml="bpmnXml"
|
||||
:loading="processInstanceLoading"
|
||||
@ -131,13 +131,13 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 弹窗:转派审批人 -->
|
||||
<TaskTransferForm ref="taskTransferFormRef" @success="getDetail" @back-view="backView" />
|
||||
<TaskTransferForm ref="taskTransferFormRef" @success="getDetail" />
|
||||
<!-- 弹窗:回退节点 -->
|
||||
<TaskReturnForm ref="taskReturnFormRef" @success="getDetail" @back-view="backView" />
|
||||
<TaskReturnForm ref="taskReturnFormRef" @success="getDetail" />
|
||||
<!-- 弹窗:委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中-->
|
||||
<TaskDelegateForm ref="taskDelegateForm" @success="getDetail" @back-view="backView" />
|
||||
<TaskDelegateForm ref="taskDelegateForm" @success="getDetail" />
|
||||
<!-- 弹窗:加签,当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
||||
<TaskSignCreateForm ref="taskSignCreateFormRef" @success="getDetail" @back-view="backView" />
|
||||
<TaskSignCreateForm ref="taskSignCreateFormRef" @success="getDetail" />
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -147,7 +147,7 @@ import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
||||
import * as DefinitionApi from '@/api/bpm/definition'
|
||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||
import * as TaskApi from '@/api/bpm/task'
|
||||
import ProcessInstanceBpmnViewerNoHeader from './ProcessInstanceBpmnViewerNoHeader.vue'
|
||||
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
|
||||
import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue'
|
||||
import TaskReturnForm from './dialog/TaskReturnForm.vue'
|
||||
import TaskDelegateForm from './dialog/TaskDelegateForm.vue'
|
||||
@ -158,7 +158,7 @@ import { isEmpty } from '@/utils/is'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import {TabsPaneContext} from "element-plus";
|
||||
import { FormProcessMappingApi} from '@/api/bpm/formprocessmapping'
|
||||
import {useTagsViewStore} from "@/store/modules/tagsView";
|
||||
import { ProcessInstanceTodoApi, ProcessInstanceTodoVO } from '@/api/bpm/processinstancetodo'
|
||||
|
||||
defineOptions({ name: 'BpmProcessInstanceDetail' })
|
||||
|
||||
@ -166,8 +166,6 @@ const { query } = useRoute() // 查询参数
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { proxy } = getCurrentInstance() as any
|
||||
|
||||
const { delView } = useTagsViewStore()//视图操作
|
||||
const { currentRoute, back } = useRouter()
|
||||
const userId = useUserStore().getUser.id // 当前登录的编号
|
||||
const id = query.id as unknown as string // 流程实例的编号
|
||||
const processInstanceLoading = ref(false) // 流程实例的加载中
|
||||
@ -245,13 +243,6 @@ const handleAudit = async (task, pass) => {
|
||||
}
|
||||
// 2.2 加载最新数据
|
||||
getDetail()
|
||||
delView(unref(currentRoute))
|
||||
back()
|
||||
}
|
||||
//关闭当前标签回到上个标签
|
||||
const backView = ()=>{
|
||||
delView(unref(currentRoute))
|
||||
back()
|
||||
}
|
||||
|
||||
/** 转派审批人 */
|
||||
@ -291,7 +282,7 @@ const BusinessFormComponent = ref(null) // 异步组件
|
||||
const getProcessInstance = async () => {
|
||||
try {
|
||||
processInstanceLoading.value = true
|
||||
console.log(id,"getProcessInstance_id")
|
||||
//console.log(id,"getProcessInstance_id")
|
||||
const data = await ProcessInstanceApi.getProcessInstance(id)
|
||||
if (!data) {
|
||||
message.error('查询不到流程信息!')
|
||||
@ -316,11 +307,21 @@ const getProcessInstance = async () => {
|
||||
})
|
||||
} else {
|
||||
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
||||
//console.log(data.processDefinition.formCustomViewPath,"formCustomViewPath")
|
||||
if ( data.processDefinition.formCustomViewPath == "") {
|
||||
const process_key = data.processDefinition.key
|
||||
const formCustomViewPath = await FormProcessMappingApi.getFormViewPath(process_key)
|
||||
BusinessFormComponent.value = registerComponent(formCustomViewPath)
|
||||
|
||||
if ( formCustomViewPath.length == 1) {
|
||||
BusinessFormComponent.value = registerComponent(formCustomViewPath[0])
|
||||
} else{
|
||||
const formCreatePath = await ProcessInstanceTodoApi.getProcessInstanceFormCreatePath( id )
|
||||
if ( formCreatePath ) {
|
||||
const formCustomViewPaht = await FormProcessMappingApi.getFormCustomViewPath( formCreatePath )
|
||||
if ( formCustomViewPaht ) {
|
||||
BusinessFormComponent.value = registerComponent(formCustomViewPaht)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
|
||||
}
|
||||
@ -411,7 +412,7 @@ const loadRunningTask = (tasks) => {
|
||||
/** 初始化 */
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
onMounted(async () => {
|
||||
getDetail()
|
||||
getDetail()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user