|
@@ -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() {}
|
|
|
}
|