Commit 2998a412 authored by wangqinghua's avatar wangqinghua

值班

parent 6a3479d8
/node_modules
/platforms/android/
/www
/.sourcemaps
/plugins
/platforms
......@@ -4,9 +4,11 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/platforms" />
<excludeFolder url="file://$MODULE_DIR$/platforms/android" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<content url="file://$MODULE_DIR$/platforms/android" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
......
......@@ -7,7 +7,7 @@
"proxies": [
{
"path": "/wisdomgroup",
"proxyUrl": "http://10.10.202.54:8080/wisdomgroup"
"proxyUrl": "http://180.168.156.212:2931/wisdomgroup"
}
]
}
\ No newline at end of file
......@@ -46,7 +46,6 @@ export class MyApp {
});
//log角标数目显示
badge.set(10);
});
}
}
......@@ -3,3 +3,6 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
export const monthCh = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
export const weekDay = ['日', '一', '二', '三', '四', '五', '六'];
......@@ -18,9 +18,9 @@ export class DutySignUpPage {
ionViewDidLoad() {
this.id = this.navParams.get('id');
const data = {
'id':this.id
'id':'fdc14f03746743bea1d9167b165ca76b'
};
this.appService.ObserverHttpGet('/schedule/hasSignIn',data)
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/hasSignIn',data)
.subscribe((res)=>{
console.log(res);
})
......@@ -31,7 +31,7 @@ export class DutySignUpPage {
id:this.id, //值班记录id,
address:'' //签到地址
};
this.appService.ObserverHttpGet('/schedule/signIn',data)
this.appService.ObserverHttpGet('/wisdomgroup/schedule/signIn',data)
.subscribe((res)=>{
console.log(res);
})
......
......@@ -20,10 +20,10 @@
<ion-content direction="y" scrollbar-y="true" class="bgc-e7e8ed">
<ng-container *ngIf="changeType == 1">
<ion-calendar [(ngModel)]="date"
(onSelect)="onChange($event)"
[options]="optionsMulti"
[type]="type"
[format]="'YYYY-MM-DD'">
(onChange)="onChange($event)"
[options]="options"
type="string"
format="YYYY-MM-DD">
</ion-calendar>
<div>
<ion-item>
......
......@@ -6,6 +6,7 @@ import {DutyApplyPage} from "../duty-apply/duty-apply";
import {DutyDetailPage} from "../duty-detail/duty-detail";
import {DutySignUpPage} from "../duty-sign-up/duty-sign-up";
import { DayConfig } from "ion2-calendar";
import {monthCh, weekDay} from "../../../app/main";
declare var Swiper;
@IonicPage()
......@@ -20,34 +21,25 @@ export class DutyPage {
{name:'我的值班'},
]
swiperIndex;
optionsMulti: CalendarComponentOptions ={};
changeType = 1;
dayObj;
nightObj;
nowDuty;
historyDuty;
date: string[] = ['2018-01-01', '2018-01-02', '2018-01-05'];
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat:monthCh,
pickMode: 'multi',
color:'danger'
};
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidLoad() {
let _daysConfig: DayConfig[] = [];
for (let i = 0; i < 31; i++) {
_daysConfig.push({
date: new Date(2018, 8, i + 1),
marked:true,
cssClass:'lass on-selected'
})
}
console.log(_daysConfig);
this.optionsMulti = {
pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ',
weekdays: ['天', '一', '二', '三', '四', '五', '六'],
weekStart: 1,
daysConfig:_daysConfig,
color:'danger'
};
const date = new Date().toLocaleDateString();
this.getDuty(date);
......
......@@ -37,6 +37,8 @@ export class LoginPage {
}
ionViewDidLoad(){
alert("123");
this.storage.get("userLoginInfo").then((value)=>{
if(value!=null && value != ''){
this.user = value;
......
......@@ -9,5 +9,6 @@
<ion-content padding>
<button *ngIf="applyType == 'replace'" class="submit-btn submit" (click)="replace()">确认替班</button>
<button *ngIf="applyType == 'change'" class="submit-btn submit" (click)="change()">确认换班</button>
</ion-content>
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {AppService} from "../../../service/appHttpService";
......@@ -19,38 +19,43 @@ export class ChangeApplySurePage {
}
ionViewDidLoad() {
console.log('ionViewDidLoad ChangeApplySurePage');
this.personId = this.navParams.get('personId');
this.nowId = this.navParams.get('nowId');
this.changeId = this.navParams.get('changeId');
if(this.personId){
console.log('personId:' + this.personId);
console.log('nowId:' + this.nowId);
console.log('changeId:' + this.changeId);
if (this.personId) {
this.applyType = 'replace'; //值班
}else{
} else {
this.applyType = 'change'; //替班
}
}
//换
change(){
//替
replace() {
const data = {
id:'', //值班记录id
personId:'' //替班人id
id: this.nowId, //值班记录id
personId: this.personId //替班人id
};
this.appService.ObserverHttpGet('/wisdomgroup/schedule/change',data)
.subscribe((res)=>{
console.log(data);
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/replace', data)
.subscribe((res) => {
console.log(res.json());
})
}
//替
replace(){
//换
change() {
const data = {
nowId:'', //值班记录id
changeId:'' //互换的值班ID
nowId: this.nowId, //值班记录id
changeId: this.changeId //互换的值班ID
};
this.appService.ObserverHttpGet('/wisdomgroup/schedule/replace ',data)
.subscribe((res)=>{
console.log(data);
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/change',data)
.subscribe((res) => {
console.log(res.json());
})
}
......
......@@ -13,6 +13,7 @@ export class DutyApplyHandlePage {
applyDetail = {
id:'',
scheduleId:'',
reason:''
};
personDetail = {
......@@ -40,13 +41,13 @@ export class DutyApplyHandlePage {
switch (type){
case '1':{ //换班
this.navCtrl.push('SelectChangePersonPage',{
nowId:this.applyDetail.id
nowId:this.applyDetail.scheduleId
});
break;
}
case '2':{ //替班
this.navCtrl.push('SelectRelayPersonPage',{
id:this.applyDetail.id
id:this.applyDetail.scheduleId
});
break;
}
......
<!--
Generated template for the SelectChangePersonPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>选择换班人员</ion-title>
</ion-navbar>
<div class="duty">
<div class="dutyItem" (click)="change(0)">
<span class="{{changeType == 0?'duty-title':''}}">白班</span>
</div>
<div class="dutyItem" (click)="change(1)">
<span class="{{changeType == 1?'duty-title':''}}">夜班</span>
</div>
</div>
</ion-header>
......@@ -18,8 +21,7 @@
<ion-item *ngFor="let item of list;" >
<div (click)="select(item)">
<span>{{item.dutyDate | date:'yyyy-MM-dd'}}</span>
<span *ngIf="item.nightName">夜班:{{item.nightName}}</span>
<span *ngIf="item.dayName">白班:{{item.dayName}}</span>
<span>{{item.name}}</span>
</div>
</ion-item>
......
page-select-change-person {
.duty{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.duty div{
width: 50%;
text-align: center;
position: relative;
}
.duty-title{
position: relative;
color: #24bafc;
}
.duty-title::after{
content: '';
position: absolute;
width: 100%;
height: 2px;
background-color: #24bafc;
bottom: -8px;
left: 0px;
}
}
......@@ -19,6 +19,7 @@ export class SelectChangePersonPage {
nowId;
list = [];
changeType = 0;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
......@@ -30,9 +31,10 @@ export class SelectChangePersonPage {
getMonth(){
const data = {
date:'2018/10/01'
date:'2018/10/01',
type:this.changeType
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonth',data)
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonthAndType',data)
.subscribe((res)=>{
this.list = res.json();
console.log(res.json())
......@@ -42,9 +44,14 @@ export class SelectChangePersonPage {
//换班
select(item){
this.navCtrl.push('ChangeApplySurePage',{
'changeId':'',
'changeId':item.id,
'nowId':this.nowId
})
}
change(type){
this.changeType = type;
this.getMonth();
}
}
......@@ -3,10 +3,25 @@
<ion-navbar>
<ion-title>选择替班人员</ion-title>
</ion-navbar>
<div class="duty">
<div class="dutyItem" (click)="change(0)">
<span class="{{changeType == 0?'duty-title':''}}"></span>
</div>
<div class="dutyItem" (click)="change(1)">
<span class="{{changeType == 1?'duty-title':''}}"></span>
</div>
</div>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item *ngFor="let item of list">
<div (click)="selectPerson(item)">
<span>{{item.name}}</span>
<span>{{item.orgName}}</span>
<span>{{item.phoneNumber}}</span>
</div>
</ion-item>
</ion-list>
</ion-content>
page-select-relay-person {
.duty{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.duty div{
width: 50%;
text-align: center;
position: relative;
}
.duty-title{
position: relative;
color: #24bafc;
}
.duty-title::after{
content: '';
position: absolute;
width: 100%;
height: 2px;
background-color: #24bafc;
bottom: -8px;
left: 0px;
}
}
......@@ -18,32 +18,41 @@ import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure";
export class SelectRelayPersonPage {
id;
list;
changeType = 0;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidLoad() {
this.id = this.navParams.get('id');
console.log('nowId:'+this.id);
this.getPerson();
}
getPerson(){
const data = {
date:'2018/10/01',
gender:'0',
gender:this.changeType,
id:''
};
this.appService.ObserverHttpGetOption('/wisdomgroup/dutyPerson/getPersonListOutOfMine',data)
.subscribe((res)=>{
this.list = res.json();
})
}
//替班
selectPerson(item){
this.navCtrl.push('ChangeApplySurePage',{
'personId':item.personId,
'personId':item.id,
'nowId':this.id
})
}
change(type){
this.changeType = type;
this.getPerson();
}
}
......@@ -80,7 +80,7 @@ export class AppService {
//get请求带?的
ObserverHttpGetOption(url,params): Observable<any>{
// return this.http.get(AppGlobal.domain+url+this.encode(params,"get")) //app
// return this.http.get(AppGlobal.domain+url+this.encode(params,"get")); //app
return this.http.get(url ,{
params:params
}); //本地
......
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