Fail Status Changes : ps
This commit is contained in:
parent
91767ec68d
commit
7dde6bdcd4
@ -177,6 +177,9 @@
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 24%" *ngIf="pdMain.pincode.value == 1" >
|
||||
<input matInput autocomplete="off" placeholder="Specify Pincode" formControlName="other_pincode" type="number">
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
|
||||
@ -95,6 +95,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
fk_city: [null],
|
||||
fk_state: [null],
|
||||
pincode : [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
|
||||
other_pincode:[null],
|
||||
remarks:[null],
|
||||
// allocation_type: [null],
|
||||
// sub_allocation_type: [null],
|
||||
@ -208,7 +209,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.titleList=data.records.filter(val=>val.isactive==1);
|
||||
|
||||
let index1 = this.titleList.map(data => data.name).indexOf("Master");
|
||||
this.titleList.splice(index1, 1);
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
@ -418,19 +420,28 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if((formValue.lender_contact_mobile == '') || (formValue.lender_stdcode == '' && formValue.lender_landline == '')){
|
||||
if((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null )){
|
||||
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.disableAfterSubmit=true;
|
||||
|
||||
let concat_landline
|
||||
if(formValue.lender_stdcode != null || formValue.lender_landline != null){
|
||||
concat_landline = formValue.lender_stdcode +'-'+formValue.lender_landline;
|
||||
}
|
||||
else{
|
||||
concat_landline = null;
|
||||
}
|
||||
|
||||
let pd_details:any={
|
||||
"fk_lender_id":formValue.fk_lender_id,
|
||||
"lender_applicant_id":formValue.lender_applicant_id,
|
||||
"pd_branch_id":formValue.pd_branch_id,
|
||||
"pd_contact_person":formValue.lender_contact_person,
|
||||
"pd_contact_mobileno":formValue.lender_contact_mobile,
|
||||
"pd_contact_landline":formValue.lender_stdcode +'-'+formValue.lender_landline,
|
||||
"pd_contact_landline":concat_landline,
|
||||
"fk_product_id":formValue.fk_product_id,
|
||||
"fk_subproduct_id":formValue.fk_subproduct_id,
|
||||
"fk_pd_type":formValue.fk_pd_type,
|
||||
@ -440,6 +451,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
"fk_city":formValue.fk_city,
|
||||
"fk_state":formValue.fk_state,
|
||||
"pincode":formValue.pincode ,
|
||||
"other_pincode":formValue.other_pincode ,
|
||||
"remarks":formValue.remarks,
|
||||
"pd_status": status,
|
||||
"fk_createdby" : this._aws.getlocale(),
|
||||
|
||||
@ -166,7 +166,7 @@
|
||||
<div fxFlex="30" align="end">
|
||||
<!-- <button *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button> -->
|
||||
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Trigger PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button> -->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Trigger PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, '')"><mat-icon>save</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value)"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
}
|
||||
|
||||
loadFormData() {
|
||||
// console.log('this.data.record',this.data.records);
|
||||
console.log('this.data.record',this.data.records);
|
||||
let stdcode;
|
||||
let landline;
|
||||
if(this.data.records.pd_contact_landline){
|
||||
@ -143,8 +143,8 @@ export class EditPdMasterComponent implements OnInit {
|
||||
landline = this.data.records.pd_contact_landline.substr(+stdcodesearch + 1,8);
|
||||
}
|
||||
else{
|
||||
stdcode = null;
|
||||
landline = null;
|
||||
stdcode = '';
|
||||
landline = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,41 +205,43 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this.submitPdDetails(formValue, status);
|
||||
}
|
||||
//trigger pd
|
||||
triggerPD(formValue: any, status:string){
|
||||
this._EditPDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
|
||||
triggerPD(formValue: any, status:any){
|
||||
|
||||
this._EditPDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['fk_customer_segment'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['loan_amount'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['loan_amount'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['fk_customer_segment'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['addressline1'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['addressline1'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['loan_amount'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['loan_amount'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['fk_city'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_city'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['addressline1'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['addressline1'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['fk_state'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['fk_state'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['fk_city'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_city'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['pincode'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['pincode'].updateValueAndValidity();
|
||||
if(this.applicantLength==0){
|
||||
this.notifier.notify('error', 'Please add applicants.!');
|
||||
// this._EditPDtriggerForm.controls['fk_state'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['fk_state'].updateValueAndValidity();
|
||||
|
||||
}
|
||||
this.submitPdDetails(formValue, status);
|
||||
// this._EditPDtriggerForm.controls['pincode'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['pincode'].updateValueAndValidity();
|
||||
|
||||
// if(this.applicantLength==0){
|
||||
// this.notifier.notify('error', 'Please add applicants.!');
|
||||
|
||||
// }
|
||||
this.submitPdDetails(formValue, 1);
|
||||
setTimeout(() => {
|
||||
this.clearCustomValidatorFields();
|
||||
}, 10000);
|
||||
@ -280,35 +282,39 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this.validateAllFormFields(this._EditPDtriggerForm);
|
||||
}
|
||||
|
||||
submitPdDetails(formValue: any, status:string) {
|
||||
submitPdDetails(formValue: any, status:any) {
|
||||
// let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus;
|
||||
let updateStatus = this.currentPDStatus;
|
||||
if(this._EditPDtriggerForm.invalid) {
|
||||
this.validateAllFormFields(this._EditPDtriggerForm);
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
else{
|
||||
console.log(this._EditPDtriggerForm.value);
|
||||
if(status != 1){
|
||||
if(this._EditPDtriggerForm.invalid) {
|
||||
this.validateAllFormFields(this._EditPDtriggerForm);
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
}
|
||||
let my_array = this._EditPDtriggerForm.value;
|
||||
if((my_array.pd_contact_mobileno == '') || (my_array.lender_stdcode == '' && my_array.lender_landline == '')){
|
||||
let concat_landline
|
||||
if(my_array.lender_stdcode != null && my_array.lender_landline != null){
|
||||
if(my_array.lender_stdcode == '' && my_array.lender_landline == ''){
|
||||
concat_landline = null;
|
||||
}else{
|
||||
let std = my_array.lender_stdcode == '' ? '' : my_array.lender_stdcode;
|
||||
let landline = my_array.lender_landline == '' ? '' : my_array.lender_landline;
|
||||
concat_landline = std+'-'+landline;
|
||||
}
|
||||
}else if(my_array.lender_stdcode == '' && my_array.lender_landerline == ''){
|
||||
concat_landline = null;
|
||||
}else{
|
||||
concat_landline = null;
|
||||
}
|
||||
|
||||
if((my_array.pd_contact_mobileno == '' || my_array.pd_contact_mobileno == null) && (concat_landline == '' || concat_landline == null )){
|
||||
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
|
||||
return;
|
||||
}
|
||||
else{
|
||||
let concat_landline
|
||||
if(my_array.lender_stdcode != null && my_array.lender_landline != null){
|
||||
if(my_array.lender_stdcode == '' && my_array.lender_landline == ''){
|
||||
concat_landline = null;
|
||||
}else{
|
||||
let std = my_array.lender_stdcode == '' ? '' : my_array.lender_stdcode;
|
||||
let landline = my_array.lender_landline == '' ? '' : my_array.lender_landline;
|
||||
concat_landline = std+'-'+landline;
|
||||
}
|
||||
}else if(my_array.lender_stdcode == '' && my_array.lender_landerline == ''){
|
||||
concat_landline = null;
|
||||
}else{
|
||||
concat_landline = null;
|
||||
}
|
||||
|
||||
|
||||
let lenderMasterArray = {
|
||||
"pd_id": my_array.pd_id,
|
||||
@ -343,7 +349,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});//error closed
|
||||
}//else closed
|
||||
}
|
||||
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
onReset() {
|
||||
|
||||
@ -779,7 +779,7 @@ export class AssetsInfoComponent implements OnInit {
|
||||
|
||||
/** On Key Press Event For Number only Accepting */
|
||||
keyPress(event: any) {
|
||||
const pattern = /[0-9\-\.\ ]/;
|
||||
const pattern = /[0-9]/;
|
||||
|
||||
let inputChar = String.fromCharCode(event.charCode);
|
||||
if (event.keyCode != 8 && !pattern.test(inputChar)) {
|
||||
|
||||
@ -659,7 +659,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
|
||||
/** On Key Press Event For Number only Accepting */
|
||||
keyPress(event: any) {
|
||||
const pattern = /[0-9\-\.\ ]/;
|
||||
const pattern = /[0-9]/;
|
||||
|
||||
let inputChar = String.fromCharCode(event.charCode);
|
||||
if (event.keyCode != 8 && !pattern.test(inputChar)) {
|
||||
|
||||
@ -61,8 +61,8 @@
|
||||
<div fxLayout="row nowrap" class="state-margin">
|
||||
|
||||
<mat-form-field style="width: 20%;">
|
||||
<input matInput placeholder="Year" formControlName="current_business_experiance_year" (keyup)="getWorkExperience(members.value,i)" required autocomplete="off" (keypress)="keyPress($event)">
|
||||
|
||||
<input matInput placeholder="Year" formControlName="current_business_experiance_year" (keyup)="getWorkExperience(members.value,i)" required autocomplete="off" (keypress)="keyPress($event)" (change)="checkWithExistBusinessYear($event.target.value,i)" >
|
||||
<mat-hint style="color: red;">{{errorMessage[i]}}</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 21%;">
|
||||
<input matInput placeholder="Month" formControlName="current_business_experiance_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(members,$event.target.value)" autocomplete="off">
|
||||
@ -70,7 +70,6 @@
|
||||
<mat-form-field style="width: 35%;">
|
||||
<input matInput placeholder="Total Work Experience"
|
||||
formControlName="total_business_experiance" (keypress)="keyPress($event)" (keyup)="getWorkExperience(members.value,i)" autocomplete="off" required>
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row nowrap" *ngIf="members.value.total_business_previous_experience!=undefined">
|
||||
@ -1212,11 +1211,11 @@
|
||||
formControlName="employees_total" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Permanent" (change)="checkTotal(businessForm)"
|
||||
<input matInput placeholder="Permanent" (change)="checkTotalEmployee(businessForm)"
|
||||
formControlName="employees_permanent" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Temporary" (change)="checkTotal(businessForm)"
|
||||
<input matInput placeholder="Temporary" (change)="checkTotalEmployee(businessForm)"
|
||||
formControlName="employees_temporary" required>
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
|
||||
@ -65,6 +65,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
generalExistEntityType_other:string;
|
||||
generalExistBusinessYear:Number;
|
||||
generalExistBusinessMonth:Number;
|
||||
errorMessage: any = [];
|
||||
|
||||
constructor(notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
@ -1453,10 +1454,16 @@ export class BusinessInfoComponent implements OnInit {
|
||||
// this.InvestedAmountInWords = this._pd.convertNumberToWords(e);
|
||||
// }
|
||||
|
||||
checkTotal(FormData){
|
||||
// console.log(FormData.value.employees_permanent);
|
||||
// console.log(FormData.value.employees_temporary);
|
||||
// console.log(FormData.value.employees_total);
|
||||
checkTotalEmployee(FormData){
|
||||
this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent ||0)+(+FormData.value.employees_temporary||0));
|
||||
}
|
||||
}
|
||||
checkWithExistBusinessYear(e,i){
|
||||
if(e > this.generalExistBusinessYear){
|
||||
this.errorMessage[i] = "Higher than Business Vintage";
|
||||
}
|
||||
else{
|
||||
this.errorMessage[i] = '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,10 +9,13 @@
|
||||
<form [formGroup]="_finalRemarkForm" (submit)="onSubmit()" novalidate>
|
||||
<mat-dialog-content>
|
||||
<mat-card>
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
|
||||
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{ pm.description }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field style="width:45%;">
|
||||
<mat-form-field *ngIf="_finalRemarkForm.controls['final_custormer_remark_type'].value == 1">
|
||||
<input matInput autocomplete="off" placeholder="Specify Customer Behaviour" formControlName="final_other_customer_behaviour">
|
||||
</mat-form-field>
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
|
||||
@ -56,6 +56,7 @@ export class FinalRemarksComponent implements OnInit {
|
||||
pdid: [this.pdid],
|
||||
formid: ['20'],
|
||||
final_custormer_remark_type : [],
|
||||
final_other_customer_behaviour:[],
|
||||
is_service_provided: ['', Validators.required],
|
||||
final_form_remarks: ['',Validators.required]
|
||||
});
|
||||
@ -86,6 +87,7 @@ export class FinalRemarksComponent implements OnInit {
|
||||
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type);
|
||||
this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour);
|
||||
this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided);
|
||||
this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks);
|
||||
this.noRecordsFound = true;
|
||||
|
||||
@ -205,7 +205,8 @@
|
||||
<!-- <span style="width:10%;padding-left:2%"><p>Average</p></span> -->
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Considered Sales Average" formControlName="estimate_sales_average">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_average').value != ''">{{"₹"}} {{AV_SalesInwords[i]}} Only</mat-hint>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_average').value != ''"></mat-hint>
|
||||
<!-- //{{"₹"}} {{AV_SalesInwords[i]}} Only -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
@ -249,7 +250,8 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Considered Profit Amount" formControlName="estimate_net_profit" type="number">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">{{"₹"}} {{AV_netProfitAmtInwords[i]}} Only ( {{details.get('estimate_net_profit_percent').value }} % )</mat-hint>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">( {{details.get('estimate_net_profit_percent').value }} % )</mat-hint>
|
||||
<!-- //{{"₹"}} {{AV_netProfitAmtInwords[i]}} Only -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</span>
|
||||
@ -265,7 +267,8 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Considered Margin Loss %" formControlName="estimate_loss_margin_percent" type="number">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"₹"}} {{details.get('estimate_Loss_margin').value}} ( {{AV_marginLossAmtInwords[i]}} Only ) </mat-hint>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"₹"}} {{details.get('estimate_Loss_margin').value}} </mat-hint>
|
||||
<!-- //( {{AV_marginLossAmtInwords[i]}} Only ) -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div style="width:100%">
|
||||
@ -277,7 +280,8 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Considered Loss Amount" formControlName="estimate_net_loss" type="number">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"₹"}} {{AV_netLossAmtInwords[i]}} Only ( {{details.get('estimate_net_loss_percent').value }} % )</mat-hint>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''"> ( {{details.get('estimate_net_loss_percent').value }} % )</mat-hint>
|
||||
<!-- //{{"₹"}} {{AV_netLossAmtInwords[i]}} Only -->
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -587,6 +587,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
// let annual_sale_variation = ((prev_annual_sale - salary)/salary ) * 100 ;
|
||||
|
||||
if(detail.value.finanical_profit_or_loss == 1){
|
||||
loss_margin = '';
|
||||
detail.controls.financial_margin_of_loss.setValue('');
|
||||
|
||||
let profit = detail.value.financial_net_profit;
|
||||
|
||||
@ -602,7 +604,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
else if (detail.value.finanical_profit_or_loss == 2){
|
||||
|
||||
profit_margin = '';
|
||||
detail.controls.financial_margin_of_profit.setValue('');
|
||||
let loss = detail.value.financial_net_loss;
|
||||
|
||||
if (salary != '' && loss != '') {
|
||||
|
||||
@ -706,7 +706,7 @@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!noRecordsFound" align="center"> <i> Fill Business Form First! / No Company Found at this ID {{company_id}}! .... </i> </div>
|
||||
<notifier-container></notifier-container>
|
||||
<!-- <mat-card style="padding: 12px;">
|
||||
<p>Stock Details</p>
|
||||
|
||||
@ -111,64 +111,66 @@ export class StockComponent implements OnInit {
|
||||
// console.log(this.company_id);
|
||||
|
||||
this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => {
|
||||
// console.log(data);
|
||||
// console.log(data.record);
|
||||
console.log(data);
|
||||
console.log(data.record);
|
||||
// return;
|
||||
if(data.dataStatus == true){
|
||||
let tempcount = 0;
|
||||
|
||||
let datas = data.record;
|
||||
|
||||
|
||||
let api = Object.keys(datas).map(function (key) {
|
||||
return datas[key];
|
||||
});
|
||||
console.log(api);
|
||||
if(api.length > 0){
|
||||
// for(let val of api){
|
||||
// if (val.type_of_activity_id == 2) {
|
||||
// let suppliers = datas.products;
|
||||
// console.log(suppliers);
|
||||
// }
|
||||
// }
|
||||
|
||||
api.forEach(val => {
|
||||
if (val.type_of_activity_id == 2) {
|
||||
if(val.products){
|
||||
this.suppliers_raw_materials = val.products;
|
||||
console.log(this.suppliers_raw_materials);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 3) {
|
||||
if(val.products){
|
||||
this.suppliers_finished_goods = val.products;
|
||||
console.log(this.suppliers_finished_goods);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 4) {
|
||||
if(val.products){
|
||||
this.suppliers_trade_details = val.products;
|
||||
console.log(this.suppliers_trade_details);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 5) {
|
||||
if(val.products){
|
||||
this.suppliers_service_product = val.products;
|
||||
}
|
||||
console.log(this.suppliers_service_product);
|
||||
}
|
||||
tempcount++;
|
||||
});
|
||||
console.log('tempcount',tempcount);
|
||||
// console.log('tempcount',tempcount);
|
||||
if(tempcount>0){
|
||||
this.initstockForms(datas);
|
||||
}
|
||||
else{
|
||||
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
|
||||
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
|
||||
this.noRecordsFound = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
|
||||
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
|
||||
this.noRecordsFound = false;
|
||||
}
|
||||
}else if(data.dataStatus == false)
|
||||
{
|
||||
this.notifier.notify('warning', data.msg);
|
||||
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
|
||||
this.noRecordsFound = false;
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
|
||||
this.noRecordsFound = false;
|
||||
return;
|
||||
}
|
||||
}, err => {
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<span *ngIf="master.pd_status!=pdStatusCheck.SCHEDULED && master.pd_status!=pdStatusCheck.QC_COMPLETED " style="text-align:left">{{master.pd_status | titlecase}}</span>
|
||||
<span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="text-align:left">QC Completed</span>
|
||||
</button>
|
||||
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master)"><mat-icon>flash_on</mat-icon></button>
|
||||
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Draft" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master)"><mat-icon>flash_on</mat-icon></button>
|
||||
<!-- <button *ngIf="currentPDStatus==pdStatusCheck.DRAFT && mandatoryFieldsValidations.length==0" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master.pd_id)"><mat-icon>flash_on</mat-icon></button> -->
|
||||
<br>
|
||||
<small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small>
|
||||
@ -95,7 +95,7 @@
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
|
||||
<div fxFlex="10">
|
||||
<!-- <span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span> -->
|
||||
<span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;" (click)="Maponclick(master)" matTooltip="View here Map" matTooltipPosition="left"></i></span>
|
||||
<span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;" (click)="Maponclick(master)" matTooltip="Map View" matTooltipPosition="left"></i></span>
|
||||
</div>
|
||||
<div fxFlex="90">
|
||||
<span *ngIf="master.state_name" class="hover-icon"> {{master.addressline1}},<br> {{master.city_name}},<br>{{master.state_name}}-{{master.pincode}} </span>
|
||||
|
||||
@ -14,6 +14,10 @@ import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.componen
|
||||
import { PdRequirementComponent } from '../pd-requirement/pd-requirement.component';
|
||||
|
||||
import {DatePipe } from '@angular/common';
|
||||
|
||||
/**sweet alert */
|
||||
import Swal from 'sweetalert2';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-pd',
|
||||
templateUrl: './view-pd.component.html',
|
||||
@ -23,6 +27,7 @@ import {DatePipe } from '@angular/common';
|
||||
export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
pipe = new DatePipe('en-US');
|
||||
private notifier:NotifierService;
|
||||
|
||||
errorMessage: any;
|
||||
pdMasterData: any=[];
|
||||
pdApplicantData: any=[];
|
||||
@ -164,13 +169,55 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
this.ListPdComponent.pdListLoad(true);
|
||||
}
|
||||
|
||||
// isactiveBranch(id: number,isactive : number){
|
||||
|
||||
// let ActiveDatas = isactive == 0
|
||||
// ? { 'branch_id':id,'isactive': '1'}
|
||||
// : { 'branch_id':id,'isactive': '0'}
|
||||
|
||||
// //if is active '1' have TO deactive So deactive messages
|
||||
// if(isactive == 1){
|
||||
// this.SwalButtonText = 'Yes, deactivate it!';
|
||||
// this.SwalMessage = 'Deactivated!';
|
||||
// }
|
||||
// else{
|
||||
// this.SwalButtonText = 'Yes, activate it!';
|
||||
// this.SwalMessage = 'Activated!';
|
||||
// }
|
||||
|
||||
// Swal({
|
||||
// title: 'Are you sure?',
|
||||
// type: 'warning',
|
||||
// showCancelButton: true,
|
||||
// confirmButtonColor: '#3085d6',
|
||||
// cancelButtonColor: '#d33',
|
||||
// confirmButtonText: this.SwalButtonText
|
||||
// }).then((result) => {
|
||||
// if (result.value) {
|
||||
// this._mastersService.editMasterDetails(ActiveDatas,'BRANCH')
|
||||
// .subscribe(dataresult=>{
|
||||
// if (dataresult.dataStatus == true){
|
||||
// Swal(this.SwalMessage,'success');
|
||||
// this.getBranch();
|
||||
// }
|
||||
// else{
|
||||
// Swal("Sorry Try Again !");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else{
|
||||
// this.getBranch();
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
Maponclick(master : any){
|
||||
let url = "https://www.google.com/maps/place/"
|
||||
let concat_url = url+master.addressline1+'/'+master.city_name+','+master.pincode+','+master.state_name;
|
||||
window.open(concat_url,'_blank');
|
||||
}
|
||||
|
||||
editPdMaster(masterData:any){
|
||||
editPdMaster(masterData:any,flag){
|
||||
let record = {
|
||||
"records":masterData,
|
||||
"applicantLength": this.pdApplicantData.length
|
||||
@ -183,13 +230,25 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
dialogPDMaster.afterOpen()
|
||||
.subscribe(dataresult => {
|
||||
if(this.localcount == 1){
|
||||
if(flag == 1){
|
||||
let ffd : any = [];
|
||||
this.FilteredFieldNames.forEach(field => {
|
||||
ffd.push(field.frontEnd_FieldName);
|
||||
});
|
||||
// this.notifier.notify('info', 'Please Fill ' + ffd.join(',') + ' are Fields.!');
|
||||
this.notifier.notify('warn', 'Please Fill ' + ffd.join(' , ') + ' Fields.!');
|
||||
|
||||
// this.notifier.notify('info', 'Please Fill ' + ffd.join(' , ') + ' Fields.!');
|
||||
Swal({
|
||||
title:'Please complete the below details',
|
||||
confirmButtonColor: "red",
|
||||
// html:true,
|
||||
//text:'Please Fill' + ffd.forEach(data=>{ data }) + ' ! ',
|
||||
text:ffd.join(' , ')
|
||||
});
|
||||
// Swal({
|
||||
// title: "HTML <small>Title</small>!",
|
||||
// text: "...<div class='row my_tracking_swal'>" + flag + "</div>...",
|
||||
|
||||
// }) ;
|
||||
}
|
||||
});
|
||||
dialogPDMaster.afterClosed().subscribe(dataresult => {
|
||||
@ -350,7 +409,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
if(data.length>0){
|
||||
this.localcount = 1;
|
||||
this.editPdMaster(masterdetail);
|
||||
this.editPdMaster(masterdetail,this.localcount);
|
||||
}
|
||||
else {
|
||||
let lenderMasterArray = {"pd_id": pdid}
|
||||
|
||||
@ -25,5 +25,5 @@ export const environment = {
|
||||
s3_endpoint: '',
|
||||
accessToken:'',
|
||||
//apiUrl:'http://localhost/sparqapi/api/'
|
||||
apiEndpoint: 'http://ssa.sineedge.com/sparqapi/api/'
|
||||
apiEndpoint: 'https://ssa.sineedge.com/sparqtest/api/'
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user