This commit is contained in:
吴红兵
2026-03-08 17:37:57 +08:00
parent 877d9f0848
commit 35d179b1b9
2 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,247 @@
<template>
<el-dialog v-model="visible" title="招标文件审批详情" width="90%" top="5vh" destroy-on-close append-to-body>
<template #header>
<div class="dialog-header">
<span class="dialog-title">
<el-icon><DocumentChecked /></el-icon>
招标文件审批详情 - {{ applyData.purchaseNo || applyId }}
</span>
</div>
</template>
<el-row :gutter="16">
<el-col :span="8">
<el-card shadow="never" class="info-card">
<template #header>
<div class="card-header">
<span class="card-title">采购申请信息</span>
</div>
</template>
<el-descriptions :column="1" border size="small">
<el-descriptions-item label="采购编号">{{ applyData.purchaseNo || '-' }}</el-descriptions-item>
<el-descriptions-item label="项目名称">{{ applyData.projectName || '-' }}</el-descriptions-item>
<el-descriptions-item label="采购金额">{{ applyData.budget ? Number(applyData.budget).toLocaleString() + ' 元' : '-' }}</el-descriptions-item>
<el-descriptions-item label="招标代理">{{ applyData.agentName || '-' }}</el-descriptions-item>
<el-descriptions-item label="审批状态">
<el-tag v-if="applyData.fileFlowStatus === '0'" type="primary">运行中</el-tag>
<el-tag v-else-if="applyData.fileFlowStatus === '1'" type="success">完成</el-tag>
<el-tag v-else-if="applyData.fileFlowStatus === '2'" type="danger">作废</el-tag>
<el-tag v-else-if="applyData.fileFlowStatus === '3'" type="info">终止</el-tag>
<el-tag v-else type="warning">未发起</el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card shadow="never" class="file-card">
<template #header>
<div class="card-header">
<span class="card-title">招标文件</span>
</div>
</template>
<el-table :data="docList" border stripe size="small" v-if="docList.length > 0" max-height="300">
<el-table-column type="index" label="序号" width="50" />
<el-table-column prop="fileName" label="文件名称" show-overflow-tooltip />
<el-table-column prop="createTime" label="上传时间" width="160" />
<el-table-column label="操作" width="120" align="center">
<template #default="scope">
<el-button type="primary" link size="small" icon="View" @click="handlePreview(scope.row)">预览</el-button>
<el-button type="success" link size="small" icon="Download" @click="handleDownload(scope.row)">下载</el-button>
</template>
</el-table-column>
</el-table>
<el-empty v-else description="暂无招标文件" :image-size="60" />
</el-card>
</el-col>
<el-col :span="16">
<el-card shadow="never" class="flow-card">
<template #header>
<div class="card-header">
<span class="card-title">审批流程</span>
</div>
</template>
<template v-if="applyData.fileFlowInstId">
<FlowCommentTimeline :key="String(applyData.fileFlowInstId) + 'doc'" :curr-job="fileFlowJob" />
</template>
<el-empty v-else description="暂未发起审批流程" :image-size="80" />
</el-card>
</el-col>
</el-row>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
<el-dialog v-model="previewVisible" :title="previewTitle" width="80%" top="5vh" destroy-on-close append-to-body>
<div class="preview-container">
<iframe v-if="previewUrl" :src="previewUrl" class="preview-iframe" />
</div>
</el-dialog>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { DocumentChecked } from '@element-plus/icons-vue';
import { useMessage } from '/@/hooks/message';
import { getObj, getDocList, previewFileById, downloadFileById } from '/@/api/purchase/purchasingrequisition';
const FlowCommentTimeline = defineAsyncComponent(() => import('/@/views/jsonflow/comment/timeline.vue'));
interface DocItem {
id: string;
fileName: string;
fileUrl: string;
createTime?: string;
}
const visible = ref(false);
const applyId = ref('');
const applyData = ref<any>({});
const docList = ref<DocItem[]>([]);
const previewVisible = ref(false);
const previewTitle = ref('');
const previewUrl = ref('');
const fileFlowJob = computed(() => {
if (!applyData.value.fileFlowInstId) return null;
return {
id: applyData.value.id,
flowInstId: applyData.value.fileFlowInstId,
};
});
const open = async (id: string, row?: any) => {
applyId.value = id || '';
visible.value = true;
docList.value = [];
applyData.value = row || {};
if (!row || !row.fileFlowInstId) {
try {
const res = await getObj(id);
applyData.value = res?.data || {};
} catch (e) {
console.error('获取采购申请详情失败', e);
useMessage().error('获取采购申请详情失败');
return;
}
}
// 加载招标文件列表
if (applyData.value.id) {
try {
const docsRes = await getDocList(applyData.value.id);
const docs = docsRes?.data || [];
if (Array.isArray(docs) && docs.length > 0) {
docList.value = docs.map((d: any) => ({
id: d.id || d.fileId,
fileName: d.fileName || d.fileTitle || '招标文件',
fileUrl: d.fileUrl,
createTime: d.createTime,
}));
}
} catch (e) {
console.error('获取招标文件列表失败', e);
}
}
};
const handlePreview = async (row: DocItem) => {
if (!row.id) {
useMessage().warning('文件ID不存在');
return;
}
try {
const blob = await previewFileById(row.id);
previewUrl.value = window.URL.createObjectURL(blob);
previewTitle.value = row.fileName || '文件预览';
previewVisible.value = true;
} catch (e) {
console.error('预览失败', e);
useMessage().error('预览失败');
}
};
const handleDownload = async (row: DocItem) => {
if (!row.id) {
useMessage().warning('文件ID不存在');
return;
}
try {
const blob = await downloadFileById(row.id);
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = row.fileName || '招标文件.pdf';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
} catch (e) {
console.error('下载失败', e);
useMessage().error('下载失败');
}
};
const emit = defineEmits<{
(e: 'refresh'): void;
}>();
defineExpose({
open,
});
</script>
<style scoped lang="scss">
.dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.dialog-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 16px;
font-weight: 500;
}
.info-card,
.file-card,
.flow-card {
margin-bottom: 16px;
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.card-title {
font-size: 14px;
font-weight: 500;
}
.preview-container {
width: 100%;
height: 75vh;
}
.preview-iframe {
width: 100%;
height: 100%;
border: none;
}
:deep(.el-card__header) {
padding: 12px 16px;
}
:deep(.el-card__body) {
padding: 12px 16px;
}
</style>

View File

@@ -270,6 +270,37 @@
</template>
</el-table-column>
<!-- 招标审批列 -->
<el-table-column prop="fileFlowStatus" label="招标审批" width="100" align="center">
<template #header>
<el-icon>
<DocumentChecked />
</el-icon>
<span style="margin-left: 4px">招标审批</span>
</template>
<template #default="scope">
<template v-if="scope.row.fileFlowInstId">
<el-tooltip v-if="scope.row.fileFlowInstId" content="点击查看审批流程及招标文件" placement="top">
<el-tag v-if="scope.row.fileFlowStatus === '0'" type="primary" class="status-tag-clickable" @click="handleShowDocAudit(scope.row)"
>运行中
</el-tag>
<el-tag v-else-if="scope.row.fileFlowStatus === '1'" type="success" class="status-tag-clickable" @click="handleShowDocAudit(scope.row)"
>完成
</el-tag>
<el-tag v-else-if="scope.row.fileFlowStatus === '2'" type="danger" class="status-tag-clickable" @click="handleShowDocAudit(scope.row)"
>作废
</el-tag>
<el-tag v-else-if="scope.row.fileFlowStatus === '3'" type="info" class="status-tag-clickable" @click="handleShowDocAudit(scope.row)"
>终止
</el-tag>
<el-tag v-else type="warning" class="status-tag-clickable" @click="handleShowDocAudit(scope.row)">未知</el-tag>
</el-tooltip>
<el-tag v-else type="info">未发起</el-tag>
</template>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="150">
<template #default="scope">
<div class="op-cell">
@@ -333,6 +364,9 @@
<!-- 补充材料查看弹窗 -->
<SupplementViewDialog ref="supplementViewDialogRef" @refresh="getDataList" />
<!-- 招标文件审批查看弹窗 -->
<DocAuditViewDialog ref="docAuditViewDialogRef" @refresh="getDataList" />
<!-- 招标文件审核弹窗 -->
<!-- <DocAuditDialog ref="docAuditDialogRef" @refresh="getDataList" />-->
@@ -450,6 +484,7 @@ const UpdateFilesDialog = defineAsyncComponent(() => import('./UpdateFilesDialog
const ContractDialog = defineAsyncComponent(() => import('./contract/ContractDialog.vue'));
const SupplementFilesDialog = defineAsyncComponent(() => import('./SupplementFilesDialog.vue'));
const SupplementViewDialog = defineAsyncComponent(() => import('./SupplementViewDialog.vue'));
const DocAuditViewDialog = defineAsyncComponent(() => import('./DocAuditViewDialog.vue'));
// const DocAuditDialog = defineAsyncComponent(() => import('./docAudit/DocAuditDialog.vue'));
// 字典数据和品目树数据
@@ -483,6 +518,7 @@ const updateFilesDialogRef = ref();
const contractDialogRef = ref();
const supplementFilesDialogRef = ref();
const supplementViewDialogRef = ref();
const docAuditViewDialogRef = ref();
/** 采购代表弹窗 */
const representorDialogVisible = ref(false);
@@ -603,6 +639,16 @@ const handleShowFileFlowComment = (row: any) => {
showFlowComment.value = true;
};
/** 点击招标审批状态:打开招标文件审批查看弹窗 */
const handleShowDocAudit = (row: any) => {
const id = row?.id ?? row?.purchaseId;
if (!id) {
useMessage().warning('无法获取采购申请ID');
return;
}
docAuditViewDialogRef.value?.open(String(id), row);
};
const SUPPLEMENT_STATUS_MAP: Record<string, { icon: any; class: string; tooltip: string }> = {
'1': { icon: Select, class: 'supplement-done', tooltip: '补充材料已完成,点击查看' },
'0': { icon: CloseBold, class: 'supplement-running', tooltip: '补充材料审批中,点击查看' },