|
@@ -1,17 +1,25 @@
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
|
-import { NzModalRef, NzMessageService, NzDrawerRef } from 'ng-zorro-antd';
|
|
|
+import { NzModalRef, NzMessageService, NzDrawerRef, NzNotificationService } from 'ng-zorro-antd';
|
|
|
import { _HttpClient } from '@delon/theme';
|
|
|
import { ProjectManageArchivesAddEssentialInformationComponent } from './essential-information/essential-information.component';
|
|
|
import { ProjectManageArchivesAddBusinessAffairsComponent } from './business-affairs/business-affairs.component';
|
|
|
import { ProjectManageArchivesAddImplementationComponent } from './implementation/implementation.component';
|
|
|
import { DictService } from 'app/services/dict.service';
|
|
|
+import { PersonnelService } from 'app/services/basedata/personnel.service';
|
|
|
+import { recursiveQuery } from '@shared/utils/yuan copy';
|
|
|
+import { ProjectManageArchivesAddDevelopmentComponent } from './development/development.component';
|
|
|
+import { ProjectManageArchivesAddServicetaComponent } from './serviceta/serviceta.component';
|
|
|
+import { BaseArchivesMilestone } from 'app/entity/basedata/base-archives-milestone';
|
|
|
+import { BaseArchivesMilestoneService } from 'app/services/basedata/base-archives-milestone.service';
|
|
|
+import { ProjectManageArchives } from 'app/entity/project-manage-archives/project-manage-archives';
|
|
|
+import { I18NService } from '@core';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-project-manage-archives-add',
|
|
|
templateUrl: './add.component.html',
|
|
|
- styles:[
|
|
|
+ styles: [
|
|
|
`
|
|
|
- .base {
|
|
|
+ .base {
|
|
|
position: absolute;
|
|
|
bottom: 0px;
|
|
|
width: 100%;
|
|
@@ -22,72 +30,248 @@ import { DictService } from 'app/services/dict.service';
|
|
|
background: #fff;
|
|
|
z-index: 99;
|
|
|
}
|
|
|
- `
|
|
|
- ]
|
|
|
+ `,
|
|
|
+ ],
|
|
|
})
|
|
|
export class ProjectManageArchivesAddComponent implements OnInit {
|
|
|
-
|
|
|
-
|
|
|
constructor(
|
|
|
- private drawerRef:NzDrawerRef,
|
|
|
- private dictService:DictService
|
|
|
- ) { }
|
|
|
+ private drawerRef: NzDrawerRef,
|
|
|
+ private dictService: DictService,
|
|
|
+ private personnelService: PersonnelService,
|
|
|
+ private baseArchivesMilestoneService: BaseArchivesMilestoneService,
|
|
|
+ private nzNotificationService: NzNotificationService,
|
|
|
+ private i18NService: I18NService,
|
|
|
+ ) {}
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
this.getPlanType();
|
|
|
+
|
|
|
+ this.getPersonnelList();
|
|
|
+
|
|
|
+ this.getTypeList();
|
|
|
}
|
|
|
|
|
|
- isLoadingSave=false;
|
|
|
+ isLoadingSave = false;
|
|
|
|
|
|
@ViewChild('essentialInformation') essentialInformation: ProjectManageArchivesAddEssentialInformationComponent;
|
|
|
|
|
|
@ViewChild('businessAffairs') businessAffairs: ProjectManageArchivesAddBusinessAffairsComponent;
|
|
|
|
|
|
@ViewChild('implementation') implementation: ProjectManageArchivesAddImplementationComponent;
|
|
|
+
|
|
|
+ @ViewChild('development') development: ProjectManageArchivesAddDevelopmentComponent;
|
|
|
+
|
|
|
+ @ViewChild('serviceta') serviceta: ProjectManageArchivesAddServicetaComponent;
|
|
|
|
|
|
|
|
|
* 计划类型查询
|
|
|
*/
|
|
|
- getPlanType(){
|
|
|
- return new Promise((resolve)=>{
|
|
|
+ getPlanType() {
|
|
|
+ return new Promise(resolve => {
|
|
|
this.dictService.getByDictCode('plan_type').then(response => {
|
|
|
|
|
|
this.businessAffairs.planList = response.result;
|
|
|
resolve();
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
|
* 根据类型id回写数据到实施、开发、服务页签的汇款信息
|
|
|
* @param data 计划对象
|
|
|
*/
|
|
|
- remittanceInformationChange(data){
|
|
|
+ remittanceInformationChange(data) {
|
|
|
|
|
|
- if(data.planId==="2"){
|
|
|
- this.implementation.remittanceInformation=data;
|
|
|
- }else if(data.planId==="3"){
|
|
|
-
|
|
|
- }else if(data.planId==="4"){
|
|
|
-
|
|
|
+ if (data.planId === '2') {
|
|
|
+ this.implementation.remittanceInformation = data;
|
|
|
+ } else if (data.planId === '3') {
|
|
|
+
|
|
|
+ this.development.remittanceInformation = data;
|
|
|
+ } else if (data.planId === '4') {
|
|
|
+
|
|
|
+ this.serviceta.remittanceInformation = data;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
* 基本信息的信息回写到其他页签
|
|
|
*/
|
|
|
- projectManageArchivesaEntiy(event){
|
|
|
+ projectManageArchivesaEntiy(event) {
|
|
|
|
|
|
- this.businessAffairs.projectManageArchives=event;
|
|
|
+ this.businessAffairs.projectManageArchives = event;
|
|
|
|
|
|
- this.implementation.projectManageArchives=event;
|
|
|
+ this.implementation.projectManageArchives = event;
|
|
|
|
|
|
-
|
|
|
+ this.development.projectManageArchives = event;
|
|
|
|
|
|
+ this.serviceta.projectManageArchives = event;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取人员下拉数据到各个页签中
|
|
|
+ */
|
|
|
+ getPersonnelList() {
|
|
|
+ return new Promise(resolve => {
|
|
|
+ this.personnelService.queryApprover(sessionStorage.getItem('pkOrg')).then(response => {
|
|
|
+
|
|
|
+ this.essentialInformation.personnelList = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.essentialInformation.saleManagerList = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.essentialInformation.impManagerList = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.essentialInformation.deManagerList = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.essentialInformation.seManagerList = JSON.parse(JSON.stringify(response.result));
|
|
|
+
|
|
|
+ this.implementation.personnelList = JSON.parse(JSON.stringify(response.result));
|
|
|
+
|
|
|
+ this.development.personnelList = JSON.parse(JSON.stringify(response.result));
|
|
|
+
|
|
|
+ this.serviceta.personnelList = JSON.parse(JSON.stringify(response.result));
|
|
|
+ recursiveQuery(this.essentialInformation.personnelList);
|
|
|
+ recursiveQuery(this.essentialInformation.saleManagerList);
|
|
|
+ recursiveQuery(this.essentialInformation.impManagerList);
|
|
|
+ recursiveQuery(this.essentialInformation.deManagerList);
|
|
|
+ recursiveQuery(this.essentialInformation.seManagerList);
|
|
|
+
|
|
|
+
|
|
|
+ recursiveQuery(this.implementation.personnelList);
|
|
|
+
|
|
|
+ recursiveQuery(this.development.personnelList);
|
|
|
+
|
|
|
+ recursiveQuery(this.serviceta.personnelList);
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- save(){
|
|
|
- this.essentialInformation.submitForm();
|
|
|
+
|
|
|
+ * 获取里程碑类型到基本信息中
|
|
|
+ */
|
|
|
+ getTypeList() {
|
|
|
+ this.dictService.getByDictCode('base_archives_milestone_type').then(response => {
|
|
|
+ this.essentialInformation.milestoneList = response.result;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 根据里程碑类型查询商务的里程碑下拉数据以及实施、开发、服务的里程碑明细
|
|
|
+ */
|
|
|
+ milestone(event: ProjectManageArchives) {
|
|
|
+
|
|
|
+
|
|
|
+ let baseArchivesMilestone = new BaseArchivesMilestone();
|
|
|
+ baseArchivesMilestone.parentId = '0';
|
|
|
+ baseArchivesMilestone.typeId = event.milestoneId;
|
|
|
+
|
|
|
+ this.baseArchivesMilestoneService.getAllParent(baseArchivesMilestone).then(response => {
|
|
|
+ if (response.result) {
|
|
|
+ this.businessAffairs.milestoneList = response.result;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ let baseArchivesMilestone2 = new BaseArchivesMilestone();
|
|
|
+ baseArchivesMilestone2.pkOrg = sessionStorage.getItem('pkOrg');
|
|
|
+ baseArchivesMilestone2.typeId = event.milestoneId;
|
|
|
+
|
|
|
+ this.baseArchivesMilestoneService.getTreeList(baseArchivesMilestone2).then(response => {
|
|
|
+ if (response.result) {
|
|
|
+
|
|
|
+ this.implementation.listOfMapData = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.implementation.getLoding();
|
|
|
+
|
|
|
+ this.development.listOfMapData = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.development.getLoding();
|
|
|
+
|
|
|
+ this.serviceta.listOfMapData = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.serviceta.getLoding();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ save() {
|
|
|
+ return new Promise(resolve => {
|
|
|
+
|
|
|
+ this.essentialInformation.submitForm();
|
|
|
+
|
|
|
+ let projectManageArchives = this.essentialInformation.projectManageArchivesa;
|
|
|
+
|
|
|
+ projectManageArchives.received;
|
|
|
+
|
|
|
+ projectManageArchives.pkOrg = sessionStorage.getItem('pkOrg');
|
|
|
+
|
|
|
+ let bsInfo: any = {};
|
|
|
+ bsInfo.coPlanList = this.businessAffairs.collectionPlanList;
|
|
|
+ bsInfo.coSituationList = this.businessAffairs.paymentCollectionList;
|
|
|
+ bsInfo.payPlanList = this.businessAffairs.paymentPlanList;
|
|
|
+ bsInfo.paySituationList = this.businessAffairs.paymentStatusList;
|
|
|
+ projectManageArchives.bsInfo = bsInfo;
|
|
|
+
|
|
|
+ let ipInfo: any = {};
|
|
|
+ let implementation = [];
|
|
|
+
|
|
|
+ this.getMileItem(this.implementation, implementation);
|
|
|
+ ipInfo.planList = implementation;
|
|
|
+ projectManageArchives.ipInfo = ipInfo;
|
|
|
+
|
|
|
+ let deInfo: any = {};
|
|
|
+ let development = [];
|
|
|
+
|
|
|
+ this.getMileItem(this.development, development);
|
|
|
+ deInfo.planList = development;
|
|
|
+ projectManageArchives.deInfo = deInfo;
|
|
|
+
|
|
|
+ let seInfo: any = {};
|
|
|
+ let serviceta = [];
|
|
|
+
|
|
|
+ this.getMileItem(this.serviceta, serviceta);
|
|
|
+ seInfo.planList = serviceta;
|
|
|
+ projectManageArchives.seInfo = seInfo;
|
|
|
+ this.baseArchivesMilestoneService.add(projectManageArchives).then(response => {
|
|
|
+ if (response.success) {
|
|
|
+
|
|
|
+ this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
|
|
|
+ this.drawerRef.close();
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取计划里程碑明细数据
|
|
|
+ * @param component 页签组件对象
|
|
|
+ * @param list 需要的保存集合
|
|
|
+ */
|
|
|
+ getMileItem(component, list) {
|
|
|
+ component.listOfMapData.forEach(item => {
|
|
|
+ component.mapOfExpandedData[item.key].forEach(element => {
|
|
|
+ let names = '';
|
|
|
+ let ids = '';
|
|
|
+
|
|
|
+ element.executors.forEach(element => {
|
|
|
+ component.personnelList.forEach(pkOrg => {
|
|
|
+ pkOrg.children.forEach(depart => {
|
|
|
+ depart.children.forEach(personnel => {
|
|
|
+ if (personnel.key === element) {
|
|
|
+ if (names === '') {
|
|
|
+ names = personnel.name;
|
|
|
+ ids = personnel.key;
|
|
|
+ } else {
|
|
|
+ names = names + '、' + personnel.name;
|
|
|
+ ids = ids + '、' + personnel.key;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ element.executor = names;
|
|
|
+ element.executorId = ids;
|
|
|
+ list.push(element);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
close() {
|