diff --git a/src/app/components/pending-suggested/pending-suggested.component.html b/src/app/components/pending-suggested/pending-suggested.component.html index d77d31d..d24b660 100644 --- a/src/app/components/pending-suggested/pending-suggested.component.html +++ b/src/app/components/pending-suggested/pending-suggested.component.html @@ -46,17 +46,24 @@
- NGN - USD + border-radius: 0px 10px 10px 0px;" + [(ngModel)]='country' + (ionChange)="testInputs()" + aria-label="Favorite Fruit" value="Naira"> + NGN + USD
Timeline
- + {{item.tx}}
@@ -71,7 +78,13 @@
Delivery Details
- + @@ -106,8 +119,8 @@ Assign Task + [disabled]="isDisabled" + (click)="processTask()">Assign Task diff --git a/src/app/components/pending-suggested/pending-suggested.component.ts b/src/app/components/pending-suggested/pending-suggested.component.ts index 92d6753..968adb5 100644 --- a/src/app/components/pending-suggested/pending-suggested.component.ts +++ b/src/app/components/pending-suggested/pending-suggested.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit } from '@angular/core'; -import {NavController} from "@ionic/angular"; +import {Component, OnInit, ViewChild} from '@angular/core'; +import {LoadingController, NavController} from "@ionic/angular"; import {Router} from "@angular/router"; import {SessionDataProviderService} from "../../store/session-data-provider.service"; import {WrenchService} from "../../services/wrench.service"; @@ -12,11 +12,14 @@ import {FamilysuggestPendingService} from "../../store/familysuggest-pending.ser }) export class PendingSuggestedComponent implements OnInit { familyPendingData: []; + isDisabled:boolean= true; + constructor( private navctr: NavController, private router: Router, public sessionDataProviderService: SessionDataProviderService, private wrenchService: WrenchService, - public familysuggestPendingService: FamilysuggestPendingService) { + public familysuggestPendingService: FamilysuggestPendingService, + private loadingCtrl: LoadingController) { addEventListener('app-pending-suggested-closemodal', () => { this.setCloseModal(); @@ -89,4 +92,87 @@ selectedItem:any; this.isModalOpenBackdrop= false; },1000); } + + reqData: { + action:number, + member_id: number, + uid: string, + sessionid: string, + family_uid: string, + category : string, + banner: string, + title: string, + timeline_days: number, + job_description: string, + job_detail:string, + country: string, + assign_mode: number + }; + +@ViewChild('timeline_days') timeline_days; +@ViewChild('title') title; +@ViewChild('job_description') job_description; +@ViewChild('job_detail') job_detail; +@ViewChild('country') country; + assigResult:any; + assign_ind_result:string=''; + assign_mak_result:string=''; + + async sendOfferToFamily(){ + if ( this.timeline_days== undefined || this.timeline_days < 1){ + alert("Select Duration"); + return; + } + this.reqData = { + action:13025, + member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, + sessionid: this.sessionDataProviderService.session, + family_uid: this.selectedItem.family_uid, + category:'', + banner: '', + title: this.selectedItem.title, + timeline_days: this.timeline_days, + job_description: this.selectedItem.description, + job_detail: this.timeline_days, + country: this.country, + assign_mode: 110055 + }; +// console.log('XXX-> ', this.reqData ); + // debugger; + + const loading = await this.loadingCtrl.create({ + message: 'Sending...', + duration: 5000, + }); + + loading.present(); + + this.wrenchService.assignTask(this.reqData).subscribe( + assigResult => { + this.assigResult = assigResult; + console.log("assigResult RETURN->", this.assigResult); + if ( this.assigResult != undefined && this.assigResult.internal_return > 0){ + this.assign_mak_result = "Task sent to market"; + const event = new Event("app-myjob-offers-refresh"); + // Dispatch the event. + dispatchEvent(event); + setTimeout(() => { + this.assign_mak_result =''; + }, 3000); + } + else + { + + } + } + ); + + } + testInputs(){ +//isDisabled + } + processTask(){ + + } } diff --git a/src/app/pages/ownersjob/ownersjob.page.html b/src/app/pages/ownersjob/ownersjob.page.html index f2151a9..7fd92eb 100644 --- a/src/app/pages/ownersjob/ownersjob.page.html +++ b/src/app/pages/ownersjob/ownersjob.page.html @@ -130,7 +130,7 @@ - Prefered List + Preferred List