This commit is contained in:
吴红兵
2026-03-04 23:20:40 +08:00
parent 7f61c9bdce
commit 48b31285c8
3 changed files with 108 additions and 32 deletions

View File

@@ -109,11 +109,19 @@
<el-icon><List /></el-icon>
</template>
</el-table-column>
<el-table-column prop="purchaseNo" label="申请单编号" min-width="140" show-overflow-tooltip>
<el-table-column prop="purchaseNo" label="申请单编号" min-width="150" show-overflow-tooltip>
<template #header>
<el-icon><DocumentCopy /></el-icon>
<span style="margin-left: 4px">申请单编号</span>
</template>
<template #default="scope">
<div class="purchase-no-cell">
<span>{{ scope.row.purchaseNo }}</span>
<el-button v-if="scope.row.purchaseNo" type="primary" link size="small" class="copy-btn" @click.stop="copyToClipboard(scope.row.purchaseNo)">
<el-icon><CopyDocument /></el-icon>
</el-button>
</div>
</template>
</el-table-column>
<el-table-column prop="projectName" label="采购项目名称" min-width="200" show-overflow-tooltip>
<template #header>
@@ -185,15 +193,18 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="purchaseMode" label="采购形式" width="130" align="center">
<el-table-column prop="purchaseMode" label="采购形式" width="140" align="center">
<template #header>
<el-icon><Shop /></el-icon>
<span style="margin-left: 4px">采购形式</span>
</template>
<template #default="scope">
<el-tag v-if="scope.row.purchaseMode === '1'" type="success">部门自行采购</el-tag>
<el-tag v-else-if="scope.row.purchaseMode === '2'" type="primary">学校统一采购</el-tag>
<span v-else>-</span>
<div class="purchase-mode-cell">
<el-tag v-if="scope.row.purchaseMode === '1'" type="success">部门自行采购</el-tag>
<el-tag v-else-if="scope.row.purchaseMode === '2'" type="primary">学校统一采购</el-tag>
<span v-else>-</span>
<el-tag v-if="scope.row.purchaseMode === '1' && scope.row.purchaseChannel === '2'" type="warning" size="small" class="entrust-tag"></el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="purchaseType" label="采购方式" width="120" align="center">
@@ -383,7 +394,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import { useAuth } from '/@/hooks/auth';
import { getDicts } from '/@/api/admin/dict';
import { getTree } from '/@/api/purchase/purchasingcategory';
import { List, Document, DocumentCopy, Search, Money, CircleCheck, InfoFilled, Calendar, OfficeBuilding, Warning, DocumentChecked, Edit, Delete, Upload, FolderOpened, Download, User, RefreshRight, Shop } from '@element-plus/icons-vue'
import { List, Document, DocumentCopy, Search, Money, CircleCheck, InfoFilled, Calendar, OfficeBuilding, Warning, DocumentChecked, Edit, Delete, Upload, FolderOpened, Download, User, RefreshRight, Shop, CopyDocument } from '@element-plus/icons-vue'
import other from '/@/utils/other'
import { Session } from '/@/utils/storage'
@@ -574,6 +585,26 @@ const handleImplement = (row: any) => {
implementFormRef.value?.openDialog(row);
};
/** 复制到剪贴板 */
const copyToClipboard = async (text: string) => {
if (!text) return;
try {
await navigator.clipboard.writeText(text);
useMessage().success('复制成功');
} catch (err) {
// 降级方案
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.opacity = '0';
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
useMessage().success('复制成功');
}
};
/** 打开招标文件审核 */
const handleDocAudit = (row: any) => {
docAuditDialogRef.value?.open(row);
@@ -973,5 +1004,34 @@ onMounted(() => {
--el-tag-border-color: #e0e0e0;
--el-tag-text-color: #616161;
}
.purchase-no-cell {
display: flex;
align-items: center;
gap: 4px;
.copy-btn {
opacity: 0;
transition: opacity 0.2s;
}
&:hover .copy-btn {
opacity: 1;
}
}
.purchase-mode-cell {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
.entrust-tag {
font-size: 11px;
padding: 0 4px;
height: 18px;
line-height: 16px;
}
}
</style>