Job Group assign
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-button size="small" shape="round" expand="block">Create a group</ion-button>
|
||||
<ion-button size="small" shape="round" expand="block" (click)="addGroup()">Create a group</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
@@ -32,6 +32,7 @@
|
||||
</div>
|
||||
<div style="float: right; width: 20%;">
|
||||
<ion-button
|
||||
(click)="addGroup()"
|
||||
style="height: 35px;"
|
||||
size="small" >+Group</ion-button>
|
||||
</div>
|
||||
@@ -55,7 +56,11 @@
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
<ion-item>
|
||||
<ion-button size="small" shape="round" expand="block">Add Member</ion-button>
|
||||
<ion-button
|
||||
size="small"
|
||||
(click)="addGroupMember()"
|
||||
shape="round"
|
||||
expand="block">Add Member</ion-button>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {Component, Input, OnInit, ViewChild} from '@angular/core';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {AlertController, LoadingController} from "@ionic/angular";
|
||||
@@ -11,6 +11,7 @@ import {JobgroupDataService} from "../../store/jobgroup-data.service";
|
||||
})
|
||||
export class JobGroupComponent implements OnInit {
|
||||
@ViewChild('job_group') job_group;
|
||||
@Input('jobData') jobData:any;
|
||||
|
||||
constructor( public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
@@ -67,7 +68,7 @@ export class JobGroupComponent implements OnInit {
|
||||
{
|
||||
text: "Send now",
|
||||
handler: () => {
|
||||
|
||||
this.sendOfferGroup();
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -75,4 +76,75 @@ export class JobGroupComponent implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
async sendOfferGroup(){
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Sending...',
|
||||
duration: 5000,
|
||||
});
|
||||
/*
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "job_id", 1, -1);
|
||||
REQ_LONG(in, "group_id", 1, -1);
|
||||
//REQ_STRING (in, "email", 1, 59, "(.*)");
|
||||
REQ_STRING(in, "job_description", 1, 5000, "(.*)");
|
||||
*/
|
||||
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,
|
||||
group_id: this.job_group,
|
||||
duration: 0,
|
||||
job_description: this.jobData.description,
|
||||
email: '',
|
||||
assign_mode: 110044
|
||||
};
|
||||
// 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 group ";
|
||||
const event = new Event("app-myjob-offers-refresh");
|
||||
// Dispatch the event.
|
||||
dispatchEvent(event);
|
||||
setTimeout(() => {
|
||||
this.assign_ind_result ='';
|
||||
}, 3000);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
reqData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
job_id: string,
|
||||
job_uid: string,
|
||||
group_id: number,
|
||||
duration: number,
|
||||
job_description: string,
|
||||
email:string,
|
||||
assign_mode: number
|
||||
};
|
||||
assigResult:any;
|
||||
assign_ind_result:string='';
|
||||
assign_mak_result:string='';
|
||||
|
||||
addGroup(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<ion-label>Preferred List</ion-label>
|
||||
</ion-item>
|
||||
<div class="ion-padding" slot="content">
|
||||
<app-job-group></app-job-group>
|
||||
<app-job-group [jobData]="jobData"></app-job-group>
|
||||
</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
|
||||
@@ -44,6 +44,7 @@ export class OwnersjobPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
validateEmail(email) {
|
||||
var re = /\S+@\S+\.\S+/;
|
||||
return re.test(email);
|
||||
|
||||
Reference in New Issue
Block a user