send suggested

This commit is contained in:
CHIEFSOFT\ameye
2023-12-18 07:45:21 -05:00
parent 9383b0ad0a
commit 5bcaf984c2
2 changed files with 31 additions and 18 deletions
@@ -60,15 +60,6 @@
<div *ngIf="tabs =='about'" class="about"> <div *ngIf="tabs =='about'" class="about">
<ion-grid> <ion-grid>
<ion-row>
<ion-col class="mtop">
<ion-button
expand="block"
shape="round"
size="small"
(click)="sendReminder()">Send Reminder</ion-button>
</ion-col>
</ion-row>
<ion-row> <ion-row>
<ion-col class="mtop"> <ion-col class="mtop">
<ion-button color="danger" <ion-button color="danger"
@@ -76,6 +67,18 @@
shape="round" shape="round"
size="small" (click)="cancelSuggest()">Cancel Request</ion-button> size="small" (click)="cancelSuggest()">Cancel Request</ion-button>
</ion-col> </ion-col>
<ion-col class="mtop">
<ion-button
expand="block"
shape="round"
size="small"
[disabled]="sendDisabled"
(click)="sendReminder()">Send Reminder</ion-button>
</ion-col>
</ion-row>
<ion-row>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</div> </div>
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {AlertController, NavController} from "@ionic/angular"; import {AlertController, LoadingController, NavController} from "@ionic/angular";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service"; import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service"; import {WrenchService} from "../../services/wrench.service";
@@ -12,16 +12,17 @@ import {WrenchService} from "../../services/wrench.service";
export class SuggestdetailsPage implements OnInit { export class SuggestdetailsPage implements OnInit {
tabs = 'about'; tabs = 'about';
suggestTotalData:any; suggestTotalData:any;
suggestData:any; suggestData:any;
suggestActionData:any; suggestActionData:any;
constructor( constructor(
private navctr: NavController, private navctr: NavController,
private router: Router, private router: Router,
public sessionDataProviderService: SessionDataProviderService, public sessionDataProviderService: SessionDataProviderService,
private alertController:AlertController, private alertController:AlertController,
private wrenchService: WrenchService private wrenchService: WrenchService,
private loadingCtrl: LoadingController,
) { ) {
// debugger; // debugger;
this.suggestTotalData = this.router.getCurrentNavigation().extras.state; this.suggestTotalData = this.router.getCurrentNavigation().extras.state;
@@ -66,7 +67,7 @@ suggestActionData:any;
text: "Send", text: "Send",
handler: () => { handler: () => {
this.setSuggestStatus(222); // remind this.setSuggestStatus(222); // remind
this.onBack(); // this.onBack();
}, },
}, },
], ],
@@ -99,13 +100,18 @@ suggestActionData:any;
await alert.present(); await alert.present();
} }
statusResult:any; statusResult:any;
sendDisabled:boolean= false;
//define('WRENCHBOARD_FAMILY_SGGESTSTATUS', 22026); //define('WRENCHBOARD_FAMILY_SGGESTSTATUS', 22026);
suggestEditData: { suggestEditData: {
action:number, member_id: number, uid: string, sessionid: string, suggest_uid:20, suggest_action: string,offset: 0 action:number, member_id: number, uid: string, sessionid: string, suggest_uid:20, suggest_action: string,offset: 0
}; };
setSuggestStatus(suggest_action){ async setSuggestStatus(suggest_action){
const loading = await this.loadingCtrl.create({
message: 'Sending...',
duration: 3500,
});
this.suggestEditData = this.suggestEditData =
{ {
action:22026, action:22026,
@@ -116,10 +122,14 @@ suggestActionData:any;
suggest_action:suggest_action,offset: 0 suggest_action:suggest_action,offset: 0
}; };
loading.present();
this.wrenchService.setSuggestStatus(this.suggestEditData).subscribe( this.wrenchService.setSuggestStatus(this.suggestEditData).subscribe(
statusResult => { statusResult => {
this.statusResult = statusResult; loading.dismiss();
console.log("statusResult RETURN->", this.statusResult); this.statusResult = statusResult;
console.log("statusResult RETURN->", this.statusResult);
this.sendDisabled= true;
//this.total_family = this.familyData.length; //this.total_family = this.familyData.length;
} }