客户自定义表单流程
This commit is contained in:
@ -38,7 +38,9 @@
|
||||
</template>
|
||||
</a-space>
|
||||
</div>
|
||||
<component v-if="customFormConfig.codeList.includes(curPageCode)" :is="componentName" :disabled="readonly" />
|
||||
<FormInformation
|
||||
v-else
|
||||
:key="renderKey"
|
||||
ref="formInformation"
|
||||
:disabled="readonly"
|
||||
@ -74,7 +76,7 @@
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { onMounted, reactive, ref, unref, createVNode, provide } from 'vue';
|
||||
import { onMounted, reactive, ref, unref, createVNode, provide,computed,defineAsyncComponent } from 'vue';
|
||||
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
||||
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
||||
import { getApprovalProcess, postApproval, postGetNextTaskMaybeArrival, postTransfer, getDrawNode, withdraw } from '/@/api/workflow/task';
|
||||
@ -97,6 +99,7 @@
|
||||
import { TaskTypeUrl } from '/@/enums/workflowEnum';
|
||||
import { postSetSign, postSetSignV2 } from '/@/api/workflow/task';
|
||||
import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';
|
||||
import {customFormConfig} from './customFormConfig'
|
||||
|
||||
const spinning = ref(false);
|
||||
const userStore = useUserStore();
|
||||
@ -174,7 +177,17 @@
|
||||
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
||||
});
|
||||
let approvedType = ref(ApproveType.AGREE);
|
||||
|
||||
|
||||
const componentName = computed(() => {
|
||||
if (!data.formInfos.length) {
|
||||
return defineAsyncComponent({
|
||||
loader: () => import('/@/views/secondDev/Empty.vue')
|
||||
});
|
||||
}
|
||||
return defineAsyncComponent({
|
||||
loader: () => import(`/@/views/${data.formInfos[0]?.functionalModule}/${data.formInfos[0]?.functionName}/components/createForm.vue`)
|
||||
});
|
||||
});
|
||||
function showButton(btn) {
|
||||
// 撤回有drawNode才显示,流程图任何情况下都显示
|
||||
let show =
|
||||
@ -570,10 +583,11 @@
|
||||
return data.taskApproveOpinions || [];
|
||||
}
|
||||
}
|
||||
|
||||
const curPageCode = ref()
|
||||
onMounted(async () => {
|
||||
try {
|
||||
let res = await getApprovalProcess(unref(taskId), unref(processId));
|
||||
curPageCode.value = res?.schemaInfo?.code
|
||||
initProcessData(res);
|
||||
await getBackNode();
|
||||
processInfo.value = res;
|
||||
|
||||
Reference in New Issue
Block a user