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 c2321fe..d9d6bee 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 c26e5cb..e29d908 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',
@@ -25,16 +26,24 @@ export class PdStatusChangeDialogueComponent implements OnInit {
usertype: string;
vendorOfficerList: any;
errorMessage: 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() {
@@ -123,14 +132,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 8e70e2e..230091d 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
@@ -216,16 +216,17 @@
-
-
+
+
-
+
-
+
+
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 d5fcd48..333953a 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 = [];
@@ -715,6 +716,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) {