assign job
This commit is contained in:
@@ -67,7 +67,8 @@
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-select label="Stacked label" label-placement="stacked">
|
||||
<ion-select [(ngModel)]='job_duration' label="Stacked label" label-placement="stacked">
|
||||
<ion-select-option value="0" selected="true">Select Duration</ion-select-option>
|
||||
<ion-select-option value="1">1 Day</ion-select-option>
|
||||
<ion-select-option value="2">2 Days</ion-select-option>
|
||||
<ion-select-option value="3">3 Days</ion-select-option>
|
||||
@@ -108,7 +109,7 @@
|
||||
<ion-col>
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-input label="Email of recipient" placeholder="Enter Recipient Email" maxlength="35"></ion-input>
|
||||
<ion-input label="Email of recipient" [(ngModel)]='job_recipient' placeholder="Enter Recipient Email" maxlength="35"></ion-input>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-col>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
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";
|
||||
@@ -10,6 +10,9 @@ import {WrenchService} from "../../services/wrench.service";
|
||||
styleUrls: ['./ownersjob.page.scss'],
|
||||
})
|
||||
export class OwnersjobPage implements OnInit {
|
||||
@ViewChild('job_duration') job_duration;
|
||||
@ViewChild('job_recipient') job_recipient;
|
||||
|
||||
jobData: any;
|
||||
item_banner:string = 'default.jpg';
|
||||
session_image_server:string='';
|
||||
@@ -29,6 +32,7 @@ export class OwnersjobPage implements OnInit {
|
||||
if (this.jobData== undefined){
|
||||
this.onBack();
|
||||
}
|
||||
//debugger;
|
||||
}
|
||||
onBack() {
|
||||
this.navctr.back();
|
||||
@@ -38,17 +42,99 @@ export class OwnersjobPage implements OnInit {
|
||||
//this.activeJobMsgList();
|
||||
}
|
||||
|
||||
|
||||
validateEmail(email) {
|
||||
var re = /\S+@\S+\.\S+/;
|
||||
return re.test(email);
|
||||
}
|
||||
async sendOfferToIndividual(){
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Sending...',
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
if ( this.job_recipient== undefined || !this.validateEmail( this.job_recipient)){
|
||||
alert("Enter valid email");
|
||||
return;
|
||||
}
|
||||
|
||||
this.reqData = {
|
||||
action:13025,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
job_id: this.jobData.job_id,
|
||||
job_uid: this.jobData.job_uid,
|
||||
duration: 0,
|
||||
job_description: this.jobData.description,
|
||||
email: this.job_recipient,
|
||||
assign_mode: 110033
|
||||
};
|
||||
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){
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
reqData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
job_id: string,
|
||||
job_uid: string,
|
||||
duration: number,
|
||||
job_description: string,
|
||||
email:string,
|
||||
assign_mode: number
|
||||
};
|
||||
|
||||
/*
|
||||
'member_id' => int 1
|
||||
'sessionid' => string 'FF736CCF2D202B59164BD144152E6BF670EC1171FD54CF831966C0252B1F643D' (length=64)
|
||||
'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36)
|
||||
'job_id' => string '98' (length=2)
|
||||
'job_uid' => string '473d3239-ecd7-4eb5-859c-78261720cb8e' (length=36)
|
||||
'duration' => int 10
|
||||
'job_description' => string 'Nitetronic Z6 Anti Snoring Pillow, Best Snore Stopper Device, Clinically Proven Snoring Solution for Snorers, Smart Stop Snoring Technology Suitable for All Sleepers' (length=165)
|
||||
'action' => int 13025
|
||||
'assign_mode' => int 110022
|
||||
*/
|
||||
|
||||
async sendOfferToMarket(){
|
||||
if ( this.job_duration== undefined || this.job_duration < 1){
|
||||
alert("Select Duration");
|
||||
return;
|
||||
}
|
||||
this.reqData = {
|
||||
action:13025,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
job_id: this.jobData.job_id,
|
||||
job_uid: this.jobData.job_uid,
|
||||
duration: this.job_duration,
|
||||
job_description: this.jobData.description,
|
||||
email: '',
|
||||
assign_mode: 110022
|
||||
};
|
||||
console.log('XXX-> ', this.reqData );
|
||||
// debugger;
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Sending...',
|
||||
duration: 5000,
|
||||
@@ -56,5 +142,26 @@ export class OwnersjobPage implements OnInit {
|
||||
|
||||
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){
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
assigResult:any;
|
||||
|
||||
// assignTask(reqData){
|
||||
// return this.getPostData("assigntask", reqData);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -147,7 +147,9 @@ export class WrenchService {
|
||||
return this.getPostData('homebanners',usrData);
|
||||
}
|
||||
|
||||
//
|
||||
assignTask(reqData){
|
||||
return this.getPostData("assigntask", reqData);
|
||||
}
|
||||
|
||||
getFamilySampleTasks(reqData) {
|
||||
return this.getPostData("familysampletasks", reqData);
|
||||
|
||||
Reference in New Issue
Block a user