diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html index 1566015..ea83f02 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html @@ -175,7 +175,7 @@

- {{details.pd_status=='ALLOCATED_TO_FIA'?details.SMC_vendor_agency_name:details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }} + {{details.pd_status=='ALLOCATED_TO_FIA'?details.SMC_vendor_agency_name:details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html index 60bca73..4862cd7 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html @@ -17,6 +17,13 @@ +
+ + Remarks + + Remarks required + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts index 1c0f0c8..590e379 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -3,6 +3,7 @@ import { NotifierService } from "angular-notifier"; import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; +import { FormControl, Validators } from '@angular/forms'; @Component({ selector: 'app-pd-status-change-dialogue', @@ -31,15 +32,24 @@ export class PdStatusChangeDialogueComponent implements OnInit { fk_pd_allocated_to: any; pd_agency_id: any; }; + public masterRandomString : string; + fk_pd_type: any; + pd_completeness_override: String = '0'; + is_remarks_enabled:boolean = false + remarks:FormControl = new FormControl('',Validators.compose([Validators.required])) constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) { + console.log('sankrish',this.data); this.notifier = notifier; - this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Send Back to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : this.data.pd_status == 'CM_ALLOCATED' ? 'Self Allocate' : 'Change Discussion'; - this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion' : this.data.pd_status=='ALLOCATED' ? 'Do you want to Send back the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : this.data.pd_status == 'CM_ALLOCATED' ? 'Do you want to Allocate the PD to yourself' : 'Change Discussion'; + this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Send Back to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : this.data.pd_status == 'CM_ALLOCATED' ? 'Self Allocate' : this.data.pd_status=='CANCELLED' ? 'PD Cancel': 'Change Discussion'; + this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion' : this.data.pd_status=='ALLOCATED' ? 'Do you want to Send back the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : this.data.pd_status == 'CM_ALLOCATED' ? 'Do you want to Allocate the PD to yourself' : this.data.pd_status=='CANCELLED' ? 'Are you going to cancel this PD' : 'Change Discussion'; this.enableAddonPD = false; this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true; this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false; - this.dialogType = this.data.dialogType + this.dialogType = this.data.dialogType; + this.masterRandomString = this.data.random_string; + this.fk_pd_type = this.data.pd_type + this.is_remarks_enabled = this.data.pd_status == 'CANCELLED' } ngOnInit() { @@ -129,14 +139,22 @@ export class PdStatusChangeDialogueComponent implements OnInit { else { - let update_status = { + let update_status : any= { "pd_id":this.data.pdid, "random_string":this.data.random_string }; + if(this.is_remarks_enabled) { + console.log(this.remarks); + if(this.remarks.invalid) { + this.notifier.notify("warning","Remarks is Required"); + return; + } + update_status.remark = this.remarks.value + } this.pd.editPdMasterDetails(update_status, status).subscribe(result => { if (result.status == 200) { this.dialogRef.close({update_status:true}); - this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully'); + this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :this.data.pd_status=='CANCELLED' ? 'PD Cancelled Successfully' : 'Discussions Updated Successfully'); } else { this.dialogRef.close({update_status:false}); 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 0e542a2..9e2bd52 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 @@ -205,27 +205,31 @@
-
+
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status==pdStatusCheck.ALLOCATED_TO_FIA ?'Allocated to vendor':master.pd_status | titlecase}}
-
- {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status==pdStatusCheck.ALLOCATED_TO_FIA ?'Allocated to vendor':master.pd_status | titlecase}} +
+ {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status | titlecase}}

{{master.vendor_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.vendor_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.vendor_status | titlecase}}

-
+
- - + - + + + + + - + - - + + +
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 558cb51..7810402 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 @@ -87,7 +87,8 @@ export class ViewPdComponent implements OnInit, OnDestroy { "ADD_ON_PENDING": 'ADD_ON_PENDING', "QC_COMPLETED": 'QC_COMPLETED', "BOUNCED" : 'BOUNCED', - "ALLOCATED_TO_FIA":'ALLOCATED_TO_FIA' + "ALLOCATED_TO_FIA":'ALLOCATED_TO_FIA', + "CANCELLED":'CANCELLED' }; mandatoryFieldsValidations: any = []; @@ -714,6 +715,19 @@ dialogRef1.afterClosed().subscribe(rr=>{ }); } + cancelPD(pdDetails: any){ + console.log("pddetails sankrish ",pdDetails,this.pdStatusCheck.CANCELLED); + const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { + data: { pdid: pdDetails.assigned_pd, pd_status: this.pdStatusCheck.CANCELLED ,random_string:this.masterRandomString}, + disableClose: true, + minWidth: '30%', + maxWidth: '40%', + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + this.viewPdDetails(this.viewID) + }); + } // updateViewComponent(editBack:string) {