diff --git a/src/components/Approval/selectApproverDialog.vue b/src/components/Approval/selectApproverDialog.vue index 866ef12..8fc7c6b 100644 --- a/src/components/Approval/selectApproverDialog.vue +++ b/src/components/Approval/selectApproverDialog.vue @@ -31,6 +31,7 @@ deptType: '', }) const list = ref([]) +const tableRef = ref() const checkoutList = ref([]) const total = ref(0) const treeData = ref([]) @@ -116,6 +117,9 @@ } // 关闭弹窗 function dialogClose() { + if (tableRef.value) { + tableRef.value.clearMulti() + } dialogVisible.value = false } // ----------------------- 以下是暴露的方法内容 ---------------------------- @@ -174,6 +178,7 @@ { + if (!approverList.length) { + ElMessage.warning('无审批人,无法提交!') + return false + } + console.log('审批人', approverList) + ElMessageBox.confirm(`是否提交计量数据管理 ${submitRow.value.certificateReportCode}-${submitRow.value.certificateReportName}`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + if (submitRow.value.id) { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + const params = { + id: submitRow.value.id, + formId: SCHEDULE.BUSINESS_REPORT_ON_CREDENTIALS, // 表单id + assignees: approverList, + } + submit(params).then(() => { + ElMessage.success('提交成功') + loading.close() + fetchData(true) + }).catch(() => { + loading.close() + }) + } + else { + ElMessage.warning('请先保存!') + } + }) +} +// -------------------------------------------------------------------------------------- // 操作 const handleEdit = (row: IList, val: string, title = '') => { @@ -218,24 +258,8 @@ }) } else if (val === '提交') { - ElMessageBox.confirm( - '确认提交该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submit({ id: row.id, formId: SCHEDULE.BUSINESS_REPORT_ON_CREDENTIALS, processId: row.processId }).then((res) => { - ElMessage({ - type: 'success', - message: '已提交', - }) - fetchData(true) - }) - }) + submitRow.value = row + selectApproverRef.value.initDialog() } else if (val === '同意') { approvalDialog.value.initDialog('agree', row.taskId, row.id, row.decisionItem, row.processId) @@ -508,7 +532,10 @@ - + + + +