From fb10a28cb8848e8c5939457b471936a0e43b451b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 31 Oct 2018 15:21:08 +0530 Subject: [PATCH 1/7] qc changes --- .../list-pd/start-pd/start-pd.component.html | 12 ++++++------ .../manage-pd/list-pd/start-pd/start-pd.component.ts | 2 +- .../qc-list/qc-start/qc-start.component.html | 4 ++-- .../qc-list/qc-start/qc-start.component.ts | 3 ++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index 04b126ac9..e1244df9c 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -25,7 +25,7 @@ Category @@ -229,9 +229,9 @@
- skip_previous - chevron_left - chevron_right + skip_previous + chevron_left + chevron_right skip_next @@ -325,9 +325,9 @@
- skip_previous + skip_previous chevron_left - chevron_right + chevron_right skip_next diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index 2118ecebe..6dcd7b8fe 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -122,7 +122,7 @@ loadTemplates(startID:string){ // load question based answer list getAnswers(serachList:any){ - + this.answerList=[]; this._pd.getAnswersForPD(serachList).subscribe( data => { if (data.status == 200) { diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html index 8f8ee07e0..582be1829 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html @@ -24,7 +24,7 @@ Category @@ -166,7 +166,7 @@
{{textBoxForm.controls.pd_question.value}} -
+
diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts index fd7384441..576298f02 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts @@ -8,7 +8,8 @@ import { QcService } from './../../qc-service/qc.service'; @Component({ selector: 'app-qc-start', templateUrl: './qc-start.component.html', - styleUrls: ['./qc-start.component.scss'] + styleUrls: ['./qc-start.component.scss'], + }) export class QcStartComponent implements OnInit, OnDestroy { private notifier: NotifierService; From 52a8b777bcceabe2ffcbcbacb0b98cff6f760a5a Mon Sep 17 00:00:00 2001 From: saravanakumarkandasami Date: Wed, 31 Oct 2018 15:33:18 +0530 Subject: [PATCH 2/7] Sarat pd UI --- .../list-pd/map-pd-view/map-pd-view.component.html | 10 +++++----- .../manage-pd/list-pd/start-pd/start-pd.component.html | 2 +- .../qc-list/qc-start/qc-start.component.html | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html index d6feedecd..30d6932eb 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html @@ -39,11 +39,11 @@ -  {{details.city_name}}/{{details.state_name}}-{{details.pincode}}
- {{details.product_abbr}}/{{details.subproduct_abbr}}
- {{details.customer_segment_abbr}} {{details.loan_amount}}
- {{details.pd_date_of_initiation}}
- {{details.pd_status}} - {{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }} +  {{details.city_name}}/{{details.state_name}}-{{details.pincode}}
+ {{details.product_abbr}}/{{details.subproduct_abbr}}
+ {{details.customer_segment_abbr}} {{details.loan_amount}}
+ {{details.pd_date_of_initiation}}
+ {{details.pd_status}} - {{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index e1244df9c..17ac0ee26 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -171,7 +171,7 @@
- + diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html index 582be1829..d23b5e8f8 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html @@ -169,7 +169,7 @@
- + From ca6e86549fd419e37b24e51b090daf1ffd1b2a9a Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 31 Oct 2018 16:52:31 +0530 Subject: [PATCH 3/7] pd changes --- .../manage-pd/list-pd/view-pd/view-pd.component.html | 2 +- .../quality-check/qc-list/qc-start/qc-start.component.html | 2 +- .../app/quality-check/qc-list/qc-view/qc-view.component.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 6b9143ef8..4f0dd61f1 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -15,7 +15,7 @@
{{master.pd_allocated_to | titlecase}}    {{master.pd_status | titlecase}}  On {{master.scheduled_on}} - {{master.pd_status | titlecase}}  On  {{ (master.updatedon)? (master.updatedon | slice:0:10):(master.updatedon) }} + {{master.pd_status | titlecase}}
diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html index d23b5e8f8..b9e6c908d 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html @@ -2,7 +2,7 @@ - + diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html index e1791b737..14f062c2e 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html @@ -14,7 +14,7 @@
{{master.pd_allocated_to | titlecase}}    {{master.pd_status | titlecase}}  On {{master.scheduled_on}} - {{master.pd_status | titlecase}}  On  {{ (master.updatedon)? (master.updatedon | slice:0:10):(master.updatedon) }} + {{master.pd_status | titlecase}}
@@ -24,7 +24,7 @@
-
+
From 7eac0511093859bd33659561ecf1d3a7275b3314 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Wed, 31 Oct 2018 18:04:20 +0530 Subject: [PATCH 4/7] entity , template list bug changes : kdk --- .../entity-edit-billing-info.component.html | 2 +- .../entity-edit-billing-info.component.ts | 2 +- .../entity-edit-region.component.html | 2 +- .../entity-edit-tat.component.html | 60 ++++++- .../entity-edit-tat.component.ts | 155 ++++++++++++++++-- ...ntity-edit-vendor-city-info.component.html | 2 +- .../entity-edit-vendor-city-info.component.ts | 3 +- .../entity-edit/entity.edit.component.html | 8 +- .../entity-list/entity.list.component.ts | 4 +- .../questions/edit/edit.component.html | 6 +- .../questions/list/list.component.html | 5 +- .../template/questions/list/list.component.ts | 4 +- .../templates.list.component.html | 4 +- .../templates.list.component.ts | 4 +- 14 files changed, 226 insertions(+), 35 deletions(-) diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html index 1d27932de..28ffe3d7d 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html @@ -14,7 +14,7 @@ Pan: {{data.pan}}, Gst: {{data.gstno}}
- Contact Person Info, Contact Person Info, Contact Person Info +
{{conts.contact_person}} - {{conts.contact_email}} - {{conts.contact_mobile_no}} ,
diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts index bfabea685..4f0e1423c 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts @@ -213,7 +213,7 @@ export class DialogAddEditBillingInfo implements OnInit { //To Remove The "Null" With Key also Object.keys(billingInfoFormValues).forEach((key) => (billingInfoFormValues[key] == null) && delete billingInfoFormValues[key]); - alert(billingInfoFormValues); + // alert(billingInfoFormValues); this.entityService.updateEntityIdBillingInfoDetails(billingInfoFormValues).subscribe( dataresult => { if (dataresult.status == 200) { diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html index d9dd8b47d..bcca26bbe 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html @@ -46,7 +46,7 @@
- +
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 6222fc96d..d075294b9 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 +1,59 @@ -

Tat info

\ No newline at end of file + +
+
+
+ + + {{pd.name}} + + PD Type Required.! + + + {{pdName.name}} + +
+
+ + + {{prdct.name}} + + Product Required.! + + + {{prdcName.name}} + +
+
+ + + {{city.name}} + + City Required.! + + + {{cityName.name}} + +
+
+ + + + 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.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts index ac780819d..f0e5f73dc 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 @@ -20,16 +20,25 @@ export class EntityEditTatComponent implements OnInit { public noRocordsFound: boolean; public entityVendorCityRecord: any; public errorMessage; + submitted: Boolean; - @Input() public entityId: number; - public m_city: any = []; + tatForm: FormGroup; + + @Input() public entityId: number; public selectedArr: any = []; + public selectedProductArr: any = []; + public selectedCityArr: any = []; + // toppings1 = new FormControl(); + // toppings2 = new FormControl(); + // toppings3 = new FormControl(); + // toppings4 = new FormControl(); - toppings1 = new FormControl(); - - toppingList1: any[] = [{'id': 1,'name':'Extra cheese'}, {'id': 2, 'name':'Mushroom'}, { 'id': 3, 'name':'Onion'}]; + toppingList1: any[] = [{ 'id': 1, 'name': 'Extra cheese' }, { 'id': 2, 'name': 'Mushroom' }, { 'id': 3, 'name': 'Onion' }]; + m_pdType = [{ 'id': 1, 'name': 'PD Type 1' }, { 'id': 2, 'name': 'PD Type 2' }]; + m_product = [{ 'id': 1, 'name': 'Product 1' }, { 'id': 2, 'name': 'Product 2' }, { 'id': 3, 'name': 'Product 3' }]; + m_city = [{ 'id': 1, 'name': 'City 1' }, { 'id': 2, 'name': 'City 2' }, { 'id': 3, 'name': 'City 3' }]; /** * Notifier service */ @@ -39,24 +48,43 @@ export class EntityEditTatComponent implements OnInit { private entityService: EntityService, private mastersService: MastersService, private _formBuilder: FormBuilder) { - this.notifier = notifier; - } + this.notifier = notifier; + this.tatForm = this._formBuilder.group({ + toppings1: ['', Validators.compose([Validators.required])], + toppings2: ['', Validators.compose([Validators.required])], + toppings3: ['', Validators.compose([Validators.required])], + toppings4: ['', Validators.compose([Validators.required])], + toppings5: ['', Validators.compose([Validators.required])] + }) + } ngOnInit() { - this.getEntityIdCityDetails(); - this.getCityMasters(); - this.toppings1.setValue([3]); + } - selectedItem: any; + get f() { return this.tatForm.controls }; - selected(e){ + selectedItem: any; + + selectedPD(e) { this.selectedArr = [...e.value]; - this.selectedItem = this.m_city.filter(val => this.selectedArr.indexOf(val.city_id) > -1) + this.selectedItem = this.m_pdType.filter(val => this.selectedArr.indexOf(val.id) > -1) } - getEntityIdCityDetails(){ - this.entityService.getEntityIdCityInfoDetails(this.entityId).subscribe( + selectedProductItem: any; + selectedProduct(e) { + this.selectedProductArr = [...e.value]; + this.selectedProductItem = this.m_product.filter(val => this.selectedProductArr.indexOf(val.id) > -1) + } + + selectedCityItem: any; + selectedCity(e) { + this.selectedCityArr = [...e.value]; + this.selectedCityItem = this.m_city.filter(val => this.selectedCityArr.indexOf(val.id) > -1) + } + + getEntityIdCityDetails() { + this.entityService.getEntityIdCityInfoDetails(this.entityId).subscribe( data => { if (data) { if (data.records) { @@ -84,4 +112,101 @@ 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; + } + + getIdProductName(id) { + let pdF = this.m_product.filter(a => a.id == id); + return pdF[0].name; + } + + getIdCityName(id) { + let pdF = this.m_city.filter(a => a.id == id); + return pdF[0].name; + } + + public existValArray:any = []; + + onSubmit() { + this.submitted = true; + if (this.tatForm.invalid) { + return + } else { + let arr1 = this.tatForm.controls['toppings1'].value; + let arr2 = this.tatForm.controls['toppings2'].value; + let arr3 = this.tatForm.controls['toppings3'].value + + 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); + if(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 { + + } + } + + } + } + + + +// 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); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html index 8034c6fea..f8cc44638 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html @@ -7,7 +7,7 @@ - + {{cit.name}} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts index 3027434d1..9da70da57 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts @@ -84,9 +84,10 @@ export class EntityEditVendorCityInfoComponent implements OnInit { selectedCityName:any; getNameofCityId(arg) { + let arrs = [...arg]; this.selectedCityName = this.m_city.filter(val => arrs.indexOf(val.city_id) > -1) - } +} getCityMasters() { this.mastersService.getAllMasterData('CITY').subscribe( 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 164d895e5..faebe9a2e 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 @@ -233,7 +233,13 @@ - + +
diff --git a/ng6-seed/src/app/template/questions/list/list.component.html b/ng6-seed/src/app/template/questions/list/list.component.html index 82654ad40..4665b1381 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.html +++ b/ng6-seed/src/app/template/questions/list/list.component.html @@ -45,11 +45,12 @@ -
+ + -
+ +
+
+
+ + +
+ + +
\ 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 ac780819d..f0e5f73dc 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 @@ -20,16 +20,25 @@ export class EntityEditTatComponent implements OnInit { public noRocordsFound: boolean; public entityVendorCityRecord: any; public errorMessage; + submitted: Boolean; - @Input() public entityId: number; - public m_city: any = []; + tatForm: FormGroup; + + @Input() public entityId: number; public selectedArr: any = []; + public selectedProductArr: any = []; + public selectedCityArr: any = []; + // toppings1 = new FormControl(); + // toppings2 = new FormControl(); + // toppings3 = new FormControl(); + // toppings4 = new FormControl(); - toppings1 = new FormControl(); - - toppingList1: any[] = [{'id': 1,'name':'Extra cheese'}, {'id': 2, 'name':'Mushroom'}, { 'id': 3, 'name':'Onion'}]; + toppingList1: any[] = [{ 'id': 1, 'name': 'Extra cheese' }, { 'id': 2, 'name': 'Mushroom' }, { 'id': 3, 'name': 'Onion' }]; + m_pdType = [{ 'id': 1, 'name': 'PD Type 1' }, { 'id': 2, 'name': 'PD Type 2' }]; + m_product = [{ 'id': 1, 'name': 'Product 1' }, { 'id': 2, 'name': 'Product 2' }, { 'id': 3, 'name': 'Product 3' }]; + m_city = [{ 'id': 1, 'name': 'City 1' }, { 'id': 2, 'name': 'City 2' }, { 'id': 3, 'name': 'City 3' }]; /** * Notifier service */ @@ -39,24 +48,43 @@ export class EntityEditTatComponent implements OnInit { private entityService: EntityService, private mastersService: MastersService, private _formBuilder: FormBuilder) { - this.notifier = notifier; - } + this.notifier = notifier; + this.tatForm = this._formBuilder.group({ + toppings1: ['', Validators.compose([Validators.required])], + toppings2: ['', Validators.compose([Validators.required])], + toppings3: ['', Validators.compose([Validators.required])], + toppings4: ['', Validators.compose([Validators.required])], + toppings5: ['', Validators.compose([Validators.required])] + }) + } ngOnInit() { - this.getEntityIdCityDetails(); - this.getCityMasters(); - this.toppings1.setValue([3]); + } - selectedItem: any; + get f() { return this.tatForm.controls }; - selected(e){ + selectedItem: any; + + selectedPD(e) { this.selectedArr = [...e.value]; - this.selectedItem = this.m_city.filter(val => this.selectedArr.indexOf(val.city_id) > -1) + this.selectedItem = this.m_pdType.filter(val => this.selectedArr.indexOf(val.id) > -1) } - getEntityIdCityDetails(){ - this.entityService.getEntityIdCityInfoDetails(this.entityId).subscribe( + selectedProductItem: any; + selectedProduct(e) { + this.selectedProductArr = [...e.value]; + this.selectedProductItem = this.m_product.filter(val => this.selectedProductArr.indexOf(val.id) > -1) + } + + selectedCityItem: any; + selectedCity(e) { + this.selectedCityArr = [...e.value]; + this.selectedCityItem = this.m_city.filter(val => this.selectedCityArr.indexOf(val.id) > -1) + } + + getEntityIdCityDetails() { + this.entityService.getEntityIdCityInfoDetails(this.entityId).subscribe( data => { if (data) { if (data.records) { @@ -84,4 +112,101 @@ 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; + } + + getIdProductName(id) { + let pdF = this.m_product.filter(a => a.id == id); + return pdF[0].name; + } + + getIdCityName(id) { + let pdF = this.m_city.filter(a => a.id == id); + return pdF[0].name; + } + + public existValArray:any = []; + + onSubmit() { + this.submitted = true; + if (this.tatForm.invalid) { + return + } else { + let arr1 = this.tatForm.controls['toppings1'].value; + let arr2 = this.tatForm.controls['toppings2'].value; + let arr3 = this.tatForm.controls['toppings3'].value + + 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); + if(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 { + + } + } + + } + } + + + +// 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); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html index 8034c6fea..f8cc44638 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.html @@ -7,7 +7,7 @@ - + {{cit.name}} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts index 3027434d1..9da70da57 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component.ts @@ -84,9 +84,10 @@ export class EntityEditVendorCityInfoComponent implements OnInit { selectedCityName:any; getNameofCityId(arg) { + let arrs = [...arg]; this.selectedCityName = this.m_city.filter(val => arrs.indexOf(val.city_id) > -1) - } +} getCityMasters() { this.mastersService.getAllMasterData('CITY').subscribe( 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 164d895e5..faebe9a2e 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 @@ -233,7 +233,13 @@ - + +
diff --git a/ng6-seed/src/app/template/questions/list/list.component.html b/ng6-seed/src/app/template/questions/list/list.component.html index 82654ad40..4665b1381 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.html +++ b/ng6-seed/src/app/template/questions/list/list.component.html @@ -45,11 +45,12 @@ -
+ + -
+