From db156d9b1cccc1fe12f06d5a05ff2ef32532def4 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Sat, 3 Nov 2018 09:35:14 +0530 Subject: [PATCH] enetity details changes : kdk --- .../entity-add-tat.component.html | 79 ++++++++++ .../entity-edit-tat.component.html | 73 +++------ .../entity-edit-tat.component.scss | 16 ++ .../entity-edit-tat.component.ts | 149 ++++++++++++------ .../entity-edit/entity.edit.component.html | 4 +- .../src/app/settings/entity/entity.module.ts | 5 + 6 files changed, 219 insertions(+), 107 deletions(-) create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html new file mode 100644 index 000000000..921e2291d --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html @@ -0,0 +1,79 @@ +
+
+
+ +
+
+ +
+
+ + + TAT 1 Value Required.! + + + + TAT 2 Value Required.! + +
+
+
+ + + {{pd.name}} + + PD Type Required.! + +
+
    +
  • + {{pdName.name}} +
  • +
+
+
+
+ + + {{prdct.name}} + + Product Required.! + +
+
    +
  • + {{prdcName.name}} +
  • +
+
+
+
+ + + {{city.name}} + + City Required.! + +
+
    +
  • + {{cityName.name}} +
  • +
+
+
+
+
+ + +
+
+
+
Note : Following are already exist for this Entity.
+
    +
  • {{ val }}
  • +
+
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html index d075294b9..13d6670fe 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html @@ -1,59 +1,24 @@ - -
-
-
- - - {{pd.name}} - - PD Type Required.! - - - {{pdName.name}} - +
+
+ +
+
+ + +
+
+
+
{{comb.pd.name}} - {{comb.product.name}} - {{comb.city.name}} ,
+
-
- - - {{prdct.name}} - - Product Required.! - - - {{prdcName.name}} - +
+ {{data.tatVal1}}
-
- - - {{city.name}} - - City Required.! - - - {{cityName.name}} - +
+ {{data.tatVal2}}
-
- - - - TAT 1 Value Required.! - - - - +
+
-
-
- - -
- - +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss index e69de29bb..4a04955c7 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss @@ -0,0 +1,16 @@ +.text-line-limit { + text-overflow: ellipsis; + overflow: hidden; + // white-space: nowrap; + display: -webkit-box; + line-height: 16px; /* fallback */ + max-height: 32px; /* fallback */ + -webkit-line-clamp: 2; /* number of lines to show */ + -webkit-box-orient: vertical; + + // text-overflow: ellipsis; + // overflow: hidden; + // width: 160px; + // height: 1.2em; + // white-space: nowrap; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts index f0e5f73dc..c9dffdecf 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts @@ -17,6 +17,93 @@ import { EntityService } from './../../../service/entity/entity.service'; }) export class EntityEditTatComponent implements OnInit { + + @Input() public entityId: number; + + /** + * Notifier service + */ + private notifier: NotifierService; + + constructor(notifier: NotifierService, + private entityService: EntityService, + private mastersService: MastersService, + private dialog: MatDialog) { + this.notifier = notifier; + } + ngOnInit() { + } + + addNewTatDetails() { + const dialogRef = this.dialog.open(DialogEntityAddTatComponent, { + data: {entity_id: this.entityId}, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + }); + } + + entityTatListDetails: any = [ { + 'm_id': 1, + 'tatVal1': 3, + 'tatVal2':10, + "tatCombinations" : [ + { + 'c_id': 1, + 'pd': { + 'id': 1, + 'name': 'PD Type 1' + }, + 'product': { + 'id': 2, + 'name': 'Product 2' + }, + 'city' : { + 'id': 3, + 'name': 'City 3' + } + }, + { + 'c_id': 2, + 'pd': { + 'id': 2, + 'name': 'PD Type 2' + }, + 'product': { + 'id': 1, + 'name': 'Product 1' + }, + 'city' : { + 'id': 1, + 'name': 'City 1' + } + } + ] + }] + +} + + +// var array1=["A","B","C","D"]; +// var array2=["1","2","3"]; +// var array3=["#","$","@"]; +// var result1 = array1.reduce( (a1, v1, i1) => +// a1.concat(array2.map(w => v1+w)),[]).reduce((a2, v2, i3)=> +// a2.concat(array3.map(u=> v2+u)),[]) +// console.log(result1); +// var valueApi = ["B1$","C2#"]; +// var exist = result1.filter(a => valueApi.indexOf(a) > -1); +// console.log("exit :" + exist); + +@Component({ + selector: 'dialog-entity-add-tat', + styles: [`` + ], + templateUrl: './entity-add-tat.component.html' +}) +export class DialogEntityAddTatComponent implements OnInit { + public noRocordsFound: boolean; public entityVendorCityRecord: any; public errorMessage; @@ -47,6 +134,8 @@ export class EntityEditTatComponent implements OnInit { constructor(notifier: NotifierService, private entityService: EntityService, private mastersService: MastersService, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, private _formBuilder: FormBuilder) { this.notifier = notifier; this.tatForm = this._formBuilder.group({ @@ -114,33 +203,6 @@ export class EntityEditTatComponent implements OnInit { resultApi = ['123', '211']; - check() { - let arr1 = this.tatForm.controls['toppings1'].value; - let arr2 = this.tatForm.controls['toppings2'].value; - let arr3 = this.tatForm.controls['toppings3'].value; - alert(arr1); - let array1 = [...arr1]; - let array2 = [...arr2]; - let array3 = [...arr3]; - let result1 = array1.reduce((a1, v1, i1) => - a1.concat(array2.map(w => v1 + "" + w)), []).reduce((a2, v2, i3) => - a2.concat(array3.map(u => v2 + "" + u)), []); - - let exist = this.resultApi.filter(a => result1.indexOf(a) > -1); - alert(result1); - alert(exist); - } - -// { -// alert("a.id = "+a.id+" id ="+id); -// if(a.id == id) -// { -// return a -// } -// else{ -// return -1 -// }} - getIdPdName(id) { let pdF = this.m_pdType.filter(a => a.id == id); return pdF[0].name; @@ -151,7 +213,7 @@ export class EntityEditTatComponent implements OnInit { return pdF[0].name; } - getIdCityName(id) { + getIdCityName(id) { let pdF = this.m_city.filter(a => a.id == id); return pdF[0].name; } @@ -176,37 +238,22 @@ export class EntityEditTatComponent implements OnInit { let exist = this.resultApi.filter(a => result1.indexOf(a) > -1); if(exist){ - - alert(result1); - alert(exist); - + // alert(result1); + // alert(exist); this.existValArray = []; - exist.forEach(a=>{ let pdName = this.getIdPdName(a[0]); let productName = this.getIdProductName(a[1]); let cityName = this.getIdCityName(a[2]); this.existValArray.push(`${pdName}, ${productName}, ${cityName}`); }); - - } else { - + } else { + // api add new here } } - } -} - - - -// var array1=["A","B","C","D"]; -// var array2=["1","2","3"]; -// var array3=["#","$","@"]; -// var result1 = array1.reduce( (a1, v1, i1) => -// a1.concat(array2.map(w => v1+w)),[]).reduce((a2, v2, i3)=> -// a2.concat(array3.map(u=> v2+u)),[]) -// console.log(result1); -// var valueApi = ["B1$","C2#"]; -// var exist = result1.filter(a => valueApi.indexOf(a) > -1); -// console.log("exit :" + exist); + onNoClick(): void { + this.dialogRef.close(); + } +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html index faebe9a2e..86216b766 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html @@ -234,12 +234,12 @@ - +