Commit aa2a262b authored by wangqinghua's avatar wangqinghua

签到

parent e8f4e54d
......@@ -42,7 +42,7 @@ export class OutGoingReportPage {
//报备
goReport(item) {
console.log(item);
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
......
......@@ -37,14 +37,16 @@ export class OutGoingReportEditPage {
leaveTime: "", //离沪时间
backTime: "", //回沪时间
userpreDesc: "", //离沪说明
outaddressids: "" //个人报备选择的地点地址:保存id值
}
outaddressids: "", //个人报备选择的地点地址:保存id值
userId:'', //协助报备
userName:''
};
//报备截至日期
temp_endTime;
//临时离沪信息
temp_userpre = {}
person; //协助报备人
//离沪时间差
dategap: any;
//离沪地点显示
......@@ -114,6 +116,12 @@ export class OutGoingReportEditPage {
}
}
});
this.storage.get("person").then((value)=>{
if (value != null && value != ''){
this.person = value;
console.log(this.person);
}
})
//此操作只从报备列表页面到此页面,仅执行一次(不然每次都初始化了)
this.storage.remove("premanager");
this.gettemp_userprePre();
......@@ -200,7 +208,6 @@ export class OutGoingReportEditPage {
//提交报备
savePremanager() {
if (this.userpre.isorFromsh == 1) {
//判断离沪地点是否选择
if (this.userpre.outaddressids == null || this.userpre.outaddressids == '') {
......@@ -215,6 +222,9 @@ export class OutGoingReportEditPage {
}
}
this.userpre.userId = this.person.id;
this.userpre.userName = this.person.name;
//判断报备截止日期
let signflag = Date.parse(this.temp_endTime.toString()) > Date.parse(new Date().toString());
......@@ -223,30 +233,36 @@ export class OutGoingReportEditPage {
return false;
}
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/create", this.userpre)
.subscribe((res: Response) => {
let resultback = res.json();
if (resultback.code == '200') {
const index = this.navCtrl.getActive().index;
this.navCtrl.remove(0, index);
this.navCtrl.setRoot(MinePage);
this.navCtrl.parent.select(3);
this.navCtrl.push("MyReportPage");
this.storage.remove("premanager");
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
} else {
//失败
this.appService.popToastView(resultback.msg, 'middle', 1000);
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/create", this.userpre)
.subscribe((res: Response) => {
let resultback = res.json();
if (resultback.code == '200') {
if( this.person ){
const index = this.navCtrl.getActive().index;
this.navCtrl.remove(3, index);
this.navCtrl.pop();
}else{
const index = this.navCtrl.getActive().index;
this.navCtrl.remove(0, index);
this.navCtrl.setRoot(MinePage);
this.navCtrl.parent.select(3);
this.navCtrl.push("MyReportPage");
}
this.storage.remove("premanager");
this.storage.remove("person");
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
} else {
//失败
this.appService.popToastView(resultback.msg, 'middle', 1000);
}
}, error => {
this.appService.alert('网络异常!');
}
}, error => {
this.appService.alert('网络异常!');
}
);
);
}
//修改报备
......
......@@ -45,7 +45,7 @@
<button ion-button round class="btn color2" *ngIf="type == 2">离沪</button>
<button ion-button round class="btn color3" *ngIf="type == 3">不离沪</button>
</p>
<p style="color:#24bafc;margin-top: 6px">协助报备</p>
<p *ngIf="type == 1" (click)="goReport(item)" style="color:#24bafc;margin-top: 6px">协助报备</p>
</div>
</div>
......
......@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, AlertController, ToastController } from 'ionic-angular';
import { Http, Response} from '@angular/http';
import { Storage } from '@ionic/storage';
import { AppService } from '../../../service/appHttpService';
@IonicPage()
......@@ -18,18 +18,29 @@ export class ReportDetailPage {
itemsOfNotLeave: object[] = [];
title: string;
type: number;
id;
premanager; //报备信息
constructor(public navCtrl: NavController,
public navParams: NavParams,
public alertCtrl: AlertController,
public http: Http,
public http: Http,public storage: Storage,
public appService: AppService, public toast: ToastController) {
this.title = this.navParams.get("title");
let id = this.navParams.get("id");
this.getUserAboutLeave(id);
this.getUserAboutNotLeave(id);
this.getUserAboutNotReport(id);
}
ionViewDidLoad(){
this.premanager = this.navParams.get('item');
this.title = this.navParams.get("title");
this.id = this.navParams.get("id");
}
ionViewDidEnter(){
this.getUserAboutLeave(this.id);
this.getUserAboutNotLeave(this.id);
this.getUserAboutNotReport(this.id);
}
//获取处室下所有未报备人员
......@@ -87,4 +98,18 @@ export class ReportDetailPage {
}
}
//协助报备
goReport(item) {
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
this.storage.remove("person");
this.storage.set('premanager', this.premanager);
this.storage.set('person', item);
this.navCtrl.push('OutGoingReportEditPage', { premanager: this.premanager });
}
}
......@@ -5,7 +5,7 @@
</ion-header>
<ion-content class="bgc-e7e8ed">
<ion-list>
<ion-item *ngFor="let item of all" (click)="goDetail(item.id,item.title)">
<ion-item *ngFor="let item of all" (click)="goDetail(item)">
<div class="item">
<div class="item-header">
<div class="item-header-box">
......
......@@ -35,10 +35,11 @@ export class ReportTrackPage {
}
goDetail(id,title) {
goDetail(item) {
this.navCtrl.push("ReportDetailPage",{
id:id,
title:title
id:item.id,
title:item.title,
item:item
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment