查看模式下新增实施采购的信息

This commit is contained in:
吴红兵
2026-02-08 23:47:56 +08:00
parent 00a005e65f
commit 8c51f49b74

View File

@@ -396,6 +396,46 @@
</el-form-item>
</el-col>
</el-row>
<!-- 查看时实施采购信息 -->
<div v-if="isViewMode && (dataForm.implementType || viewImplementPurchaseFiles.length)" class="implement-info-block mb20">
<el-divider content-position="left">实施采购信息</el-divider>
<el-row :gutter="24">
<el-col :span="12" class="mb16" v-if="dataForm.implementType">
<div class="view-label">实施采购方式</div>
<div class="view-value">{{ dataForm.implementType === '1' ? '自行组织采购' : dataForm.implementType === '2' ? '委托代理采购' : dataForm.implementType || '—' }}</div>
</el-col>
<el-col :span="12" class="mb16" v-if="dataForm.fileFlowInstId">
<div class="view-label">文件审批状态</div>
<div class="view-value">
<el-tag v-if="dataForm.fileFlowStatus === '-2'" type="info">撤回</el-tag>
<el-tag v-else-if="dataForm.fileFlowStatus === '-1'" type="warning">暂存</el-tag>
<el-tag v-else-if="dataForm.fileFlowStatus === '0'" type="primary">运行中</el-tag>
<el-tag v-else-if="dataForm.fileFlowStatus === '1'" type="success">完成</el-tag>
<el-tag v-else-if="dataForm.fileFlowStatus === '2'" type="danger">作废</el-tag>
<el-tag v-else-if="dataForm.fileFlowStatus === '3'" type="info">终止</el-tag>
<span v-else></span>
</div>
</el-col>
</el-row>
<div v-if="viewImplementPurchaseFiles.length" class="mb16">
<div class="view-label mb8">采购文件</div>
<el-table :data="viewImplementPurchaseFiles" border size="small" max-height="240">
<el-table-column type="index" label="版本" width="70" align="center">
<template #default="{ $index }">V{{ $index + 1 }}</template>
</el-table-column>
<el-table-column prop="fileTitle" label="文件名" min-width="180" show-overflow-tooltip />
<el-table-column label="上传时间" width="165" align="center">
<template #default="{ row }">{{ formatImplementFileTime(row.createTime) }}</template>
</el-table-column>
<el-table-column label="操作" width="90" align="center">
<template #default="{ row }">
<el-button type="primary" link size="small" @click="downloadImplementFile(row)">下载</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-form>
<!-- 操作按钮流程嵌入时隐藏取消/返回由流程页处理 -->
@@ -554,7 +594,13 @@ const dataForm = reactive({
schoolLeaderName: '',
// 其他材料zip压缩包
otherMaterials: '',
// 实施采购信息(查看时展示)
implementType: '',
fileFlowInstId: '',
fileFlowStatus: '',
});
/** 查看时展示的采购文件列表(实施采购上传的 type=130 */
const viewImplementPurchaseFiles = ref<{ id: string; fileTitle?: string; createTime?: string; remark?: string }[]>([]);
const categoryTreeData = ref<any[]>([]);
const categoryCodePath = ref<string[]>([]); // 级联选择器的路径数组
const fundSourceList = ref<any[]>([]);
@@ -1100,6 +1146,9 @@ async function loadDetail(applyId: string | number) {
schoolLeaderUserId: detail.schoolLeaderUserId ?? '',
schoolLeaderName: detail.schoolLeaderName ?? '',
otherMaterials: detail.otherMaterials ?? '',
implementType: detail.implementType ?? '',
fileFlowInstId: detail.fileFlowInstId ?? '',
fileFlowStatus: detail.fileFlowStatus ?? '',
});
setCategoryCodePath();
if (dataForm.budget != null) {
@@ -1129,9 +1178,20 @@ async function loadDetail(applyId: string | number) {
});
}
});
// 查看时展示实施采购的采购文件列表type=130
const purchaseFiles = fileList.filter((f: any) => String(f.fileType) === '130').map((f: any) => ({
id: f.id,
fileTitle: f.fileTitle || f.file_title || '采购文件',
createTime: f.createTime || f.create_time,
remark: f.remark,
}));
viewImplementPurchaseFiles.value = purchaseFiles;
} else {
viewImplementPurchaseFiles.value = [];
}
} catch (err) {
console.error('加载采购申请附件失败', err);
viewImplementPurchaseFiles.value = [];
}
}
} catch (e) {
@@ -1140,6 +1200,21 @@ async function loadDetail(applyId: string | number) {
}
}
function formatImplementFileTime(t?: string) {
if (!t) return '—';
const d = new Date(t);
return isNaN(d.getTime()) ? t : d.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
}
function downloadImplementFile(file: { remark?: string; fileTitle?: string }) {
if (!file?.remark) {
useMessage().warning('无法获取文件路径');
return;
}
const url = `/purchase/purchasingfiles/download?fileName=${encodeURIComponent(file.remark)}&fileTitle=${encodeURIComponent(file.fileTitle || '采购文件')}`;
other.downBlobFile(url, {}, file.fileTitle || '采购文件');
}
/** 流程嵌入时提供给 orderVue.currElTabIsView 的 methods只读/禁用提交) */
const flowMethods = {
disableForm(disabled?: boolean) {
@@ -1827,6 +1902,9 @@ onMounted(async () => {
.mb16 {
margin-bottom: 16px;
}
.mb8 {
margin-bottom: 8px;
}
.mb10 {
margin-bottom: 10px;
}
@@ -1842,6 +1920,18 @@ onMounted(async () => {
margin-bottom: 16px;
}
.implement-info-block {
.view-label {
font-size: 14px;
color: var(--el-text-color-secondary);
margin-bottom: 4px;
}
.view-value {
font-size: 14px;
color: var(--el-text-color-primary);
}
}
/* 紧凑表单样式 */
.compact-form {
:deep(.el-form-item) {