feat: 新增票据夹模块并优化 OCR 与员工画像服务

后端新增票据夹端点、数据模型和服务模块,优化 OCR 端点
Schema 和附件操作逻辑,完善员工行为画像服务和辅助函数,
前端新增票据夹视图和服务层,优化文档中心样式和侧边栏导
航,完善员工画像详情弹窗和权限控制,补充单元测试。
This commit is contained in:
caoxiaozhu
2026-05-29 14:51:18 +08:00
parent 678f64d772
commit 4c59941ec6
33 changed files with 2855 additions and 551 deletions

View File

@@ -15,135 +15,6 @@
overflow: hidden;
}
.status-tabs {
display: flex;
gap: 28px;
margin-top: 14px;
border-bottom: 1px solid #dbe4ee;
}
.status-tabs button {
position: relative;
min-height: 36px;
display: inline-flex;
align-items: center;
gap: 7px;
border: 0;
background: transparent;
color: #64748b;
font-size: 14px;
font-weight: 750;
}
.status-tabs button.active {
color: var(--theme-primary-active);
}
.status-tabs button.active::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: -1px;
height: 3px;
border-radius: 999px 999px 0 0;
background: var(--theme-primary);
}
.scope-tab-badge {
min-width: 18px;
height: 18px;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 5px;
border-radius: 999px;
background: #ef4444;
color: #fff;
font-size: 11px;
font-weight: 850;
line-height: 1;
box-shadow: 0 6px 14px rgba(239, 68, 68, 0.22);
}
.document-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-top: 14px;
}
.filter-set,
.document-actions {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.list-search {
position: relative;
width: 280px;
}
.list-search .mdi {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: #64748b;
font-size: 15px;
}
.list-search input {
width: 100%;
height: 38px;
padding: 0 12px 0 36px;
border: 1px solid #d7e0ea;
border-radius: 4px;
background: #fff;
color: #0f172a;
font-size: 13px;
transition: border-color 160ms ease, box-shadow 160ms ease;
}
.list-search input::placeholder {
color: #8da0b4;
}
.list-search input:focus {
border-color: var(--theme-primary);
box-shadow: 0 0 0 3px rgba(58, 124, 165, 0.14);
outline: none;
}
.filter-btn {
min-height: 38px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 9px;
padding: 0 14px;
border: 1px solid #d7e0ea;
border-radius: 4px;
background: #fff;
color: #334155;
font-size: 14px;
font-weight: 750;
white-space: nowrap;
}
.filter-btn {
min-width: 120px;
justify-content: space-between;
}
.filter-btn:hover {
border-color: rgba(58, 124, 165, .32);
color: var(--theme-primary-active);
}
.document-filter,
.date-range-filter {
position: relative;
@@ -287,43 +158,6 @@
background: #cbd5e1;
}
.create-request-btn {
min-height: 40px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 0 18px;
border: 0;
border-radius: 4px;
background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-active));
color: #fff;
font-size: 14px;
font-weight: 800;
white-space: nowrap;
box-shadow: 0 10px 24px var(--theme-primary-shadow);
transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.create-request-btn.secondary {
border: 1px solid #d7e0ea;
background: #fff;
color: #334155;
box-shadow: none;
}
.create-request-btn:hover {
transform: translateY(-1px);
box-shadow: 0 14px 28px var(--theme-primary-shadow);
filter: saturate(1.02);
}
.create-request-btn.secondary:hover {
border-color: rgba(58, 124, 165, .32);
color: var(--theme-primary-active);
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.document-status-filter {
display: inline-flex;
align-items: center;
@@ -348,83 +182,6 @@
min-width: 154px;
}
.table-wrap {
min-height: 400px;
margin-top: 10px;
overflow-x: auto;
overflow-y: auto;
border: 1px solid #edf2f7;
border-radius: 10px;
background: linear-gradient(180deg, #fcfefd 0%, #f4f8f6 100%);
display: flex;
flex-direction: column;
}
.table-wrap.is-empty {
align-items: center;
justify-content: center;
}
.table-wrap table {
width: 100%;
align-self: flex-start;
}
.table-state {
width: 100%;
min-height: 260px;
display: grid;
place-items: center;
gap: 10px;
padding: 28px 20px;
text-align: center;
color: #64748b;
background: linear-gradient(180deg, #fcfffd 0%, #f5f9f7 100%);
}
.table-state .mdi {
font-size: 28px;
color: var(--theme-primary);
}
.table-state strong {
color: #0f172a;
font-size: 15px;
}
.table-state p {
max-width: 420px;
margin: 0;
font-size: 13px;
line-height: 1.6;
}
.table-state.error {
background: linear-gradient(180deg, #fffdfd 0%, #fff6f6 100%);
}
.table-state.error .mdi {
color: #ef4444;
}
.retry-btn {
height: 36px;
padding: 0 14px;
border: 1px solid #f1c5c5;
border-radius: 8px;
background: #fff;
color: #b91c1c;
font-size: 13px;
font-weight: 750;
}
table {
width: 100%;
min-width: 1420px;
border-collapse: collapse;
table-layout: fixed;
}
.col-id { width: 11%; }
.col-created { width: 10%; }
.col-stay { width: 9%; }
@@ -437,47 +194,6 @@ table {
.col-status { width: 8%; }
.col-updated { width: 9%; }
th,
td {
padding: 13px 12px;
border-bottom: 1px solid #edf2f7;
color: #24324a;
font-size: 14px;
line-height: 1.35;
text-align: center;
vertical-align: middle;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
th {
position: sticky;
top: 0;
z-index: 1;
background: #f7fafc;
color: #64748b;
font-size: 13px;
font-weight: 800;
}
tbody tr {
cursor: pointer;
}
tbody tr:hover {
background: linear-gradient(90deg, rgba(58, 124, 165, .08), rgba(58, 124, 165, .03));
}
tbody tr:last-child td {
border-bottom: 0;
}
.doc-id {
color: var(--theme-primary-active);
font-weight: 800;
}
.new-document-badge {
display: inline-flex;
align-items: center;
@@ -505,211 +221,16 @@ tbody tr:last-child td {
background: #ef4444;
}
.doc-kind-tag,
.type-tag,
.status-tag {
display: inline-flex;
align-items: center;
justify-content: center;
white-space: nowrap;
}
.doc-kind-tag {
min-height: 26px;
padding: 0 10px;
border-radius: 7px;
font-size: 12px;
font-weight: 800;
}
.doc-kind-tag.reimbursement {
background: var(--theme-primary-light-9);
color: var(--theme-primary-active);
}
.doc-kind-tag.application {
background: #eff6ff;
color: #2563eb;
}
.type-tag {
min-height: 26px;
padding: 0 10px;
border-radius: 999px;
font-size: 12px;
font-weight: 800;
}
.type-tag.travel,
.type-tag.hotel,
.type-tag.transport {
background: var(--theme-primary-light-9);
color: var(--theme-primary-active);
}
.type-tag.entertainment,
.type-tag.meal {
background: #fff7ed;
color: #ea580c;
}
.type-tag.office {
background: #eff6ff;
color: #2563eb;
}
.type-tag.meeting,
.type-tag.training {
background: #eef2ff;
color: #4f46e5;
}
.type-tag.other {
background: #f8fafc;
color: #475569;
}
.status-tag {
min-height: 24px;
padding: 0 9px;
border: 1px solid transparent;
border-radius: 6px;
font-size: 12px;
font-weight: 750;
}
.status-tag.info {
border-color: #bfdbfe;
background: #eff6ff;
color: #2563eb;
}
.status-tag.success,
.status-tag.archived {
border-color: var(--success-line);
background: var(--success-soft);
color: var(--success-active);
}
.status-tag.warning,
.status-tag.draft {
border-color: #fed7aa;
background: #fff7ed;
color: #f97316;
}
.status-tag.danger {
border-color: #fecaca;
background: #fef2f2;
color: #dc2626;
}
.status-tag.neutral {
border-color: #cbd5e1;
background: #f8fafc;
color: #475569;
}
.list-foot {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 16px;
margin-top: 12px;
}
.page-summary {
color: #64748b;
font-size: 14px;
font-weight: 650;
}
.pager {
display: inline-flex;
justify-content: center;
gap: 6px;
padding: 4px;
border: 1px solid #e2e8f0;
border-radius: 12px;
background: #f8fafc;
}
.pager button {
width: 32px;
height: 32px;
border: 0;
border-radius: 9px;
background: transparent;
color: #334155;
font-size: 14px;
font-weight: 800;
}
.pager button:hover:not(.active) {
background: #fff;
color: var(--theme-primary-active);
box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}
.pager button.active {
background: var(--theme-primary-active);
color: #fff;
box-shadow: 0 8px 16px var(--theme-primary-shadow);
}
.pager button:disabled {
color: #cbd5e1;
cursor: not-allowed;
}
.page-size-select {
width: 118px;
justify-self: end;
}
@media (max-width: 1200px) {
.document-toolbar,
.list-foot {
grid-template-columns: 1fr;
}
.document-toolbar {
align-items: stretch;
flex-direction: column;
}
.document-actions {
justify-content: flex-start;
}
}
@media (max-width: 760px) {
.documents-list {
padding: 16px;
}
.status-tabs {
gap: 18px;
overflow-x: auto;
}
.filter-set,
.document-actions,
.document-status-filter,
.list-search,
.filter-btn,
.page-size-select {
width: 100%;
}
.document-status-filter {
width: 100%;
align-items: stretch;
flex-direction: column;
gap: 6px;
}
.list-foot {
display: grid;
justify-items: stretch;
}
}

View File

@@ -0,0 +1,372 @@
.receipt-folder-page {
height: 100%;
min-height: 0;
display: grid;
grid-template-rows: minmax(0, 1fr);
animation: fadeUp 220ms var(--ease) both;
overflow: hidden;
}
.receipt-folder-list,
.receipt-folder-detail {
min-height: 0;
overflow: hidden;
padding: 16px 18px;
}
.receipt-folder-list {
display: grid;
grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.receipt-detail-head,
.receipt-detail-foot,
.receipt-basic-panel header,
.receipt-preview-panel header,
.receipt-field-list-head {
display: flex;
align-items: center;
}
.receipt-form-grid input,
.receipt-form-grid textarea,
.receipt-field-row input {
width: 100%;
border: 1px solid #d7e0ea;
border-radius: 4px;
background: #fff;
color: #0f172a;
font-size: 13px;
transition: border-color 160ms ease, box-shadow 160ms ease;
}
.receipt-form-grid input,
.receipt-field-row input {
height: 36px;
padding: 0 10px;
}
.receipt-form-grid textarea {
resize: vertical;
min-height: 78px;
padding: 9px 10px;
line-height: 1.55;
}
.receipt-form-grid input:focus,
.receipt-form-grid textarea:focus,
.receipt-field-row input:focus {
border-color: var(--theme-primary);
box-shadow: 0 0 0 3px rgba(58, 124, 165, 0.14);
outline: none;
}
.apply-btn,
.ghost-btn,
.danger-btn,
.back-btn {
min-height: 36px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
border-radius: 4px;
font-size: 13px;
font-weight: 750;
white-space: nowrap;
}
.ghost-btn,
.back-btn {
padding: 0 13px;
border: 1px solid #d7e0ea;
background: #fff;
color: #334155;
}
.apply-btn {
padding: 0 14px;
border: 1px solid var(--theme-primary);
background: var(--theme-primary);
color: #fff;
}
.danger-btn {
padding: 0 14px;
border: 1px solid #dc2626;
background: #dc2626;
color: #fff;
}
.apply-btn:disabled,
.danger-btn:disabled {
opacity: .55;
cursor: not-allowed;
}
.receipt-folder-detail {
display: grid;
grid-template-rows: auto minmax(0, 1fr) auto;
}
.receipt-detail-head {
gap: 14px;
padding-bottom: 14px;
border-bottom: 1px solid #dbe4ee;
}
.receipt-detail-head h2 {
margin: 4px 0;
color: #0f172a;
font-size: 20px;
line-height: 1.25;
}
.receipt-detail-head p {
margin: 0;
color: #64748b;
font-size: 13px;
}
.assistant-badge {
display: inline-flex;
align-items: center;
min-height: 22px;
padding: 0 8px;
border-radius: 4px;
background: #eef6ff;
color: var(--theme-primary-active);
font-size: 12px;
font-weight: 850;
}
.detail-loading {
min-height: 0;
display: grid;
place-items: center;
}
.receipt-detail-layout {
min-height: 0;
display: grid;
grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
gap: 16px;
padding: 16px 0;
overflow: hidden;
}
.receipt-basic-panel,
.receipt-preview-panel {
min-height: 0;
overflow: hidden;
border: 1px solid #dbe4ee;
border-radius: 4px;
background: #fff;
}
.receipt-basic-panel {
display: grid;
grid-template-rows: auto minmax(0, 1fr) auto;
padding: 14px;
overflow-y: auto;
}
.receipt-basic-panel header,
.receipt-preview-panel header,
.receipt-field-list-head {
justify-content: space-between;
gap: 12px;
}
.receipt-basic-panel header strong,
.receipt-preview-panel header strong,
.receipt-field-list-head strong {
color: #0f172a;
font-size: 15px;
}
.receipt-form-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
margin-top: 14px;
}
.receipt-form-grid label {
display: grid;
gap: 6px;
}
.receipt-form-grid label span {
color: #64748b;
font-size: 12px;
font-weight: 750;
}
.field-wide {
grid-column: 1 / -1;
}
.receipt-field-list {
margin-top: 18px;
display: grid;
gap: 10px;
}
.receipt-field-row {
display: grid;
grid-template-columns: minmax(100px, .6fr) minmax(160px, 1fr) 30px;
gap: 8px;
}
.receipt-field-row button {
display: grid;
place-items: center;
border: 1px solid #d7e0ea;
border-radius: 4px;
background: #fff;
color: #64748b;
}
.receipt-preview-panel {
display: grid;
grid-template-rows: auto minmax(0, 1fr);
}
.receipt-preview-panel header {
padding: 14px;
border-bottom: 1px solid #e5edf5;
}
.preview-source-btn {
border: 0;
background: transparent;
color: var(--theme-primary-active);
font-size: 13px;
font-weight: 750;
text-decoration: none;
}
.receipt-preview-box {
min-height: 0;
display: grid;
place-items: center;
overflow: auto;
background: #f8fafc;
}
.receipt-preview-box img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
.receipt-preview-box iframe {
width: 100%;
height: 100%;
border: 0;
background: #fff;
}
.preview-empty {
display: grid;
gap: 8px;
justify-items: center;
color: #64748b;
text-align: center;
}
.preview-empty .mdi {
color: var(--theme-primary);
font-size: 34px;
}
.receipt-detail-foot {
justify-content: space-between;
gap: 12px;
padding-top: 14px;
border-top: 1px solid #dbe4ee;
}
.associate-step {
display: grid;
gap: 12px;
}
.associate-hint {
margin: 0;
color: #64748b;
font-size: 13px;
}
.receipt-checkbox-list,
.draft-choice-list {
max-height: 360px;
display: grid;
gap: 8px;
overflow-y: auto;
}
.receipt-checkbox-list :deep(.el-checkbox),
.draft-choice {
min-height: 50px;
align-items: center;
margin-right: 0;
padding: 9px 10px;
border: 1px solid #dbe4ee;
border-radius: 4px;
background: #fff;
}
.receipt-checkbox-list :deep(.el-checkbox__label) {
display: grid;
gap: 3px;
color: #0f172a;
font-weight: 750;
}
.receipt-checkbox-list small,
.draft-choice small {
color: #64748b;
font-size: 12px;
font-weight: 650;
}
.draft-choice {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 9px;
cursor: pointer;
}
.draft-choice.active {
border-color: rgba(58, 124, 165, .42);
background: rgba(58, 124, 165, .07);
}
.draft-choice span {
display: grid;
gap: 3px;
}
@media (max-width: 1120px) {
.receipt-detail-layout {
grid-template-columns: 1fr;
overflow-y: auto;
}
.receipt-preview-panel {
min-height: 520px;
}
}
@media (max-width: 760px) {
.receipt-folder-list,
.receipt-folder-detail {
padding: 12px;
}
.receipt-form-grid {
grid-template-columns: 1fr;
}
}