diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts index 0cceec89d..247b93d73 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts @@ -43,6 +43,7 @@ export class EditPdApplicantComponent implements OnInit { fk_applicant_primary_id: [null], applicant_name: [null, Validators.compose([Validators.required])], mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])], + stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])], company_name: [null], applicant_type: [1], @@ -54,7 +55,6 @@ export class EditPdApplicantComponent implements OnInit { loadApplicantFormData() { let stdcodesearch = this.mainApplicantData[0].landline.search("-"); let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch); - console.log(stdcode); let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8); this._EditApplicantForm = this._fb.group({ fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index 78a36ac59..f4a58047d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -19,26 +19,29 @@ - - +
+
+ + - - +
+
+ {{m_addressType.address_type}} - - + - - +
+
+ {{m_locality.locality_name}} @@ -46,27 +49,75 @@ - + - - +
+ + +
+
+
+ {{data.description}} - - +
+
+ {{data.rating}} +
+
+ + + + {{ownerShip.name}} + + + + + + + + + + + +
+
+
+
+ + + Yes + No + + + +
+ + + + + + + +
+ +
+
- - - - {{ownerShip.name}} - - - - - - - - - - - - - - - Yes - No - - + + + -

Type of Premises

-
+ +
{{at.address_type}}
@@ -157,12 +187,12 @@ - +
- + +
- +
- +
- +
@@ -174,19 +174,19 @@
- + - + - + - + Yes No - NAN + NA @@ -215,7 +215,7 @@
- +
@@ -223,7 +223,7 @@ + formControlName="business_name_of_the_owner" > {{owner.applicant_name}} @@ -238,7 +238,7 @@
- + {{relations.name}} @@ -329,7 +329,7 @@
- + {{ asset.name }} @@ -343,7 +343,7 @@
- + {{ prop.name }} @@ -364,7 +364,7 @@
- +
@@ -378,7 +378,7 @@
- +
@@ -406,7 +406,7 @@
- +
@@ -421,33 +421,33 @@
- +
- + {{ freqn.name }}
- +
- +
@@ -463,7 +463,7 @@
- + {{ ins_type.name }} @@ -477,14 +477,14 @@
- +
- +
@@ -499,19 +499,43 @@
- + - + + + + + {{owner.applicant_name}} + + + +
+ + + +
+
+ + + + {{relations.name}} + + + +
- + - + Yes No - NAN + NA @@ -545,7 +569,7 @@
+ formControlName="name_of_the_owner" > {{owner.applicant_name}} @@ -560,7 +584,7 @@
- + {{relations.name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index 4304d3314..90c350611 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts @@ -31,6 +31,7 @@ export class AssetsInfoComponent implements OnInit { pageTitle: string ="Assets Details"; //@Input() pdid: number; pdid:string; + businessProfessionName :string; public _assetsQuesFrom: FormGroup; public submitted = false; @@ -196,9 +197,12 @@ public m_investmentType = []; }; ngOnInit() { + + this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { + this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; + }); this.getPdSupplierFormDetails(); - this.getM_Assets_Type(); this.getM_PropertyType(); this.getM_InvestmentType(); @@ -209,6 +213,7 @@ public m_investmentType = []; // ====================== + getM_Assets_Type() { this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe( data => { @@ -322,7 +327,7 @@ public m_investmentType = []; this.initDetails(), ]), business_assets_details : this._formBuilder.array([ - this.initBusinessDetails(), + this.initBusinessDetails(this.businessProfessionName), ]), assets_form_remark:[''] }); @@ -340,14 +345,14 @@ public m_investmentType = []; // Dynamic Form field creation Functionality : START ===> initDetails() { return this._formBuilder.group({ - assets_mode: ['', Validators.compose([Validators.required])], + assets_mode: [''], details: this._formBuilder.array([]), - approximate_market_value: ['', Validators.compose([])], - name_of_the_owner: ['', Validators.compose([])], + approximate_market_value: [''], + name_of_the_owner: [''], other_owner:[''], relation: [''], - // purchase_year: ['', Validators.compose([])], - //purchase_month: ['', Validators.compose([])], + // purchase_year: [''], + //purchase_month: [''], emi: [''], emi_paid: [''], original_loan_tenure: [''], @@ -356,16 +361,16 @@ public m_investmentType = []; }); } - initBusinessDetails() { + initBusinessDetails(data) { return this._formBuilder.group({ - business_assets_mode: ['', Validators.compose([Validators.required])], + business_assets_mode: [''], business_details: this._formBuilder.array([]), - business_approximate_market_value: ['', Validators.compose([])], - business_name_of_the_owner: ['', Validators.compose([])], + business_approximate_market_value: [''], + business_name_of_the_owner: [data], // other_owner:[''], // relation:[''], - // purchase_year: ['', Validators.compose([])], - //purchase_month: ['', Validators.compose([])], + // purchase_year: [''], + //purchase_month: [''], business_emi: [''], business_emi_paid: [''], business_original_loan_tenure: [''], @@ -434,9 +439,14 @@ public m_investmentType = []; break; } case '8': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('details') as FormArray ; - control.push(this.otherAssetsDescription()); + if(flag == 1){ + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ; + control.push(this.otherAssetsDescription()); + } + else if (flag == 2){ + const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.otherBusinessAssetsDescription()); + } break; } default: { @@ -448,26 +458,39 @@ public m_investmentType = []; loadProperty() { return this._formBuilder.group({ - property_type: ['', Validators.compose([Validators.required])], + property_type: [''], other_property_type: [''] }); } loadJwellDescription() { return this._formBuilder.group({ - jwell_description: ['', Validators.compose([])] + jwell_description: [''] }); } loadConsumerDurableDescription() { return this._formBuilder.group({ - consumer_durable_description: ['', Validators.compose([Validators.required])] + consumer_durable_description: [''] }); } otherAssetsDescription() { return this._formBuilder.group({ - any_other_assets: ['', Validators.compose([Validators.required])], + any_other_assets: [''], + name_of_the_owner:[''], + other_owner:[''], + relation:[''], + any_other_asset_value : [''], + any_other_asset_loan : [''], + other_asset_emi_amt : [''] + + }); + } + + otherBusinessAssetsDescription() { + return this._formBuilder.group({ + any_other_assets: [''], any_other_asset_value : [''], any_other_asset_loan : [''], other_asset_emi_amt : [''] @@ -477,32 +500,32 @@ public m_investmentType = []; loadInsuranceDescription() { return this._formBuilder.group({ - //insurance_type: ['', Validators.compose([Validators.required])], - premium_paid: ['', Validators.compose([])], - frequency_mode: ['', Validators.compose([])], - sum_assured: ['', Validators.compose([])], - members_coverd: ['', Validators.compose([])] + //insurance_type: [''], + premium_paid: [''], + frequency_mode: [''], + sum_assured: [''], + members_coverd: [''] }); } loadInvestDescription() { return this._formBuilder.group({ - investments_type: ['', Validators.compose([])], + investments_type: [''], other_investments_type:[''], - amount_of_invest: ['', Validators.compose([])], - bank_name: ['', Validators.compose([])] + amount_of_invest: [''], + bank_name: [''] }); } load_Four_Weeler() { return this._formBuilder.group({ - manufacturer_model_four_weeler: ['', Validators.compose([])] + manufacturer_model_four_weeler: [''] }); } load_Two_Weeler() { return this._formBuilder.group({ - manufacturer_model_two_weeler: ['', Validators.compose([Validators.required])] + manufacturer_model_two_weeler: [''] }); } @@ -510,67 +533,74 @@ public m_investmentType = []; loadPropertyWithData(data) { return this._formBuilder.group({ - property_type: [data.property_type, Validators.compose([Validators.required])] - //property_type:[''] - }); - } - - loadPropertyWithData2(data) { - return this._formBuilder.group({ - property_type: [data.property_type, Validators.compose([Validators.required])] + property_type: [data.property_type] //property_type:[''] }); } loadJwellDescriptionWithData(data) { return this._formBuilder.group({ - jwell_description: [data.jwell_description, Validators.compose([Validators.required])] + jwell_description: [data.jwell_description] }); } loadConsumerDurableDescriptionWithData(data) { return this._formBuilder.group({ - consumer_durable_description: [data.consumer_durable_description, Validators.compose([Validators.required])] + consumer_durable_description: [data.consumer_durable_description] }); } otherAssetsDescriptionWithData(data) { return this._formBuilder.group({ - any_other_assets: [data.any_other_assets, Validators.compose([Validators.required])], + any_other_assets: [data.any_other_assets], + name_of_the_owner:[data.name_of_the_owner], + other_owner:[data.other_owner], + relation:[data.relation], any_other_asset_value : [data.any_other_asset_value], any_other_asset_loan : [data.any_other_asset_loan], other_asset_emi_amt : [data.other_asset_emi_amt] }); } + otherBusinessAssetsDescriptionWithData(data) { + return this._formBuilder.group({ + any_other_assets: [data.any_other_assets], + any_other_asset_value : [data.any_other_asset_value], + any_other_asset_loan : [data.any_other_asset_loan], + other_asset_emi_amt : [data.other_asset_emi_amt] + }); + } + + + loadInsuranceDescriptionWithData(data) { return this._formBuilder.group({ - //insurance_type: [data.insurance_type, Validators.compose([Validators.required])], - premium_paid: [data.premium_paid, Validators.compose([Validators.required])], - frequency_mode: [data.frequency_mode, Validators.compose([Validators.required])], - sum_assured: [data.sum_assured, Validators.compose([Validators.required])], - members_coverd: [data.members_coverd, Validators.compose([Validators.required])] + //insurance_type: [data.insurance_type], + premium_paid: [data.premium_paid], + frequency_mode: [data.frequency_mode], + sum_assured: [data.sum_assured], + members_coverd: [data.members_coverd] }); } loadInvestDescriptionWithData(data) { return this._formBuilder.group({ - investments_type: [data.investments_type, Validators.compose([Validators.required])], - other_investment_type : [data.other_investment_type], - amount_of_invest: [data.amount_of_invest, Validators.compose([Validators.required])], - bank_name: [data.bank_name, Validators.compose([Validators.required])] + investments_type: [data.investments_type], + other_investments_type : [data.other_investments_type], + amount_of_invest: [data.amount_of_invest], + bank_name: [data.bank_name] }); } load_Four_WeelerWithData(data) { return this._formBuilder.group({ - manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler, Validators.compose([Validators.required])] + manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler] }); } load_Two_WeelerWithData(data) { return this._formBuilder.group({ - manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler, Validators.compose([Validators.required])] + manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler] }); } @@ -578,14 +608,14 @@ public m_investmentType = []; initDetailsWithdata(data) { return this._formBuilder.group({ - assets_mode: [data.assets_mode, Validators.compose([Validators.required])], + assets_mode: [data.assets_mode], details: this._formBuilder.array([]), - approximate_market_value: [data.approximate_market_value, Validators.compose([])], - name_of_the_owner: [data.name_of_the_owner, Validators.compose([])], + approximate_market_value: [data.approximate_market_value], + name_of_the_owner: [data.name_of_the_owner], other_owner:[data.other_owner || ''], relation: [data.relation || ''], - // purchase_year: [data.purchase_year, Validators.compose([])], - // purchase_month: [data.purchase_month, Validators.compose([])], + // purchase_year: [data.purchase_year], + // purchase_month: [data.purchase_month], emi: [data.emi || 0], emi_paid: [data.emi_paid || ''], original_loan_tenure: [data.original_loan_tenure || ''], @@ -595,14 +625,14 @@ public m_investmentType = []; } initBusinessDetailsWithdata(data) { return this._formBuilder.group({ - business_assets_mode: [data.business_assets_mode, Validators.compose([Validators.required])], + business_assets_mode: [data.business_assets_mode], business_details: this._formBuilder.array([]), - business_approximate_market_value: [data.business_approximate_market_value, Validators.compose([])], - business_name_of_the_owner: [data.business_name_of_the_owner, Validators.compose([])], + business_approximate_market_value: [data.business_approximate_market_value], + business_name_of_the_owner: [data.business_name_of_the_owner], // other_owner:[data.other_owner || ''], // relation: [data.relation || ''], - // purchase_year: [data.purchase_year, Validators.compose([])], - // purchase_month: [data.purchase_month, Validators.compose([])], + // purchase_year: [data.purchase_year], + // purchase_month: [data.purchase_month], business_emi: [data.business_emi || 0], business_emi_paid: [data.business_emi_paid || ''], business_original_loan_tenure: [data.business_original_loan_tenure || ''], @@ -741,7 +771,7 @@ public m_investmentType = []; switch (assets_details_mode) { case '1': { const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadPropertyWithData2(data)); + control.push(this.loadPropertyWithData(data)); break; } case '2': { @@ -774,7 +804,7 @@ public m_investmentType = []; } case '8': { const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.otherAssetsDescriptionWithData(data)); + control.push(this.otherBusinessAssetsDescriptionWithData(data)); break; } default: { @@ -791,7 +821,7 @@ public m_investmentType = []; control.push(this.initDetails()); }else if(flag == 2){ const control = this._assetsQuesFrom.controls['business_assets_details']; - control.push(this.initBusinessDetails()); + control.push(this.initBusinessDetails(this.businessProfessionName)); } } removeLanguage(i: number,flag) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index afaceb53b..f25950d8d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -33,8 +33,7 @@ -
-
+ @@ -44,6 +43,12 @@ + + + {{list.name}} + +
- - - {{list.name}} - - + - + - +
- + - + {{ pm.name }} - +
@@ -75,7 +75,7 @@
Trading Product #{{l+1}}
- + {{ pm.name }} @@ -83,23 +83,23 @@ - + - +
- + - + {{ pm.name }} - +
@@ -142,18 +142,18 @@ - + - +
- + - + {{ pm.name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index 6f215861d..cd2bf8ef3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -22,7 +22,7 @@ + formControlName="existing_loan" > Yes No @@ -38,45 +38,51 @@ - + + formControlName="frequency" > {{freq.name}} - - + + - + + {{types.loan_type_name}} + + + + + - + {{owner.applicant_name}} - Others + - - + + - + {{ btLen.lender_name }} - + - + - +
+ +
+
+ Yes No +
+ +
+ +
- + {{"₹"}} {{balTxrfAmtInWords}} Only - + Yes No - + {{ btLen.lender_name }} - + - + {{"₹"}} {{topUpAmtInWords}} Only
- + {{"₹"}} {{ownContributionInWords}} Only - + {{ sour.name }} @@ -102,7 +118,7 @@
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index 0b227700e..f0405408d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -378,10 +378,10 @@ getM_sourceofamount() { } submitLoanDetails() { console.log('formData', this.loanDetailsForm.value); - if (!this.loanDetailsForm.valid) { - //this.notifier.notify('warning', 'Form Invaild Check all requried Field .!'); - return; - } + // if (!this.loanDetailsForm.valid) { + // //this.notifier.notify('warning', 'Form Invaild Check all requried Field .!'); + // return; + // } let records: any = {}; records.pdid = this.pdid; records.formid = this.form_id; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html index e8da740ae..d137527b2 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html @@ -57,11 +57,15 @@ - + Enter Valid Mobile Number. - + + + Enter Valid STD Code. + - + Enter Valid Landline Number. @@ -77,7 +81,7 @@ - +

Period of Relationship

diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index 9919dd140..ce94b7288 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -16,7 +16,7 @@ export class NeighbourHoodComponent implements OnInit { form_id:number; private notifier: NotifierService; check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] - default_reference_details: any= {'reference_name':'','mobile':'','landline':'','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''}; + default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''}; busineesRelationshipList:any=[]; @@ -128,10 +128,14 @@ export class NeighbourHoodComponent implements OnInit { // create reference check form array createReerenceCheck(elementValue:any){ + let stdcodesearch = elementValue.landline.search("-"); + let stdcode = elementValue.landline.substr(0,stdcodesearch); + let landline = elementValue.landline.substr(+stdcodesearch + 1,8); return this._fb.group({ reference_name: [elementValue.reference_name, Validators.required], mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])], - landline: [elementValue.landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], + std_code: [stdcode,Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], + landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], location:[elementValue.location,Validators.required], relationship_with:[elementValue.relationship_with,Validators.required], others: [elementValue.others], @@ -217,7 +221,7 @@ export class NeighbourHoodComponent implements OnInit { referencecheck_list.push({ "reference_name":element.reference_name, "mobile":element.mobile, - "landline":element.landline, + "landline":element.std_code+'-'+element.landline, "location":element.location, "relationship_with":element.relationship_with, "others":element.others, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts index 1e7bb0909..c827957b0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts @@ -104,7 +104,7 @@ public viewerOptions: any = { } } } else { - control.push(this.createDetail()); + //control.push(this.createDetail()); } }) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html index ea0fce859..746983219 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html @@ -27,43 +27,43 @@

{{a+1}} . Raw Material

- + - + Yes No - + + formControlName="raw_uom" > {{uom.name}} - + - - + + {{"₹"}} {{M_rawValueInWords}} Only - + - + Yes No Please comment on the stock level observed? - +
+ + + +

Service Provider

+
+
Service Provider Details Not applicable here !!
+
@@ -509,7 +516,7 @@
Remarks - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index 9eff1689c..d220137bd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts @@ -40,14 +40,23 @@ export class StockComponent implements OnInit { public uomData : any = []; rawmaterial : any; - goodsValueInWords : any; - rawValueInWords : any; - tradedGoodsValueInWords : any; + + M_rawValueInWords : any; + + M_goodsValueInWords : any; + R_goodsValueInWords : any; + T_goodsValueInWords : any; + + M_tradedGoodsValueInWords : any; + R_tradedGoodsValueInWords : any; + T_tradedGoodsValueInWords : any; + rawMaterialAccess: boolean; finishedGoodsAccess: boolean; tradeConcernAccess: boolean; public submitted = false; noRecordsFound: Boolean = false; + serviceProviderForm: Boolean = false; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -85,37 +94,27 @@ export class StockComponent implements OnInit { // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); // }) - this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { - // if(data.dataStatus === undefined){ - let datas = { - "profession_name": "Others", - "type_of_activity": [ - { - "type_of_activity_id": 1, - "name": "Manufacturing Details" - }, - { - "type_of_activity_id": 2, - "name": "Retail trading" - }, - { - "type_of_activity_id": 3, - "name": "Trading Concern" - }, - { - "type_of_activity_id": 4, - "name": "Service Provider" - } - ] - }; - this.initstockForms(datas.type_of_activity); - // }else { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // this.noRecordsFound = false; - // } + //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( + this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => { + + if(data.dataStatus == true){ + let datas = data.records; + if(datas.type_of_activity != undefined){ + this.initstockForms(datas.type_of_activity) + } + else{ + this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); + } + }else if(data.dataStatus == false) + { + this.notifier.notify('warning', data.msg); + return; + } + else{ + return; + } }, err => { - - this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); + this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); this.noRecordsFound = false; }) @@ -123,7 +122,7 @@ export class StockComponent implements OnInit { } public initstockForms(record){ - +console.log(record); let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; @@ -133,7 +132,7 @@ export class StockComponent implements OnInit { let dataForm = value.records; if(dataForm !== undefined) { - console.log('dtaForm',dataForm); + this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], @@ -142,7 +141,12 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id === 1); + + let arr0 = Object.keys(record).map(function (key) { + return record[key]; + }); + let arr = record.filter(data => data.type_of_activity_id == 1); + if(arr.length > 0) { let retail_finished_goods; let manufacturing_raw_materials; @@ -175,7 +179,7 @@ export class StockComponent implements OnInit { manufacturing_temparr['manufacturing_traded_goods'] = manufacturing_traded_goods;manufacturing_temparr['manufacturing_finished_goods'] = manufacturing_finished_goods;manufacturing_temparr['manufacturing_raw_materials'] = manufacturing_raw_materials; this.initManufacturingDetails(manufacturing_temparr); } - let arr1 = record.filter(data => data.type_of_activity_id === 2); + let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { let retail_finished_goods; let retail_traded_goods; @@ -199,7 +203,7 @@ export class StockComponent implements OnInit { retail_temparr['retail_finished_goods'] = retail_finished_goods; this.initRetailDetails(retail_temparr); } - let arr2 = record.filter(data => data.type_of_activity_id === 3); + let arr2 = record.filter(data => data.type_of_activity_id == 3); if(arr2.length > 0) { let trading_finished_goods; let trading_traded_goods; @@ -223,10 +227,14 @@ export class StockComponent implements OnInit { trading_temparr['trading_traded_goods'] = trading_traded_goods; this.initTradingDetails(trading_temparr); } + let arr3 = record.filter(data => data.type_of_activity_id == 4); + if(arr3.length > 0) { + this.serviceProviderForm = true; + } this.noRecordsFound = true; } else{ - console.log('dataForm',dataForm); + // console.log('dataForm',dataForm); this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], @@ -235,21 +243,21 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id === 1); + let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { this.initManufacturingDetails(null); } - let arr1 = record.filter(data => data.type_of_activity_id === 2); + let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { this.initRetailDetails(null); } - let arr2 = record.filter(data => data.type_of_activity_id === 3); + let arr2 = record.filter(data => data.type_of_activity_id == 3); if(arr2.length > 0) { this.initTradingDetails(null); } - let arr3 = record.filter(data => data.type_of_activity_id === 4); + let arr3 = record.filter(data => data.type_of_activity_id == 4); if(arr3.length > 0) { - //this.serviceProviderForm = true; + this.serviceProviderForm = true; } this.noRecordsFound = true; } @@ -263,21 +271,21 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id === 1); + let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { this.initManufacturingDetails(null); } - let arr1 = record.filter(data => data.type_of_activity_id === 2); + let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { this.initRetailDetails(null); } - let arr2 = record.filter(data => data.type_of_activity_id === 3); + let arr2 = record.filter(data => data.type_of_activity_id == 3); if(arr2.length > 0) { this.initTradingDetails(null); } - let arr3 = record.filter(data => data.type_of_activity_id === 4); + let arr3 = record.filter(data => data.type_of_activity_id == 4); if(arr3.length > 0) { - //this.serviceProviderForm = true; + this.serviceProviderForm = true; } this.noRecordsFound = true; } @@ -292,9 +300,12 @@ export class StockComponent implements OnInit { } manufacturingForm: Boolean = false; - manufacturingFormCreation(val) { - let arr = val.filter(data => data.type_of_activity_id === 1); + manufacturingFormCreation(record) { + console.log(record); + let arr = record.filter(data => data.type_of_activity_id == 1); + console.log(arr); if (arr.length > 0) { + console.log(arr.length); this.manufacturingForm = true; return this.fb.group({ manufacturing_raw_materials: this.fb.array([]), @@ -309,7 +320,8 @@ export class StockComponent implements OnInit { retailForm: Boolean = false; retailFormCreation(val) { - let arr = val.filter(data => data.type_of_activity_id === 2); + + let arr = val.filter(data => data.type_of_activity_id == 2); if (arr.length > 0) { this.retailForm = true; return this.fb.group({ @@ -324,7 +336,7 @@ export class StockComponent implements OnInit { tradingForm: Boolean = false; tradingFormCreation(val) { - let arr = val.filter(data => data.type_of_activity_id === 3); + let arr = val.filter(data => data.type_of_activity_id == 3); if (arr.length > 0) { this.tradingForm = true; return this.fb.group({ @@ -350,32 +362,39 @@ export class StockComponent implements OnInit { const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; if(datas === null){ - console.log(299,'if'); + // console.log(299,'if'); // rawMaterial.push(this.createRawmaterial(null)); // finishedGoods.push(this.createGoods(null)); // tradedGoods.push(this.createTradedGoods(null)); } else { - console.log(305,'else') + // console.log(305,'else') for (let val of datas.manufacturing_raw_materials) { - console.log(val); - + // console.log(val); + if(val.raw_value){ + this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); + } rawMaterial.push(this.createRawmaterial(val)); + } for (let val of datas.manufacturing_finished_goods) { - console.log(val); - + // console.log(val); + if(val.goods_value){ + this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + } finishedGoods.push(this.createGoods(val)); } for (let val of datas.manufacturing_traded_goods) { - console.log(val); - + // console.log(val); + if(val.estimated_traded_goods_value){ + this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + } tradedGoods.push(this.createTradedGoods(val)); } - console.log(310,rawMaterial); + // console.log(310,rawMaterial); } } @@ -439,13 +458,19 @@ export class StockComponent implements OnInit { } else { for (let val of datas.retail_finished_goods) { - console.log(val); - + // console.log(val); + + if(val.goods_value){ + this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + } finishedGoods.push(this.createGoods(val)); } for (let val of datas.retail_traded_goods) { - console.log(val); + // console.log(val); + if(val.estimated_traded_goods_value){ + this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + } tradedGoods.push(this.createTradedGoods(val)); } @@ -521,13 +546,18 @@ export class StockComponent implements OnInit { // } for (let val of datas.trading_finished_goods) { - console.log(val); - + // console.log(val); + if(val.goods_value){ + this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + } finishedGoods.push(this.createGoods(val)); } for (let val of datas.trading_traded_goods) { - console.log(val); + // console.log(val); + if(val.estimated_traded_goods_value){ + this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + } tradedGoods.push(this.createTradedGoods(val)); } @@ -749,15 +779,28 @@ export class StockComponent implements OnInit { /** To Convert Amount into Words */ inWords(e,flag:number){ + switch(flag){ case 1 : - this.rawValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value); break; case 2 : - this.goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); break; case 3 : - this.tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 4 : + this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 5 : + this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 6 : + this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + break; + case 7 : + this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); break; default: break; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index b43043049..982ab5fdf 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -17,26 +17,26 @@
Raw Material #{{l+1}}
- + - + - +
- + - + {{ pm.name }} - +
@@ -70,26 +70,26 @@
Trading Product #{{l+1}}
- + - + - +
- + - + {{ pm.name }} - +
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 7f6e2a2a5..a79735f1e 100755 --- 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 @@ -24,12 +24,11 @@
{{quesIndex+1}}
-
- + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss index 38778876d..ce04f2137 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss @@ -60,7 +60,7 @@ mat-card .child_mat_card > mat-card { transition: box-shadow 0.5s, transform 0.5s; &:hover { cursor: pointer; - background-color: #e00201 !important; + // background-color: #e00201 !important; transform: scale(1); box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); } 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 d1a7e83ec..70d19e4b3 100755 --- 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 @@ -40,141 +40,10 @@ export class StartPdComponent implements OnInit, OnDestroy { selectedCategory: any = []; categoryList: any = []; pdMasterList: any = []; - optionsForm: FormGroup; - checkBoxForm: FormGroup; - textBoxForm: FormGroup; - next: number; - previous: number; - selectedCategoryIndex: number; - selectedQuestionIndex: number; - getQuestionsLength: number; - answerList: any = []; - ansPDList: any = []; - relationDetails: any = [1]; - rentalDetail: any = { form_id: "16", form_name: "Rental Information", isAnswered: true} -// errorMessage:any; -// selectedCategory:any=[]; -// categoryList: any=[]; -// pdMasterList: any=[]; -// optionsForm: FormGroup; -// checkBoxForm:FormGroup; -// textBoxForm:FormGroup; -// next:number; -// previous:number; -// selectedCategoryIndex:number; -// selectedQuestionIndex:number; -// getQuestionsLength:number; -// answerList:any=[]; -// ansPDList:any=[]; - - -// category static form buttons - // categoryFormButtons: any = [ - // { - // "form_id": 1, - // "form_name": "Supplier Details" - // }, - // { - // "form_id": 2, - // "form_name": "Client Details", - // }, - // { - // "form_id": 3, - // "form_name": "Personal Details", - // }, - // { - // "form_id":4, - // "form_name":"Asset Details", - // }, - // { - // "form_id": 5, - // "form_name": "Address" - // }, - // { - // "form_id": 6, - // "form_name": "Family", - // }, - // { - // "form_id": 7, - // "form_name": "Banking", - // }, - // { - // "form_id": 8, - // "form_name": "Current Loan", - // }, - // { - // "form_id": 9, - // "form_name": "Other Income", - // }, - // { - // "form_id": 10, - // "form_name": "Loan Details", - // }, - // { - // "form_id": 11, - // "form_name": "Stock", - // }, - // { - // "form_id": 12, - // "form_name": "Employmet Info", - // }, - // { - // "form_id": 13, - // "form_name": "Business Info", - // }, - // { - // "form_id": 14, - // "form_name": "Financial Info", - // }, - // ]; - -pdFullDetails:any=[]; + pdFullDetails:any=[]; // category static form buttons categoryFormButtons: any; - // = [ - // { - // "form_id": 1, - // "form_name": "Supplier Details" - // }, - // { - // "form_id": 2, - // "form_name": "Client Details", - // }, - // { - // "form_id": 3, - // "form_name": "Personal Details", - // }, - // { - // "form_id":4, - // "form_name":"Asset Details", - // }, - // { - // "form_id": 5, - // "form_name": "Address" - // }, - // { - // "form_id": 6, - // "form_name": "Family", - // }, - // { - // "form_id": 7, - // "form_name": "Banking", - // }, - // { - // "form_id": 8, - // "form_name": "Current Loan", - // }, - // { - // "form_id": 9, - // "form_name": "Other Income", - // }, - // { - // "form_id": 10, - // "form_name": "Loan Details", - // }, - - // ]; formsCategoryEnable: boolean = false; selectedFormsCategory: any; // create values for status check @@ -190,15 +59,8 @@ pdFullDetails:any=[]; currentPDStatus: string; actualQuestions: number; answeredQuestions: number; - - - - // start - - // end private notifier: NotifierService; - constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) { @@ -221,8 +83,6 @@ pdFullDetails:any=[]; } this.loadTemplates(this.startPD); - this.next = 1; - this.previous = 2; } // start @@ -237,93 +97,23 @@ pdFullDetails:any=[]; return bool; } -// load pd template details - -// loadTemplates(startID: string) { -// this._pd.loadPDTemplates(startID).subscribe( -// data => { -// if (data.status == 200) { -// this.pdMasterList = data.records.pdmaster_details; -// this.categoryList = data.records.question_answers; -// let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); -// this.mainApplicantName = filterApplicantName[0].applicant_name; -// this.currentPDStatus = data.records.pdmaster_details.pd_status; -// -// this.actualQuestions = data.records.counts.overall_question_count; -// this.answeredQuestions = data.records.counts.overall_answered_count; -// -// } -// else { -// this.pdMasterList = ""; -// this.mainApplicantName = ""; -// this.categoryList = []; -// this.currentPDStatus = ""; -// } -// }, error => this.errorMessage = error); -// } -// loadTemplates(startID: string) { -// this._pd.loadPDTemplates(startID).subscribe( -// data => { -// if (data.status == 200) { -// this.pdMasterList = data.records.pdmaster_details; -// this.categoryList = data.records.question_answers; -// // this.categoryFormButtons = data.records.template_forms; -// let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); -// this.mainApplicantName = filterApplicantName[0].applicant_name; -// this.currentPDStatus = data.records.pdmaster_details.pd_status; -// -// this.actualQuestions = data.records.counts.overall_question_count; -// this.answeredQuestions = data.records.counts.overall_answered_count; -// -// this.pdFullDetails = data.records -// } -// else { -// this.pdMasterList = ""; -// this.mainApplicantName = ""; -// this.categoryList = []; -// this.currentPDStatus = ""; -// } -// }, error => this.errorMessage = error); -// } - - ngOnDestroy(): void { - this.listPDComponent.showListView(true); - } - - isOver(): boolean { return window.matchMedia(`(max-width: 960px)`).matches; } - OnSelectDirectQuestions(selectedQuestions: any, categoryIndex: number, questionsIndex: number) { - this.formsCategoryEnable = false; - this.selectedCategory = selectedQuestions; - this.selectedCategoryIndex = categoryIndex; - this.selectedQuestionIndex = questionsIndex; - - let serachQuestions = { - "question_id": selectedQuestions.fk_question_id, - "pd_id": this.startPD, - "template_id": selectedQuestions.fk_template_id, - "category_id": selectedQuestions.fk_template_question_category_id - } - this.getAnswers(serachQuestions); - } - loadTemplates(startID:string){ this._pd.loadPDTemplates(startID).subscribe( data => { if (data.status == 200) { this.pdMasterList=data.records.pdmaster_details; - this.categoryList=data.records.question_answers; - this.categoryFormButtons = data.records.template_forms; + // this.categoryList=data.records.question_answers; let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); this.mainApplicantName = filterApplicantName[0].applicant_name; this.currentPDStatus = data.records.pdmaster_details.pd_status; - - this.actualQuestions = data.records.counts.overall_question_count; - this.answeredQuestions = data.records.counts.overall_answered_count; - + this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]); + this.actualQuestions = this.categoryFormButtons.length; + let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered==true); + this.answeredQuestions = getAnsweredFormsCount.length; this.pdFullDetails = data.records @@ -339,292 +129,7 @@ pdFullDetails:any=[]; }); } - // load question based answer list - getAnswers(serachList: any) { - this.answerList = []; - this._pd.getAnswersForPD(serachList).subscribe( - data => { - if (data.status == 200) { - this.answerList = data.records.answers; - this.ansPDList = data.records; - this.actualQuestions = data.records.counts.overall_question_count, - this.answeredQuestions = data.records.counts.overall_answered_count - - // this for options type questions - if (this.selectedCategory.fk_question_answertype == 1) { - this.loadOtionsForm(this.selectedCategory, this.answerList); - } - //this for text box type questions - else if (this.selectedCategory.fk_question_answertype == 2) { - - this.loadTextBoxForm(this.selectedCategory, this.answerList); - } -//this for check box type questions - else if (this.selectedCategory.fk_question_answertype == 3) { - - this.loadCheckBoxForm(this.selectedCategory, this.answerList); - } - } - }, error => this.errorMessage = error); - - - } - - // load check box form - - loadCheckBoxForm(selectedCategory: any, ansItem: any) { - // create checkbox group - let checkboxGroup = new FormArray(ansItem.map(item => new FormGroup({ - fk_pd_id: new FormControl(this.startPD), - pd_detail_answer_id: new FormControl(item.pd_detail_answer_id), - pd_answer_id: new FormControl(item.question_answer_id), - pd_answer: new FormControl(item.answer), - pd_answer_weightage: new FormControl(item.template_answer_weightage), - checkbox: new FormControl(item.isactive == null ? false : true) - }))); - // create documents group - let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({ - pd_document_title: new FormControl(item.pd_document_title), - pd_document_url: new FormControl(item.pd_document_name), - - }))); - - // create a hidden reuired formControl to keep status of checkbox group - let hiddenControl = new FormControl(this.mapItems(checkboxGroup.value), Validators.required); - // update checkbox group's value to hidden formcontrol - checkboxGroup.valueChanges.subscribe((v) => { - hiddenControl.setValue(this.mapItems(v)); - }); - - - this.checkBoxForm = new FormGroup({ - pd_detail_id: new FormControl(this.ansPDList.pd_detail_id), - fk_pd_id: new FormControl(this.startPD), - fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id), - fk_question_id: new FormControl(this.selectedCategory.fk_question_id), - pd_question: new FormControl(this.selectedCategory.question), - pd_question_weightage: new FormControl(this.selectedCategory.question_weightage), - pd_answer_remark: new FormControl(this.ansPDList.question_remark), - items: checkboxGroup, - selectedItems: hiddenControl, - documents: documentsGroup - }); - } - - // map options form group values - mapItems(items) { - let selectedItems = items.filter((item) => item.checkbox).map((item) => item); - return selectedItems.length ? selectedItems : null; - } - - // load Options form - loadOtionsForm(selectedCategory: any, ansItem: any) { - // create options type group - let optionsGroup = new FormArray(ansItem.map(item => new FormGroup({ - fk_pd_id: new FormControl(this.startPD), - pd_detail_answer_id: new FormControl(item.pd_detail_answer_id), - pd_answer_id: new FormControl(item.question_answer_id), - pd_answer: new FormControl(item.answer), - pd_answer_weightage: new FormControl(item.template_answer_weightage), - options: new FormControl(item.isactive == null ? false : true) - }))); - - // create documents group - let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({ - pd_document_title: new FormControl(item.pd_document_title), - pd_document_url: new FormControl(item.pd_document_name), - - }))); - - // create a hidden reuired formControl to keep status of checkbox group - let hiddenControl = new FormControl(this.optionsMapItems(optionsGroup.value), Validators.required); - let checkedItem = hiddenControl.value != null ? new FormControl(hiddenControl.value[0].pd_answer_id) : new FormControl(null); - - this.optionsForm = new FormGroup({ - pd_detail_id: new FormControl(this.ansPDList.pd_detail_id), - fk_pd_id: new FormControl(this.startPD), - fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id), - fk_question_id: new FormControl(this.selectedCategory.fk_question_id), - pd_question: new FormControl(this.selectedCategory.question), - pd_question_weightage: new FormControl(this.selectedCategory.question_weightage), - pd_answer_remark: new FormControl(this.ansPDList.question_remark), - items: optionsGroup, - selectedItems: hiddenControl, - modelValue: checkedItem, - documents: documentsGroup - - }); - this.optionsForm.controls.modelValue.valueChanges.subscribe((v) => { - hiddenControl.setValue(this.updateOptionsMapItems(v, optionsGroup.value)); - }); - - } - -// map option type group values - optionsMapItems(items) { - - let optionSelectedItems = items.filter((item) => item.options == true).map((item) => item); - return optionSelectedItems.length ? optionSelectedItems : null; - } - - // map options type while change options - updateOptionsMapItems(key, items) { - - let updateSelectedItems = items.filter((item) => item.pd_answer_id == key).map((item) => item); - return updateSelectedItems.length ? updateSelectedItems : null; - } - - // load text box form - loadTextBoxForm(selectedCategory: any, ansItem: any) { - // create text box type group - let textGroup = new FormArray(ansItem.map(item => new FormGroup({ - fk_pd_id: new FormControl(this.startPD), - pd_detail_answer_id: new FormControl(item.pd_detail_answer_id), - pd_answer_id: new FormControl(item.question_answer_id), - pd_answer: new FormControl(item.pd_answer), - pd_answer_weightage: new FormControl(item.template_answer_weightage), - text: new FormControl(item.pd_detail_answer_id == null ? false : true) - }))); - - // create documents group - let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({ - pd_document_title: new FormControl(item.pd_document_title), - pd_document_url: new FormControl(item.pd_document_name), - - }))); - - this.textBoxForm = new FormGroup({ - pd_detail_id: new FormControl(this.ansPDList.pd_detail_id), - fk_pd_id: new FormControl(this.startPD), - fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id), - fk_question_id: new FormControl(this.selectedCategory.fk_question_id), - pd_question: new FormControl(this.selectedCategory.question), - pd_question_weightage: new FormControl(this.selectedCategory.question_weightage), - pd_answer_remark: new FormControl(this.ansPDList.question_remark), - items: textGroup, - documents: documentsGroup - }); - } - - // next save and previous save for options and check box type questions - saveNextPrevious(details: any, type: number) { - - let fetchAns = []; - details.selectedItems.value.forEach((itemElement, itemIndex) => { - let obj1 = { - fk_pd_detail_id: details.pd_detail_id.value, - fk_pd_id: itemElement.fk_pd_id, - pd_detail_answer_id: itemElement.pd_detail_answer_id, - pd_answer_id: itemElement.pd_answer_id, - pd_answer: itemElement.pd_answer, - pd_answer_weightage: itemElement.pd_answer_weightage, - } - fetchAns.push(obj1) - }); - - let pd_details: any = [{ - "pd_detail_id": details.pd_detail_id.value, - "fk_pd_id": details.fk_pd_id.value, - "fk_category_id": details.fk_category_id.value, - "fk_question_id": details.fk_question_id.value, - "pd_question": details.pd_question.value, - "pd_question_weightage": details.pd_question_weightage.value, - "question_remark": details.pd_answer_remark.value, - "answers": fetchAns, - "images": [] - }]; - this._pd.savePDQuestions(pd_details).subscribe(result => { - if (result.status == 200) { - if (type == 1) { - this.skipNextPrevious(this.next); - } - else { - this.skipNextPrevious(this.previous); - } - } - }, error => { - }); - } - - // next save and previous save for text type questions - saveNextPreviousText(details: any, type: number) { - let fetchAns = []; - details.items.value.forEach((itemElement, itemIndex) => { - let obj1 = { - fk_pd_detail_id: details.pd_detail_id.value, - fk_pd_id: itemElement.fk_pd_id, - pd_detail_answer_id: itemElement.pd_detail_answer_id, - pd_answer_id: itemElement.pd_answer_id, - pd_answer: itemElement.pd_answer, - pd_answer_weightage: itemElement.pd_answer_weightage, - } - fetchAns.push(obj1) - }); - let pd_details: any = [{ - "pd_detail_id": details.pd_detail_id.value, - "fk_pd_id": details.fk_pd_id.value, - "fk_category_id": details.fk_category_id.value, - "fk_question_id": details.fk_question_id.value, - "pd_question": details.pd_question.value, - "pd_question_weightage": details.pd_question_weightage.value, - "question_remark": details.pd_answer_remark.value, - "answers": fetchAns, - "images": [] - }]; - this._pd.savePDQuestions(pd_details).subscribe(result => { - if (result.status == 200) { - if (type == 1) { - this.skipNextPrevious(this.next); - } - else { - this.skipNextPrevious(this.previous); - } - } - }, error => { - }); - } - - // skip to previous and next questions - - skipNextPrevious(type: number) { - // for skip to next - if (type == 1) { - if (this.categoryList.length > this.selectedCategoryIndex) { - let nextCatList = this.categoryList[this.selectedCategoryIndex]; - this.selectedQuestionIndex = this.selectedQuestionIndex < nextCatList.questions.length - 1 ? this.selectedQuestionIndex + 1 : this.selectedQuestionIndex; - let nextQuesList = nextCatList.questions[this.selectedQuestionIndex]; - this.selectedCategory = nextQuesList; - this.selectedCategoryIndex = this.selectedCategoryIndex; - this.selectedQuestionIndex = this.selectedQuestionIndex; - let serachQuestions = { - "question_id": nextQuesList.fk_question_id, - "pd_id": this.startPD, - "template_id": nextQuesList.fk_template_id, - "category_id": nextQuesList.fk_template_question_category_id - } - this.getAnswers(serachQuestions); - } - } - // for skip to previous - else if (type == 2) { - if (this.categoryList.length > this.selectedCategoryIndex) { - let preCatList = this.categoryList[this.selectedCategoryIndex]; - this.selectedQuestionIndex = this.selectedQuestionIndex == 0 ? this.selectedQuestionIndex : this.selectedQuestionIndex - 1; - let preQuesList = preCatList.questions[this.selectedQuestionIndex]; - this.selectedCategory = preQuesList; - this.selectedCategoryIndex = this.selectedCategoryIndex; - this.selectedQuestionIndex = this.selectedQuestionIndex; - let serachQuestions = { - "question_id": preQuesList.fk_question_id, - "pd_id": this.startPD, - "template_id": preQuesList.fk_template_id, - "category_id": preQuesList.fk_template_question_category_id - } - this.getAnswers(serachQuestions); - } - - } - } + //change pd status changePDStatus(status: string) { @@ -916,12 +421,12 @@ pdFullDetails:any=[]; } - + ngOnDestroy(): void { + this.listPDComponent.showListView(true); + } // load pd view component loadPdViewCompoent() { this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route}); } - - -// end + } 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 3c7d65a08..8c26e9ebf 100755 --- 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 @@ -82,10 +82,18 @@

- -  {{applicant.applicant_name}}     - -  {{applicant.mobile_no}}
Main Applicant + +  {{applicant.applicant_name}} +     + + +  {{applicant.mobile_no}} +     + + +  {{applicant.landline}} + +
Main Applicant {{applicant.relation_name}}

diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index e45388092..0cec83e9f 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -40,14 +40,12 @@ export class PdTrigerService { // get add pd master details getAllMasterDatas(TableName: string): Observable { - console.log('table', TableName); return this._http.post(this.apiUrl + 'getListOfMaster', {"master_name": TableName}) .pipe( catchError(this.handleError('role', [])) ) } saveForm(records: any): Observable { - console.log('table', records); records.fk_createdby = this._aws.getlocale(); let params = {records} return this._http.post(this.apiUrl + 'savePDFormDetails', params) @@ -56,7 +54,6 @@ export class PdTrigerService { ) } retriveForm(params): Observable { - console.log('data', params); return this._http.post(this.apiUrl + 'getPDFormDetails', params) .pipe( catchError(this.handleError('role', [])) 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 76b13c847..fd3aa26fb 100755 --- 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 @@ -11,7 +11,7 @@
- +
person{{master.pd_allocated_to | titlecase}}    @@ -80,6 +80,30 @@

No Applicant

+
+ + +
+ +
+ + Additional Requirements + + + + + +

{{requirement.add_requirement}}

+
+
+
+

No Additional Requirements

+
+ + + + +
diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index 5aebabbe6..0dcaefe8e 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -11,7 +11,8 @@ import { TelePdAllocationComponent } from './../../../personal-discussion/manage import { SchedulePdComponent } from './../../../personal-discussion/manage-pd/list-pd/schedule-pd/schedule-pd.component'; import { EditPdApplicantComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component'; import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component'; - +import { PdRequirementComponent } from './../../../personal-discussion/manage-pd/list-pd/pd-requirement/pd-requirement.component'; +import {DatePipe } from '@angular/common'; @Component({ selector: 'app-qc-view', templateUrl: './qc-view.component.html', @@ -19,6 +20,7 @@ import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/ encapsulation: ViewEncapsulation.None }) export class QcViewComponent implements OnInit, OnDestroy { + pipe = new DatePipe('en-US'); public selectedMoment = new Date(); private notifier:NotifierService; errorMessage: any; @@ -31,7 +33,8 @@ export class QcViewComponent implements OnInit, OnDestroy { viewParams:any; destroyType:number=1; currentPDStatus:string; - + pdAdditionalReqData: any=[]; + enableStartPD: boolean; // create values for status check pdStatusCheck :any={ "DRAFT" :'DRAFT', @@ -46,6 +49,7 @@ export class QcViewComponent implements OnInit, OnDestroy { constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) { this.notifier=notifier + this.enableStartPD=false; } ngOnInit() { @@ -64,8 +68,25 @@ export class QcViewComponent implements OnInit, OnDestroy { this.pdApplicantData= data.records.applicants_details; this.pdDocumentsData=data.records.pd_documnets; this.masterPdLogsData=data.records.pd_logs.master; + this.pdAdditionalReqData = data.records.pd_additional_requirements; //this.applicantPDLogsData= data.records.pd_logs.master; this.currentPDStatus = data.records.pd_master_details[0].pd_status; + // enable pd start time + if(data.records.pd_master_details[0].scheduled_on_for_validation){ + let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm'); + let scheduledDateTime: string=data.records.pd_master_details[0].scheduled_on_for_validation; + let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime); + let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60); + if(diffInHours>=-4){ + this.enableStartPD=true; + } + else { + this.enableStartPD=false; + } + } + else { + this.enableStartPD=false; + } } }, error => this.errorMessage = error); @@ -84,6 +105,8 @@ export class QcViewComponent implements OnInit, OnDestroy { } const dialogPDMaster = this.dialog.open(EditPdMasterComponent, { data: record, + position: { right: '0'}, + width: '80%', disableClose: true }); dialogPDMaster.afterClosed() @@ -99,6 +122,8 @@ export class QcViewComponent implements OnInit, OnDestroy { } const dialogApplicant = this.dialog.open(EditPdApplicantComponent, { data: setPdDetails, + position: { right: '0'}, + width: '60%', disableClose: true }); dialogApplicant.afterClosed() @@ -107,6 +132,24 @@ export class QcViewComponent implements OnInit, OnDestroy { this.viewPdDetails(this.viewID) }); } + // edit pd addtional requirements + editAdditionalRequirement(requirementData:any){ + let setPdDetails = { + "pdID":this.viewID, + "records":requirementData + } + const dialogRequirement = this.dialog.open(PdRequirementComponent, { + data: setPdDetails, + position: { right: '0'}, + width: '60%', + disableClose: true + }); + dialogRequirement.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + this.viewPdDetails(this.viewID) + }); + } // pd allocation to pdAllocationTo(pdData:any) { if(pdData.fk_pd_type == 1){ diff --git a/ng6-seed/src/app/settings/service/entity/entity.service.ts b/ng6-seed/src/app/settings/service/entity/entity.service.ts index d40a3639e..8fb6020ae 100755 --- a/ng6-seed/src/app/settings/service/entity/entity.service.ts +++ b/ng6-seed/src/app/settings/service/entity/entity.service.ts @@ -11,10 +11,10 @@ import { environment } from 'environments/environment'; /** Imported Service Files Are., */ import { AwsService } from '../../../AwsService/aws.service'; + /** Consant Value For Created Date And Updated Date */ const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' '); - @Injectable({ providedIn: 'root' }) @@ -24,6 +24,7 @@ const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' '); * Kdk */ export class EntityService { + private apiUrl = environment.apiEndpoint; private serviceUrl = 'https://jsonplaceholder.typicode.com/users';