Commit 06d8ceb11c48dc432d069427e4c9987809080a40

Authored by YunaiV
1 parent bd6a1dcc

bpm:流程详情的审批表单

yudao-ui-admin-vue3/src/types/auto-components.d.ts
@@ -61,6 +61,8 @@ declare module '@vue/runtime-core' { @@ -61,6 +61,8 @@ declare module '@vue/runtime-core' {
61 ElTabPane: typeof import('element-plus/es')['ElTabPane'] 61 ElTabPane: typeof import('element-plus/es')['ElTabPane']
62 ElTabs: typeof import('element-plus/es')['ElTabs'] 62 ElTabs: typeof import('element-plus/es')['ElTabs']
63 ElTag: typeof import('element-plus/es')['ElTag'] 63 ElTag: typeof import('element-plus/es')['ElTag']
  64 + ElTimeline: typeof import('element-plus/es')['ElTimeline']
  65 + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
64 ElTooltip: typeof import('element-plus/es')['ElTooltip'] 66 ElTooltip: typeof import('element-plus/es')['ElTooltip']
65 ElTransfer: typeof import('element-plus/es')['ElTransfer'] 67 ElTransfer: typeof import('element-plus/es')['ElTransfer']
66 ElTree: typeof import('element-plus/es')['ElTree'] 68 ElTree: typeof import('element-plus/es')['ElTree']
yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 </template> 12 </template>
13 <el-col :span="16" :offset="6"> 13 <el-col :span="16" :offset="6">
14 <el-form 14 <el-form
15 - :ref="auditFormRefs" 15 + :ref="'form' + index"
16 :model="auditForms[index]" 16 :model="auditForms[index]"
17 :rules="auditRule" 17 :rules="auditRule"
18 label-width="100px" 18 label-width="100px"
@@ -119,6 +119,7 @@ @@ -119,6 +119,7 @@
119 </ContentWrap> 119 </ContentWrap>
120 </template> 120 </template>
121 <script setup lang="ts"> 121 <script setup lang="ts">
  122 +import { getCurrentInstance } from 'vue'
122 import dayjs from 'dayjs' 123 import dayjs from 'dayjs'
123 import * as ProcessInstanceApi from '@/api/bpm/processInstance' 124 import * as ProcessInstanceApi from '@/api/bpm/processInstance'
124 import * as TaskApi from '@/api/bpm/task' 125 import * as TaskApi from '@/api/bpm/task'
@@ -126,6 +127,7 @@ import { formatPast2 } from &#39;@/utils/formatTime&#39; @@ -126,6 +127,7 @@ import { formatPast2 } from &#39;@/utils/formatTime&#39;
126 127
127 const { query } = useRoute() // 查询参数 128 const { query } = useRoute() // 查询参数
128 const message = useMessage() // 消息弹窗 129 const message = useMessage() // 消息弹窗
  130 +const { proxy } = getCurrentInstance()
129 131
130 // ========== 审批信息 ========== 132 // ========== 审批信息 ==========
131 const id = query.id as unknown as number 133 const id = query.id as unknown as number
@@ -141,12 +143,14 @@ const auditRule = reactive({ @@ -141,12 +143,14 @@ const auditRule = reactive({
141 const handleAudit = async (task, pass) => { 143 const handleAudit = async (task, pass) => {
142 // 1.1 获得对应表单 144 // 1.1 获得对应表单
143 const index = runningTasks.value.indexOf(task) 145 const index = runningTasks.value.indexOf(task)
144 - // const auditFormRef = ref<any>([]).value.get(index) 146 + const auditFormRef = proxy.$refs['form' + index][0]
  147 + // alert(auditFormRef)
  148 +
145 // 1.2 校验表单 149 // 1.2 校验表单
146 - // const elForm = unref(auditFormRef)  
147 - // if (!elForm) return  
148 - // const valid = await auditFormRef.validate()  
149 - // if (!valid) return 150 + const elForm = unref(auditFormRef)
  151 + if (!elForm) return
  152 + const valid = await elForm.validate()
  153 + if (!valid) return
150 154
151 // 2.1 提交审批 155 // 2.1 提交审批
152 const data = { 156 const data = {