feat: 优化差旅报销预审流程与个人工作台 UI 体系

- 完善 user_agent_application 申请差旅报销预审槽位与消息组装
- 增强预算助理报告与风险建议卡片交互
- 重构登录页视觉样式与移动端响应式适配
- 优化个人工作台、文档中心、政策中心、员工管理等页面布局
- 拆分 travelRequestDetailPreReviewModel 为 advice/submit 模型
- 补充报销草稿、风险复核、Item Sync 与模板执行器测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-02 14:01:51 +08:00
parent 92444e7eae
commit ca691f3ee0
107 changed files with 5663 additions and 1542 deletions

View File

@@ -120,7 +120,9 @@ export default {
status: '全部'
})
const canEditBudget = computed(() => canEditBudgetCenter(props.currentUser))
const canEditBudget = computed(() =>
canEditBudgetCenter(props.currentUser) || isBudgetMonitorUser(props.currentUser)
)
const canAuditBudgetDrafts = computed(() => canEditBudgetCenter(props.currentUser))
const canSwitchDepartments = computed(() => canSwitchBudgetDepartments(props.currentUser))
const isDepartmentBudgetMonitor = computed(
@@ -145,7 +147,10 @@ export default {
})
)
const budgetScopeTabs = computed(() => buildBudgetScopeTabs(budgetRowsByScope.value))
const budgetScopeTabs = computed(() =>
buildBudgetScopeTabs(budgetRowsByScope.value)
.filter((tab) => canAuditBudgetDrafts.value || tab.value !== BUDGET_SCOPE_REVIEW)
)
const activeScopeRows = computed(() => budgetRowsByScope.value[activeBudgetScope.value] || [])
const activeScopeLabel = computed(
() => budgetScopeTabs.value.find((item) => item.value === activeBudgetScope.value)?.label || '预算'
@@ -224,14 +229,59 @@ export default {
}))
const pageSummary = computed(() => `${totalBudgetRows.value} 条,目前第 ${currentBudgetPage.value}`)
function openBudgetAssistant(prompt = '') {
function buildBudgetAssistantContext(row, mode = 'edit') {
if (!row) return null
return {
mode,
budgetNo: row.budgetNo,
departmentCode: row.departmentCode,
departmentName: row.departmentName,
costCenter: row.costCenter,
periodLabel: row.periodLabel,
periodType: row.periodType,
budgetYear: row.budgetYear,
budgetQuarter: row.budgetQuarter,
version: row.version,
compiler: row.compiler || row.owner,
reviewer: row.reviewer,
submittedAt: row.submittedAt,
requestedAmount: row.requestedAmount || row.quarterAmount,
previousAmount: row.quarterAmount,
categoryRows: Array.isArray(row.categoryRows)
? row.categoryRows.map((item) => ({ ...item }))
: []
}
}
function resolveEditableBudgetRow() {
const allRows = budgetRowsByScope.value[BUDGET_SCOPE_ALL] || []
if (isDepartmentBudgetMonitor.value) {
return allRows.find((row) => (
row.scope === BUDGET_SCOPE_ALL &&
(
(currentUserCostCenter.value && row.costCenter === currentUserCostCenter.value) ||
(currentUserDepartmentName.value && row.departmentName === currentUserDepartmentName.value)
)
)) || allRows[0] || null
}
return allRows.find((row) => row.scope === BUDGET_SCOPE_ALL) || allRows[0] || null
}
function openBudgetAssistant(prompt = '', budgetContext = null) {
if (!canEditBudget.value) return
const context = budgetContext || buildBudgetAssistantContext(resolveEditableBudgetRow(), 'edit')
emit('openAssistant', {
source: 'budget',
sessionType: 'budget',
prompt,
prompt: prompt || (
context?.departmentName
? `编辑${context.departmentName}${context.periodLabel || ''}预算`
: '编辑本部门预算'
),
files: [],
conversation: null
conversation: null,
budgetContext: context
})
}
@@ -242,7 +292,8 @@ export default {
}
openBudgetAssistant(
`请进入预算审核模式,审核${row.departmentName}${row.periodLabel}预算草案,重点看差旅、通信、招待费和办公用品的合理性、风险点和是否可以通过。`
`请进入预算审核模式,审核${row.departmentName}${row.periodLabel}预算草案,重点看差旅、通信、招待费和办公用品的合理性、风险点和是否可以通过。`,
buildBudgetAssistantContext(row, 'review')
)
}
@@ -332,6 +383,12 @@ export default {
}
)
watch(canAuditBudgetDrafts, (allowed) => {
if (!allowed && activeBudgetScope.value === BUDGET_SCOPE_REVIEW) {
activeBudgetScope.value = BUDGET_SCOPE_ALL
}
}, { immediate: true })
watch(
[
budgetPageSize,