浏览代码

feat: 表单提交

luoyali 1 年之前
父节点
当前提交
12ca57e71d
共有 2 个文件被更改,包括 20 次插入4 次删除
  1. 20 3
      src/views/approve/components/approvedContent.vue
  2. 0 1
      src/views/flow/test/businessLaunch.vue

+ 20 - 3
src/views/approve/components/approvedContent.vue

@@ -39,7 +39,7 @@
 					<!-- 审批信息 -->
 					<div v-show="tabName === 'ApprovalInfo'" class="scroll-wrap">
 						<!-- 系统表单-->
-						<template v-if="currentTaskRow.processType === 'business' && currentObj?.formTemplate.type">
+						<template v-if="currentTaskRow.processType === 'business' && currentObj?.formTemplate.type === 1">
 							<component :is="dyVueComponent" ref="dyVueComponentRef"></component>
 						</template>
 
@@ -384,10 +384,14 @@ const openComment = async (visibleType, item) => {
 }
 /**
  * 获取taskId对应的详情
+ * @param taskId
+ * 1、获取流程数据
+ * 2、获取表单数据
+ * 	2.1 主流程、业务流程(type=0 表单设计)、子流程 使用EverightForm表单来渲染表单值
+ * 	2.2 业务流程(type=1 使用系统表单来渲染表单值)
  */
 const getTaskDetail = () => {
 	const cur = currentTaskRow.value || {}
-	// 提交的表单 数据展示
 	validateForm.value.loading = true
 	processTaskApprovalInfo({
 		taskId: cur.taskId,
@@ -404,7 +408,6 @@ const getTaskDetail = () => {
 				v.local_content = _content?.opinion
 			})
 			activeData.value = activeList
-			// todo 获取当前的操作权限,进行赋值
 			try {
 				const modelContent = JSON.parse(data.modelContent || '{}')
 				const modelContent_config = modelContent.nodeConfig // ?? modelContent.childNode
@@ -413,6 +416,7 @@ const getTaskDetail = () => {
 				}
 				modelContentConfig.value = modelContent_config || {}
 				window.modelContentConfig = modelContentConfig
+				/* 允许转交 允许加减签 允许回退 start */
 				if (props.currentTaskType === 'pendingApproval') {
 					allowTransfer.value = data?.allowTransfer
 					allowAppendNode.value = data?.allowAppendNode
@@ -424,12 +428,25 @@ const getTaskDetail = () => {
 				if (props.currentTaskType === 'myApplication') {
 					allowRevocation.value = data.processSetting.allowRevocation
 				}
+				/* 允许转交 允许加减签 允许回退 end */
+
 				/* 这里主要是表单设计的逻辑 start */
 				let formContent = null
 				const { processType } = currentTaskRow.value
 				if (processType === 'business') {
 					currentObj.value = data
 					if (data?.formTemplate.type === 1) {
+						dyVueForm.value = {
+							dy: {
+								name: '测试名字',
+								region: 1,
+								delivery: true,
+								type: ['1'],
+								resource: 'Sponsor',
+								desc: '啦啦啦'
+							}
+						}
+						dyVueComponent.value = markRaw(defineAsyncComponent(() => import('@/views/flow/test/test1.vue')))
 						return
 					} else {
 						formContent = `{"formStructure":${data.formTemplate.content}}` || '{}'

+ 0 - 1
src/views/flow/test/businessLaunch.vue

@@ -141,7 +141,6 @@ const onSubmit = async () => {
 			})
 	}
 
-
 }
 
 // 获取当前表单中的详情