【功能修复】工作流:流程审批不通过后,重启发起时,直接报错的问题
parent
d599134de6
commit
67430a83fb
|
@ -70,13 +70,7 @@
|
||||||
|
|
||||||
<!-- 弹窗:流程模型图的预览 -->
|
<!-- 弹窗:流程模型图的预览 -->
|
||||||
<Dialog title="流程图" v-model="bpmnDetailVisible" width="800">
|
<Dialog title="流程图" v-model="bpmnDetailVisible" width="800">
|
||||||
<MyProcessViewer
|
<MyProcessViewer style="height: 700px" key="designer" :xml="bpmnXml" />
|
||||||
key="designer"
|
|
||||||
v-model="bpmnXml"
|
|
||||||
:value="bpmnXml as any"
|
|
||||||
v-bind="bpmnControlForm"
|
|
||||||
:prefix="bpmnControlForm.prefix"
|
|
||||||
/>
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -118,7 +112,7 @@ const formDetailPreview = ref({
|
||||||
rule: [],
|
rule: [],
|
||||||
option: {}
|
option: {}
|
||||||
})
|
})
|
||||||
const handleFormDetail = async (row) => {
|
const handleFormDetail = async (row: any) => {
|
||||||
if (row.formType == 10) {
|
if (row.formType == 10) {
|
||||||
// 设置表单
|
// 设置表单
|
||||||
setConfAndFields2(formDetailPreview, row.formConf, row.formFields)
|
setConfAndFields2(formDetailPreview, row.formConf, row.formFields)
|
||||||
|
@ -133,13 +127,13 @@ const handleFormDetail = async (row) => {
|
||||||
|
|
||||||
/** 流程图的详情按钮操作 */
|
/** 流程图的详情按钮操作 */
|
||||||
const bpmnDetailVisible = ref(false)
|
const bpmnDetailVisible = ref(false)
|
||||||
const bpmnXml = ref(null)
|
const bpmnXml = ref('')
|
||||||
const bpmnControlForm = ref({
|
const handleBpmnDetail = async (row: any) => {
|
||||||
prefix: 'flowable'
|
// 设置可见
|
||||||
})
|
bpmnXml.value = ''
|
||||||
const handleBpmnDetail = async (row) => {
|
|
||||||
bpmnXml.value = (await DefinitionApi.getProcessDefinition(row.id))?.bpmnXml
|
|
||||||
bpmnDetailVisible.value = true
|
bpmnDetailVisible.value = true
|
||||||
|
// 加载 BPMN XML
|
||||||
|
bpmnXml.value = (await DefinitionApi.getProcessDefinition(row.id))?.bpmnXml
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as DefinitionApi from '@/api/bpm/definition'
|
import * as DefinitionApi from '@/api/bpm/definition'
|
||||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
import { decodeFields, setConfAndFields2 } from '@/utils/formCreate'
|
||||||
import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
||||||
import ProcessInstanceBpmnViewer from '../detail/ProcessInstanceBpmnViewer.vue'
|
import ProcessInstanceBpmnViewer from '../detail/ProcessInstanceBpmnViewer.vue'
|
||||||
import { CategoryApi } from '@/api/bpm/category'
|
import { CategoryApi } from '@/api/bpm/category'
|
||||||
|
@ -185,7 +185,17 @@ const handleSelect = async (row, formVariables) => {
|
||||||
// 情况一:流程表单
|
// 情况一:流程表单
|
||||||
if (row.formType == 10) {
|
if (row.formType == 10) {
|
||||||
// 设置表单
|
// 设置表单
|
||||||
|
// 注意:需要从 formVariables 中,移除不在 row.formFields 的值。
|
||||||
|
// 原因是:后端返回的 formVariables 里面,会有一些非表单的信息。例如说,某个流程节点的审批人。
|
||||||
|
// 这样,就可能导致一个流程被审批不通过后,重新发起时,会直接后端报错!!!
|
||||||
|
const allowedFields = decodeFields(row.formFields).map((fieldObj: any) => fieldObj.field)
|
||||||
|
for (const key in formVariables) {
|
||||||
|
if (!allowedFields.includes(key)) {
|
||||||
|
delete formVariables[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
setConfAndFields2(detailForm, row.formConf, row.formFields, formVariables)
|
setConfAndFields2(detailForm, row.formConf, row.formFields, formVariables)
|
||||||
|
|
||||||
// 加载流程图
|
// 加载流程图
|
||||||
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(row.id)
|
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(row.id)
|
||||||
if (processDefinitionDetail) {
|
if (processDefinitionDetail) {
|
||||||
|
|
Loading…
Reference in New Issue