在待办任务中增加显示已完成的验收流程

pull/874/head
wh 2026-03-06 15:27:04 +08:00
parent 8c7c10f252
commit e6973e7564
8 changed files with 813 additions and 1311 deletions

8
.env
View File

@ -1,5 +1,5 @@
# 标题
VITE_APP_TITLE=芋道管理系统
VITE_APP_TITLE=ncc项目管理系统
# 项目本地运行端口号
VITE_PORT=80
@ -8,13 +8,13 @@ VITE_PORT=80
VITE_OPEN=true
# 租户开关
VITE_APP_TENANT_ENABLE=true
VITE_APP_TENANT_ENABLE=false
# 验证码的开关
VITE_APP_CAPTCHA_ENABLE=true
VITE_APP_CAPTCHA_ENABLE=false
# 文档地址的开关
VITE_APP_DOCALERT_ENABLE=true
VITE_APP_DOCALERT_ENABLE=false
# 百度统计
VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc

View File

@ -3,8 +3,8 @@ NODE_ENV=production
VITE_DEV=false
# 请求路径(修改为实际的后端服务地址,如果前后端在同一服务器,可以使用相对路径或当前域名)
VITE_BASE_URL='http://localhost:48080'
# 请求路径(如果前后端部署在同一台服务器上就设置为空否则设置为后端实际的ip+port)
VITE_BASE_URL=''
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server

View File

@ -175,6 +175,11 @@ export const getTodoList = () => {
return request.get({ url: '/project/acceptance/todo' })
}
// 查询已办任务
export const getDoneList = () => {
return request.get({ url: '/project/acceptance/done' })
}
// 获取验收状态列表
export const getStatusList = () => {
return request.get<{ code: string; name: string }[]>({ url: '/project/acceptance/status-list' })

View File

@ -1,6 +1,6 @@
<template>
<el-card v-loading="loading" class="box-card">
<MyProcessViewer key="designer" :xml="view.bpmnXml" :view="view" class="process-viewer" />
<MyProcessViewer v-if="view.bpmnXml" key="designer" :xml="view.bpmnXml" :view="view" class="process-viewer" />
</el-card>
</template>
<script lang="ts" setup>
@ -39,6 +39,17 @@ watch(
view.value.bpmnXml = value
}
)
onMounted(async () => {
await nextTick()
if (props.modelView) {
//@ts-ignore
view.value = props.modelView
}
if (props.bpmnXml) {
view.value.bpmnXml = props.bpmnXml
}
})
</script>
<style lang="scss" scoped>
.box-card {

File diff suppressed because it is too large Load Diff

View File

@ -146,6 +146,7 @@
<Icon icon="ep:check" class="mr-1" /> 审核
</el-button>
<el-button
v-if="!['98', '99'].includes(scope.row.status)"
link
type="warning"
@click="handleForceArchive(scope.row)"
@ -155,6 +156,7 @@
<Icon icon="ep:folder-checked" class="mr-1" /> 归档
</el-button>
<el-button
v-if="!['98', '99'].includes(scope.row.status)"
link
type="danger"
@click="handleCancel(scope.row)"

View File

@ -1,152 +1,271 @@
<template>
<ContentWrap>
<div class="mb-4">
<el-alert
title="待办任务"
type="info"
description="以下是您需要处理的验收任务"
:closable="false"
/>
<div class="app-container">
<!-- 顶部统计 -->
<div class="todo-header">
<div class="header-info">
<div class="header-title">
<Icon icon="ep:bell" class="header-icon" />
我的验收任务
</div>
<div class="header-sub">管理您参与的所有验收任务</div>
</div>
<div class="header-stats">
<div class="stat-item">
<span class="stat-num pending">{{ todoList.length }}</span>
<span class="stat-label">待处理</span>
</div>
<div class="stat-divider"></div>
<div class="stat-item">
<span class="stat-num done">{{ doneList.length }}</span>
<span class="stat-label">已处理</span>
</div>
</div>
</div>
<el-table v-loading="loading" :data="list" stripe>
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="项目编号" align="center" prop="projectCode" width="150" />
<el-table-column label="验收类型" align="center" prop="acceptanceType" width="100">
<template #default="scope">
<el-tag v-if="scope.row.acceptanceType === 'PRE'" type="info"></el-tag>
<el-tag v-else-if="scope.row.acceptanceType === 'FINAL'" type="primary">终验</el-tag>
<el-tag v-else>{{ scope.row.acceptanceType }}</el-tag>
</template>
</el-table-column>
<el-table-column label="验收状态" align="center" prop="statusDesc" width="120" />
<el-table-column label="轮次" align="center" prop="round" width="80" />
<el-table-column label="任务类型" align="center" prop="taskTypeDesc" width="150" />
<el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180"
/>
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="handleProcess(scope.row)"
>
<Icon icon="ep:check" /> 处理
</el-button>
<el-button
link
type="info"
@click="handleView(scope.row)"
>
<Icon icon="ep:view" /> 查看
</el-button>
</template>
</el-table-column>
</el-table>
</ContentWrap>
<!-- 审核表单弹窗 -->
<AcceptanceAuditForm ref="auditFormRef" @success="getList" />
<!-- 标签切换 -->
<div class="tab-bar">
<span class="tab-item" :class="{active: activeTab === 'todo'}" @click="activeTab = 'todo'">
<Icon icon="ep:clock" /> 待处理
<span class="tab-badge" v-if="todoList.length > 0">{{ todoList.length }}</span>
</span>
<span class="tab-item" :class="{active: activeTab === 'done'}" @click="activeTab = 'done'">
<Icon icon="ep:circle-check" /> 已处理
</span>
</div>
<!-- 任务卡片列表 -->
<div v-loading="loading" class="todo-list">
<template v-if="activeTab === 'todo'">
<el-empty v-if="!loading && todoList.length === 0" description="暂无待办任务,您可以放心休息 🎉" />
<div v-for="item in todoList" :key="item.acceptanceId + '-todo'" class="todo-card" @click="handleProcess(item)">
<div class="card-stripe" :class="item.acceptanceType === 'PRE' ? 'stripe-pre' : 'stripe-final'"></div>
<div class="card-content">
<div class="card-title-row">
<span class="project-name">{{ item.projectName }}</span>
<div class="tags">
<el-tag :type="item.acceptanceType === 'PRE' ? 'info' : 'primary'" size="small" effect="light">{{ item.acceptanceType === 'PRE' ? '预验收' : '终验' }}</el-tag>
<el-tag type="warning" size="small" effect="light">{{ item.statusDesc }}</el-tag>
</div>
</div>
<div class="card-meta-row">
<div class="meta-item highlight"><Icon icon="ep:aim" /><span>{{ item.taskName || item.taskTypeDesc }}</span></div>
<div class="meta-item"><Icon icon="ep:document" /><span>{{ item.projectCode }}</span></div>
<div class="meta-item"><Icon icon="ep:refresh" /><span> {{ item.round }} </span></div>
<div class="meta-item"><Icon icon="ep:clock" /><span>{{ formatDate(item.createTime) }}</span></div>
</div>
</div>
<div class="card-actions" @click.stop>
<el-button type="primary" class="process-btn" @click.stop="handleProcess(item)">
<Icon icon="ep:check" style="margin-right: 4px;" /> 立即处理
</el-button>
</div>
</div>
</template>
<template v-if="activeTab === 'done'">
<el-empty v-if="!loading && doneList.length === 0" description="暂无已处理的验收任务" />
<div v-for="item in doneList" :key="item.acceptanceId + '-done'" class="todo-card done-card" @click="handleView(item)">
<div class="card-stripe stripe-done"></div>
<div class="card-content">
<div class="card-title-row">
<span class="project-name">{{ item.projectName }}</span>
<div class="tags">
<el-tag :type="item.acceptanceType === 'PRE' ? 'info' : 'primary'" size="small" effect="light">{{ item.acceptanceType === 'PRE' ? '预验收' : '终验' }}</el-tag>
<el-tag type="success" size="small" effect="light">已处理</el-tag>
</div>
</div>
<div class="card-meta-row">
<div class="meta-item"><Icon icon="ep:document" /><span>{{ item.projectCode }}</span></div>
<div class="meta-item"><Icon icon="ep:refresh" /><span> {{ item.round }} </span></div>
<div class="meta-item"><Icon icon="ep:clock" /><span>{{ formatDate(item.createTime) }}</span></div>
</div>
</div>
<div class="card-actions" @click.stop>
<el-button plain @click.stop="handleView(item)">查看详情</el-button>
</div>
</div>
</template>
</div>
</div>
</template>
<script lang="ts" setup>
import { dateFormatter } from '@/utils/formatTime'
import * as AcceptanceApi from '@/api/project/acceptance'
import AcceptanceAuditForm from '../AcceptanceAuditForm.vue'
import dayjs from 'dayjs'
defineOptions({ name: 'AcceptanceTodo' })
const router = useRouter()
const loading = ref(true) //
const list = ref<AcceptanceApi.AcceptanceTodoVO[]>([]) //
const loading = ref(false)
const activeTab = ref<'todo' | 'done'>('todo')
const todoList = ref<AcceptanceApi.AcceptanceTodoVO[]>([])
const doneList = ref<AcceptanceApi.AcceptanceTodoVO[]>([])
/** 查询待办列表 */
const getList = async () => {
const loadAll = async () => {
loading.value = true
try {
list.value = await AcceptanceApi.getTodoList()
const [todo, done] = await Promise.all([
AcceptanceApi.getTodoList(),
AcceptanceApi.getDoneList()
])
todoList.value = todo
doneList.value = done
} finally {
loading.value = false
}
}
/** 处理任务 */
const auditFormRef = ref()
const handleProcess = (row: AcceptanceApi.AcceptanceTodoVO) => {
//
// taskType BPMN taskDefinitionKey
const taskType = row.taskType
//
if (['task_pre_liaison_review', 'task_pre_leader_review', 'task_expert_check', 'task_rectify_review', 'task_meeting_review'].includes(taskType)) {
auditFormRef.value.open({
id: row.acceptanceId,
acceptanceType: row.acceptanceType,
status: row.status
}, getAuditType(taskType))
}
//
else if (taskType === 'task_final_admin_review') {
if (['task_liaison_submit', 'task_pre_rectify', 'task_final_rectify', 'task_final_apply', 'task_lianluoren_upload_rectify', 'task_lianluoren_reupload_final_materies'].includes(taskType)) {
router.push({ path: '/project/acceptance/detail/' + row.acceptanceId, query: { tab: 'materials' } })
} else {
router.push({ path: '/project/acceptance/detail/' + row.acceptanceId, query: { tab: 'info' } })
}
// tab
else if (['task_liaison_submit', 'task_pre_rectify', 'task_final_rectify', 'task_final_apply', 'task_lianluoren_upload_rectify', 'task_lianluoren_reupload_final_materies'].includes(taskType)) {
router.push({ path: '/project/acceptance/detail/' + row.acceptanceId, query: { tab: 'materials' } })
}
//
else {
handleView(row)
}
}
/** 获取审核类型 */
const getAuditType = (taskType: string) => {
switch (taskType) {
case 'task_pre_liaison_review': //
case 'task_pre_leader_review': //
return 'pre-audit'
case 'task_final_admin_review': //
return 'final-admin'
case 'task_meeting_review': //
return 'meeting-review'
case 'task_rectify_review': //
return 'rectify-review'
case 'task_expert_check': //
return 'expert-check'
default:
return 'pre-audit'
}
}
/** 提交整改 */
const message = useMessage()
const handleSubmitRectify = async (row: AcceptanceApi.AcceptanceTodoVO) => {
try {
await message.confirm('确定提交整改吗?')
if (row.acceptanceType === 'PRE') {
await AcceptanceApi.submitPreRectify(row.acceptanceId)
} else {
await AcceptanceApi.submitFinalRectify(row.acceptanceId)
}
message.success('整改提交成功')
await getList()
} catch {}
}
/** 查看详情 */
const handleView = (row: AcceptanceApi.AcceptanceTodoVO) => {
router.push({ path: '/project/acceptance/detail/' + row.acceptanceId, query: { tab: 'info' } })
}
/** 初始化 **/
onMounted(() => {
getList()
})
const formatDate = (d: any) => {
if (!d) return ''
return dayjs(d).format('YYYY-MM-DD HH:mm')
}
onMounted(() => loadAll())
</script>
<style scoped>
.app-container {
padding: 20px;
background-color: #f5f7fa;
min-height: calc(100vh - 84px);
}
.todo-header {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border-radius: 12px;
padding: 20px 28px;
margin-bottom: 16px;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.header-info { display: flex; flex-direction: column; gap: 6px; }
.header-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: #1a2e4a; }
.header-icon { font-size: 22px; color: #295abc; }
.header-sub { font-size: 13px; color: #909399; }
.header-stats { display: flex; align-items: center; gap: 20px; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-num.pending { color: #e6a23c; }
.stat-num.done { color: #67c23a; }
.stat-label { font-size: 12px; color: #909399; margin-top: 4px; }
.stat-divider { width: 1px; height: 40px; background: #ebeef5; }
/* Tab bar */
.tab-bar {
display: flex;
gap: 4px;
background: #fff;
border-radius: 12px;
padding: 8px 12px;
margin-bottom: 16px;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tab-item {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 20px;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
color: #606266;
transition: all 0.2s ease;
user-select: none;
position: relative;
}
.tab-item:hover { background: #f5f7fa; }
.tab-item.active {
background: #295abc;
color: #fff;
font-weight: 600;
}
.tab-badge {
background: #e6a23c;
color: #fff;
border-radius: 10px;
padding: 1px 7px;
font-size: 11px;
font-weight: 600;
margin-left: 2px;
}
/* Task cards */
.todo-list { display: flex; flex-direction: column; gap: 12px; }
.todo-card {
background: #fff;
border-radius: 12px;
border: 1px solid #ebeef5;
display: flex;
align-items: stretch;
overflow: hidden;
transition: box-shadow 0.25s ease, transform 0.25s ease;
cursor: pointer;
}
.todo-card:hover {
box-shadow: 0 6px 20px rgba(41, 90, 188, 0.08);
transform: translateY(-2px);
}
.done-card { opacity: 0.85; }
.done-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.card-stripe { width: 5px; flex-shrink: 0; }
.stripe-pre { background: #909399; }
.stripe-final { background: #295abc; }
.stripe-done { background: #67c23a; }
.card-content { flex: 1; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.project-name { font-size: 15px; font-weight: 600; color: #1a2e4a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.tags { display: flex; gap: 6px; flex-shrink: 0; }
.card-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.meta-item { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #909399; }
.meta-item.highlight { color: #295abc; font-weight: 500; font-size: 14px; }
.card-actions {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-end;
gap: 10px;
padding: 16px 22px;
border-left: 1px solid #f0f2f5;
flex-shrink: 0;
}
.process-btn {
border-radius: 20px;
padding: 10px 22px;
font-weight: 500;
background: #295abc;
border: none;
box-shadow: 0 4px 10px rgba(41, 90, 188, 0.2);
transition: all 0.3s;
}
.process-btn:hover { background: #1d439b; box-shadow: 0 6px 15px rgba(41, 90, 188, 0.3); transform: translateY(-1px); }
</style>

View File

@ -1,162 +1,126 @@
<template>
<ContentWrap>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="项目编号" prop="projectCode">
<el-input
v-model="queryParams.projectCode"
placeholder="请输入项目编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="申报单位" prop="applyUnit">
<el-input
v-model="queryParams.applyUnit"
placeholder="请输入申报单位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
class="!w-240px"
>
<el-option label="待验收" value="0" />
<el-option label="验收中" value="1" />
<el-option label="已完成" value="2" />
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['project:project:create']"
>
<Icon icon="ep:plus" /> 新增
<el-card shadow="never" class="search-wrapper">
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable class="!w-240px" @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="项目编号" prop="projectCode">
<el-input v-model="queryParams.projectCode" placeholder="请输入项目编号" clearable class="!w-240px" @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="申报单位" prop="applyUnit">
<el-input v-model="queryParams.applyUnit" placeholder="请输入申报单位" clearable class="!w-240px" @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="项目状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择项目状态" clearable class="!w-240px">
<el-option label="待验收" value="0" />
<el-option label="验收中" value="1" />
<el-option label="已完成" value="2" />
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" start-placeholder="" end-placeholder="" class="!w-240px" />
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<div class="action-toolbar">
<el-button type="primary" plain @click="openForm('create')" v-hasPermi="['project:project:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增项目
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['project:project:export']"
>
<Icon icon="ep:download" />导出
<el-button type="success" plain @click="handleExport" :loading="exportLoading" v-hasPermi="['project:project:export']">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
<el-button
type="danger"
plain
:disabled="checkedIds.length === 0"
@click="handleDeleteBatch"
v-hasPermi="['project:project:delete']"
>
<Icon icon="ep:delete" />批量删除
<el-button type="danger" plain @click="handleDeleteBatch" :disabled="checkedIds.length === 0" v-hasPermi="['project:project:delete']">
<Icon icon="ep:delete" class="mr-5px" /> 批量删除
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
</div>
</el-card>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" @selection-change="handleRowCheckboxChange">
<el-table-column type="selection" width="55" />
<el-table-column label="项目ID" align="center" prop="id" width="80" />
<el-table-column label="立项编号" align="center" prop="projectCode" width="150" />
<el-table-column label="合同编号" align="center" prop="contractCode" width="150" />
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="申报单位" align="center" prop="applyUnit" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status" width="100">
<template #default="scope">
<el-tag v-if="scope.row.status === '0'" type="info"></el-tag>
<el-tag v-else-if="scope.row.status === '1'" type="warning">验收中</el-tag>
<el-tag v-else-if="scope.row.status === '2'" type="success">已完成</el-tag>
<el-tag v-else>{{ scope.row.status }}</el-tag>
</template>
</el-table-column>
<el-table-column label="当前节点" align="center" prop="currentNode" width="120" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180"
/>
<el-table-column label="操作" align="center" width="180" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['project:project:update']"
>
编辑
</el-button>
<el-button
link
type="primary"
@click="handleStartAcceptance(scope.row)"
v-hasPermi="['project:acceptance:submit-pre']"
>
发起验收
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['project:project:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 卡片列表布局 -->
<el-card shadow="never" class="list-wrapper" v-loading="loading">
<div class="list-header" v-if="total > 0">
共找到 <span class="total-count">{{ total }}</span> 个项目
</div>
<el-row :gutter="20" class="project-grid">
<el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6" v-for="item in list" :key="item.id" class="grid-col">
<div class="modern-card" :class="{'is-active': checkedIds.includes(item.id)}" @click="toggleCheck(item.id)">
<!-- 头部 -->
<div class="card-header">
<div class="header-left">
<el-checkbox :model-value="checkedIds.includes(item.id)" @change="toggleCheck(item.id)" @click.stop />
<div class="title text-ellipsis" :title="item.projectName">{{ item.projectName }}</div>
</div>
<el-tag :type="getStatusType(item.status)" effect="light" class="status-tag">
{{ getStatusLabel(item.status) }}
</el-tag>
</div>
<!-- 主体信息 -->
<div class="card-body">
<div class="info-row">
<Icon icon="ep:office-building" class="info-icon" />
<span class="info-label">申报单位</span>
<span class="info-value text-ellipsis" :title="item.applyUnit">{{ item.applyUnit || '-' }}</span>
</div>
<div class="info-row">
<Icon icon="ep:document" class="info-icon" />
<span class="info-label">项目编号</span>
<span class="info-value">{{ item.projectCode || '-' }}</span>
</div>
<div class="info-row">
<Icon icon="ep:tickets" class="info-icon" />
<span class="info-label">合同编号</span>
<span class="info-value">{{ item.contractCode || '-' }}</span>
</div>
<div class="info-row current-node-row" v-if="item.currentNode">
<Icon icon="ep:location" class="info-icon text-primary" />
<span class="info-label">当前节点</span>
<span class="info-value text-primary font-bold">{{ item.currentNode }}</span>
</div>
</div>
<!-- 表单弹窗添加/修改 -->
<ProjectForm ref="formRef" @success="getList" />
<!-- 发起验收弹窗 -->
<StartAcceptanceForm ref="startAcceptanceFormRef" @success="getList" />
<!-- 底部操作 -->
<div class="card-footer" @click.stop>
<span class="create-time">{{ formatDate(item.createTime) }}</span>
<div class="actions">
<el-button link type="primary" @click.stop="openForm('update', item.id)" v-hasPermi="['project:project:update']">
编辑
</el-button>
<el-button v-if="item.status === '0'" type="primary" class="start-btn" size="small" @click.stop="handleStartAcceptance(item)" v-hasPermi="['project:acceptance:submit-pre']">
发起验收
</el-button>
</div>
</div>
</div>
</el-col>
</el-row>
<!-- 空数据状态 -->
<el-empty v-if="list.length === 0 && !loading" description="暂无项目数据" />
<!-- 分页组件 -->
<div class="pagination-container">
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</el-card>
<!-- 表单弹窗添加/修改 -->
<ProjectForm ref="formRef" @success="getList" />
<!-- 发起验收弹窗 -->
<StartAcceptanceForm ref="startAcceptanceFormRef" @success="getList" />
</div>
</template>
<script lang="ts" setup>
@ -165,6 +129,7 @@ import download from '@/utils/download'
import * as ProjectApi from '@/api/project/project'
import ProjectForm from './ProjectForm.vue'
import StartAcceptanceForm from './StartAcceptanceForm.vue'
import dayjs from 'dayjs'
defineOptions({ name: 'ProjectProject' })
@ -186,6 +151,7 @@ const queryParams = reactive({
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
const checkedIds = ref<number[]>([]) // ID
/** 查询列表 */
const getList = async () => {
@ -220,31 +186,20 @@ const openForm = (type: string, id?: number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProjectApi.deleteProject(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 批量删除按钮操作 */
const checkedIds = ref<number[]>([])
const handleRowCheckboxChange = (rows: ProjectApi.ProjectVO[]) => {
checkedIds.value = rows.map((row) => row.id)
}
const handleDeleteBatch = async () => {
try {
//
await message.delConfirm()
//
await ProjectApi.deleteProjectList(checkedIds.value)
checkedIds.value = []
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
@ -252,9 +207,7 @@ const handleDeleteBatch = async () => {
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProjectApi.exportProject(queryParams)
download.excel(data, '项目数据.xls')
@ -270,8 +223,262 @@ const handleStartAcceptance = (row: ProjectApi.ProjectVO) => {
startAcceptanceFormRef.value.open(row)
}
/** 卡片单选/多选切换 */
const toggleCheck = (id: number) => {
const index = checkedIds.value.indexOf(id)
if (index > -1) {
checkedIds.value.splice(index, 1)
} else {
checkedIds.value.push(id)
}
}
/** 格式化状态 */
const getStatusType = (status: string) => {
if (status === '0') return 'primary'
if (status === '1') return 'warning'
if (status === '2') return 'success'
return 'info'
}
const getStatusLabel = (status: string) => {
if (status === '0') return '待验收'
if (status === '1') return '验收中'
if (status === '2') return '已完成'
return status || '未知'
}
/** 格式化时间 */
const formatDate = (dateString: string) => {
if (!dateString) return ''
return dayjs(dateString).format('YYYY-MM-DD HH:mm')
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>
<style scoped>
.app-container {
padding: 20px;
background-color: #f5f7fa;
min-height: calc(100vh - 84px);
}
.search-wrapper {
margin-bottom: 20px;
border-radius: 8px;
border: none;
}
.action-toolbar {
margin-top: 10px;
padding-top: 15px;
border-top: 1px dashed #ebeef5;
display: flex;
justify-content: flex-end;
}
.list-wrapper {
border-radius: 8px;
border: none;
min-height: 500px;
}
.list-header {
margin-bottom: 20px;
font-size: 15px;
color: #606266;
}
.total-count {
color: #295abc;
font-size: 18px;
font-weight: 600;
margin: 0 4px;
}
.grid-col {
margin-bottom: 20px;
}
.modern-card {
background: #fff;
border-radius: 12px;
border: 1px solid #ebeef5;
padding: 20px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
position: relative;
overflow: hidden;
height: 100%;
display: flex;
flex-direction: column;
}
.modern-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
background: transparent;
transition: all 0.3s ease;
}
.modern-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 24px rgba(41, 90, 188, 0.08);
border-color: rgba(41, 90, 188, 0.2);
}
.modern-card:hover::before {
background: #295abc;
}
.modern-card.is-active {
border-color: #295abc;
background-color: #f7f9fc;
}
.modern-card.is-active::before {
background: #295abc;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 15px;
padding-bottom: 12px;
border-bottom: 1px solid #f0f2f5;
}
.header-left {
display: flex;
align-items: flex-start;
gap: 12px;
flex: 1;
overflow: hidden;
}
.title {
font-size: 16px;
font-weight: 600;
color: #303133;
line-height: 1.4;
flex: 1;
}
.status-tag {
margin-left: 10px;
border-radius: 4px;
font-weight: 500;
}
.card-body {
flex: 1;
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 20px;
}
.info-row {
display: flex;
align-items: center;
font-size: 14px;
line-height: 1.5;
}
.info-icon {
color: #909399;
margin-right: 8px;
font-size: 15px;
}
.info-label {
color: #909399;
min-width: 75px;
}
.info-value {
color: #606266;
flex: 1;
}
.current-node-row {
margin-top: 5px;
padding-top: 5px;
border-top: 1px dashed #ebeef5;
}
.text-primary {
color: #295abc;
}
.font-bold {
font-weight: 600;
}
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: auto;
padding-top: 15px;
border-top: 1px solid #f0f2f5;
}
.create-time {
font-size: 13px;
color: #a8abb2;
}
.actions {
display: flex;
align-items: center;
gap: 15px;
}
.start-btn {
background: #295abc;
border: none;
border-radius: 20px;
padding: 8px 18px;
color: #fff;
font-size: 13px;
font-weight: 500;
box-shadow: 0 4px 10px rgba(41, 90, 188, 0.2);
transition: all 0.3s ease;
}
.start-btn:hover {
transform: translateY(-2px);
background: #1d439b;
box-shadow: 0 6px 15px rgba(41, 90, 188, 0.3);
}
.mr-5px {
margin-right: 5px;
}
.pagination-container {
margin-top: 20px;
display: flex;
justify-content: flex-end;
}
:deep(.el-form-item) {
margin-bottom: 12px;
}
</style>