问题:管理员端显示23个"订单分配"项目,其他端只显示4个
原因:管理员端使用了阶段规范化逻辑,将子阶段映射到核心阶段
修复:
src/app/pages/admin/project-management/project-management.tsnormalizeStage()调用,直接使用currentStage效果:管理员端现在显示实际阶段名称,与其他端一致
// 修复前
const normalizedStage = normalizeStage(rawStage);
currentStage: normalizedStage
// 修复后
const currentStage = json.currentStage || json.stage || '订单分配';
currentStage: currentStage // 🔥 使用实际阶段名称
问题:底部卡片显示"软装"、"白膜"等子阶段,而非"交付执行"
原因:组件直接显示currentStage,未进行阶段分类
修复:
src/modules/project/components/project-bottom-card/project-bottom-card.component.ts效果:交付执行阶段项目的底部卡片统一显示"交付执行"
getProjectStatus(): string {
const currentStage = this.project?.get('currentStage') || '订单分配';
const corePhase = mapStageToCorePhase(currentStage);
// 🔥 交付执行阶段的子阶段统一显示"交付执行"
if (corePhase === 'delivery') {
return '交付执行';
}
return currentStage;
}
问题:某些项目的空间报价显示为¥0
原因:
修复:
src/modules/project/components/quotation-editor.component.tsfixZeroPriceProducts() 方法效果:自动修复报价为¥0的产品
// 加载数据时检测
if (this.products.length > 0) {
const hasZeroPrice = this.products.some(product => {
const quotation = product.get('quotation') || {};
return quotation.price === 0 || quotation.price == null;
});
if (hasZeroPrice) {
console.warn('⚠️ 检测到报价为¥0的产品,自动修复...');
await this.fixZeroPriceProducts();
}
}
// 修复逻辑
private async fixZeroPriceProducts(): Promise<void> {
for (const product of this.products) {
if (price === 0) {
// 重新计算价格
const basePrice = this.calculateBasePrice({...});
quotation.price = Math.round(basePrice);
await product.save();
}
}
// 重新生成报价
await this.generateQuotationFromProducts();
}
⚠️ 检测到报价为¥0的产品,自动修复...✅ 主卧 报价已修复: ¥800🔍 [报价编辑器] Product表查询结果: 2 条记录
✅ [报价编辑器] 最终加载 2 个唯一空间
✅ [报价编辑器] 无需修复,所有产品报价正常
🔍 [报价编辑器] Product表查询结果: 2 条记录
✅ [报价编辑器] 最终加载 2 个唯一空间
⚠️ [报价编辑器] 检测到报价为¥0的产品,自动修复...
🔧 [报价编辑器] 开始修复报价为¥0的产品...
🔨 修复产品: 主卧
✅ 主卧 报价已修复: ¥800
🔨 修复产品: 厨房
✅ 厨房 报价已修复: ¥600
✅ [报价编辑器] 共修复 2 个产品的报价
💰 [报价编辑器] 自动生成报价...
✅ [报价编辑器] 报价生成完成,总额: ¥1400
ADMIN_PROJECT_STAGE_AND_QUOTATION_ISSUES.mdsrc/app/utils/project-stage-mapper.tssrc/modules/project/components/quotation-editor.component.ts修复完成! 🎉