|
@@ -306,7 +306,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 客户信息卡片展开/收起状态
|
|
|
isCustomerInfoExpanded: boolean = false;
|
|
|
|
|
|
- // 新增:订单创建表单相关
|
|
|
+ // 新增:订单分配表单相关
|
|
|
orderCreationForm!: FormGroup;
|
|
|
optionalForm!: FormGroup;
|
|
|
isOptionalFormExpanded: boolean = false;
|
|
@@ -340,10 +340,10 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
mappingIsGeneratingMapping: boolean = false;
|
|
|
|
|
|
// 新增:9阶段顺序(串式流程)- 包含后期阶段
|
|
|
- stageOrder: ProjectStage[] = ['订单创建', '需求沟通', '方案确认', '建模', '软装', '渲染', '后期', '尾款结算', '客户评价', '投诉处理'];
|
|
|
+ stageOrder: ProjectStage[] = ['订单分配', '需求沟通', '方案确认', '建模', '软装', '渲染', '后期', '尾款结算', '客户评价', '投诉处理'];
|
|
|
// 新增:阶段展开状态(默认全部收起,当前阶段在数据加载后自动展开)
|
|
|
expandedStages: Partial<Record<ProjectStage, boolean>> = {
|
|
|
- '订单创建': false,
|
|
|
+ '订单分配': false,
|
|
|
'需求沟通': false,
|
|
|
'方案确认': false,
|
|
|
'建模': false,
|
|
@@ -357,7 +357,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
|
|
|
// 新增:四大板块定义与展开状态 - 交付执行板块调整为三个阶段
|
|
|
sections: Array<{ key: SectionKey; label: string; stages: ProjectStage[] }> = [
|
|
|
- { key: 'order', label: '订单创建', stages: ['订单创建'] },
|
|
|
+ { key: 'order', label: '订单分配', stages: ['订单分配'] },
|
|
|
{ key: 'requirements', label: '确认需求', stages: ['需求沟通', '方案确认'] },
|
|
|
{ key: 'delivery', label: '交付执行', stages: ['建模', '软装', '渲染', '后期'] },
|
|
|
{ key: 'aftercare', label: '售后', stages: [] }
|
|
@@ -542,26 +542,26 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
this.router.navigate([], { relativeTo: this.route, queryParamsHandling: 'merge', queryParams: { id: projectId } });
|
|
|
}
|
|
|
|
|
|
- // 检查是否处于订单创建阶段,用于红色高亮显示
|
|
|
+ // 检查是否处于订单分配阶段,用于红色高亮显示
|
|
|
isCurrentOrderCreation(): boolean {
|
|
|
- // 只有当订单创建阶段是当前活跃阶段时才标红显示
|
|
|
+ // 只有当订单分配阶段是当前活跃阶段时才标红显示
|
|
|
// 修复逻辑:完成前序环节后才标红当前阶段
|
|
|
const currentStage = this.project?.currentStage;
|
|
|
if (!currentStage) return false;
|
|
|
|
|
|
- // 如果当前阶段就是订单创建阶段,说明需要标红显示
|
|
|
- if (currentStage === '订单创建') return true;
|
|
|
+ // 如果当前阶段就是订单分配阶段,说明需要标红显示
|
|
|
+ if (currentStage === '订单分配') return true;
|
|
|
|
|
|
- // 如果当前阶段在订单创建之后,说明订单创建已完成,不应标红
|
|
|
+ // 如果当前阶段在订单分配之后,说明订单分配已完成,不应标红
|
|
|
const stageOrder = [
|
|
|
- '订单创建', '需求沟通', '方案确认', '建模', '软装',
|
|
|
+ '订单分配', '需求沟通', '方案确认', '建模', '软装',
|
|
|
'渲染', '尾款结算', '客户评价', '投诉处理'
|
|
|
];
|
|
|
|
|
|
const currentIndex = stageOrder.indexOf(currentStage);
|
|
|
- const orderCreationIndex = stageOrder.indexOf('订单创建');
|
|
|
+ const orderCreationIndex = stageOrder.indexOf('订单分配');
|
|
|
|
|
|
- // 如果当前阶段在订单创建之后,说明订单创建已完成
|
|
|
+ // 如果当前阶段在订单分配之后,说明订单分配已完成
|
|
|
return currentIndex <= orderCreationIndex;
|
|
|
}
|
|
|
|
|
@@ -576,7 +576,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
|
|
|
// 定义阶段顺序
|
|
|
const stageOrder = [
|
|
|
- '订单创建', '需求沟通', '方案确认', '建模', '软装',
|
|
|
+ '订单分配', '需求沟通', '方案确认', '建模', '软装',
|
|
|
'渲染', '尾款结算', '客户评价', '投诉处理'
|
|
|
];
|
|
|
|
|
@@ -715,7 +715,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 设置同步状态
|
|
|
this.isSyncingCustomerInfo = true;
|
|
|
|
|
|
- // 存储订单创建数据用于显示
|
|
|
+ // 存储订单分配数据用于显示
|
|
|
this.orderCreationData = syncData;
|
|
|
|
|
|
// 更新projectData以传递给子组件
|
|
@@ -882,7 +882,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 只读规则:客服视角为只读
|
|
|
isReadOnly(): boolean { return this.isCustomerServiceView(); }
|
|
|
|
|
|
- // 权限控制:客服只能编辑订单创建、确认需求、售后板块
|
|
|
+ // 权限控制:客服只能编辑订单分配、确认需求、售后板块
|
|
|
canEditSection(sectionKey: SectionKey): boolean {
|
|
|
if (this.isCustomerServiceView()) {
|
|
|
return sectionKey === 'order' || sectionKey === 'requirements' || sectionKey === 'aftercare';
|
|
@@ -894,7 +894,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
canEditStage(stage: ProjectStage): boolean {
|
|
|
if (this.isCustomerServiceView()) {
|
|
|
const editableStages: ProjectStage[] = [
|
|
|
- '订单创建', '需求沟通', '方案确认', // 订单创建和确认需求板块
|
|
|
+ '订单分配', '需求沟通', '方案确认', // 订单分配和确认需求板块
|
|
|
'尾款结算', '客户评价', '投诉处理' // 售后板块
|
|
|
];
|
|
|
return editableStages.includes(stage);
|
|
@@ -910,7 +910,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
}
|
|
|
|
|
|
// 返回当前板块的全部阶段(所有角色一致):
|
|
|
- // 设计师也可查看 订单创建/确认需求/售后 板块内容
|
|
|
+ // 设计师也可查看 订单分配/确认需求/售后 板块内容
|
|
|
getVisibleStages(): ProjectStage[] {
|
|
|
const activeKey = this.getActiveSectionKey();
|
|
|
const sec = this.sections.find(s => s.key === activeKey);
|
|
@@ -1432,7 +1432,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 将现有细分阶段映射为标准化阶段
|
|
|
mapToStandardPhase(stage: ProjectStage): '待分配' | '需求方案' | '项目执行' | '收尾验收' | '归档' {
|
|
|
const mapping: Record<ProjectStage, '待分配' | '需求方案' | '项目执行' | '收尾验收' | '归档'> = {
|
|
|
- '订单创建': '待分配',
|
|
|
+ '订单分配': '待分配',
|
|
|
'需求沟通': '需求方案',
|
|
|
'方案确认': '需求方案',
|
|
|
'建模': '项目执行',
|
|
@@ -2139,7 +2139,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 根据阶段映射所属板块
|
|
|
getSectionKeyForStage(stage: ProjectStage): SectionKey {
|
|
|
switch (stage) {
|
|
|
- case '订单创建':
|
|
|
+ case '订单分配':
|
|
|
return 'order';
|
|
|
case '需求沟通':
|
|
|
case '方案确认':
|
|
@@ -2163,8 +2163,8 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 优先使用本地的currentStage,如果没有则使用project.currentStage
|
|
|
const current = (this.currentStage || this.project?.currentStage) as ProjectStage | undefined;
|
|
|
|
|
|
- // 如果没有当前阶段(新创建的项目),默认订单创建板块为active(红色)
|
|
|
- if (!current || current === '订单创建') {
|
|
|
+ // 如果没有当前阶段(新创建的项目),默认订单分配板块为active(红色)
|
|
|
+ if (!current || current === '订单分配') {
|
|
|
return key === 'order' ? 'active' : 'pending';
|
|
|
}
|
|
|
|
|
@@ -2203,7 +2203,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 阶段到锚点的映射
|
|
|
stageToAnchor(stage: ProjectStage): string {
|
|
|
const map: Record<ProjectStage, string> = {
|
|
|
- '订单创建': 'order',
|
|
|
+ '订单分配': 'order',
|
|
|
'需求沟通': 'requirements-talk',
|
|
|
'方案确认': 'proposal-confirm',
|
|
|
'建模': 'modeling',
|
|
@@ -2226,7 +2226,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 订单创建阶段:客户信息(迁移自客服端"客户信息"卡片)
|
|
|
+ // 订单分配阶段:客户信息(迁移自客服端"客户信息"卡片)
|
|
|
orderCreationMethod: 'miniprogram' | 'manual' = 'miniprogram';
|
|
|
isSyncing: boolean = false;
|
|
|
orderTime: string = '';
|
|
@@ -2582,7 +2582,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
}
|
|
|
|
|
|
const stageOrder = [
|
|
|
- '订单创建', '需求沟通', '方案确认', '建模', '软装',
|
|
|
+ '订单分配', '需求沟通', '方案确认', '建模', '软装',
|
|
|
'渲染', '尾款结算', '客户评价', '投诉处理'
|
|
|
];
|
|
|
|
|
@@ -2674,12 +2674,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
getProjectStatusText(): string {
|
|
|
const current = (this.currentStage || this.project?.currentStage) as ProjectStage | undefined;
|
|
|
|
|
|
- if (!current || current === '订单创建') {
|
|
|
+ if (!current || current === '订单分配') {
|
|
|
return '待开始';
|
|
|
}
|
|
|
|
|
|
// 检查是否已完成所有阶段
|
|
|
- const allStages: ProjectStage[] = ['订单创建', '需求沟通', '方案确认', '建模', '软装', '渲染', '尾款结算', '客户评价', '投诉处理'];
|
|
|
+ const allStages: ProjectStage[] = ['订单分配', '需求沟通', '方案确认', '建模', '软装', '渲染', '尾款结算', '客户评价', '投诉处理'];
|
|
|
const currentIndex = allStages.indexOf(current);
|
|
|
|
|
|
if (currentIndex === allStages.length - 1) {
|
|
@@ -2693,8 +2693,8 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
getCurrentStageText(): string {
|
|
|
const current = (this.currentStage || this.project?.currentStage) as ProjectStage | undefined;
|
|
|
|
|
|
- if (!current || current === '订单创建') {
|
|
|
- return '订单创建阶段';
|
|
|
+ if (!current || current === '订单分配') {
|
|
|
+ return '订单分配阶段';
|
|
|
}
|
|
|
|
|
|
return `${current}阶段`;
|
|
@@ -2710,7 +2710,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
|
|
|
// 定义所有阶段及其权重
|
|
|
const stageWeights: Record<ProjectStage, number> = {
|
|
|
- '订单创建': 5,
|
|
|
+ '订单分配': 5,
|
|
|
'需求沟通': 15,
|
|
|
'方案确认': 25,
|
|
|
'建模': 40,
|
|
@@ -2866,12 +2866,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
}
|
|
|
|
|
|
// 处理咨询订单表单提交
|
|
|
- // 存储订单创建时的客户信息和需求信息
|
|
|
+ // 存储订单分配时的客户信息和需求信息
|
|
|
|
|
|
onConsultationOrderSubmit(formData: any): void {
|
|
|
console.log('咨询订单表单提交:', formData);
|
|
|
|
|
|
- // 保存订单创建数据
|
|
|
+ // 保存订单分配数据
|
|
|
this.orderCreationData = formData;
|
|
|
|
|
|
// 更新projectData以便传递给子组件(集成报价与指派信息)
|
|
@@ -2993,7 +2993,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
// 进入下一个阶段:需求沟通
|
|
|
this.updateProjectStage('需求沟通');
|
|
|
this.expandedStages['需求沟通'] = true;
|
|
|
- this.expandedStages['订单创建'] = false;
|
|
|
+ this.expandedStages['订单分配'] = false;
|
|
|
|
|
|
// 显示成功消息
|
|
|
alert('团队分配成功!已进入需求沟通阶段');
|
|
@@ -3015,9 +3015,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
this.project.currentStage = '需求沟通';
|
|
|
}
|
|
|
|
|
|
- // 展开需求沟通阶段,收起订单创建阶段
|
|
|
+ // 展开需求沟通阶段,收起订单分配阶段
|
|
|
this.expandedStages['需求沟通'] = true;
|
|
|
- this.expandedStages['订单创建'] = false;
|
|
|
+ this.expandedStages['订单分配'] = false;
|
|
|
|
|
|
// 自动展开确认需求板块
|
|
|
this.expandedSection = 'requirements';
|
|
@@ -3746,7 +3746,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
};
|
|
|
|
|
|
sopStagesData: any[] = [
|
|
|
- { name: '订单创建', plannedDuration: 1, actualDuration: 1, score: 95, status: 'completed', statusText: '已完成', isDelayed: false, issues: [] },
|
|
|
+ { name: '订单分配', plannedDuration: 1, actualDuration: 1, score: 95, status: 'completed', statusText: '已完成', isDelayed: false, issues: [] },
|
|
|
{ name: '需求沟通', plannedDuration: 3, actualDuration: 4, score: 75, status: 'completed', statusText: '已完成', isDelayed: true, issues: ['沟通次数超标'] },
|
|
|
{ name: '方案确认', plannedDuration: 2, actualDuration: 2, score: 90, status: 'completed', statusText: '已完成', isDelayed: false, issues: [] },
|
|
|
{ name: '建模', plannedDuration: 4, actualDuration: 5, score: 80, status: 'completed', statusText: '已完成', isDelayed: true, issues: ['细节调整耗时'] },
|
|
@@ -4722,7 +4722,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
|
|
|
// 初始化表单
|
|
|
initializeForms(): void {
|
|
|
- // 初始化订单创建表单(必填项)
|
|
|
+ // 初始化订单分配表单(必填项)
|
|
|
this.orderCreationForm = this.fb.group({
|
|
|
orderAmount: ['', [Validators.required, Validators.min(0)]],
|
|
|
smallImageDeliveryTime: ['', Validators.required],
|
|
@@ -4742,12 +4742,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // 检查是否可以创建订单
|
|
|
+ // 检查是否可以分配订单
|
|
|
canCreateOrder(): boolean {
|
|
|
return this.orderCreationForm ? this.orderCreationForm.valid : false;
|
|
|
}
|
|
|
|
|
|
- // 创建订单
|
|
|
+ // 分配订单
|
|
|
createOrder(): void {
|
|
|
if (!this.canCreateOrder()) {
|
|
|
// 标记所有字段为已触摸,以显示验证错误
|
|
@@ -4763,14 +4763,14 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
designerAssignment: this.designerAssignmentData
|
|
|
};
|
|
|
|
|
|
- console.log('创建订单:', orderData);
|
|
|
+ console.log('分配订单:', orderData);
|
|
|
|
|
|
- // 这里应该调用API创建订单
|
|
|
+ // 这里应该调用API分配订单
|
|
|
// 模拟API调用
|
|
|
setTimeout(() => {
|
|
|
- alert('订单创建成功!');
|
|
|
- // 订单创建成功后自动切换到下一环节
|
|
|
- this.advanceToNextStage('订单创建');
|
|
|
+ alert('订单分配成功!');
|
|
|
+ // 订单分配成功后自动切换到下一环节
|
|
|
+ this.advanceToNextStage('订单分配');
|
|
|
}, 500);
|
|
|
}
|
|
|
|