|
|
@@ -2,7 +2,11 @@ import { Component, OnInit, Input, ViewChild, ElementRef, ChangeDetectionStrateg
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
-import { FmodeObject, FmodeParse, WxworkSDK } from 'fmode-ng/core';
|
|
|
+import { FmodeObject, FmodeParse, WxworkAuth, WxworkSDK } from 'fmode-ng/core';
|
|
|
+import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
|
+import { MatInputModule } from '@angular/material/input';
|
|
|
+import { MatNativeDateModule } from '@angular/material/core';
|
|
|
+import { MatFormFieldModule } from '@angular/material/form-field';
|
|
|
|
|
|
import { ProjectFileService } from '../../../services/project-file.service';
|
|
|
import { ProductSpaceService, Project } from '../../../services/product-space.service';
|
|
|
@@ -35,7 +39,16 @@ const Parse = FmodeParse.with('nova');
|
|
|
@Component({
|
|
|
selector: 'app-stage-order',
|
|
|
standalone: true,
|
|
|
- imports: [CommonModule, FormsModule, QuotationEditorComponent, TeamAssignComponent],
|
|
|
+ imports: [
|
|
|
+ CommonModule,
|
|
|
+ FormsModule,
|
|
|
+ MatDatepickerModule,
|
|
|
+ MatInputModule,
|
|
|
+ MatNativeDateModule,
|
|
|
+ MatFormFieldModule,
|
|
|
+ QuotationEditorComponent,
|
|
|
+ TeamAssignComponent
|
|
|
+ ],
|
|
|
templateUrl: './stage-order.component.html',
|
|
|
styleUrls: ['./stage-order.component.scss'],
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
|
@@ -54,13 +67,14 @@ export class StageOrderComponent implements OnInit {
|
|
|
title: '',
|
|
|
projectType: '', // 家装 | 工装
|
|
|
renderType: '', // 静态单张 | 360全景
|
|
|
- demoday: new Date(),
|
|
|
- deadline: new Date(),
|
|
|
+ demoday: new Date() as Date | null,
|
|
|
+ deadline: new Date() as Date | null,
|
|
|
description: '',
|
|
|
priceLevel: '一级', // 一级(老客户) | 二级(中端组) | 三级(高端组)
|
|
|
spaceType: 'single' // single | multi
|
|
|
};
|
|
|
|
|
|
+
|
|
|
// 空间管理
|
|
|
projectSpaces: Project[] = [];
|
|
|
isMultiSpaceProject: boolean = false;
|
|
|
@@ -286,8 +300,8 @@ export class StageOrderComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
if (!this.currentUser && this.cid) {
|
|
|
- const wxwork = new WxworkSDK({ cid: this.cid, appId: 'crm' });
|
|
|
- this.currentUser = await wxwork.getCurrentUser();
|
|
|
+ const wxwork = new WxworkAuth({ cid: this.cid, appId: 'crm' });
|
|
|
+ this.currentUser = await wxwork.currentProfile();
|
|
|
|
|
|
const role = this.currentUser?.get('roleName') || '';
|
|
|
this.canEdit = ['客服', '组员', '组长', '管理员'].includes(role);
|
|
|
@@ -298,8 +312,8 @@ export class StageOrderComponent implements OnInit {
|
|
|
this.projectInfo.title = this.project.get('title') || '';
|
|
|
this.projectInfo.projectType = this.project.get('projectType') || '';
|
|
|
this.projectInfo.renderType = this.project.get('renderType') || '';
|
|
|
- this.projectInfo.deadline = this.project.get('deadline') || '';
|
|
|
- this.projectInfo.demoday = this.project.get('demoday') || '';
|
|
|
+ this.projectInfo.deadline = this.project.get('deadline') || new Date();
|
|
|
+ this.projectInfo.demoday = this.project.get('demoday') || new Date();
|
|
|
this.projectInfo.description = this.project.get('description') || '';
|
|
|
|
|
|
const data = this.project.get('data') || {};
|
|
|
@@ -830,9 +844,9 @@ export class StageOrderComponent implements OnInit {
|
|
|
approvalHistory.push({
|
|
|
stage: '订单分配',
|
|
|
submitter: {
|
|
|
- id: this.currentUser!.id,
|
|
|
- name: this.currentUser!.get('name'),
|
|
|
- role: this.currentUser!.get('roleName')
|
|
|
+ id: this.currentUser?.id,
|
|
|
+ name: this.currentUser?.get('name'),
|
|
|
+ role: this.currentUser?.get('roleName')
|
|
|
},
|
|
|
submitTime: new Date(),
|
|
|
status: 'confirm',
|