Browse Source

合同档案

chenc 3 years ago
parent
commit
77b0db5367

+ 2 - 0
src/app/entity/basedata/base-material-file-product.ts

@@ -18,6 +18,8 @@ export class BaseMaterialFileProduct extends Page{
 	status?:string;
 	/**产品属性(1采购2销售)*/
 	attribute?:string;
+	/**分类id */
+	baseMaterialFileClassificationId?:string;
 	/**模块子表数据*/
 	baseMaterialFileModularList?:BaseMaterialFileModular[];
 }

+ 2 - 1
src/app/routes/basedata/customer/edit/edit.component.ts

@@ -16,6 +16,7 @@ import { BaseSalesStatusService } from 'app/services/basedata/base-sales-status.
 import { PersonnelService } from 'app/services/basedata/personnel.service'; //销售人员
 import { BasedataCustomerModalTableComponent } from '../modal-table/modal-table.component';
 import { recursiveQuery } from '@shared/utils/yuan copy'; //筛选可选择
+import { RoutesSharedModalCustomerSelectComponent } from 'app/routes/shared/modal/customer-select/customer-select.component';
 
 @Component({
   selector: 'app-basedata-customer-edit',
@@ -213,7 +214,7 @@ export class BasedataCustomerEditComponent implements OnInit {
   modalTable() {
     const modalRef = this.modalService.create({
       nzTitle: '选择上级单位',
-      nzContent: BasedataCustomerModalTableComponent,
+      nzContent: RoutesSharedModalCustomerSelectComponent,
       nzWidth: 1400,
       nzFooter: [
         {

+ 9 - 0
src/app/routes/contract-management/contract-file/add/collection-plan/collection-plan.component.ts

@@ -222,6 +222,15 @@ export class ContractManagementContractFileAddCollectionPlanComponent implements
    */
   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 {}

+ 6 - 4
src/app/routes/contract-management/contract-file/add/essential-information/essential-information.component.ts

@@ -9,6 +9,7 @@ import { DictService } from 'app/services/dict.service';
 import { BasedataCustomerModalTableComponent } from 'app/routes/basedata/customer/modal-table/modal-table.component';
 import { CustomerService } from 'app/services/basedata/customer.service';
 import { DatePipe } from '@angular/common';
+import { RoutesSharedModalCustomerSelectComponent } from 'app/routes/shared/modal/customer-select/customer-select.component';
 
 @Component({
   selector: 'app-contract-management-contract-file-add-essential-information',
@@ -87,10 +88,9 @@ export class ContractManagementContractFileAddEssentialInformationComponent impl
    * 客户选择
    */
   modalTable() {
-    this.getLdCustomerPersonnelList('');
     const modalRef = this.modalService.create({
       nzTitle: '选择客户',
-      nzContent: BasedataCustomerModalTableComponent,
+      nzContent: RoutesSharedModalCustomerSelectComponent,
       nzWidth: 1400,
       nzFooter: [
         {
@@ -108,6 +108,8 @@ export class ContractManagementContractFileAddEssentialInformationComponent impl
             // addModel.selectObj 包含勾选项的 id 和 name
             this.contractFile.fdCustomerName = addModel.selectObj[0].name;
             this.contractFile.fdCustomerId = addModel.selectObj[0].id;
+            //查询客户的联系人
+            this.getLdCustomerPersonnelList();
           },
         },
       ],
@@ -118,9 +120,9 @@ export class ContractManagementContractFileAddEssentialInformationComponent impl
    * 根据客户获取客户人员数据
    */
   fdCustomerPersonnelList: any = [];
-  getLdCustomerPersonnelList(customerId) {
+  getLdCustomerPersonnelList() {
     return new Promise(resolve => {
-      this.customerService.getContactsByMainId('4d0df0dc441aff4655d8aa4380b194dc').then(response => {
+      this.customerService.getContactsByMainId(this.contractFile.fdCustomerId).then(response => {
         this.fdCustomerPersonnelList = response.result;
         resolve();
       });

+ 14 - 3
src/app/routes/contract-management/contract-file/add/product-module/product-module.component.html

@@ -29,13 +29,24 @@
         <tbody>
           <tr *ngFor="let data of productRowTable.data" class="editable-row">
             <td><input type="text" nz-input [(ngModel)]="data.code" /></td>
-            <td><input type="text" nz-input [(ngModel)]="data.name" /></td>
+            <td>
+              <nz-input-group nzSearch [nzAddOnAfter]="suffixIconButton">
+                <input type="text" [(ngModel)]="data.name" nz-input
+                  placeholder="{{ 'select.please.choose' | translate }}" disabled="true" />
+              </nz-input-group>
+              <ng-template #suffixIconButton>
+                <!-- 放大镜  勾选列表 -->
+                <button nz-button nzType="primary" nzSearch (click)="selectProdutModal(data)">
+                  <i nz-icon type="search"></i>
+                </button>
+              </ng-template>
+            </td>
             <td>
               <nz-input-number [nzMin]="0" [(ngModel)]="data.discountRate"></nz-input-number>
             </td>
             <td>
-              <nz-input-number [nzMin]="0" [nzDisabled]="true" [(ngModel)]="data.standardQuotation" [nzFormatter]="formatterDollar"
-                [nzParser]="parserDollar"></nz-input-number>
+              <nz-input-number [nzMin]="0" [nzDisabled]="true" [(ngModel)]="data.standardQuotation"
+                [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number>
             </td>
             <td>
               <nz-input-number [nzMin]="0" [(ngModel)]="data.unitPriceAfterDiscount" [nzFormatter]="formatterDollar"

+ 52 - 17
src/app/routes/contract-management/contract-file/add/product-module/product-module.component.ts

@@ -1,16 +1,19 @@
 import { Component, OnInit, Output, EventEmitter } from '@angular/core';
-import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
+import { NzModalRef, NzMessageService, NzModalService } from 'ng-zorro-antd';
 import { _HttpClient } from '@delon/theme';
 import { ContractFileProduct } from 'app/entity/contract-management/contract-file-product';
 import { ContractFileModular } from 'app/entity/contract-management/contract-file-modular';
 import { ContractFile } from 'app/entity/contract-management/contract-file';
+import { RoutesSharedModalProdutSelectComponent } from 'app/routes/shared/modal/produt-select/produt-select.component';
 
 @Component({
   selector: 'app-contract-management-contract-file-add-product-module',
   templateUrl: './product-module.component.html',
 })
 export class ContractManagementContractFileAddProductModuleComponent implements OnInit {
-  constructor() {}
+  constructor(
+    private modalService:NzModalService
+  ) {}
   ngOnInit(): void {}
 
   productList: ContractFileProduct[] = []; //产品数据
@@ -78,20 +81,20 @@ export class ContractManagementContractFileAddProductModuleComponent implements
    * 模块标准报价键盘弹起事件
    * @param product 产品对象
    */
-  standardQuotationModuleKeyUp(product){
+  standardQuotationModuleKeyUp(product) {
     //判断当前产品下是否存在模块
-    if(product&&product.contractFileModularList){
-      let standardQuotationTotal=0.0;//定义模块中标准报价总计
+    if (product && product.contractFileModularList) {
+      let standardQuotationTotal = 0.0; //定义模块中标准报价总计
       //循环模块
       product.contractFileModularList.forEach(element => {
         //判断标准报价是否为数字
-        if(!isNaN(Number(element.standardQuotation))){
+        if (!isNaN(Number(element.standardQuotation))) {
           //累加
-          standardQuotationTotal=standardQuotationTotal+Number(element.standardQuotation);
+          standardQuotationTotal = standardQuotationTotal + Number(element.standardQuotation);
         }
       });
       //把模块标准报价总和赋值给产品的标准报价
-      product.standardQuotation=standardQuotationTotal;
+      product.standardQuotation = standardQuotationTotal;
       //获取品总标准报价并传入基本信息
       this.getContractFileStandardQuotationTotal();
     }
@@ -100,31 +103,63 @@ export class ContractManagementContractFileAddProductModuleComponent implements
   /**
    * 获取合同总共的标准报价
    */
-  
-  getContractFileStandardQuotationTotal(){
-    if(this.productList){
-      let standardQuotationProductTotal=0.0;//定义产品中标准报价总计
+
+  getContractFileStandardQuotationTotal() {
+    if (this.productList) {
+      let standardQuotationProductTotal = 0.0; //定义产品中标准报价总计
       this.productList.forEach(element => {
         //判断标准报价是否为数字
-        if(!isNaN(Number(element.standardQuotation))){
+        if (!isNaN(Number(element.standardQuotation))) {
           //累加
-          standardQuotationProductTotal=standardQuotationProductTotal+Number(element.standardQuotation);
+          standardQuotationProductTotal = standardQuotationProductTotal + Number(element.standardQuotation);
         }
       });
       //把产品的总标准报价给合同标准报价
-      this.contractFile.standardQuotation=standardQuotationProductTotal;
+      this.contractFile.standardQuotation = standardQuotationProductTotal;
       //传给基本信息
       this.outContractFileObject();
     }
   }
 
-  contractFile:ContractFile={}//合同的对象
+  contractFile: ContractFile = {}; //合同的对象
   /**
    * 获取当前页面的相关信息传个父级页面
    */
   @Output() contractFileObject = new EventEmitter<{}>();
-  outContractFileObject(){
+  outContractFileObject() {
     this.contractFileObject.emit(this.contractFile);
   }
+
+  /**
+   * 选择产品事件
+   */
+  selectProdutModal(data) {
+    const modalRef = this.modalService.create({
+      nzTitle: '选择产品',
+      nzContent: RoutesSharedModalProdutSelectComponent,
+      nzWidth: 1400,
+      nzFooter: [
+        {
+          label: '关闭',
+          type: 'default',
+          onClick: addModel => {
+            addModel.close();
+          },
+        },
+        {
+          label: '确定',
+          type: 'primary',
+          onClick: addModel => {
+            addModel.save().then(()=>{
+              data.code=addModel.selectObj[0].code
+              data.name=addModel.selectObj[0].name
+              data.baseMaterialFileProductId=addModel.selectObj[0].id
+            });
+          },
+        },
+      ],
+    });
+  }
+
   close() {}
 }

+ 9 - 4
src/app/routes/routes.module.ts

@@ -14,8 +14,10 @@ import { UserRegisterResultComponent } from './passport/register-result/register
 // single pages
 import { UserLockComponent } from './passport/lock/lock.component';
 import { CallbackComponent } from './callback/callback.component';
-import { BasedataModule } from './basedata/basedata.module';
-import { RoutesUploadDownloadComponent } from './upload-download/upload-download.component';
+import { BasedataModule } from './basedata/basedata.module';
+import { RoutesUploadDownloadComponent } from './upload-download/upload-download.component';
+import { RoutesSharedModalCustomerSelectComponent } from './shared/modal/customer-select/customer-select.component';
+import { RoutesSharedModalProdutSelectComponent } from './shared/modal/produt-select/produt-select.component';
 // import { PmModule } from './pm/pm.module';
 // import { RoutesCommonUploadUrlAddComponent } from './common/upload-url-add/upload-url-add.component';
 // import { RoutesMessageNotificationComponent } from './message-notification/message-notification.component';
@@ -41,8 +43,11 @@ const COMPONENTS_NOROUNT = [
   // RoutesCommonUploadUrlAddComponent,
   // RoutesMessageNotificationComponent,
   // RoutesCommonSelectContractCodeComponent
-
-  RoutesUploadDownloadComponent];
+
+  RoutesUploadDownloadComponent
+  ,
+  RoutesSharedModalCustomerSelectComponent,
+  RoutesSharedModalProdutSelectComponent];
 
 @NgModule({
   imports: [SharedModule, RouteRoutingModule],

+ 63 - 0
src/app/routes/shared/modal/customer-select/customer-select.component.html

@@ -0,0 +1,63 @@
+<!-- nzAlign="center" whereCustomer-->
+
+<form nz-form>
+  <!-- 查询条件 -->
+  <div nz-row nzGutter="24">
+    <div nz-col nzMd="24" nzLg="3">
+      <nz-form-label>{{ 'customer.abbreviation' | translate }}</nz-form-label>
+    </div>
+    <div nz-col nzMd="24" nzLg="6">
+      <input nz-input [(ngModel)]="customer.abbreviation" name="abbreviation" />
+    </div>
+    <div nz-col nzMd="24" nzLg="3">
+      <nz-form-label>{{ 'customer.name' | translate }}</nz-form-label>
+    </div>
+    <div nz-col nzMd="24" nzLg="6">
+      <input nz-input [(ngModel)]="customer.name" name="name" />
+    </div>
+    <div nz-col nzMd="24" nzLg="6">
+      <button (click)="query()" nz-button nzType="primary">{{ 'button.query' | translate }}</button>
+      <!-- <button nz-button nzType="primary">{{ 'button.reset' | translate }}</button> -->
+    </div>
+  </div>
+</form>
+
+<nz-table
+  #rowSelectTable
+  [nzData]="selectData"
+  [nzTotal]="page.total"
+  [nzPageIndex]="page.current"
+  [nzFrontPagination]="false"
+  (nzPageIndexChange)="pageIndexChange($event)"
+  [nzLoading]="isSpinning"
+  nzBordered
+  nzAlign
+  (nzCurrentPageDataChange)="currentPageDataChange($event)"
+  
+>
+  <thead>
+    <tr>
+      <th
+        
+      ></th>
+      <th>{{ 'customer.code' | translate }}</th>
+      <th>{{ 'customer.name' | translate }}</th>
+      <th>{{ 'customer.shortName' | translate }}</th>
+      <th>{{ 'customer.abbreviation' | translate }}</th>
+      <th>{{ 'customer.contacts.name' | translate }}</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr *ngFor="let data of rowSelectTable.data">
+      <td 
+        nzShowCheckbox 
+        [(nzChecked)]="mapOfCheckedId[data.id]" 
+        (nzCheckedChange)="refreshStatus()"></td>
+      <td>{{ data.code }}</td>
+      <td>{{ data.name }}</td>
+      <td>{{ data.shortName }}</td>
+      <td>{{ data.abbreviation }}</td>
+      <td>{{ data.contactPsn }}</td>
+    </tr>
+  </tbody>
+</nz-table>

+ 24 - 0
src/app/routes/shared/modal/customer-select/customer-select.component.spec.ts

@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { RoutesSharedModalCustomerSelectComponent } from './customer-select.component';
+
+describe('RoutesSharedModalCustomerSelectComponent', () => {
+  let component: RoutesSharedModalCustomerSelectComponent;
+  let fixture: ComponentFixture<RoutesSharedModalCustomerSelectComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ RoutesSharedModalCustomerSelectComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(RoutesSharedModalCustomerSelectComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 105 - 0
src/app/routes/shared/modal/customer-select/customer-select.component.ts

@@ -0,0 +1,105 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService } from 'ng-zorro-antd';
+import { _HttpClient } from '@delon/theme';
+import { Customer } from 'app/entity/basedata/customer';
+import { CustomerService } from 'app/services/basedata/customer.service';
+
+@Component({
+  selector: 'app-routes-shared-modal-customer-select',
+  templateUrl: './customer-select.component.html',
+})
+/**
+ * 客户选择公用弹框
+ * chenchuang
+ */
+export class RoutesSharedModalCustomerSelectComponent implements OnInit {
+  customer: Customer = {};
+
+  //页码
+  page = {
+    total: 0,
+    current: 0,
+    // pageNo: '',
+  };
+
+  constructor(
+    private customerService: CustomerService,
+    private modal: NzModalRef,
+    private notification: NzNotificationService,
+  ) {}
+
+  ngOnInit() {
+    this.getTableList();
+  }
+
+  selectData = []; //弹框所有列表数据
+  isSpinning = false;
+
+  //查询按钮
+  query() {
+    this.customer.pageNo = 1;
+    this.getTableList();
+  }
+  //查询列表数据
+  getTableList() {
+    this.isSpinning = true;
+    this.customer.pkOrg = sessionStorage.getItem('pkOrg');
+    this.customerService.getCustomer1(this.customer).then(res => {
+      // console.log('!!!!!--->', res);
+      this.selectData = res.result.records;
+      console.log('弹框列表集合--->', this.selectData);
+      this.page = res.result; //页码信息
+      this.isSpinning = false;
+    });
+  }
+
+  listOfDisplayData: any[] = []; //所有列表集合(包含勾选框)
+  mapOfCheckedId: { [key: string]: boolean } = {}; //已勾选 and 层勾选的项
+  selectComName: ''; //勾选的公司名称
+  selectObj: any = []; //被勾选的集合
+  //勾选 的回调
+  refreshStatus(): void {
+    // console.log('所有列表集合(包含勾选)', this.listOfDisplayData);
+  }
+
+  //勾选弹框 确定
+  handleOk(): void {
+    console.log('111111');
+    this.selectObj = []; //清空其他的勾选记录
+    this.listOfDisplayData.forEach(element => {
+      //判断 出 已勾选 true
+      if (this.mapOfCheckedId[element.id]) {
+        var obj = {
+          id: element.id,
+          name: element.name,
+        };
+        this.selectObj.push(obj);
+        console.log('勾选的上级单位', obj);
+        // console.log(this.selectObj);
+      }
+    });
+    //判断勾选个数
+    if (this.selectObj.length == 1) {
+      // console.log('勾选的名称', this.selectObj[0].name);
+      console.log( this.selectObj[0].name);
+      console.log('该对象selectObj',this.selectObj);
+      this.modal.destroy();
+    } else {
+      this.notification.warning('错误提示', '上级单位只可选择一个!'); //通知提醒框
+    }
+  }
+
+  handleCancel(): void {
+    this.modal.destroy();
+    console.log('销毁该弹框');
+  }
+  //按页码显示数据
+  pageIndexChange(event) {
+    this.customer.pageNo = event; //当前页码
+    this.getTableList();
+  }
+  currentPageDataChange($event: Array<{ id: number; name: string; age: number; address: string }>): void {
+    this.listOfDisplayData = $event;
+    this.refreshStatus();
+  }
+}

+ 72 - 0
src/app/routes/shared/modal/produt-select/produt-select.component.html

@@ -0,0 +1,72 @@
+<div nz-row [nzGutter]="24">
+  <!-- 产品分类 -->
+  <div nz-col [nzSpan]="6">
+    <nz-card>
+      <!-- 搜索框 -->
+      <div nz-row [nzGutter]="24">
+        <div nz-col nzMd="24" nzLg="24">
+          <nz-input-group [nzSuffix]="suffixIcon" style="width:100%">
+            <input type="text" nz-input placeholder="请输入" [(ngModel)]="searchValue" />
+          </nz-input-group>
+          <ng-template #suffixIcon>
+            <i nz-icon type="search"></i>
+          </ng-template>
+        </div>
+      </div>
+      <!-- tree -->
+      <div nz-row [nzGutter]="24">
+        <div nz-col nzMd="24" nzLg="24">
+          <nz-tree [nzData]="nodes" [nzSearchValue]="searchValue" (nzClick)="treeClick($event)"
+            (nzDblClick)="openFolder($event)">
+            <ng-template #contextTemplate>
+            </ng-template>
+            <ng-template #nzTreeTemplate let-node>
+              <span class="custom-node">
+                <span *ngIf="!node.isLeaf" (contextmenu)="contextMenu(node.key,$event, contextTemplate)">
+                  <span class="folder-name">{{ node.title }}</span>
+                </span>
+                <span *ngIf="node.isLeaf" (contextmenu)="contextMenu(node.key,$event, contextTemplate)">
+                  <span class="file-name">{{ node.title }}</span>
+                </span>
+              </span>
+            </ng-template>
+          </nz-tree>
+        </div>
+      </div>
+    </nz-card>
+  </div>
+  <!-- 产品表格 -->
+  <div nz-col [nzSpan]="18">
+    <nz-card>
+      <!-- 搜索条件 -->
+      <div nz-row [nzGutter]="24">
+
+      </div>
+      <!-- 表格 -->
+      <div nz-row [nzGutter]="24">
+        <div nz-col [nzSpan]="24">
+          <nz-table nzSize="small" #basicTable [nzData]="listOfData" [nzFrontPagination]="false" [nzTotal]="page.total"
+            [nzPageIndex]="page.current" (nzPageIndexChange)="pageIndexChange($event)" [nzLoading]="isSpinning"
+            (nzCurrentPageDataChange)="currentPageDataChange($event)">
+            <thead>
+              <tr>
+                <th></th>
+                <th>产品编码</th>
+                <th>产品名称</th>
+                <th>产品属性</th>
+              </tr>
+            </thead>
+            <tbody>
+              <tr *ngFor="let data of basicTable.data">
+                <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" ></td>
+                <td>{{ data.code }}</td>
+                <td>{{ data.name }}</td>
+                <td>{{ data.attribute }}</td>
+              </tr>
+            </tbody>
+          </nz-table>
+        </div>
+      </div>
+    </nz-card>
+  </div>
+</div>

+ 24 - 0
src/app/routes/shared/modal/produt-select/produt-select.component.spec.ts

@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { RoutesSharedModalProdutSelectComponent } from './produt-select.component';
+
+describe('RoutesSharedModalProdutSelectComponent', () => {
+  let component: RoutesSharedModalProdutSelectComponent;
+  let fixture: ComponentFixture<RoutesSharedModalProdutSelectComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ RoutesSharedModalProdutSelectComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(RoutesSharedModalProdutSelectComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 139 - 0
src/app/routes/shared/modal/produt-select/produt-select.component.ts

@@ -0,0 +1,139 @@
+import { Component, OnInit, TemplateRef } from '@angular/core';
+import {
+  NzModalRef,
+  NzMessageService,
+  NzTreeNode,
+  NzFormatEmitEvent,
+  NzDropdownContextComponent,
+  NzDropdownService,
+  NzNotificationService,
+} from 'ng-zorro-antd';
+import { _HttpClient } from '@delon/theme';
+import { BaseMaterialFileClassificationService } from 'app/services/basedata/base-material-file-classification.service';
+import { BaseMaterialFileClassification } from 'app/entity/basedata/base-material-file-classification';
+import { BaseMaterialFileProduct } from 'app/entity/basedata/base-material-file-product';
+import { BaseMaterialFileProductService } from 'app/services/basedata/base-material-file-product.service';
+
+@Component({
+  selector: 'app-routes-shared-modal-produt-select',
+  templateUrl: './produt-select.component.html',
+})
+/**
+ * 产品选择公用弹框
+ */
+export class RoutesSharedModalProdutSelectComponent implements OnInit {
+  constructor(
+    private nzDropdownService: NzDropdownService,
+    private baseMaterialFileClassificationService: BaseMaterialFileClassificationService,
+    private baseMaterialFileProductService: BaseMaterialFileProductService,
+    private modal: NzModalRef,
+    private notification: NzNotificationService,
+  ) {}
+
+  ngOnInit(): void {
+    this.getListContractTree();
+  }
+
+  searchValue = ''; //搜索框的值
+  nodes: any = []; //tree集合
+  dropdown: NzDropdownContextComponent;
+  listOfData: BaseMaterialFileProduct[] = []; //产品集合
+  isSpinning = false; //加载状态
+  page = {
+    total: 0,
+    current: 0,
+  }; //页码
+  baseMaterialFileProduct: BaseMaterialFileProduct = {}; //产品查询对象
+
+  //双击节点自动打开树分支
+  openFolder(data: NzTreeNode | Required<NzFormatEmitEvent>): void {
+    if (data instanceof NzTreeNode) {
+      data.isExpanded = !data.isExpanded;
+    } else {
+      const node = data.node;
+      if (node) {
+        node.isExpanded = !node.isExpanded;
+      }
+    }
+  }
+
+  //右键树节点
+  id = '';
+  contextMenu(Fid, $event: MouseEvent, template: TemplateRef<void>): void {
+    this.id = Fid; //获取id
+    this.dropdown = this.nzDropdownService.create($event, template);
+  }
+
+  //查询tree合同类型
+  getListContractTree() {
+    return new Promise(resolve => {
+      let baseMaterialFileClassification = new BaseMaterialFileClassification();
+      baseMaterialFileClassification.pkOrg = sessionStorage.getItem('pkOrg');
+      this.baseMaterialFileClassificationService.getTreeList(baseMaterialFileClassification).then(response => {
+        this.nodes = JSON.parse(JSON.stringify(response.result));
+        resolve();
+      });
+    });
+  }
+
+  //树节点点击事件
+  treeClick(event) {
+    var getdDepart = event.node.origin; //当前点击的对象
+    this.baseMaterialFileProduct.baseMaterialFileClassificationId = getdDepart.key; //获取分类id
+    //根据分类id查询产品数据
+    this.getProdutPage();
+  }
+
+  /**
+   * 产品分页查询
+   */
+  getProdutPage() {
+    return new Promise(resolve => {
+      this.isSpinning = true;
+      this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg');
+      this.baseMaterialFileProductService.list(this.baseMaterialFileProduct).then(response => {
+        this.listOfData = response.result.records;
+        this.isSpinning = false;
+        resolve();
+      });
+    });
+  }
+
+  //按页码显示数据
+  pageIndexChange(event) {
+    // this.customer.pageNo = event; //当前页码
+    // this.getList();
+  }
+
+  selectObj: any = []; //最终勾选的产品
+  save() {
+    return new Promise(resolve => {
+      this.selectObj = []; //清空上一次勾选的数据
+      this.listOfDisplayData.forEach(element => {
+        //判断 出 已勾选 true
+        if (this.mapOfCheckedId[element.id]) {
+          this.selectObj.push(element);
+        }
+      });
+      if (this.selectObj.length == 0) {
+        this.notification.warning('提示', '必须选择一个产品');
+      } else if (this.selectObj.length > 1) {
+        this.notification.warning('提示', '只能选择一个产品');
+      } else if (this.selectObj.length == 1) {
+        resolve()
+        this.modal.close();
+      }
+    });
+  }
+
+  listOfDisplayData: any[] = []; //所有列表集合(包含勾选框)
+  mapOfCheckedId: { [key: string]: boolean } = {}; //已勾选 and 层勾选的项
+  currentPageDataChange($event: Array<{ id: number; name: string; age: number; address: string }>): void {
+    this.listOfDisplayData = $event;
+    // this.refreshStatus();
+  }
+
+  close() {
+    this.modal.close();
+  }
+}