bpm:流程详情的审批表单

pull/2/head
YunaiV 2023-01-24 13:32:33 +08:00
parent bd6a1dcc64
commit 06d8ceb11c
2 changed files with 12 additions and 6 deletions

View File

@ -61,6 +61,8 @@ declare module '@vue/runtime-core' {
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTransfer: typeof import('element-plus/es')['ElTransfer']
ElTree: typeof import('element-plus/es')['ElTree']

View File

@ -12,7 +12,7 @@
</template>
<el-col :span="16" :offset="6">
<el-form
:ref="auditFormRefs"
:ref="'form' + index"
:model="auditForms[index]"
:rules="auditRule"
label-width="100px"
@ -119,6 +119,7 @@
</ContentWrap>
</template>
<script setup lang="ts">
import { getCurrentInstance } from 'vue'
import dayjs from 'dayjs'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import * as TaskApi from '@/api/bpm/task'
@ -126,6 +127,7 @@ import { formatPast2 } from '@/utils/formatTime'
const { query } = useRoute() //
const message = useMessage() //
const { proxy } = getCurrentInstance()
// ========== ==========
const id = query.id as unknown as number
@ -141,12 +143,14 @@ const auditRule = reactive({
const handleAudit = async (task, pass) => {
// 1.1
const index = runningTasks.value.indexOf(task)
// const auditFormRef = ref<any>([]).value.get(index)
const auditFormRef = proxy.$refs['form' + index][0]
// alert(auditFormRef)
// 1.2
// const elForm = unref(auditFormRef)
// if (!elForm) return
// const valid = await auditFormRef.validate()
// if (!valid) return
const elForm = unref(auditFormRef)
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
// 2.1
const data = {