diff --git a/ng6-seed/angular.json b/ng6-seed/angular.json index 65f5ce492..d9ae0d73e 100755 --- a/ng6-seed/angular.json +++ b/ng6-seed/angular.json @@ -86,7 +86,7 @@ "fileReplacements": [ { "replace": "src/environments/environment.ts", - "with": "src/environments/environment.stage.ts" + "with": "src/environments/environment.prod.ts" }] } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index f6e9e3076..407c62939 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -237,7 +237,18 @@ export class BusinessAssetsInfoComponent implements OnInit { this.pdTrigerService.getVendorDatas('business_assets',this.pdid).subscribe(result=>{ if(result) { let ParCtrls = this._businessAssetsQuesFrom.controls.business_assets_for_address; - + let business_is_pd_visited_yes_value:String='' + if(result.records.business_is_pd_visited == 'yes') { + if(result.records.business_is_pd_visited_yes.length>0) { + business_is_pd_visited_yes_value = result.records.business_is_pd_visited_yes.toString(); + console.log("bb",business_is_pd_visited_yes_value.includes('Others')) + if(business_is_pd_visited_yes_value.includes('Others')) { + business_is_pd_visited_yes_value = business_is_pd_visited_yes_value.replace('Others (Please specify)',result.records.specify_pd_visited) + console.log(business_is_pd_visited_yes_value) + } + this._businessAssetsQuesFrom.controls.business_assets_form_remark.setValue(business_is_pd_visited_yes_value); + } + } let assetCtrl: any = ParCtrls.controls[0]; result.records.business_address_availability ='yes' console.log("Vendor Datas",result.records) 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 0d9f911e2..837d09678 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 @@ -2033,6 +2033,23 @@ +
+ + + Yes + No + Not Applicable + + Rent Agreement Required + + + + + +

Rent Agreement Image

+
+
+
{ + if(this.fk_pd_type == '2') { + this.businessForm.addControl('rent_agreement',new FormControl('',Validators.compose([Validators.required]))) + } let businessVal = data.records; let constVal: any; @@ -647,6 +650,7 @@ export class BusinessInfoComponent implements OnInit { if(data.records.export_import_cert =='yes'){ this.businessForm.addControl('export_import_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('export_import_cert_pic');} if(data.records.fire_noc =='yes'){ this.businessForm.addControl('fire_noc_pic', new FormControl('')); }else{ this.businessForm.removeControl('fire_noc_pic');} if(data.records.eb_bill =='yes' && data.records.manufacturing_activity_details.length > 0){ this.businessForm.addControl('eb_bill_pic', new FormControl('')); }else{ this.businessForm.removeControl('eb_bill_pic');} + if(data.records.rent_agreement =='yes' && this.fk_pd_type == '2'){ this.businessForm.addControl('rent_agreement_pic', new FormControl('')); }else{ this.businessForm.removeControl('rent_agreement_pic');} this.businessForm.patchValue(businessVal); // console.log('this.businessForm',this.businessForm); } else { @@ -717,9 +721,13 @@ export class BusinessInfoComponent implements OnInit { // individualsControl.patchValue(result.records.individuals); result.records.documents_info.forEach(val=>{ if(val) { - if(this.businessForm.value[val.document_name] != 'yes') { + if(!this.businessForm.value[val.document_name] || this.businessForm.value[val.document_name] != 'yes') { this.businessForm.addControl(val.document_name+'_pic', new FormControl(val.document_image)); } + else { + console.log("Else part",val.document_name) + this.businessForm.controls[val.document_name+'_pic'].patchValue(val.document_image) + } // result.records[val.document_name+'_pic'] =val.document_image result.records[val.document_name] = 'yes' } @@ -2127,6 +2135,7 @@ export class BusinessInfoComponent implements OnInit { if(Flag == 3) {event.value =='yes' ? this.businessForm.addControl('export_import_cert_pic', new FormControl('')) : this.businessForm.removeControl('export_import_cert_pic');} if(Flag == 8) {event.value =='yes' ? this.businessForm.addControl('fire_noc_pic', new FormControl('')) : this.businessForm.removeControl('fire_noc_pic');} if(Flag == 9) {event.value =='yes' ? this.businessForm.addControl('eb_bill_pic', new FormControl('')) : this.businessForm.removeControl('eb_bill_pic');} + if(Flag == 10) {event.value =='yes' ? this.businessForm.addControl('rent_agreement_pic', new FormControl('')) : this.businessForm.removeControl('rent_agreement_pic');} } /* imageCrop(pic) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index e1d24b232..625303e55 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -31,7 +31,7 @@ Location - + Select @@ -141,7 +141,7 @@ Any additional visit (Godown /multiple rental properties)  
- + Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index e7f7b3c5a..bf676ed52 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -330,7 +330,12 @@ export class FinalRemarksComponent implements OnInit { // FOR GETTING THE COMMENTS API CALL getVendorComments() { this.pdTrigerService.getVendorDatas('COMMENTS',this.pdid).subscribe(result=>{ - this._finalRemarkForm.controls.final_form_remarks.patchValue(result.records.final_comments); + if(result.dataStatus) { + let comments:String =''; + comments = result.records.hasOwnProperty('final_visit_status') && result.records.final_visit_status != '' ? "Final Status of visit : "+result.records.final_visit_status+'\n' : '' + comments += result.records.final_comments + this._finalRemarkForm.controls.final_form_remarks.patchValue(comments); + } }) } /************************* END OF VENDOR FORM DATAS *********************************/ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index 09cb5b46e..52b8a6259 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -433,9 +433,26 @@ export class GeneralInfoComponent implements OnInit { let individualsControl = this._generalForm.controls['individuals']; console.log("Vendor Datas",result.records) individualsControl.patchValue(result.records.individuals); - if(result.records.general_remark) { - this._generalForm.controls.general_remark.patchValue(result.records.general_remark) + // if(result.records.general_remark) { + // this._generalForm.controls.general_remark.patchValue(result.records.general_remark) + // } + let newPersonMet:any = result.records + if(this.customer_segment_abbr == 'SAL') { + if(newPersonMet.person_met_entered) { + let commonRemarks = "Met "+newPersonMet.person_met_entered +", at the time of FI visit." + this._generalForm.controls.general_remark.patchValue(commonRemarks) + } + else if(newPersonMet.is_met_during_visit == 'no') { + let commonRemarks = " No one was met at the time of FI visit." + this._generalForm.controls.general_remark.patchValue(commonRemarks) + } } + else { + if(newPersonMet.person_met_entered && newPersonMet.designation_entered && newPersonMet.relation_entered && newPersonMet.relation_to) { + let commonRemarks = "Met "+newPersonMet.person_met_entered +" during visit, who is "+newPersonMet.designation_entered+" and "+newPersonMet.relation_entered+" of "+newPersonMet.relation_to + this._generalForm.controls.general_remark.patchValue(commonRemarks) + } + } console.log(this._generalForm.value) } }) 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 c814cf202..9925dbd43 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 @@ -208,9 +208,12 @@ export class StockComponent implements OnInit { } if (val.type_of_activity_id == 3) { if (val.products) { - let retail_temparr = []; + if(dataForm.retail_details[0]) { + let retail_temparr = [] retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods; this.initRetailDetails(retail_temparr); + } + else {this.initRetailDetails(null);} } } if (val.type_of_activity_id == 4) { @@ -221,13 +224,14 @@ export class StockComponent implements OnInit { trading_temparr['trading_traded_goods'] = dataForm.trade_details[0].trading_traded_goods ; this.initTradingDetails(trading_temparr); } + else {this.initTradingDetails(null);} } } if (val.type_of_activity_id == 5) { if (val.products) { // this.serviceProviderForm = true; let servicing_temparr = []; - if(dataForm.hasOwnProperty('servicing_details')){ + if(dataForm.hasOwnProperty('servicing_details') && dataForm.servicing_details[0]){ servicing_temparr['service_provider'] = dataForm.servicing_details[0].service_provider; this.initServicingDetails(servicing_temparr); } @@ -348,9 +352,79 @@ export class StockComponent implements OnInit { this.noRecordsFound = true; } } + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { + console.log(this.pd_all_details.pdmaster_details.vendor_status); + this.getDataFromVendor() + } }) } + /************************* START OF VENDOR FORM DATAS *********************************/ + + getDataFromVendor() { + + this._pd.getVendorDatas('stock',this.pdid).subscribe(result=>{ + if(result && result['dataStatus']) { + // let individualsControl = this._generalForm.controls['individuals']; + console.log("Vendor Datas",result.records) + if(result.records.is_stock_photo) { + + let manufacturingArray = this.stockForms.get('manufacturing_details') as FormArray + console.log("Check1",manufacturingArray) + let raw_mat_manu = manufacturingArray.at(0).get('manufacturing_raw_materials') + console.log("Check2",raw_mat_manu) + if(raw_mat_manu != null && raw_mat_manu) { + this.setStockObserveValue(raw_mat_manu['controls'],'stock_observed') + } + + let finished_mat_manu =manufacturingArray.at(0).get('manufacturing_finished_goods') + if(finished_mat_manu != null && finished_mat_manu) { + this.setStockObserveValue(finished_mat_manu['controls'],'goods_observed') + } + + let retailformArray = this.stockForms.get('retail_details') as FormArray + console.log("Check1stock",retailformArray) + let retail_trade = retailformArray.at(0).get('retail_traded_goods') + console.log("Check2stock",retail_trade) + if(retail_trade != null && retail_trade) { + this.setStockObserveValue(retail_trade['controls'],'traded_goods_observed') + } + + let wholeSaleFormArray = this.stockForms.get('trade_details') as FormArray + console.log("Check1stock",wholeSaleFormArray) + let wholeSalesTrading = wholeSaleFormArray.at(0).get('trading_traded_goods') + console.log("Check2stock",wholeSalesTrading) + if(wholeSalesTrading != null && wholeSalesTrading) { + this.setStockObserveValue(wholeSalesTrading['controls'],'traded_goods_observed') + } + + let serviceFormArray = this.stockForms.get('servicing_details') as FormArray + console.log("Check1stock",serviceFormArray) + let serviceTrading = serviceFormArray.at(0).get('service_provider') + console.log("Check2stock",serviceTrading) + if(serviceTrading != null && serviceTrading) { + this.setStockObserveValue(serviceTrading['controls'],'service_provider_observed') + } + } + // individualsControl.patchValue(result.records.individuals); + // if(result.records.general_remark) { + // this._generalForm.controls.general_remark.patchValue(result.records.general_remark) + // } + + } + }) + + } + setStockObserveValue(controls,key_name) { + if(controls && controls.length > 0) { + controls.forEach(form_obj=>{ + form_obj.controls[key_name].patchValue('yes') + }) + } + + } + /************************* END OF VENDOR FORM DATAS *********************************/ + manufacturingForm: Boolean = false; manufacturingFormCreation(record) { 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 59177c988..a25d156c0 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 @@ -963,7 +963,9 @@ export class PdTrigerService { getVendorDatas(form_name,pd_id?) { let formsDet = [{form_name:"general",form_id:"18"},{form_name:"address",form_id:"5"},{form_name:"business_info",form_id:"13"}, - {form_name:"business_assets",form_id:"22"},{form_name:"neighbourhood_details",form_id:"19"}, + {form_name:"business_assets",form_id:"22"}, + {form_name:"stock",form_id:"11"}, + {form_name:"neighbourhood_details",form_id:"19"}, {form_name:"final_remarks",form_id:"20"}, {form_name:"queries_form",form_id:"24"}, {form_name:"COMMENTS",form_id:"COMMENTS"}