feat: add personal workbench view with todo and reimbursement tracking

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 18:22:47 +08:00
parent ad66067694
commit ab9f132192
8 changed files with 770 additions and 29 deletions

View File

@@ -21,6 +21,7 @@
:class="{
'chat-main': activeView === 'chat',
'overview-main': activeView === 'overview',
'workbench-main': activeView === 'workbench',
'requests-main': activeView === 'requests',
'approval-main': activeView === 'approval',
'policies-main': activeView === 'policies'
@@ -42,7 +43,7 @@
/>
<FilterBar
v-if="activeView !== 'chat' && activeView !== 'overview' && activeView !== 'requests' && activeView !== 'approval' && activeView !== 'policies'"
v-if="activeView !== 'chat' && activeView !== 'overview' && activeView !== 'workbench' && activeView !== 'requests' && activeView !== 'approval' && activeView !== 'policies'"
:compact="activeView === 'overview'"
:filters="filters"
:ranges="ranges"
@@ -67,6 +68,11 @@
@reject="handleReject"
/>
<PersonalWorkbenchView
v-else-if="activeView === 'workbench'"
@open-assistant="handleOpenChat"
/>
<TravelReimbursementCreateView
v-else-if="activeView === 'chat' && travelCreateMode"
@back-to-requests="backToRequests"
@@ -126,6 +132,7 @@ import FilterBar from './components/layout/FilterBar.vue'
import ToastNotification from './components/shared/ToastNotification.vue'
import LoginView from './views/LoginView.vue'
import OverviewView from './views/OverviewView.vue'
import PersonalWorkbenchView from './views/PersonalWorkbenchView.vue'
import ChatView from './views/ChatView.vue'
import TravelReimbursementCreateView from './views/TravelReimbursementCreateView.vue'
import RequestsView from './views/RequestsView.vue'
@@ -228,6 +235,9 @@ function backToRequests() {
.main.overview-main {
grid-template-rows: auto minmax(0, 1fr);
}
.main.workbench-main {
grid-template-rows: auto minmax(0, 1fr);
}
.main.chat-main {
height: 100dvh;
grid-template-rows: auto minmax(0, 1fr);

View File

@@ -0,0 +1,735 @@
<template>
<section class="workbench">
<PanelHead
v-if="showHeader"
eyebrow="Personal Workspace"
title="个人工作台"
note="把今天要处理的待办、报销进度和制度更新集中到一个入口。"
/>
<article class="panel assistant-hero">
<div class="assistant-visual" aria-hidden="true">
<div class="assistant-core">
<i class="mdi mdi-robot-happy-outline"></i>
</div>
</div>
<div class="assistant-copy">
<span class="assistant-tag">AI 报销助手</span>
<h3>描述费用或上传票据AI 直接帮你判断怎么报</h3>
<p>自动识别报销类别核对附件完整性并生成可继续提交的报销草稿</p>
<div class="assistant-input">
<span>例如我昨天请客户吃饭花了 860 还打车去了客户公司</span>
<button type="button" class="hero-action" @click="emit('openAssistant')">开始识别</button>
</div>
<div class="assistant-tools">
<button type="button" class="ghost-action" @click="emit('openAssistant')">
<i class="mdi mdi-upload-outline"></i>
<span>上传票据</span>
</button>
<div class="assistant-skills">
<span v-for="item in assistantSkills" :key="item">{{ item }}</span>
</div>
</div>
</div>
</article>
<div class="workbench-grid">
<article class="panel list-panel">
<div class="section-head">
<h3>今日待办</h3>
<span class="count-chip">{{ todoItems.length }} </span>
</div>
<div class="list-body">
<div v-for="item in todoItems" :key="item.title" class="todo-row">
<div class="todo-icon" :style="{ '--icon-color': item.color }">
<i :class="item.icon"></i>
</div>
<div class="todo-copy">
<strong>{{ item.title }}</strong>
<p>{{ item.suggestion }}</p>
</div>
<button type="button" class="row-action" @click="emit('openAssistant')">{{ item.action }}</button>
</div>
</div>
</article>
<article class="panel list-panel">
<div class="section-head">
<h3>报销进度</h3>
<button type="button" class="link-action">查看全部 <i class="mdi mdi-chevron-right"></i></button>
</div>
<div class="list-body">
<div v-for="item in progressItems" :key="item.id" class="progress-row">
<div class="todo-icon" :style="{ '--icon-color': item.color }">
<i :class="item.icon"></i>
</div>
<div class="todo-copy progress-copy">
<div class="progress-main">
<strong>{{ item.title }}</strong>
<strong class="amount">{{ item.amount }}</strong>
</div>
<p>提交时间{{ item.date }}</p>
</div>
<span class="progress-status" :class="item.tone">{{ item.status }}</span>
</div>
</div>
</article>
</div>
<article class="panel policy-panel">
<div class="section-head">
<h3>最新报销制度</h3>
<button type="button" class="link-action">查看全部 <i class="mdi mdi-chevron-right"></i></button>
</div>
<div class="policy-table">
<div class="policy-head policy-row">
<span>制度名称</span>
<span>摘要</span>
<span>发布日期</span>
<span>状态</span>
<span></span>
</div>
<div v-for="item in policyItems" :key="item.name" class="policy-row">
<strong>{{ item.name }}</strong>
<span>{{ item.summary }}</span>
<span>{{ item.date }}</span>
<span>
<b class="policy-status" :class="item.tone">{{ item.status }}</b>
</span>
<button type="button" class="row-link" :aria-label="`查看 ${item.name}`">
<i class="mdi mdi-chevron-right"></i>
</button>
</div>
</div>
</article>
</section>
</template>
<script setup>
import PanelHead from '../shared/PanelHead.vue'
defineProps({
showHeader: { type: Boolean, default: true }
})
const emit = defineEmits(['openAssistant'])
const assistantSkills = ['识别报销类别', '检查缺少材料', '生成报销草稿']
const todoItems = [
{
title: '业务招待报销建议补参与人员',
suggestion: 'AI 建议:补充客户单位、客户人数、我方陪同人员',
action: '去补充',
icon: 'mdi mdi-account-group-outline',
color: '#10b981'
},
{
title: '差旅报销单待提交',
suggestion: 'AI 建议:补齐出发交通,可直接生成报销单',
action: '继续填写',
icon: 'mdi mdi-briefcase-outline',
color: '#16a34a'
},
{
title: '有 5 张票据未关联报销单',
suggestion: 'AI 建议:其中 3 张疑似交通费,可合并生成交通报销',
action: '去整理',
icon: 'mdi mdi-receipt-text-outline',
color: '#3b82f6'
}
]
const progressItems = [
{
id: 'travel',
title: '差旅报销',
amount: '¥3,280',
date: '2026-05-03',
status: '主管审批中',
tone: 'success',
icon: 'mdi mdi-airplane',
color: '#10b981'
},
{
id: 'transport',
title: '交通报销',
amount: '¥126',
date: '2026-05-02',
status: '财务复核中',
tone: 'info',
icon: 'mdi mdi-car-outline',
color: '#3b82f6'
},
{
id: 'office',
title: '办公采购',
amount: '¥458',
date: '2026-05-01',
status: '已到账',
tone: 'mint',
icon: 'mdi mdi-cart-outline',
color: '#16a34a'
}
]
const policyItems = [
{
name: '差旅报销管理办法2026版',
summary: '更新住宿标准与交通等级规则',
date: '2026-05-04',
status: '已生效',
tone: 'success'
},
{
name: '业务招待费用报销规范',
summary: '明确参与人员与事由填写要求',
date: '2026-05-02',
status: '更新',
tone: 'warning'
},
{
name: '交通费用报销细则',
summary: '补充网约车与停车费报销说明',
date: '2026-04-28',
status: '已生效',
tone: 'success'
},
{
name: '票据与附件提交规范通知',
summary: '统一附件命名与上传要求',
date: '2026-04-25',
status: '通知',
tone: 'info'
}
]
</script>
<style scoped>
.workbench {
display: grid;
gap: 16px;
}
.assistant-hero {
position: relative;
overflow: hidden;
display: grid;
grid-template-columns: 164px minmax(0, 1fr);
gap: 24px;
padding: 24px 26px;
border: 1px solid rgba(16, 185, 129, 0.12);
background:
radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 34%),
radial-gradient(circle at right 20%, rgba(59, 130, 246, 0.07), transparent 28%),
linear-gradient(135deg, #f7fffb 0%, #ffffff 48%, #f5fbff 100%);
}
.assistant-hero::before,
.assistant-hero::after {
content: "";
position: absolute;
border-radius: 999px;
background: rgba(16, 185, 129, 0.06);
pointer-events: none;
}
.assistant-hero::before {
right: -48px;
bottom: -58px;
width: 220px;
height: 220px;
}
.assistant-hero::after {
right: 92px;
top: -44px;
width: 140px;
height: 140px;
}
.assistant-visual {
position: relative;
display: grid;
place-items: center;
}
.assistant-core {
position: relative;
z-index: 1;
width: 132px;
height: 132px;
display: grid;
place-items: center;
border-radius: 36px;
background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
box-shadow:
0 20px 44px rgba(15, 23, 42, 0.08),
inset 0 -10px 18px rgba(16, 185, 129, 0.10);
color: #0f9f78;
}
.assistant-core::before,
.assistant-core::after {
content: "";
position: absolute;
background: #d1fae5;
}
.assistant-core::before {
top: -12px;
width: 14px;
height: 14px;
border-radius: 999px;
box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.10);
}
.assistant-core::after {
top: -4px;
width: 2px;
height: 16px;
}
.assistant-core .mdi {
font-size: 68px;
}
.assistant-copy {
position: relative;
z-index: 1;
display: grid;
gap: 14px;
align-content: center;
}
.assistant-tag {
display: inline-flex;
width: fit-content;
align-items: center;
padding: 6px 12px;
border-radius: 999px;
background: rgba(16, 185, 129, 0.10);
color: #0f9f78;
font-size: 12px;
font-weight: 800;
}
.assistant-copy h3 {
color: #0f172a;
font-size: 28px;
line-height: 1.25;
font-weight: 800;
}
.assistant-copy p {
max-width: 760px;
color: #5b6b83;
font-size: 15px;
line-height: 1.7;
}
.assistant-input {
display: flex;
align-items: center;
gap: 14px;
min-height: 58px;
padding: 10px 10px 10px 18px;
border: 1px solid rgba(148, 163, 184, 0.28);
border-radius: 12px;
background: rgba(255, 255, 255, 0.92);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.assistant-input span {
min-width: 0;
flex: 1;
color: #94a3b8;
font-size: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.hero-action,
.ghost-action,
.row-action,
.link-action,
.row-link {
border: 0;
background: transparent;
}
.hero-action {
height: 40px;
padding: 0 20px;
border-radius: 10px;
background: linear-gradient(135deg, #10b981, #059669);
color: #fff;
font-size: 14px;
font-weight: 800;
white-space: nowrap;
box-shadow: 0 10px 22px rgba(16, 185, 129, 0.18);
}
.assistant-tools {
display: flex;
align-items: center;
gap: 16px;
flex-wrap: wrap;
}
.ghost-action {
height: 40px;
display: inline-flex;
align-items: center;
gap: 8px;
padding: 0 16px;
border: 1px solid rgba(16, 185, 129, 0.34);
border-radius: 10px;
background: rgba(255, 255, 255, 0.72);
color: #0f9f78;
font-size: 14px;
font-weight: 700;
}
.assistant-skills {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
color: #22a06b;
font-size: 14px;
font-weight: 700;
}
.assistant-skills span {
position: relative;
}
.assistant-skills span + span::before {
content: "";
position: absolute;
left: -7px;
top: 50%;
width: 1px;
height: 14px;
background: rgba(16, 185, 129, 0.22);
transform: translateY(-50%);
}
.workbench-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
}
.list-panel,
.policy-panel {
padding: 20px 22px;
}
.section-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 16px;
}
.section-head h3 {
color: #0f172a;
font-size: 17px;
font-weight: 700;
}
.count-chip {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 46px;
height: 28px;
padding: 0 10px;
border-radius: 999px;
background: #ecfdf5;
color: #0f9f78;
font-size: 12px;
font-weight: 800;
}
.link-action {
display: inline-flex;
align-items: center;
gap: 4px;
color: #10b981;
font-size: 14px;
font-weight: 700;
}
.list-body {
display: grid;
}
.todo-row,
.progress-row {
display: grid;
grid-template-columns: 48px minmax(0, 1fr) auto;
gap: 14px;
align-items: center;
padding: 14px 0;
border-top: 1px solid #edf2f7;
}
.todo-row:first-child,
.progress-row:first-child {
padding-top: 4px;
border-top: 0;
}
.todo-icon {
width: 48px;
height: 48px;
display: grid;
place-items: center;
border-radius: 14px;
background: color-mix(in srgb, var(--icon-color) 12%, white);
color: var(--icon-color);
font-size: 24px;
}
.todo-copy {
min-width: 0;
}
.todo-copy strong {
display: block;
color: #0f172a;
font-size: 15px;
font-weight: 700;
line-height: 1.4;
}
.todo-copy p {
margin-top: 4px;
color: #6b7280;
font-size: 14px;
line-height: 1.5;
}
.row-action {
height: 38px;
padding: 0 16px;
border: 1px solid rgba(16, 185, 129, 0.36);
border-radius: 10px;
color: #10b981;
font-size: 14px;
font-weight: 700;
white-space: nowrap;
}
.progress-copy .progress-main {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.progress-copy .amount {
font-size: 17px;
}
.progress-status {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 32px;
padding: 6px 12px;
border-radius: 999px;
font-size: 13px;
font-weight: 800;
white-space: nowrap;
}
.progress-status.success,
.policy-status.success {
background: #eafaf2;
color: #16935f;
}
.progress-status.info,
.policy-status.info {
background: #eff6ff;
color: #3b82f6;
}
.progress-status.mint {
background: #edfdf5;
color: #10b981;
}
.policy-table {
border: 1px solid #e7edf5;
border-radius: 12px;
overflow: hidden;
}
.policy-row {
display: grid;
grid-template-columns: 2.1fr 2.2fr 1fr auto 40px;
gap: 16px;
align-items: center;
min-height: 56px;
padding: 0 18px;
border-top: 1px solid #edf2f7;
}
.policy-head {
min-height: 44px;
background: #f8fbff;
color: #64748b;
font-size: 12px;
font-weight: 800;
border-top: 0;
}
.policy-row strong,
.policy-row span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.policy-row strong {
color: #0f172a;
font-size: 14px;
font-weight: 700;
}
.policy-row span {
color: #64748b;
font-size: 14px;
}
.policy-status {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 66px;
min-height: 28px;
padding: 0 10px;
border-radius: 999px;
font-size: 12px;
font-weight: 800;
}
.policy-status.warning {
background: #fff7e8;
color: #f59e0b;
}
.row-link {
width: 32px;
height: 32px;
display: grid;
place-items: center;
border-radius: 8px;
color: #94a3b8;
}
@media (max-width: 1320px) {
.assistant-copy h3 {
font-size: 24px;
}
.policy-row {
grid-template-columns: 1.7fr 1.7fr 1fr auto 32px;
}
}
@media (max-width: 1080px) {
.assistant-hero {
grid-template-columns: 1fr;
}
.assistant-visual {
justify-content: flex-start;
}
.workbench-grid {
grid-template-columns: 1fr;
}
}
@media (max-width: 860px) {
.assistant-hero,
.list-panel,
.policy-panel {
padding: 18px;
}
.assistant-input {
flex-direction: column;
align-items: stretch;
padding: 14px;
}
.assistant-input span {
white-space: normal;
}
.hero-action,
.ghost-action,
.row-action {
width: 100%;
justify-content: center;
}
.todo-row,
.progress-row {
grid-template-columns: 48px minmax(0, 1fr);
}
.row-action,
.progress-status {
grid-column: 2;
justify-self: start;
}
.policy-table {
border: 0;
border-radius: 0;
}
.policy-head {
display: none;
}
.policy-row {
grid-template-columns: 1fr;
gap: 8px;
padding: 16px 0;
border-top: 1px solid #edf2f7;
}
.policy-row strong,
.policy-row span {
white-space: normal;
}
.policy-row > :last-child {
display: none;
}
}
</style>

View File

@@ -51,6 +51,7 @@ const emit = defineEmits(['navigate', 'openChat'])
const sidebarMeta = {
overview: { label: '总览' },
workbench: { label: '个人工作台' },
requests: { label: '差旅申请/报销' },
approval: { label: '审批中心', badge: '12' },
chat: { label: 'AI助手' },

View File

@@ -10,6 +10,14 @@ export const navItems = [
title: '企业报销智能运营台',
desc: '面向财务共享中心的审批、风控、SLA与自动化运营看板'
},
{
id: 'workbench',
label: '个人工作台',
navHint: '今日待办与报销进度',
icon: icons.workspace,
title: '个人工作台',
desc: '集中处理今日待办、查看报销进度,并快速进入 AI 报销助手'
},
{
id: 'requests',
label: '差旅申请/报销',

View File

@@ -2,6 +2,7 @@ const iconPath = (content) => `<svg viewBox="0 0 24 24" aria-hidden="true">${con
export const icons = {
dashboard: iconPath('<path d="M3 13h8V3H3z"/><path d="M13 21h8V11h-8z"/><path d="M13 3h8v6h-8z"/><path d="M3 21h8v-6H3z"/>'),
workspace: iconPath('<path d="M4 20h16"/><path d="M6 20V8a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12"/><path d="M9 10h6"/><path d="M9 14h6"/><path d="M12 3v3"/>'),
list: iconPath('<path d="M8 6h13"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M3 6h.01"/><path d="M3 12h.01"/><path d="M3 18h.01"/>'),
approval: iconPath('<path d="M9 11l2 2 4-5"/><path d="M20 12v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h8"/><path d="M17 3h4v4"/>'),
file: iconPath('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/><path d="M8 13h8"/><path d="M8 17h5"/>'),

View File

@@ -112,6 +112,8 @@
<button type="button" class="text-link">查看详情 <i class="mdi mdi-chevron-right"></i></button>
</article>
</div>
<PersonalWorkbench @open-assistant="emit('ask')" />
</section>
</template>
@@ -131,11 +133,14 @@ import TrendChart from '../components/charts/TrendChart.vue'
import DonutChart from '../components/charts/DonutChart.vue'
import BarChart from '../components/charts/BarChart.vue'
import GaugeChart from '../components/charts/GaugeChart.vue'
import PersonalWorkbench from '../components/business/PersonalWorkbench.vue'
defineProps({
filteredRequests: { type: Array, required: true }
})
const emit = defineEmits(['ask'])
const activeTrendRange = ref(trendRanges[0])
const activeDepartmentRange = ref(departmentRangeOptions[0])

View File

@@ -0,0 +1,9 @@
<template>
<PersonalWorkbench :show-header="false" @open-assistant="emit('openAssistant')" />
</template>
<script setup>
import PersonalWorkbench from '../components/business/PersonalWorkbench.vue'
const emit = defineEmits(['openAssistant'])
</script>

View File

@@ -68,7 +68,6 @@
<col class="col-node">
<col class="col-approval">
<col class="col-travel">
<col class="col-actions">
</colgroup>
<thead>
<tr>
@@ -81,7 +80,6 @@
<th>当前节点</th>
<th>审批状态</th>
<th>商旅状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@@ -95,14 +93,6 @@
<td>{{ row.node }}</td>
<td><span class="status-tag" :class="row.approvalTone">{{ row.approval }}</span></td>
<td><span class="status-tag" :class="row.travelTone">{{ row.travel }}</span></td>
<td>
<div class="row-actions">
<button type="button" @click.stop="emit('ask', row)">查看</button>
<button type="button" aria-label="更多操作" @click.stop>
<i class="mdi mdi-dots-horizontal"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
@@ -580,24 +570,6 @@ tbody tr:last-child td {
color: #475569;
}
.row-actions {
display: inline-flex;
align-items: center;
gap: 12px;
}
.row-actions button {
border: 0;
background: transparent;
color: #2563eb;
font-size: 13px;
font-weight: 800;
}
.row-actions button:hover {
color: #059669;
}
.list-foot {
display: grid;
grid-template-columns: 1fr auto 1fr;