Browse Source

项目档案

chenc 3 years ago
parent
commit
7532fa7d6c
17 changed files with 680 additions and 99 deletions
  1. 10 0
      src/app/entity/contract-management/contract-file.ts
  2. 2 0
      src/app/entity/project-manage-archives/project-manage-archives.ts
  3. 2 2
      src/app/routes/contract-management/contract-file/contract-file.component.html
  4. 21 1
      src/app/routes/contract-management/contract-file/contract-file.component.ts
  5. 188 0
      src/app/routes/contract-management/contract-process-view/process-view/collection-plan/collection-plan.component.html
  6. 224 4
      src/app/routes/contract-management/contract-process-view/process-view/collection-plan/collection-plan.component.ts
  7. 4 4
      src/app/routes/contract-management/contract-process-view/process-view/essential-information/essential-information.component.html
  8. 1 7
      src/app/routes/contract-management/contract-process-view/process-view/process-view.component.html
  9. 64 3
      src/app/routes/contract-management/contract-process-view/process-view/process-view.component.ts
  10. 7 11
      src/app/routes/contract-management/contract-process-view/process-view/product-module/product-module.component.html
  11. 1 1
      src/app/routes/project-manage-archives/add/add.component.html
  12. 17 1
      src/app/routes/project-manage-archives/add/add.component.ts
  13. 24 18
      src/app/routes/project-manage-archives/add/essential-information/essential-information.component.html
  14. 101 35
      src/app/routes/project-manage-archives/add/essential-information/essential-information.component.ts
  15. 5 10
      src/app/routes/project-manage-archives/update/essential-information/essential-information.component.html
  16. 2 2
      src/app/routes/project-manage-archives/update/essential-information/essential-information.component.ts
  17. 7 0
      src/app/services/contract-management/contract-file.service.ts

+ 10 - 0
src/app/entity/contract-management/contract-file.ts

@@ -69,6 +69,8 @@ export class ContractFile extends Page {
 	received?:number;
 
 	 //显示
+	 /**客户编码 */
+	 fdCustomerCode?:string;
 	 /**客户名称 */
 	 fdCustomerName?:string;
 	 /**客户人员名称 */
@@ -77,6 +79,14 @@ export class ContractFile extends Page {
 	 fdCustomerPersonnelTel?:string;
 	 /**客户地址 */
 	 fdCustomeraddress?:string;
+	 /**项目立项编码 */
+	 proCode?:string;
+	 /**项目立项名称*/
+	proName?:string;
+	/**里程碑类型名称*/
+	milestoneName?:string;
+	/**业务类型名称 */
+	businessTypeDictName?:string;
 
 	/**合同产品子表*/
 	contractFileProductList?:ContractFileProduct[];

+ 2 - 0
src/app/entity/project-manage-archives/project-manage-archives.ts

@@ -74,4 +74,6 @@ export class ProjectManageArchives extends Page{
     seInfo?:{}
     //类型
     planType?:string;
+    //合同档案id
+    contractFileId?:string;
 }

+ 2 - 2
src/app/routes/contract-management/contract-file/contract-file.component.html

@@ -77,8 +77,8 @@
             <td>{{ data.transactionAmount }}</td>
             <td>
               <!-- 详情 -->
-              <!-- <a (click)="view(data.id)">{{ 'table.view' | translate }}</a>
-              <nz-divider nzType="vertical"></nz-divider> -->
+              <a (click)="view(data.id)">{{ 'table.view' | translate }}</a>
+              <nz-divider nzType="vertical"></nz-divider>
               <!-- 修改 -->
               <a (click)="update(data.id)">{{ 'table.update' | translate }}</a>
               <nz-divider nzType="vertical"></nz-divider>

+ 21 - 1
src/app/routes/contract-management/contract-file/contract-file.component.ts

@@ -9,6 +9,7 @@ import { ContractFile } from 'app/entity/contract-management/contract-file';
 import { ContractFileService } from 'app/services/contract-management/contract-file.service';
 import { ContractManagementContractFileUpdateComponent } from './update/update.component';
 import { Router } from '@angular/router';
+import { ContractProcessViewProcessViewComponent } from '../contract-process-view/process-view/process-view.component';
 
 @Component({
   selector: 'app-contract-management-contract-file',
@@ -70,7 +71,26 @@ export class ContractManagementContractFileComponent implements OnInit {
   /**
    * 详情
    */
-  view(id) {}
+  view(id) {
+    const drawerRef = this.nzDrawerService.create({
+      nzTitle: this.i18NService.fanyi('table.view'), //详情标题
+      nzContent: ContractProcessViewProcessViewComponent,
+      nzWidth: window.innerWidth,
+      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
+      nzContentParams: {
+        //合同id
+        id: id,
+      },
+    });
+
+    //关闭抽屉的回调
+    drawerRef.afterClose.subscribe(isRefresh => {
+      if (isRefresh) {
+        //刷新list列表
+        this.getList();
+      }
+    });
+  }
 
   /**
    * 修改

+ 188 - 0
src/app/routes/contract-management/contract-process-view/process-view/collection-plan/collection-plan.component.html

@@ -0,0 +1,188 @@
+<!-- 收款计划 -->
+<nz-card nzTitle="{{ 'payment.plan' | translate }}" nzSize="small">
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <nz-table
+        nzBordered
+          style="padding-top: 5px;"
+          nzSize="small"
+          #basicTable
+          [nzData]="collectionPlanList"
+          [nzFrontPagination]="false"
+          [nzShowPagination]="false"
+          [nzScroll]="{ x: '123vw' }"
+        >
+          <!-- <thead>
+            <tr>
+              <th>{{ 'customer.contacts.name' | translate }}</th>
+              <th>{{ 'customer.contacts.telephone' | translate }}</th>
+              <th>{{ 'customer.contacts.mail' | translate }}</th>
+              <th>{{ 'customer.is.it.default' | translate }}</th>
+              <th>{{ 'customer.contacts.client.address' | translate }}</th>
+              <th>{{ 'table.operation' | translate }}</th>
+            </tr>
+          </thead> -->
+          <tbody>
+            <tr *ngFor="let data of basicTable.data">
+              <td style="width: 7%;">
+                {{data.planName}}
+              </td>
+              <!-- 第一笔 -->
+              <td style="width: 4%;">{{ 'the.first' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price1}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone1}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc1}}
+              </td>
+              <!-- 第二笔 -->
+              <td style="width: 4%;">{{ 'the.second' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price2}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone2}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc2}}
+              </td>
+              <!-- 第三笔 -->
+              <td style="width: 4%;">{{ 'the.third' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price3}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone3}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc3}}
+              </td>
+              <!-- 第四笔 -->
+              <td style="width: 4%;">{{ 'the.fourth' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price4}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone4}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc4}}
+              </td>
+              <!-- 第五笔 -->
+              <td style="width: 4%;">{{ 'the.fifth' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price5}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone5}}
+              </td>
+              <td nzRight="0" style="width: 5%;">
+                {{data.desc5}}
+              </td>
+            </tr>
+          </tbody>
+        </nz-table>
+      </div>
+    </div>
+  </nz-card>
+  
+  <!-- 回款情况 -->
+  <nz-card nzTitle="{{ 'receivable.situation' | translate }}" nzSize="small">
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <!-- 新增按钮 -->
+        <!-- <button (click)="paymentCollectionAdd()" nz-button nzType="primary">{{ 'button.add' | translate }}</button> -->
+      </div>
+    </div>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <nz-table
+        nzBordered
+          style="padding-top: 5px;"
+          nzSize="small"
+          #basicTable2
+          [nzData]="paymentCollectionList"
+          [nzFrontPagination]="false"
+          [nzShowPagination]="false"
+          [nzScroll]="{ x: '123vw' }"
+        >
+          <!-- <thead>
+            <tr>
+              <th>{{ 'customer.contacts.name' | translate }}</th>
+              <th>{{ 'customer.contacts.telephone' | translate }}</th>
+              <th>{{ 'customer.contacts.mail' | translate }}</th>
+              <th>{{ 'customer.is.it.default' | translate }}</th>
+              <th>{{ 'customer.contacts.client.address' | translate }}</th>
+              <th>{{ 'table.operation' | translate }}</th>
+            </tr>
+          </thead> -->
+          <tbody>
+            <tr *ngFor="let data of basicTable2.data">
+              <td style="width: 7%;">
+               {{data.planName}}
+              </td>
+              <!-- 1 -->
+              <td style="width: 4%;">{{ 'the.first' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price1}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone1}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc1}}
+              </td>
+              <!-- 2 -->
+              <td style="width: 4%;">{{ 'the.second' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price2}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone2}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc2}}
+              </td>
+              <!-- 3 -->
+              <td style="width: 4%;">{{ 'the.third' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price3}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone3}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc3}}
+              </td>
+              <!-- 4 -->
+              <td style="width: 4%;">{{ 'the.fourth' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price4}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone4}}
+              </td>
+              <td style="width: 5%;">
+                {{data.desc4}}
+              </td>
+              <!-- 5 -->
+              <td style="width: 4%;">{{ 'the.fifth' | translate }}</td>
+              <td style="width: 4%;">
+                {{data.price5}}
+              </td>
+              <td style="width: 5%;">
+                {{data.milestone5}}
+              </td>
+              <td nzRight="0" style="width: 5%;">
+                {{data.desc5}}
+              </td>
+            </tr>
+          </tbody>
+        </nz-table>
+      </div>
+    </div>
+  </nz-card>
+  

+ 224 - 4
src/app/routes/contract-management/contract-process-view/process-view/collection-plan/collection-plan.component.ts

@@ -7,13 +7,233 @@ import { _HttpClient } from '@delon/theme';
   templateUrl: './collection-plan.component.html',
 })
 export class ContractProcessViewProcessViewCollectionPlanComponent implements OnInit {
+  constructor() {}
 
-  constructor(
-  ) { }
+  collectionPlanList = []; //收款计划数据
+  paymentCollectionList = []; //汇款计划数据
+  planList: any = []; //计划下来集合数据
+  milestoneList: any = []; //里程碑集合数据
+  formatterDollar = (value: number) => {
+    if (value) {
+      return `¥ ${value}`;
+    } else {
+      return `¥ `;
+    }
+  };
+  parserDollar = (value: string) => value.replace('¥ ', '');
 
-  ngOnInit(): void {
+  /**
+   * 
+   收款计划新增
+   */
+  collectionPlanSort = 0; //收款计划排序
+  collectionPlanAdd() {
+    this.collectionPlanList = [
+      ...this.collectionPlanList,
+      {
+        price1: 0,
+        price2: 0,
+        price3: 0,
+        price4: 0,
+        price5: 0,
+        sort: this.collectionPlanSort,
+        planType: '1',
+      },
+    ];
+    this.collectionPlanSort++;
+    //回款计划新增
+    this.paymentCollectionAdd();
   }
 
-  close() {
+  /**
+   * 回款计划新增
+   */
+  paymentCollectionSort = 0; //回款情况排序
+  paymentCollectionAdd() {
+    this.paymentCollectionList = [
+      ...this.paymentCollectionList,
+      {
+        price1: 0,
+        price2: 0,
+        price3: 0,
+        price4: 0,
+        price5: 0,
+        sort: this.paymentCollectionSort,
+        planType: '2',
+      },
+    ];
+    this.paymentCollectionSort++;
   }
+
+  /**
+   * 类型触发事件
+   */
+  planIdChange(data, type) {
+    //获取类型名称
+    this.getPlanName(data);
+    //同步其他三个表格数据
+    this.getData();
+  }
+
+  /**
+   * 获取类型名称
+   * @param data 计划对象
+   */
+  getPlanName(data) {
+    this.planList.forEach(element => {
+      if (element.id === data.planId) {
+        data.planName = element.name;
+      }
+    });
+  }
+
+  //根据计划收款信息表格数据复制到其他三个表格数据
+  getData() {
+    if (this.collectionPlanList) {
+      this.getAddData(this.collectionPlanList);
+    }
+  }
+
+  /**
+   * 根据计划收款信息表格数据复制到其他三个表格数据
+   *
+   */
+  getAddData(dataList) {
+    this.paymentCollectionList = [];
+    this.paymentCollectionList = [];
+    //循环收款情况
+    dataList.forEach(element => {
+      //回款表格数据
+      let data = {
+        planId: element.planId, //计划条线id
+        planName: element.planName, //计划条线名称
+        price1: element.price1, //金额
+        mileId1: element.mileId1, //里程碑id
+        milestone1: element.milestone1, //里程碑名称
+        price2: element.price2, //金额
+        mileId2: element.mileId2, //里程碑id
+        milestone2: element.milestone2, //里程碑名称
+        price3: element.price3, //金额
+        mileId3: element.mileId3, //里程碑id
+        milestone3: element.milestone3, //里程碑名称
+        price4: element.price4, //金额
+        mileId4: element.mileId4, //里程碑id
+        milestone4: element.milestone4, //里程碑名称
+        price5: element.price5, //金额
+        mileId5: element.mileId5, //里程碑id
+        milestone5: element.milestone5, //里程碑名称
+        sort: element.sort,
+        planType: '2',
+      };
+      //回款情况
+      let data2 = JSON.parse(JSON.stringify(data));
+      data2.planType = '2';
+      this.paymentCollectionList.push(data2);
+    });
+  }
+
+  /**
+   * 金额鼠标离开事件
+   */
+  priceBlur() {
+    this.getData();
+  }
+
+  /**
+   * 获取里程碑名称
+   */
+  getMileName(element) {
+    //判断是否选择里程碑
+    if (element.mileId1) {
+      //循环商务页签中计划表中里程碑下拉数据获取名称
+      this.milestoneList.forEach(mile => {
+        if (mile.id === element.mileId1) {
+          element.milestone1 = mile.name;
+        }
+      });
+    } else {
+      element.milestone1 = '';
+    }
+    //判断是否选择里程碑
+    if (element.mileId2) {
+      //循环商务页签中计划表中里程碑下拉数据获取名称
+      this.milestoneList.forEach(mile => {
+        if (mile.id === element.mileId2) {
+          element.milestone2 = mile.name;
+        }
+      });
+    } else {
+      element.milestone2 = '';
+    }
+    //判断是否选择里程碑
+    if (element.mileId3) {
+      //循环商务页签中计划表中里程碑下拉数据获取名称
+      this.milestoneList.forEach(mile => {
+        if (mile.id === element.mileId3) {
+          element.milestone3 = mile.name;
+        }
+      });
+    } else {
+      element.milestone3 = '';
+    }
+    //判断是否选择里程碑
+    if (element.mileId4) {
+      //循环商务页签中计划表中里程碑下拉数据获取名称
+      this.milestoneList.forEach(mile => {
+        if (mile.id === element.mileId4) {
+          element.milestone4 = mile.name;
+        }
+      });
+    } else {
+      element.milestone4 = '';
+    }
+    //判断是否选择里程碑
+    if (element.mileId5) {
+      //循环商务页签中计划表中里程碑下拉数据获取名称
+      this.milestoneList.forEach(mile => {
+        if (mile.id === element.mileId5) {
+          element.milestone5 = mile.name;
+        }
+      });
+    } else {
+      element.milestone5 = '';
+    }
+  }
+
+  /**
+   * 里程碑选择事件
+   */
+  mileIdChange(data) {
+    //获取里程碑名称
+    this.getMileName(data);
+    //同步其他表格数据
+    this.getData();
+  }
+
+  /**
+   * 描述输入改变事件
+   */
+  descChange() {
+    this.getData();
+  }
+
+  /**
+   * 收款删除按钮
+   */
+  collectionPlanDelete(sort) {
+    this.collectionPlanList = this.collectionPlanList.filter(d => d.sort !== sort);
+    //回款删除
+    this.paymentCollectionDelete(sort);
+  }
+
+  /**
+   * 回款删除
+   */
+  paymentCollectionDelete(sort){
+    this.paymentCollectionList = this.paymentCollectionList.filter(d => d.sort !== sort);
+  }
+
+  ngOnInit(): void {}
+
+  close() {}
 }

+ 4 - 4
src/app/routes/contract-management/contract-process-view/process-view/essential-information/essential-information.component.html

@@ -18,7 +18,7 @@
         <nz-form-item>
           <nz-form-label [nzSpan]="'vertical' ? 24 : null" >{{ 'cost.item.name' | translate }}</nz-form-label>
           <nz-form-control [nzSm]="24" [nzXs]="24">
-            {{contractFile.proId}}
+            {{contractFile.proName}}
           </nz-form-control>
         </nz-form-item>
       </div>
@@ -40,7 +40,7 @@
             {{ 'financial.management.milestoneName' | translate }}
           </nz-form-label>
           <nz-form-control [nzSm]="24" [nzXs]="24">
-            {{contractFile.milestoneId}}
+            {{contractFile.milestoneName}}
           </nz-form-control>
         </nz-form-item>
       </div>
@@ -128,7 +128,7 @@
         <nz-form-item>
           <nz-form-label [nzSpan]="'vertical' ? 24 : null" >{{ 'sales.staff' | translate }}</nz-form-label>
           <nz-form-control>
-            {{contractFile.salesmanId}}
+            {{contractFile.salesmanName}}
           </nz-form-control>
         </nz-form-item>
       </div>
@@ -137,7 +137,7 @@
         <nz-form-item>
           <nz-form-label [nzSpan]="'vertical' ? 24 : null">{{ 'business.types' | translate }}</nz-form-label>
           <nz-form-control [nzSm]="24" [nzXs]="24">
-            {{contractFile.businessTypeDictId}}
+            {{contractFile.businessTypeDictName}}
           </nz-form-control>
         </nz-form-item>
       </div>

+ 1 - 7
src/app/routes/contract-management/contract-process-view/process-view/process-view.component.html

@@ -18,11 +18,5 @@
 <!-- 按钮 -->
 <div class="base">
   <!-- 关闭按钮 -->
-  <a nz-popconfirm nzTitle="{{'pm.contract.contract.add.button.cancel'|translate}}" (nzOnConfirm)="close()"
-    style="padding-right: 8px">
-    <button nz-button>{{'pm.quotation.cancel'|translate}}</button>
-  </a>
-  <!-- 保存按钮 -->
-  <button nz-button nzType="primary" class="ant-btn ant-btn-primary" (click)="save()"
-    [nzLoading]="isLoadingSave"><span>{{'pm.finish' | translate}}</span></button>
+    <button nz-button (click)="close()">{{'pm.quotation.cancel'|translate}}</button>
 </div>

+ 64 - 3
src/app/routes/contract-management/contract-process-view/process-view/process-view.component.ts

@@ -7,6 +7,10 @@ import { StartupService } from '@core';
 import { Router, ActivatedRoute } from '@angular/router';
 import { UserService } from 'app/services/user.service';
 import { ContractFileService } from 'app/services/contract-management/contract-file.service';
+import { ContractProcessViewProcessViewEssentialInformationComponent } from './essential-information/essential-information.component';
+import { ContractProcessViewProcessViewProductModuleComponent } from './product-module/product-module.component';
+import { ContractProcessViewProcessViewCollectionPlanComponent } from './collection-plan/collection-plan.component';
+import { NzDrawerRef } from 'ng-zorro-antd';
 
 @Component({
   selector: 'app-contract-process-view-process-view',
@@ -28,8 +32,6 @@ import { ContractFileService } from 'app/services/contract-management/contract-f
   ],
 })
 export class ContractProcessViewProcessViewComponent implements OnInit {
-
-
   constructor(
     private http: _HttpClient,
     private modal: ModalHelper,
@@ -39,14 +41,34 @@ export class ContractProcessViewProcessViewComponent implements OnInit {
     private startupSrv: StartupService,
     private router: Router,
     private activateInfo: ActivatedRoute,
+    private contractFileService:ContractFileService,
+    private drawerRef:NzDrawerRef
   ) {}
 
+  //基本信息组件
+  @ViewChild('essentialInformation')
+  essentialInformation: ContractProcessViewProcessViewEssentialInformationComponent;
+  //产品与模块组件
+  @ViewChild('productModule')
+  productModule: ContractProcessViewProcessViewProductModuleComponent;
+  //收款计划
+  @ViewChild('collectionPlan')
+  collectionPlan: ContractProcessViewProcessViewCollectionPlanComponent;
+
   // md5 = require('js-md5');
   // error = '';
   // username = '';
   id = '';
-  isLoadingSave=false;
+  isLoadingSave = false;
   ngOnInit() {
+    if (this.id) {
+      this.getById();
+    } else {
+      this.activateInfo.queryParams.subscribe(queryParams => {
+        this.id = queryParams.id;
+      });
+    }
+
     //获取OA流跳转地址获取参数
     // this.activateInfo.queryParams.subscribe(queryParams => {
     //   this.username = queryParams.username;
@@ -77,6 +99,41 @@ export class ContractProcessViewProcessViewComponent implements OnInit {
     // });
   }
 
+  /**
+   * 根据id查询
+   */
+  getById() {
+    return new Promise(resolve => {
+      this.contractFileService.getContractFileById(this.id).then(response => {
+        if (response.success) {
+          let contractFile = JSON.parse(JSON.stringify(response.result));
+          //合同基本信息
+          this.essentialInformation.contractFile = contractFile;
+          //产品数据
+          if (contractFile.contractFileProductList) {
+            this.productModule.productList = contractFile.contractFileProductList;
+          }
+          //收款计划数据
+          if (contractFile.contractFileAndBusinessList) {
+            let collectionPlanList = []; //收款计划
+            let paymentCollectionList = []; //回款计划
+            contractFile.contractFileAndBusinessList.forEach(element => {
+              if (element.planType == '1') {
+                collectionPlanList.push(element);
+              }
+              if (element.planType == '2') {
+                paymentCollectionList.push(element);
+              }
+            });
+            this.collectionPlan.collectionPlanList=collectionPlanList
+            this.collectionPlan.paymentCollectionList=paymentCollectionList
+          }
+          resolve();
+        }
+      });
+    });
+  }
+
   /**
    * 自动登录
    */
@@ -115,4 +172,8 @@ export class ContractProcessViewProcessViewComponent implements OnInit {
     //   .createStatic(FormEditComponent, { i: { id: 0 } })
     //   .subscribe(() => this.st.reload());
   }
+
+  close() {
+    this.drawerRef.close();
+  }
 }

+ 7 - 11
src/app/routes/contract-management/contract-process-view/process-view/product-module/product-module.component.html

@@ -3,7 +3,8 @@
   <!-- 表格 -->
   <div nz-row [nzGutter]="24">
     <div nz-col [nzSpan]="24">
-      <nz-table #productRowTable nzSize="small" class="tableTdPadding" nzBordered [nzData]="productList">
+      <nz-table #productRowTable nzSize="small" [nzFrontPagination]="false" [nzShowPagination]="false" nzBordered
+        [nzData]="productList">
         <thead>
           <tr>
             <!-- 产品编码 -->
@@ -65,7 +66,7 @@
               {{data.standardAmount}}
             </td>
             <td>
-             {{data.amountAfterDiscount}}
+              {{data.amountAfterDiscount}}
             </td>
             <td>
               {{data.costUnitPrice}}
@@ -87,13 +88,8 @@
       <!-- 表格 -->
       <div nz-row [nzGutter]="24">
         <div nz-col [nzSpan]="24">
-          <nz-table
-            #moduleRowTable
-            nzSize="small"
-            class="tableTdPadding"
-            nzBordered
-            [nzData]="product.contractFileModularList"
-          >
+          <nz-table #moduleRowTable nzSize="small" [nzFrontPagination]="false" [nzShowPagination]="false" nzBordered
+            [nzData]="product.contractFileModularList">
             <thead>
               <tr>
                 <!-- 产品模块编码 -->
@@ -122,7 +118,7 @@
                   {{data.standardQuotation}}
                 </td>
                 <td>
-                 {{data.purchasePrice}}
+                  {{data.purchasePrice}}
                 </td>
               </tr>
             </tbody>
@@ -131,4 +127,4 @@
       </div>
     </nz-tab>
   </nz-tabset>
-</nz-card>
+</nz-card>

+ 1 - 1
src/app/routes/project-manage-archives/add/add.component.html

@@ -3,7 +3,7 @@
     <!-- 基本信息 -->
     <nz-tab nzTitle="{{'essential.information'|translate}}">
       <app-project-manage-archives-add-essential-information #essentialInformation (projectManageArchivesaEntiy)="projectManageArchivesaEntiy($event)"
-      (milestone)="milestone($event)">
+      (milestone)="milestone($event)" (businessAffairsPamars)="businessAffairsPamars($event)">
 
       </app-project-manage-archives-add-essential-information>
     </nz-tab>

+ 17 - 1
src/app/routes/project-manage-archives/add/add.component.ts

@@ -239,7 +239,23 @@ export class ProjectManageArchivesAddComponent implements OnInit {
     });
   }
 
-  
+  //基本信息相关数据传入到商务页签
+  businessAffairsPamars(event){
+    console.log(event)
+    if(event){
+      
+      //收款计划
+      if(event.collectionPlanList){
+        this.businessAffairs.collectionPlanList=event.collectionPlanList;
+        this.businessAffairs.collectionPlanSort=event.collectionPlanSort;
+      }
+      //回款计划
+      if(event.paymentCollectionList){
+        this.businessAffairs.paymentCollectionList=event.paymentCollectionList;
+        this.businessAffairs.paymentCollectionSort=event.paymentCollectionSort;
+      }
+    }
+  }
 
   /**
    * 保存接口

+ 24 - 18
src/app/routes/project-manage-archives/add/essential-information/essential-information.component.html

@@ -5,21 +5,26 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" nzRequired>项目编码</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          <nz-tree-select style="width: 100%" [nzNodes]="proList" nzShowSearch [nzMultiple]="false"
+          <!-- <nz-tree-select style="width: 100%" [nzNodes]="proList" nzShowSearch [nzMultiple]="false"
             formControlName="proId" id="proId" nzPlaceHolder="请选择" [(ngModel)]="projectManageArchivesa.proId"
             [nzMaxTagCount]="3" [nzAllowClear]="true" (ngModelChange)="proChange($event)">
-          </nz-tree-select>
-          <nz-form-explain *ngIf="validateForm.get('proId')?.dirty && validateForm.get('proId')?.errors">
-            请选择项目
-          </nz-form-explain>
+          </nz-tree-select> -->
+          自动生成
         </nz-form-control>
       </nz-form-item>
     </div>
     <div nz-col [nzSpan]="6">
       <nz-form-item>
-        <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24">项目名称</nz-form-label>
+        <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24" nzRequired>项目名称</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          {{projectManageArchivesa.proName}}
+          <!-- {{projectManageArchivesa.proName}} -->
+          <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="contractFileId" id="contractFileId"
+            [(ngModel)]="projectManageArchivesa.contractFileId" nzPlaceHolder="请选择" (ngModelChange)="contractFileIdChange($event)">
+            <nz-option *ngFor="let i of proList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+          </nz-select>
+          <nz-form-explain *ngIf="validateForm.get('contractFileId')?.dirty && validateForm.get('contractFileId')?.errors">
+            请选择项目
+          </nz-form-explain>
         </nz-form-control>
       </nz-form-item>
     </div>
@@ -27,13 +32,7 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24">客户编码</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="cusId" id="cusId"
-            [(ngModel)]="projectManageArchivesa.cusId" nzPlaceHolder="请选择" (ngModelChange)="cusChange($event)">
-            <nz-option *ngFor="let i of cusList" [nzValue]="i.id" [nzLabel]="i.name"></nz-option>
-          </nz-select>
-          <nz-form-explain *ngIf="validateForm.get('cusId')?.dirty && validateForm.get('cusId')?.errors">
-            请选择客户
-          </nz-form-explain>
+          {{projectManageArchivesa.cusCode}}
         </nz-form-control>
       </nz-form-item>
     </div>
@@ -41,7 +40,13 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24">客户名称</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          {{projectManageArchivesa.cusName}}
+          <nz-select nzDisabled style="widows: 100%;" nzShowSearch nzAllowClear formControlName="cusId" id="cusId"
+            [(ngModel)]="projectManageArchivesa.cusId" nzPlaceHolder="请选择" (ngModelChange)="cusChange($event)">
+            <nz-option *ngFor="let i of cusList" [nzValue]="i.id" [nzLabel]="i.name"></nz-option>
+          </nz-select>
+          <nz-form-explain *ngIf="validateForm.get('cusId')?.dirty && validateForm.get('cusId')?.errors">
+            请选择客户
+          </nz-form-explain>
         </nz-form-control>
       </nz-form-item>
     </div>
@@ -51,7 +56,7 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24" nzRequired>项目总金额</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          <nz-input-number [(ngModel)]="projectManageArchivesa.totalPrice" formControlName="totalPrice" id="totalPrice"
+          <nz-input-number [nzDisabled]="true" [(ngModel)]="projectManageArchivesa.totalPrice" formControlName="totalPrice" id="totalPrice"
             [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"
             (keyup)="getProjectManageArchivesa()" [nzMax]=10000000000></nz-input-number>
           <nz-form-explain *ngIf="validateForm.get('totalPrice')?.dirty && validateForm.get('totalPrice')?.errors">
@@ -65,7 +70,7 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24" nzRequired>里程碑类型</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="milestoneId" id="milestoneId"
+          <nz-select nzDisabled style="widows: 100%;" nzShowSearch nzAllowClear formControlName="milestoneId" id="milestoneId"
             [(ngModel)]="projectManageArchivesa.milestoneId" nzPlaceHolder="请选择"
             (ngModelChange)="milestoneChange($event)">
             <nz-option *ngFor="let i of milestoneList" [nzValue]="i.value" [nzLabel]="i.text"></nz-option>
@@ -179,7 +184,8 @@
         <nz-form-control [nzSm]="24" [nzXs]="24">
           <nz-tree-select style="width: 100%" [nzNodes]="personnelList" nzShowSearch [nzMultiple]="true"
             formControlName="seEngineerIds" id="seEngineerIds" nzPlaceHolder="请选择" [(ngModel)]="seEngineerIds"
-            [nzMaxTagCount]="3" [nzAllowClear]="true" (ngModelChange)="personnelChange($event,'4')" [nzDefaultExpandedKeys]="expandKeys">
+            [nzMaxTagCount]="3" [nzAllowClear]="true" (ngModelChange)="personnelChange($event,'4')"
+            [nzDefaultExpandedKeys]="expandKeys">
           </nz-tree-select>
         </nz-form-control>
       </nz-form-item>

+ 101 - 35
src/app/routes/project-manage-archives/add/essential-information/essential-information.component.ts

@@ -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);
   }

+ 5 - 10
src/app/routes/project-manage-archives/update/essential-information/essential-information.component.html

@@ -9,13 +9,7 @@
             [(ngModel)]="projectManageArchivesa.proId" nzPlaceHolder="请选择">
             <nz-option *ngFor="let i of proList" [nzValue]="i.id" [nzLabel]="i.code"></nz-option>
           </nz-select> -->
-          <nz-tree-select style="width: 100%" [nzNodes]="proList" nzShowSearch [nzMultiple]="false"
-            formControlName="proId" id="proId" nzPlaceHolder="请选择" [(ngModel)]="projectManageArchivesa.proId"
-            [nzMaxTagCount]="3" [nzAllowClear]="true" (ngModelChange)="proChange($event)">
-          </nz-tree-select>
-          <nz-form-explain *ngIf="validateForm.get('proId')?.dirty && validateForm.get('proId')?.errors">
-            请选择项目
-          </nz-form-explain>
+          {{projectManageArchivesa.proCode}}
         </nz-form-control>
       </nz-form-item>
     </div>
@@ -31,13 +25,14 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24">客户编码</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="cusId" id="cusId"
+          <!-- <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="cusId" id="cusId"
             [(ngModel)]="projectManageArchivesa.cusId" nzPlaceHolder="请选择" (ngModelChange)="cusChange($event)">
             <nz-option *ngFor="let i of cusList" [nzValue]="i.id" [nzLabel]="i.name"></nz-option>
           </nz-select>
           <nz-form-explain *ngIf="validateForm.get('cusId')?.dirty && validateForm.get('cusId')?.errors">
             请选择客户
-          </nz-form-explain>
+          </nz-form-explain> -->
+          {{projectManageArchivesa.cusCode}}
         </nz-form-control>
       </nz-form-item>
     </div>
@@ -55,7 +50,7 @@
       <nz-form-item>
         <nz-form-label [nzSpan]="'vertical' ? 24 : null" [nzXs]="24" nzRequired>项目总金额</nz-form-label>
         <nz-form-control [nzSm]="24" [nzXs]="24">
-          <nz-input-number [(ngModel)]="projectManageArchivesa.totalPrice" formControlName="totalPrice" id="totalPrice"
+          <nz-input-number [nzDisabled]="true" [(ngModel)]="projectManageArchivesa.totalPrice" formControlName="totalPrice" id="totalPrice"
             [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"
             (keyup)="getProjectManageArchivesa()" [nzMax]=10000000000></nz-input-number>
           <nz-form-explain *ngIf="validateForm.get('totalPrice')?.dirty && validateForm.get('totalPrice')?.errors">

+ 2 - 2
src/app/routes/project-manage-archives/update/essential-information/essential-information.component.ts

@@ -24,8 +24,8 @@ export class ProjectManageArchivesUpdateEssentialInformationComponent implements
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
-      proId: [null, [Validators.required]],
-      cusId: [null, [Validators.required]],
+      // proId: [null, [Validators.required]],
+      // cusId: [null, [Validators.required]],
       totalPrice: [null, [Validators.required]],
       saleManagerId: [null],
       saleManIds: [null],

+ 7 - 0
src/app/services/contract-management/contract-file.service.ts

@@ -80,4 +80,11 @@ export class ContractFileService {
       .toPromise();
   }
 
+  //详情接口
+  async getContractFileById(id: string): Promise<BaseResponse<any>> {
+    return await this.http
+      .get<BaseResponse<any>>('contract.file/contractFile/getContractFileById', { params: { id: id } })
+      .toPromise();
+  }
+
 }