task
This commit is contained in:
@@ -15,6 +15,24 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="ion-padding">
|
||||
|
||||
<!-- <ion-fab style="margin-top:100px;" slot="fixed" vertical="top" horizontal="end" [edge]="true">-->
|
||||
<!-- <ion-fab-button>-->
|
||||
<!-- <ion-icon name="chevron-down-circle"></ion-icon>-->
|
||||
<!-- </ion-fab-button>-->
|
||||
<!-- <ion-fab-list side="bottom">-->
|
||||
<!-- <ion-fab-button>-->
|
||||
<!-- <ion-icon name="document"></ion-icon>-->
|
||||
<!-- </ion-fab-button>-->
|
||||
<!-- <ion-fab-button>-->
|
||||
<!-- <ion-icon name="color-palette"></ion-icon>-->
|
||||
<!-- </ion-fab-button>-->
|
||||
<!-- <ion-fab-button>-->
|
||||
<!-- <ion-icon name="globe"></ion-icon>-->
|
||||
<!-- </ion-fab-button>-->
|
||||
<!-- </ion-fab-list>-->
|
||||
<!-- </ion-fab>-->
|
||||
|
||||
<div class="boxed_contents">
|
||||
<div
|
||||
class="bg_image back_image"
|
||||
@@ -119,4 +137,6 @@
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -507,6 +507,21 @@ ion-content {
|
||||
}
|
||||
}
|
||||
|
||||
ion-fab-button::part(native) {
|
||||
background-color: #b7f399;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
||||
color: black;
|
||||
}
|
||||
|
||||
ion-fab-button::part(native):hover::after {
|
||||
background-color: #a3e681;
|
||||
}
|
||||
|
||||
ion-fab-button::part(native):active::after {
|
||||
background-color: #87d361;
|
||||
}
|
||||
|
||||
ion-footer {
|
||||
--background: white;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, Input, OnInit} from "@angular/core";
|
||||
import { LoadingController, NavController } from "@ionic/angular";
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import {LoadingController, NavController, ToastController} from "@ionic/angular";
|
||||
import { Router } from "@angular/router";
|
||||
import { SessionDataProviderService } from "../../store/session-data-provider.service";
|
||||
import { WrenchService } from "../../services/wrench.service";
|
||||
@@ -27,14 +27,15 @@ export class FamilyaddtaskPage implements OnInit {
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private loadingCtrl: LoadingController
|
||||
private loadingCtrl: LoadingController,
|
||||
public toastController: ToastController
|
||||
) {
|
||||
// debugger;
|
||||
// debugger;
|
||||
this.familyMemberData = this.router.getCurrentNavigation().extras.state;
|
||||
|
||||
if (
|
||||
this.familyMemberData != undefined &&
|
||||
this.familyMemberData.itemData != undefined
|
||||
this.familyMemberData != undefined &&
|
||||
this.familyMemberData.itemData != undefined
|
||||
) {
|
||||
this.member_firstname = this.familyMemberData.itemData.firstname;
|
||||
this.member_lastname = this.familyMemberData.itemData.lastname;
|
||||
@@ -44,14 +45,13 @@ export class FamilyaddtaskPage implements OnInit {
|
||||
} else {
|
||||
this.onBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getJobManagerList();
|
||||
|
||||
this.session_image_server =
|
||||
this.sessionDataProviderService.session_image_server;
|
||||
this.sessionDataProviderService.session_image_server;
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
}
|
||||
onBack() {
|
||||
@@ -103,46 +103,51 @@ export class FamilyaddtaskPage implements OnInit {
|
||||
}
|
||||
|
||||
selected_task: any;
|
||||
jobData:any;
|
||||
job_select_id:number= 0;
|
||||
jobData: any;
|
||||
job_select_id: number = 0;
|
||||
jobSelected() {
|
||||
//selected_task
|
||||
console.log(this.selected_task);
|
||||
this.job_select_id = 0;
|
||||
let locJobData = this.jobManagerJobsData.filter((item) => item.job_uid == this.selected_task);
|
||||
if ( locJobData != undefined && locJobData.length == 1 && locJobData[0].id> 0){
|
||||
let locJobData = this.jobManagerJobsData.filter(
|
||||
(item) => item.job_uid == this.selected_task
|
||||
);
|
||||
if (
|
||||
locJobData != undefined &&
|
||||
locJobData.length == 1 &&
|
||||
locJobData[0].id > 0
|
||||
) {
|
||||
this.jobData = locJobData[0];
|
||||
this.job_select_id = this.jobData.id;
|
||||
this.job_select_id = this.jobData.id;
|
||||
console.log("this.jobData --- > ", this.jobData);
|
||||
}
|
||||
}
|
||||
|
||||
assigResult:any;
|
||||
assign_ind_result:string='';
|
||||
assign_mak_result:string='';
|
||||
|
||||
assigResult: any;
|
||||
assign_ind_result: string = "";
|
||||
assign_mak_result: string = "";
|
||||
|
||||
reqData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
job_id: string,
|
||||
job_uid: string,
|
||||
duration: number,
|
||||
description: string,
|
||||
job_detail:string,
|
||||
family_uid:string,
|
||||
price:number,
|
||||
timeline_days:number,
|
||||
title:string,
|
||||
country:string,
|
||||
assign_mode: number
|
||||
action: number;
|
||||
member_id: number;
|
||||
uid: string;
|
||||
sessionid: string;
|
||||
job_id: string;
|
||||
job_uid: string;
|
||||
duration: number;
|
||||
description: string;
|
||||
job_detail: string;
|
||||
family_uid: string;
|
||||
price: number;
|
||||
timeline_days: number;
|
||||
title: string;
|
||||
country: string;
|
||||
assign_mode: number;
|
||||
};
|
||||
|
||||
async sendFamTask(jobData){
|
||||
async sendFamTask(jobData) {
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Sending...',
|
||||
message: "Sending...",
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
@@ -153,7 +158,7 @@ export class FamilyaddtaskPage implements OnInit {
|
||||
// }
|
||||
|
||||
this.reqData = {
|
||||
action:13025,
|
||||
action: 13025,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
@@ -167,33 +172,40 @@ export class FamilyaddtaskPage implements OnInit {
|
||||
timeline_days: this.jobData.timeline_days,
|
||||
title: this.jobData.title,
|
||||
country: this.jobData.job_country,
|
||||
assign_mode: 110055
|
||||
assign_mode: 110055,
|
||||
};
|
||||
// console.log('XXX-> ', this.reqData );
|
||||
|
||||
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_ind_result = "Task sent to the email - " +this.job_recipient;
|
||||
// this.job_recipient='';
|
||||
const event = new Event("app-myjob-offers-refresh");
|
||||
// Dispatch the event.
|
||||
dispatchEvent(event);
|
||||
setTimeout(() => {
|
||||
this.assign_ind_result ='';
|
||||
}, 3000);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.wrenchService.assignTask(this.reqData).subscribe((assigResult) => {
|
||||
loading.dismiss();
|
||||
this.assigResult = assigResult;
|
||||
console.log("assigResult RETURN->", this.assigResult);
|
||||
if (
|
||||
this.assigResult != undefined &&
|
||||
this.assigResult.internal_return > 0 &&
|
||||
this.assigResult.offer_code != undefined &&
|
||||
this.assigResult.offer_code != ""
|
||||
) {
|
||||
const event = new Event("app-myjob-offers-refresh");
|
||||
this.presentToast("Task Sent",'middle');
|
||||
dispatchEvent(event);
|
||||
setTimeout(() => {
|
||||
this.assign_ind_result = "";
|
||||
this.onBack();
|
||||
}, 3000);
|
||||
} else {
|
||||
this.presentToast("Error: Unable to send task ",'middle');
|
||||
}
|
||||
});
|
||||
}
|
||||
async presentToast(amessage, position: 'top' | 'middle' | 'bottom') {
|
||||
const toast = await this.toastController.create({
|
||||
message: amessage,
|
||||
duration: 2500,
|
||||
position: position,
|
||||
});
|
||||
|
||||
await toast.present();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user