fix: 预算流程断点修复 — 现金流联动+行动方案补齐

断点#1: 预算↔现金流打通
- cash_plans 加 related_kpi_id/budget_plan_id 字段
- POST /budget/sync-cash-plans: 按预算KPI生成收付款计划(收入类→receive/成本类→pay, upsert)
- 前端预算执行页加'⇄同步现金流计划'按钮
- 实测: 新建108条(receive 75/pay 33, 6个KPI)

断点#2: 5个预算KPI补行动方案(净利/新客/厂补/供应链/数据自动化, 各1条含负责人)

断点#3: 悬空预算(2KPI)因已补行动方案, 性质从'无来源'→'有行动缺实际数据源', 标注保留

pytest 56 passed(budget+cash), 构建部署
This commit is contained in:
Hermes CI Fix
2026-08-27 16:54:07 +08:00
parent ec5304a1d0
commit e82a6af59c
3 changed files with 88 additions and 0 deletions
+16
View File
@@ -178,6 +178,7 @@
<el-select v-model="execFilterMonth" placeholder="截止月份" style="width:110px;" @change="loadExecutionReport"><el-option v-for="m in 12" :key="m" :label="`${m}`" :value="m" /></el-select>
<el-select v-model="execFilterDim" placeholder="维度" clearable style="width:110px;" @change="loadExecutionReport"><el-option label="财务" value="finance" /><el-option label="客户" value="customer" /><el-option label="内部流程" value="process" /><el-option label="学习成长" value="learning" /></el-select>
<el-button type="primary" @click="loadExecutionReport">刷新</el-button>
<el-button type="warning" :loading="syncingCash" @click="syncCashPlans">⇄ 同步现金流计划</el-button>
</div>
<el-row :gutter="16" style="margin-bottom:16px;">
<el-col :span="6" v-for="card in execSummaryCards" :key="card.label"><el-card shadow="hover"><div style="text-align:center;"><div style="font-size:12px;color:#999;">{{ card.label }}</div><div style="font-size:22px;font-weight:600;margin-top:4px;" :style="{color: card.color}">{{ card.value }}</div></div></el-card></el-col>
@@ -447,6 +448,21 @@ const filterYear = ref(currentYear); const filterMonth = ref(0); const searchKpi
const loading = ref(false); const budgetList = ref<any[]>([]); const page = ref(1); const pageSize = ref(20); const total = ref(0); const noMap = ref(false)
const batchEditMode = ref(false); const batchSavingAll = ref(false)
// ── 现金流联动(断点修复#1, 2026-08-27 ──
const syncingCash = ref(false)
async function syncCashPlans() {
syncingCash.value = true
try {
const r: any = await api.post('/budget/sync-cash-plans')
ElMessage.success(r.message || "现金流计划已同步")
loadExecutionReport()
} catch (e: any) {
ElMessage.error("同步失败: " + (e?.message || ""))
} finally {
syncingCash.value = false
}
}
// ── 战略地图选择 ──
const publishedMaps = ref<any[]>([])
const selectedMapId = ref<number | null>(null)