fix: 优化采购申请页面会议纪要字段及动态配置
1. 统一会议纪要字段名称为校党委会议纪要 2. 部门自行采购会议纪要使用动态配置替代硬编码2000 3. 动态配置获取不到值时直接报错而非使用默认值 4. 调整部门自行采购会议纪要显示条件为金额>=2000
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { evaluateRules, getEnabledRules } from '/@/api/purchase/purchasingRuleConfig';
|
||||
|
||||
const RULE_CACHE_KEY = 'purchase_rule_cache';
|
||||
@@ -65,26 +65,29 @@ export function usePurchaseRules() {
|
||||
|
||||
const getThresholds = () => {
|
||||
const thresholds: Record<string, number> = {
|
||||
deptPurchase: 50000,
|
||||
feasibility: 300000,
|
||||
publicSelect: 300000,
|
||||
govPurchase: 1000000
|
||||
deptPurchase: 0,
|
||||
feasibility: 0,
|
||||
publicSelect: 0,
|
||||
govPurchase: 0,
|
||||
deptSelfMeetingMinutes: 0
|
||||
};
|
||||
|
||||
rules.value.forEach(rule => {
|
||||
if (rule.ruleCode === 'DEPT_PURCHASE_THRESHOLD' && rule.amountMax) {
|
||||
thresholds.deptPurchase = Number(rule.amountMax);
|
||||
const getRuleAmount = (code: string, defaultVal?: number) => {
|
||||
const rule = rules.value.find(r => r.ruleCode === code);
|
||||
if (!rule || rule.amountMin === undefined || rule.amountMin === null) {
|
||||
if (defaultVal === undefined) {
|
||||
throw new Error(`采购规则配置缺失: ${code},请在系统配置中维护`);
|
||||
}
|
||||
return defaultVal;
|
||||
}
|
||||
if (rule.ruleCode === 'FEASIBILITY_REPORT' && rule.amountMin) {
|
||||
thresholds.feasibility = Number(rule.amountMin);
|
||||
}
|
||||
if (rule.ruleCode === 'PUBLIC_BID_40W_100W' && rule.amountMin) {
|
||||
thresholds.publicSelect = Number(rule.amountMin);
|
||||
}
|
||||
if (rule.ruleCode === 'GOV_PURCHASE_THRESHOLD' && rule.amountMin) {
|
||||
thresholds.govPurchase = Number(rule.amountMin);
|
||||
}
|
||||
});
|
||||
return Number(rule.amountMin);
|
||||
};
|
||||
|
||||
thresholds.deptPurchase = getRuleAmount('DEPT_PURCHASE_THRESHOLD');
|
||||
thresholds.feasibility = getRuleAmount('FEASIBILITY_REPORT');
|
||||
thresholds.publicSelect = getRuleAmount('PUBLIC_BID_40W_100W');
|
||||
thresholds.govPurchase = getRuleAmount('GOV_PURCHASE_THRESHOLD');
|
||||
thresholds.deptSelfMeetingMinutes = getRuleAmount('DEPT_SELF_MEETING_MINUTES', 2000);
|
||||
|
||||
return thresholds;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user