|
@@ -9,6 +9,8 @@ import { Customer } from 'app/entity/basedata/customer';
|
|
|
import { CustomerService } from 'app/services/basedata/customer.service';
|
|
|
import { PersonnelService } from 'app/services/basedata/personnel.service';
|
|
|
import { recursiveQuery } from '@shared/utils/yuan copy';
|
|
|
+import { ContractFile } from 'app/entity/contract-management/contract-file';
|
|
|
+import { ContractFileService } from 'app/services/contract-management/contract-file.service';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-project-manage-archives-add-essential-information',
|
|
@@ -20,12 +22,13 @@ export class ProjectManageArchivesAddEssentialInformationComponent implements On
|
|
|
private baseArchivesProjectApprovalService: BaseArchivesProjectApprovalService,
|
|
|
private customerService: CustomerService,
|
|
|
private personnelService: PersonnelService,
|
|
|
+ private contractFileService: ContractFileService,
|
|
|
) {}
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
//初始化表单
|
|
|
this.validateForm = this.fb.group({
|
|
|
- proId: [null, [Validators.required]],
|
|
|
+ contractFileId: [null, [Validators.required]],
|
|
|
cusId: [null, [Validators.required]],
|
|
|
totalPrice: [null, [Validators.required]],
|
|
|
saleManagerId: [null],
|
|
@@ -36,7 +39,7 @@ export class ProjectManageArchivesAddEssentialInformationComponent implements On
|
|
|
deEngineerIds: [null],
|
|
|
seManagerId: [null],
|
|
|
seEngineerIds: [null],
|
|
|
- milestoneId: [null, [Validators.required]]
|
|
|
+ milestoneId: [null, [Validators.required]],
|
|
|
});
|
|
|
this.getProList();
|
|
|
this.getCusList();
|
|
@@ -46,18 +49,18 @@ export class ProjectManageArchivesAddEssentialInformationComponent implements On
|
|
|
validateForm!: FormGroup;
|
|
|
projectManageArchivesa: ProjectManageArchives = {
|
|
|
totalPrice: 0,
|
|
|
- impConsultantList:[],
|
|
|
- deEngineerList:[],
|
|
|
- seEngineerList:[]
|
|
|
+ impConsultantList: [],
|
|
|
+ deEngineerList: [],
|
|
|
+ seEngineerList: [],
|
|
|
}; //项目档案主表对象
|
|
|
proList: any = []; //项目立项档案数据集合
|
|
|
cusList = []; //客户档案数据集合
|
|
|
//金额格式化
|
|
|
formatterDollar = (value: number) => {
|
|
|
- if(value){
|
|
|
- return `$ ${value}`;
|
|
|
- }else{
|
|
|
- return `$ `;
|
|
|
+ if (value) {
|
|
|
+ return `$ ${value}`;
|
|
|
+ } else {
|
|
|
+ return `$ `;
|
|
|
}
|
|
|
};
|
|
|
parserDollar = (value: string) => value.replace('$ ', '');
|
|
@@ -72,16 +75,76 @@ export class ProjectManageArchivesAddEssentialInformationComponent implements On
|
|
|
* 查询项目立项
|
|
|
*/
|
|
|
getProList() {
|
|
|
+ // return new Promise(resolve => {
|
|
|
+ // let baseArchivesProjectApproval = new BaseArchivesProjectApproval();
|
|
|
+ // baseArchivesProjectApproval.pkOrg = sessionStorage.getItem('pkOrg');
|
|
|
+ // this.baseArchivesProjectApprovalService.getTreeList(baseArchivesProjectApproval).then(response => {
|
|
|
+ // this.proList = response.result;
|
|
|
+ // resolve();
|
|
|
+ // });
|
|
|
+ // });
|
|
|
return new Promise(resolve => {
|
|
|
- let baseArchivesProjectApproval = new BaseArchivesProjectApproval();
|
|
|
- baseArchivesProjectApproval.pkOrg = sessionStorage.getItem('pkOrg');
|
|
|
- this.baseArchivesProjectApprovalService.getTreeList(baseArchivesProjectApproval).then(response => {
|
|
|
- this.proList = response.result;
|
|
|
+ let contractFile = new ContractFile();
|
|
|
+ contractFile.pkOrg = sessionStorage.getItem('pkOrg');
|
|
|
+ contractFile.pageSize = 20000;
|
|
|
+ this.contractFileService.getPageList(contractFile).then(response => {
|
|
|
+ this.proList = response.result.records;
|
|
|
resolve();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Output() businessAffairsPamars = new EventEmitter<{}>();
|
|
|
+ businessAffairs = {
|
|
|
+ collectionPlanList: [],
|
|
|
+ paymentCollectionList: [],
|
|
|
+ collectionPlanSort: 1,
|
|
|
+ paymentCollectionSort: 1,
|
|
|
+ };
|
|
|
+ contractFileIdChange(event) {
|
|
|
+ if (event) {
|
|
|
+ this.contractFileService.getContractFileById(event).then(response => {
|
|
|
+ let contractFile = JSON.parse(JSON.stringify(response.result));
|
|
|
+ this.projectManageArchivesa.proId = contractFile.proId;
|
|
|
+ this.projectManageArchivesa.proCode = contractFile.proCode;
|
|
|
+ this.projectManageArchivesa.proName = contractFile.proName;
|
|
|
+ this.projectManageArchivesa.cusId = contractFile.fdCustomerId;
|
|
|
+ this.projectManageArchivesa.cusCode = contractFile.fdCustomerCode;
|
|
|
+ this.projectManageArchivesa.cusName = contractFile.fdCustomerName;
|
|
|
+ this.projectManageArchivesa.milestoneId = contractFile.milestoneId;
|
|
|
+ this.projectManageArchivesa.milestoneType = contractFile.milestoneName;
|
|
|
+ this.projectManageArchivesa.totalPrice = contractFile.transactionAmount;
|
|
|
+ //收款计划数据
|
|
|
+ let collectionPlanList = []; //收款计划
|
|
|
+ let paymentCollectionList = []; //回款计划
|
|
|
+ let collectionPlanSort = 0;
|
|
|
+ let paymentCollectionSort = 0;
|
|
|
+ //获取
|
|
|
+ if (contractFile.contractFileAndBusinessList) {
|
|
|
+ contractFile.contractFileAndBusinessList.forEach(element => {
|
|
|
+ if (element.planType == '1') {
|
|
|
+ element.sort = collectionPlanSort;
|
|
|
+ collectionPlanList.push(element);
|
|
|
+ collectionPlanSort++;
|
|
|
+ }
|
|
|
+ if (element.planType == '2') {
|
|
|
+ element.sort = paymentCollectionSort;
|
|
|
+ paymentCollectionList.push(element);
|
|
|
+ paymentCollectionSort++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.businessAffairs = {
|
|
|
+ collectionPlanList: collectionPlanList,
|
|
|
+ paymentCollectionList: paymentCollectionList,
|
|
|
+ collectionPlanSort: collectionPlanSort,
|
|
|
+ paymentCollectionSort: paymentCollectionSort,
|
|
|
+ };
|
|
|
+ this.businessAffairsPamars.emit(this.businessAffairs);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 里程碑类型选择事件
|
|
|
*/
|
|
@@ -206,7 +269,7 @@ export class ProjectManageArchivesAddEssentialInformationComponent implements On
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- expandKeys=[]
|
|
|
+ expandKeys = [];
|
|
|
|
|
|
/**
|
|
|
* 人员多选触发事件
|
|
@@ -303,36 +366,39 @@ export class ProjectManageArchivesAddEssentialInformationComponent implements On
|
|
|
|
|
|
//基本信息回写到其他页签
|
|
|
@Output() projectManageArchivesaEntiy = new EventEmitter<{}>();
|
|
|
- getProjectManageArchivesa(type?:any) {
|
|
|
+ getProjectManageArchivesa(type?: any) {
|
|
|
//获取人员id传到其他页签
|
|
|
- if(type){
|
|
|
- if(type==='2'){//实施
|
|
|
- this.projectManageArchivesa.impConsultantList=[];
|
|
|
- if(this.projectManageArchivesa.impManagerId){
|
|
|
- this.projectManageArchivesa.impConsultantList.push(this.projectManageArchivesa.impManagerId);//实施经理
|
|
|
+ if (type) {
|
|
|
+ if (type === '2') {
|
|
|
+ //实施
|
|
|
+ this.projectManageArchivesa.impConsultantList = [];
|
|
|
+ if (this.projectManageArchivesa.impManagerId) {
|
|
|
+ this.projectManageArchivesa.impConsultantList.push(this.projectManageArchivesa.impManagerId); //实施经理
|
|
|
}
|
|
|
- if(this.impConsultantIds&&this.impConsultantIds.length>0){
|
|
|
- Array.prototype.push.apply(this.projectManageArchivesa.impConsultantList, this.impConsultantIds);//实施顾问
|
|
|
+ if (this.impConsultantIds && this.impConsultantIds.length > 0) {
|
|
|
+ Array.prototype.push.apply(this.projectManageArchivesa.impConsultantList, this.impConsultantIds); //实施顾问
|
|
|
}
|
|
|
}
|
|
|
- if(type==='3'){//开发
|
|
|
- this.projectManageArchivesa.deEngineerList=[]
|
|
|
- if(this.projectManageArchivesa.deManagerId){
|
|
|
- this.projectManageArchivesa.deEngineerList.push(this.projectManageArchivesa.deManagerId);//开发经理
|
|
|
+ if (type === '3') {
|
|
|
+ //开发
|
|
|
+ this.projectManageArchivesa.deEngineerList = [];
|
|
|
+ if (this.projectManageArchivesa.deManagerId) {
|
|
|
+ this.projectManageArchivesa.deEngineerList.push(this.projectManageArchivesa.deManagerId); //开发经理
|
|
|
}
|
|
|
- if(this.deEngineerIds&&this.deEngineerIds.length>0){
|
|
|
- Array.prototype.push.apply(this.projectManageArchivesa.deEngineerList, this.deEngineerIds);//开发工程师
|
|
|
+ if (this.deEngineerIds && this.deEngineerIds.length > 0) {
|
|
|
+ Array.prototype.push.apply(this.projectManageArchivesa.deEngineerList, this.deEngineerIds); //开发工程师
|
|
|
}
|
|
|
}
|
|
|
- if(type==='4'){//服务
|
|
|
- this.projectManageArchivesa.seEngineerList=[];
|
|
|
- if(this.projectManageArchivesa.seManagerId){
|
|
|
- this.projectManageArchivesa.seEngineerList.push(this.projectManageArchivesa.seManagerId);//服务经理
|
|
|
+ if (type === '4') {
|
|
|
+ //服务
|
|
|
+ this.projectManageArchivesa.seEngineerList = [];
|
|
|
+ if (this.projectManageArchivesa.seManagerId) {
|
|
|
+ this.projectManageArchivesa.seEngineerList.push(this.projectManageArchivesa.seManagerId); //服务经理
|
|
|
}
|
|
|
- if(this.seEngineerIds&&this.seEngineerIds.length>0){
|
|
|
- Array.prototype.push.apply(this.projectManageArchivesa.seEngineerList, this.seEngineerIds);//服务工程师
|
|
|
+ if (this.seEngineerIds && this.seEngineerIds.length > 0) {
|
|
|
+ Array.prototype.push.apply(this.projectManageArchivesa.seEngineerList, this.seEngineerIds); //服务工程师
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
this.projectManageArchivesaEntiy.emit(this.projectManageArchivesa);
|
|
|
}
|