diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts
index a58eb55..c6e2be4 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts
@@ -85,7 +85,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
"COMPLETED": 'COMPLETED',
"ADD_ON_PENDING": 'ADD_ON_PENDING',
"QC_COMPLETED": 'QC_COMPLETED',
- "BOUNCED" : 'BOUNCED'
+ "BOUNCED" : 'BOUNCED',
+ "ALLOCATED_TO_FIA":'ALLOCATED_TO_FIA'
};
mandatoryFieldsValidations: any = [];
@@ -125,6 +126,9 @@ export class ViewPdComponent implements OnInit, OnDestroy {
};
userId: any;
product: any;
+ userRoleType: string;
+ is_agency_logged_in: boolean;
+ currentVendorStatus: any;
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
@@ -133,11 +137,22 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.enableStartPD = false;
this.roleAccessDetails=this._pd.getRoleAccessDetails();
console.log(this.roleAccessDetails);
- console.log('tamil');
+
}
ngOnInit() {
-
+ this.userRoleType=localStorage.getItem('user_role');
+
+ if(this.userRoleType=='28' || this.userRoleType=='29')
+ {
+ this.is_agency_logged_in=true;
+ //allocate (yes 28)
+ }
+ else
+ {
+ this.is_agency_logged_in=false;
+ }
+
this.userId = this._aws.getlocale()
console.log(this.userId);
console.log(this.userRoleID);
@@ -174,6 +189,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.pdMasterData[0].addresses = data.records.pd_address.filter(item => item.isactive == 1);
this.currentPDStatus = data.records.pd_master_details[0].pd_status;
+ this.currentVendorStatus=data.records.pd_master_details[0].vendor_status;
this.pdAdditionalReqData = data.records.pd_additional_requirements;
this.pdCollectedDocument=data.records.docs_to_be_collected;
// enable pd start time
@@ -340,7 +356,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
console.log(pdDetails);
console.log('pddetails');
this.destroyType = 3;
- if (status == this.pdStatusCheck.ALLOCATED || status == this.pdStatusCheck.SCHEDULED || status == this.pdStatusCheck.TRIGGERED) {
+ if (status == this.pdStatusCheck.ALLOCATED || status == this.pdStatusCheck.SCHEDULED || status == this.pdStatusCheck.TRIGGERED||status == this.pdStatusCheck.ALLOCATED_TO_FIA) {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: pdDetails.assigned_pd, pd_status: this.pdStatusCheck.INPROGRESS,random_string:this.pdMasterData[0].random_string },
disableClose: true,
@@ -355,9 +371,31 @@ export class ViewPdComponent implements OnInit, OnDestroy {
});
}
else {
+
this.router.navigate(['../../../startpd', pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}
}
+ StatusUpdate(master)
+ {
+
+ let status='QC COMPLETE';
+
+ let update_status = {
+ "pd_id":master.pd_id,
+ "random_string":master.random_string
+ };
+ console.log(master);
+ this._pd.updateVendorStatus(update_status, status).subscribe(result => {
+ if (result.status == 200) {
+ this.notifier.notify('success', 'QC Completed Successfully.!');
+ this.viewPdDetails(this.viewID)
+ }
+ else {
+ this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
+ this.errorMessage = "Something Went Wrong Try Again.!";
+ }
+ })
+ }
getPDIDReport(pdID: any) {
this.destroyType = 3;
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 5d890b7..c1e0d7c 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,6 +40,7 @@ export class PdTrigerService {
entity_id: string;
pdagencyid: string;
userRoleType: string;
+ is_agency_logged_in: boolean;
constructor(private _http: HttpClient,
private _aws: AwsService) {
@@ -237,7 +238,7 @@ export class PdTrigerService {
// get status based pd list
getTabStatusPdDetails(status: string,lenderId): Observable
{
-
+
this.usertype=localStorage.getItem('usertype');
if(this.usertype=='true')
{
@@ -248,7 +249,7 @@ export class PdTrigerService {
let userid1=this._aws.getlocale()
let userid = localStorage.getItem('userid');
let paramHttp1:any= this.entity_id && status ?
- {params : new HttpParams().set('lenderid', this.entity_id).set('status',status).set('pdagencyid',this.pdagencyid).set('pdofficerid',userid)} : {};
+ {params : new HttpParams().set('lenderid', this.entity_id).set('status',status).set('pdagencyid',this.pdagencyid).set('pdofficerid',userid).set('is_smc_vendor',this.usertype)} : {};
paramHttp1.params = paramHttp1.params.set('createdby',userid1)
return this._http.get(this.apiUrl + "listLessPDDetails/get", paramHttp1)
.pipe(
@@ -309,7 +310,20 @@ export class PdTrigerService {
)
}
updateVendorStatus(editData: any, status: string): Observable {
- editData.pd_status = status;
+ this.userRoleType=localStorage.getItem('user_role');
+
+ if(this.userRoleType=='28' || this.userRoleType=='29')
+ {
+ this.is_agency_logged_in=true;
+ //allocate (yes 28)
+ }
+ else
+ {
+ this.is_agency_logged_in=false;
+ }
+
+ editData.vendor_status = status;
+ editData.is_smc_vendor=this.is_agency_logged_in;
editData.fk_updatedby = this._aws.getlocale();
// editData.updatedon = currentdate;
return this._http.post(this.apiUrl + "updateVendorStatus", { records: editData })