调整更新

This commit is contained in:
Flow 2025-07-23 14:46:09 +08:00
parent 493420642b
commit 87b48badde
3 changed files with 34 additions and 25 deletions

View File

@ -427,14 +427,17 @@ const onSetting = (row: any) => {
//
const handleApply = async (row: any) => {
try {
//
const updateData = { ...row, status: 1 }
await abpmApi.updateabpm(updateData)
//
row.status = 1
ElMessage.success(`${row.name} 申请成功`)
const userinfo = await getUserProfile()
const orginfo = await OrgApi.getOrg(userinfo.orgid)
if (orginfo.parentOrgId != null) {
const updateData = { ...row, status: 1, managerorg: orginfo.parentOrgId }
await abpmApi.updateabpm(updateData)
ElMessage.success(`${row.name} 申请成功`)
getList()
} else {
ElMessage.error('无上级机构')
return
}
} catch (error) {
console.error('申请失败:', error)
ElMessage.error('申请失败,请重试')

View File

@ -110,7 +110,7 @@
</el-table-column>
<el-table-column prop="status" label="状态" align="center" min-width="70">
<template #default="{ row }">
<el-link v-if="row.status === '1'" type="success" :underline="false" disabled
<el-link v-if="row.status == '1'" type="success" :underline="false" disabled
>已申请</el-link
>
<el-link v-else type="primary" @click="handleApply(row)">申请</el-link>
@ -258,14 +258,16 @@ const onViewReport = (row: any) => {
const handleApply = async (row: any) => {
try {
//
const updateData = { ...row, status: 1 }
await StaticecgApi.updateStaticecg(updateData)
//
row.status = 1
ElMessage.success(`${row.name} 申请成功`)
cc
if (orginfo.parentOrgId != null) {
const updateData = { ...row, status: 1, managerorg: orginfo.parentOrgId }
await StaticecgApi.updateStaticecg(updateData)
ElMessage.success(`${row.name} 申请成功`)
getList()
} else {
ElMessage.error('无上级机构')
return
}
} catch (error) {
console.error('申请失败:', error)
ElMessage.error('申请失败,请重试')

View File

@ -327,7 +327,7 @@
@click="handleApply(row)"
>
<Icon icon="ep:document-add" />
申请
申请
</el-button>
<el-tag v-else type="success" class="status-tag"> 已申请 </el-tag>
</template>
@ -622,6 +622,7 @@ import { ecgdataApi, ecgdataVO } from '@/api/ecgdata'
import { Search, Refresh, Plus, Download } from '@element-plus/icons-vue'
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
import { uploadFileInChunks } from '@/utils/upload'
import { OrgApi } from '@/api/org'
defineOptions({ name: 'AnalysisHolter' })
const Profilevo = ref<ProfileVO>({} as ProfileVO) //
@ -1467,13 +1468,16 @@ const handleApply = async (row) => {
cancelButtonText: '取消',
type: 'warning'
})
// API
await ecgdataApi.applySuperiorReview(row.id, row.orgid)
ElMessage.success('申请已提交,等待上级审核')
//
getList()
const userinfo = await getUserProfile()
const orginfo = await OrgApi.getOrg(userinfo.orgid)
if (orginfo.parentOrgId != null) {
await ecgdataApi.applySuperiorReview(row.id, orginfo.parentOrgId)
ElMessage.success('申请已提交,等待上级审核')
getList()
} else {
ElMessage.error('无上级机构')
return
}
} catch (error) {
if (error !== 'cancel') {
console.error('申请失败:', error)