Schedule api changes and start button issue
This commit is contained in:
parent
13e858a4b0
commit
93b2911394
@ -50,7 +50,7 @@ pin:any;
|
|||||||
}
|
}
|
||||||
getuserDetails()
|
getuserDetails()
|
||||||
{
|
{
|
||||||
this.loadingCtrl.pdloader('loading...');
|
// this.loadingCtrl.pdloader('loading...');
|
||||||
let userid = this.aws.getlocale();
|
let userid = this.aws.getlocale();
|
||||||
this.aws.getuserprofile(userid).subscribe(res=>{
|
this.aws.getuserprofile(userid).subscribe(res=>{
|
||||||
this.userDetails = res;
|
this.userDetails = res;
|
||||||
|
|||||||
@ -107,9 +107,9 @@
|
|||||||
<div *ngFor="let status of addr.addtional_pd_data;let i=index">
|
<div *ngFor="let status of addr.addtional_pd_data;let i=index">
|
||||||
<!-- <ion-button fill="clear" color="optblue" class="inprogress_btn"><i class="material-icons" style="font-size:24px;">where_to_vote</i></ion-button> -->
|
<!-- <ion-button fill="clear" color="optblue" class="inprogress_btn"><i class="material-icons" style="font-size:24px;">where_to_vote</i></ion-button> -->
|
||||||
<!-- <button mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" ><mat-icon>where_to_vote</mat-icon></ion-button> -->
|
<!-- <button mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" ><mat-icon>where_to_vote</mat-icon></ion-button> -->
|
||||||
<mat-label *ngIf="status.scheduled_on != null" style="font-size:12px;color:gray">Scheduled On</mat-label><br/>
|
<mat-label *ngIf="status.vendor_scheduled_on != null" style="font-size:12px;color:gray">Scheduled On</mat-label><br/>
|
||||||
<ion-row size="12">
|
<ion-row size="12">
|
||||||
<ion-col size="7" class="ion-align-self-start" style="font-size: 14.5px;"><ion-icon *ngIf="status.scheduled_on != null" class="schdule_time" name="calendar"> </ion-icon> {{status.scheduled_on}}</ion-col>
|
<ion-col size="7" class="ion-align-self-start" style="font-size: 14.5px;"><ion-icon *ngIf="status.vendor_scheduled_on != null" class="schdule_time" name="calendar"> </ion-icon> {{status.vendor_scheduled_on}}</ion-col>
|
||||||
<!-- <ion-col size="5" class="ion-align-self-end" style="text-align: right"><ion-icon class="addressinfo" name="people"> </ion-icon> {{status.customer_segment_abbr}}</ion-col> -->
|
<!-- <ion-col size="5" class="ion-align-self-end" style="text-align: right"><ion-icon class="addressinfo" name="people"> </ion-icon> {{status.customer_segment_abbr}}</ion-col> -->
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<!-- <ion-row class="ion-justify-content-end"> -->
|
<!-- <ion-row class="ion-justify-content-end"> -->
|
||||||
@ -145,7 +145,7 @@
|
|||||||
<ion-row *ngIf="initiatedAccess || startedAccess">
|
<ion-row *ngIf="initiatedAccess || startedAccess">
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-label><ion-icon name="calendar"></ion-icon> Scheduled On</ion-label><br/>
|
<ion-label><ion-icon name="calendar"></ion-icon> Scheduled On</ion-label><br/>
|
||||||
<ion-col size="12" class="cardinfo"> {{address_allocated_data.scheduled_on}}</ion-col>
|
<ion-col size="12" class="cardinfo"> {{address_allocated_data.vendor_scheduled_on}}</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|
||||||
@ -390,7 +390,7 @@
|
|||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|
||||||
<ion-row *ngIf="startedAccess">
|
<ion-row *ngIf="startedAccess || checkOtpAccess">
|
||||||
<ion-col size="12" style="padding:0px !important;">
|
<ion-col size="12" style="padding:0px !important;">
|
||||||
<ion-button expand="full" color="tertiary" style="background-color: green !important;" (click)="checkOTP(applicatentDetails)">
|
<ion-button expand="full" color="tertiary" style="background-color: green !important;" (click)="checkOTP(applicatentDetails)">
|
||||||
Start</ion-button>
|
Start</ion-button>
|
||||||
|
|||||||
@ -297,7 +297,7 @@ checkOtpAccess:boolean = false;
|
|||||||
|
|
||||||
if(this.address_allocated_data != '' && this.address_allocated_data !=undefined){
|
if(this.address_allocated_data != '' && this.address_allocated_data !=undefined){
|
||||||
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
|
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
|
||||||
let scheduledDateTime: string=this.address_allocated_data.scheduled_on_for_validation;
|
let scheduledDateTime: string=this.address_allocated_data.vendor_scheduled_on_validation;
|
||||||
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
|
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
|
||||||
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
|
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
|
||||||
console.log(diffInHours);
|
console.log(diffInHours);
|
||||||
@ -365,16 +365,18 @@ checkOtpAccess:boolean = false;
|
|||||||
pdschedule(scheduledate,appdetails)
|
pdschedule(scheduledate,appdetails)
|
||||||
{
|
{
|
||||||
|
|
||||||
let data :any;let param : any;
|
// let data :any;
|
||||||
|
let param : any;
|
||||||
|
|
||||||
if(scheduledate != undefined){
|
if(scheduledate != undefined){
|
||||||
let schDate = scheduledate.slice(0,19).replace('T',' ');
|
let schDate = scheduledate.slice(0,19).replace('T',' ');
|
||||||
|
|
||||||
data = {'pd_id':this.address_pd_id,'vendor_status':'SCHEDULED','scheduled_on':schDate,'fk_updatedby':this.users,'updatedon':currentdate,'random_string':this.applicatentDetails.random_string};
|
// data = {'pd_id':this.address_pd_id,'vendor_status':'SCHEDULED','scheduled_on':schDate,'fk_updatedby':this.users,'updatedon':currentdate,'random_string':this.applicatentDetails.random_string};
|
||||||
// this.pdDetails.updatepdStatus(data).subscribe(res=>
|
// this.pdDetails.updatepdStatus(data).subscribe(res=>
|
||||||
//sample format : fk_pd_id: "868", schedule_time: "2019-05-30 18:51", fk_scheduled_by: "165";
|
//sample format : fk_pd_id: "868", schedule_time: "2019-05-30 18:51", fk_scheduled_by: "165";
|
||||||
param = {'fk_pd_id': this.address_pd_id, 'schedule_time':schDate, 'fk_scheduled_by': this.users,app_client:"3"}
|
// param = {'fk_pd_id': this.address_pd_id, 'schedule_time':schDate, 'fk_scheduled_by': this.users,app_client:"3"}
|
||||||
this.pdDetails.updateSchedule(param).subscribe(res=>
|
param ={"pd_id": this.address_pd_id,"vendor_status":"SCHEDULED","vendor_scheduled_on":schDate,"fk_updatedby":this.users}
|
||||||
|
this.pdDetails.updatepdStatus(param).subscribe(res=>
|
||||||
{
|
{
|
||||||
this.updateSchedule = res;
|
this.updateSchedule = res;
|
||||||
if(this.updateSchedule.dataStatus == true)
|
if(this.updateSchedule.dataStatus == true)
|
||||||
@ -621,7 +623,7 @@ checkOtpAccess:boolean = false;
|
|||||||
this.geolocation.getCurrentPosition().then((resp) => {
|
this.geolocation.getCurrentPosition().then((resp) => {
|
||||||
this.currentPosPDofficer = resp.coords.latitude+","+resp.coords.longitude;
|
this.currentPosPDofficer = resp.coords.latitude+","+resp.coords.longitude;
|
||||||
|
|
||||||
|
// this.loading.pdloader("Please wait...")
|
||||||
this.pdDetails.updatepdStatus(data).subscribe(res=>
|
this.pdDetails.updatepdStatus(data).subscribe(res=>
|
||||||
{
|
{
|
||||||
this.updatestarted = res;
|
this.updatestarted = res;
|
||||||
@ -631,21 +633,25 @@ if(this.updatestarted.dataStatus == true)
|
|||||||
//clearInterval(this.timeInterval);
|
//clearInterval(this.timeInterval);
|
||||||
|
|
||||||
//this.navCtrl.setRoot(OtpPage,{'pdDetails':appdetails});
|
//this.navCtrl.setRoot(OtpPage,{'pdDetails':appdetails});
|
||||||
this.getNewpdupdate();
|
// this.getNewpdupdate();
|
||||||
this.startedAccess=false
|
this.startedAccess=false
|
||||||
// this.checkOtpAccess=true
|
this.checkOtpAccess=true
|
||||||
this.startPdDiscussion()
|
this.startPdDiscussion()
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.checkOtpAccess=false
|
this.checkOtpAccess=false
|
||||||
|
// this.loading.dismissLoader()
|
||||||
}
|
}
|
||||||
|
|
||||||
},err=>alert(JSON.stringify(err)));
|
},err=>{alert(JSON.stringify(err));
|
||||||
|
// this.loading.dismissLoader()
|
||||||
|
});
|
||||||
// console.log('Buy clicked');
|
// console.log('Buy clicked');
|
||||||
},err=>{
|
},err=>{
|
||||||
alert("Cordova Error " +JSON.stringify(err))
|
alert("Cordova Error " +JSON.stringify(err))
|
||||||
this.updateStartedStatus(data)
|
this.updateStartedStatus(data)
|
||||||
|
// this.loading.dismissLoader()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,21 +681,21 @@ else{
|
|||||||
{
|
{
|
||||||
|
|
||||||
// let data:any;
|
// let data:any;
|
||||||
let alert = await this.alertCtrl.create({
|
// let alert = await this.alertCtrl.create({
|
||||||
header: 'Start Discussion',
|
// header: 'Start Discussion',
|
||||||
message: 'Are you starting the Discussion',
|
// message: 'Are you starting the Discussion',
|
||||||
buttons: [
|
// buttons: [
|
||||||
{
|
// {
|
||||||
text: 'No',
|
// text: 'No',
|
||||||
role: 'cancel',
|
// role: 'cancel',
|
||||||
handler: () => {
|
// handler: () => {
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
text: 'YES',
|
// text: 'YES',
|
||||||
handler: () => {
|
// handler: () => {
|
||||||
// this.geolocation.getCurrentPosition().then((resp) => {
|
// this.geolocation.getCurrentPosition().then((resp) => {
|
||||||
// this.currentPosPDofficer = resp.coords.latitude+","+resp.coords.longitude;
|
// this.currentPosPDofficer = resp.coords.latitude+","+resp.coords.longitude;
|
||||||
|
|
||||||
@ -730,13 +736,16 @@ else{
|
|||||||
pdDetails:pdValues
|
pdDetails:pdValues
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.loading.dismissLoader()
|
||||||
this.navCtrl.navigateForward('/pd/OtpPage',navigationExtras);
|
this.navCtrl.navigateForward('/pd/OtpPage',navigationExtras);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
let data:any;
|
let data:any;
|
||||||
data = {'pd_id':this.address_pd_id,'vendor_status':"INPROGRESS",'fk_updatedby':this.users,'updatedon':currentdate,'random_string':this.applicatentDetails.random_string};
|
data = {'pd_id':this.address_pd_id,'vendor_status':"INPROGRESS",'fk_updatedby':this.users,'updatedon':currentdate,'random_string':this.applicatentDetails.random_string};
|
||||||
this.pdDetails.updatepdStatus(data).subscribe(res=>{
|
this.pdDetails.updatepdStatus(data).subscribe(res=>{
|
||||||
|
// this.loading.dismissLoader()
|
||||||
if(res['dataStatus']){
|
if(res['dataStatus']){
|
||||||
|
// this.loading.dismissLoader()
|
||||||
let navigationExtras:NavigationExtras={
|
let navigationExtras:NavigationExtras={
|
||||||
state:{
|
state:{
|
||||||
pdDetails:pdValues,
|
pdDetails:pdValues,
|
||||||
@ -754,13 +763,15 @@ else{
|
|||||||
else{
|
else{
|
||||||
this.toast.pdTriggerappmessage("Something went wrong")
|
this.toast.pdTriggerappmessage("Something went wrong")
|
||||||
}
|
}
|
||||||
|
},err=>{
|
||||||
|
// this.loading.dismissLoader()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
});
|
// });
|
||||||
await alert.present();
|
// await alert.present();
|
||||||
}
|
}
|
||||||
getNewpdupdate()
|
getNewpdupdate()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,8 +58,10 @@ export class LoadingProvider {
|
|||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
console.log(this.loading)
|
console.log(this.loading)
|
||||||
|
if(this.loading) {
|
||||||
this.loading.dismiss()
|
this.loading.dismiss()
|
||||||
},800)
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -93,7 +93,7 @@ public commonimage = "http://pdgenie.com/logo/avatar.jpg";
|
|||||||
officeruserPoolId:'ap-south-1_qQ85yQZJO',
|
officeruserPoolId:'ap-south-1_qQ85yQZJO',
|
||||||
officerclientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
officerclientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
||||||
}
|
}
|
||||||
return production;
|
return testing;
|
||||||
}
|
}
|
||||||
|
|
||||||
getcurrentDate()
|
getcurrentDate()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user