PS6 修复采购提交预算预检阻断

这个提交包含在:
2026-05-12 01:30:12 +08:00
父节点 d8b2e4f954
当前提交 a8b7351a4f
共修改 3 个文件,包含 306 行新增和 3 行删除
+13 -1
查看文件
@@ -1612,7 +1612,19 @@ async function purchaseRequestRoutes(fastify) {
}
const warnings = [];
const budgetControlMode = authoritativePrecheck?.budgetHint?.controlMode ?? normalizeBudgetControlMode(fastify.config);
const budgetPrecheckGate = await evaluateFeatureFlag({
prisma: tx,
config: fastify.config,
flagKey: FEATURE_FLAG_KEYS.budgetPrecheck,
departmentId: purchaseRequest.department_id ?? request.employee.department_id ?? null,
strictDepartment: false,
});
const fallbackBudgetControlMode = normalizeBudgetControlMode(fastify.config);
const budgetControlMode = budgetPrecheckGate.enabled
? authoritativePrecheck.matchedBudgetControlRule?.controlMode
?? authoritativePrecheck?.budgetHint?.controlMode
?? fallbackBudgetControlMode
: fallbackBudgetControlMode;
if (!selectedBudgetPoolId) {
if (!budgetPrecheckGate.enabled && budgetControlMode === "block") {
throw buildValidationError({ budget: "missing_budget_pool" }, 409);