!432 将业务表单做为动态组件,直接显示到审批页面,不再需要点击查看

Merge pull request !432 from 疯狂的世界/flowable
This commit is contained in:
芋道源码 2023-04-15 02:26:14 +00:00 committed by Gitee
commit f62bf6c21c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 19 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" label-width="100px">
<el-form-item label="开始时间:" prop="startTime"> {{parseTime(form.startTime, '{y}-{m}-{d}')}} </el-form-item> <el-form-item label="开始时间:" prop="startTime"> {{parseTime(form.startTime, '{y}-{m}-{d}')}} </el-form-item>
<el-form-item label="结束时间:" prop="endTime"> {{parseTime(form.endTime, '{y}-{m}-{d}')}} </el-form-item> <el-form-item label="结束时间:" prop="endTime"> {{parseTime(form.endTime, '{y}-{m}-{d}')}} </el-form-item>
<el-form-item label="请假类型:" prop="type"> <el-form-item label="请假类型:" prop="type">
@ -19,9 +19,15 @@ export default {
name: "BpmOALeaveDetail", name: "BpmOALeaveDetail",
components: { components: {
}, },
props: {
id: {
type: [String, Number],
default: undefined
},
},
data() { data() {
return { return {
id: undefined, // leaveId: undefined, //
// //
form: { form: {
startTime: undefined, startTime: undefined,
@ -34,8 +40,8 @@ export default {
}; };
}, },
created() { created() {
this.id = this.$route.query.id; this.leaveId = this.id || this.$route.query.id;
if (!this.id) { if (!this.leaveId) {
this.$message.error('未传递 id 参数,无法查看 OA 请假信息'); this.$message.error('未传递 id 参数,无法查看 OA 请假信息');
return; return;
} }
@ -44,7 +50,7 @@ export default {
methods: { methods: {
/** 获得请假信息 */ /** 获得请假信息 */
getDetail() { getDetail() {
getLeave(this.id).then(response => { getLeave(this.leaveId).then(response => {
this.form = response.data; this.form = response.data;
}); });
}, },

View File

@ -39,10 +39,7 @@
</div> </div>
</el-col> </el-col>
<div v-if="this.processInstance.processDefinition && this.processInstance.processDefinition.formType === 20"> <div v-if="this.processInstance.processDefinition && this.processInstance.processDefinition.formType === 20">
<router-link :to="this.processInstance.processDefinition.formCustomViewPath + '?id=' <async-biz-form-component :id="this.processInstance.businessKey"></async-biz-form-component>
+ this.processInstance.businessKey">
<el-button type="primary">点击查看</el-button>
</router-link>
</div> </div>
</el-card> </el-card>
@ -115,6 +112,7 @@ import {approveTask, getTaskListByProcessInstanceId, rejectTask, updateTaskAssig
import {getDate} from "@/utils/dateUtils"; import {getDate} from "@/utils/dateUtils";
import {listSimpleUsers} from "@/api/system/user"; import {listSimpleUsers} from "@/api/system/user";
import {getActivityList} from "@/api/bpm/activity"; import {getActivityList} from "@/api/bpm/activity";
import Vue from "vue";
// //
export default { export default {
@ -193,6 +191,12 @@ export default {
// //
this.processInstance = response.data; this.processInstance = response.data;
//
const path = this.processInstance.processDefinition.formCustomViewPath;
Vue.component("async-biz-form-component", function(resolve) {
require([`@/views${path}`], resolve);
});
// //
if (this.processInstance.processDefinition.formType === 10) { if (this.processInstance.processDefinition.formType === 10) {
this.detailForm = { this.detailForm = {