Commit 4bf815e1 authored by wangqinghua's avatar wangqinghua

color

parent 15bae915
...@@ -115,6 +115,11 @@ export class DutyPage { ...@@ -115,6 +115,11 @@ export class DutyPage {
//提交申请 //提交申请
dutyApply(item){ dutyApply(item){
let nowTime = new Date().getTime();
if(nowTime > item.dutyDate){
this.appService.popToastView('该条值班已过期','middle',1500);
return false;
}
this.navCtrl.push('DutyApplyPage',{ this.navCtrl.push('DutyApplyPage',{
id:item.id, id:item.id,
date:item.dutyDate date:item.dutyDate
......
...@@ -30,10 +30,11 @@ ...@@ -30,10 +30,11 @@
</div> </div>
<div> <div>
<span class="color-666" style="font-size: 1.5rem"> <span class="color-666" style="font-size: 1.5rem">
<span *ngIf="item.type == 1">工作日</span> <span *ngIf="item.dayType == 1">工作日</span>
<span *ngIf="item.type == 2">节假日</span> <span *ngIf="item.dayType == 2">节假日</span>
<span *ngIf="item.type == 3">调休</span> <span *ngIf="item.dayType == 3">调休</span>
<span *ngIf="item.type == 4">调班</span> <span *ngIf="item.dayType == 4">调班</span>
<span *ngIf="item.dayType == 5">周末</span>
</span> </span>
<span class="span-btn" float-right (click)="dutyDetail(item)" *ngIf="item.applyId">查看详情</span> <span class="span-btn" float-right (click)="dutyDetail(item)" *ngIf="item.applyId">查看详情</span>
......
...@@ -46,6 +46,12 @@ export class MyDutyPage { ...@@ -46,6 +46,12 @@ export class MyDutyPage {
//提交申请 //提交申请
dutyApply(item){ dutyApply(item){
let nowTime = new Date().getTime();
if(nowTime > item.dutyDate){
this.appService.popToastView('该条值班已过期','middle',1500);
return false;
}
this.navCtrl.push('DutyApplyPage',{ this.navCtrl.push('DutyApplyPage',{
id:item.id, id:item.id,
date:item.dutyDate date:item.dutyDate
......
...@@ -73,13 +73,13 @@ ...@@ -73,13 +73,13 @@
</ion-item> </ion-item>
</div> </div>
</ion-list> </ion-list>
<!--<p class="text-center">--> <p class="text-center">
<!--<label>--> <label>
<!--<input type="checkbox" [(ngModel)]="isans">--> <input type="checkbox" [(ngModel)]="isans">
<!--<span class="input-check"></span>--> <span class="input-check"></span>
<!--<span>匿名回答</span>--> <span>匿名回答</span>
<!--</label>--> </label>
<!--</p>--> </p>
<button class="submit-btn submit" (click)="confirm()">提交</button> <button class="submit-btn submit" (click)="confirm()">提交</button>
</ion-content> </ion-content>
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
</ion-item> </ion-item>
<ion-item> <ion-item>
<span><span class="color-red">*</span>参与用户组</span> <span><span class="color-red">*</span>参与用户组</span>
<span (click)="selectPerson()" class="color-666" style="font-size: 1.5rem" float-right>{{groupName}}<ion-icon style="vertical-align: text-bottom;margin-left: 4px;" ios="ios-arrow-forward" md="md-arrow-forward"></ion-icon> </span> <span (click)="selectPerson()" class="color-666" style="font-size: 1.5rem" float-right>{{groupName}}<ion-icon
style="vertical-align: text-bottom;margin-left: 4px;" ios="ios-arrow-forward"
md="md-arrow-forward"></ion-icon> </span>
</ion-item> </ion-item>
<ion-item> <ion-item>
<ion-label stacked>问卷说明</ion-label> <ion-label stacked>问卷说明</ion-label>
...@@ -25,12 +27,12 @@ ...@@ -25,12 +27,12 @@
<ion-item> <ion-item>
<ion-label>问卷结果公开</ion-label> <ion-label>问卷结果公开</ion-label>
<ion-toggle disabled [checked]="true"></ion-toggle> <ion-toggle [(ngModel)]="isopen"></ion-toggle>
</ion-item>
<ion-item>
<ion-label>匿名回答</ion-label>
<ion-toggle [(ngModel)]="isans"></ion-toggle>
</ion-item> </ion-item>
<!--<ion-item>-->
<!--<ion-label>匿名回答</ion-label>-->
<!--<ion-toggle [(ngModel)]="isans"></ion-toggle>-->
<!--</ion-item>-->
</ion-list> </ion-list>
<button *ngIf="id" class="submit-btn submit" (click)="submitEdit()">保存</button> <button *ngIf="id" class="submit-btn submit" (click)="submitEdit()">保存</button>
......
import { Component } from '@angular/core'; import {Component} from '@angular/core';
import {IonicPage, ModalController, NavController, NavParams, ToastController} from 'ionic-angular'; import {IonicPage, ModalController, NavController, NavParams, ToastController} from 'ionic-angular';
import {EditPage} from "../edit/edit"; import {EditPage} from "../edit/edit";
import {PersonPage} from "../../modal/person/person"; import {PersonPage} from "../../modal/person/person";
import { AppService } from "../../../../service/appHttpService"; import {AppService} from "../../../../service/appHttpService";
import {message} from "../../../../app/main"; import {message} from "../../../../app/main";
...@@ -15,61 +15,70 @@ export class DesicrPage { ...@@ -15,61 +15,70 @@ export class DesicrPage {
id; id;
isans = null; //匿名
isopen; //公开
desrc = { desrc = {
title:'', //问卷标题 title: '', //问卷标题
explai:'', //问卷说明 explai: '', //问卷说明
usergroup:null, //用户组id usergroup: null, //用户组id
isopen:1, //是否公开 isopen: 1, //是否公开
isans:1, //是否匿名 isans: 1, //是否匿名
state:1 //状态 state: 1 //状态
}; };
groupName = '全体用户'; groupName = '全体用户';
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public modalCtrl: ModalController,public appService: AppService, public modalCtrl: ModalController, public appService: AppService,
public toastCtrl: ToastController) { public toastCtrl: ToastController) {
} }
ionViewDidLoad() { ionViewDidLoad() {
if(this.navParams.get('id')){ if (this.navParams.get('id')) {
this.id = this.navParams.get('id'); this.id = this.navParams.get('id');
this.getDetail(); this.getDetail();
} }
} }
//新建 //新建
submitOrder(){ submitOrder() {
const toast = this.toastCtrl.create(message); const toast = this.toastCtrl.create(message);
if( !this.desrc.title ){ if (!this.desrc.title) {
toast.setMessage('请填写标题'); toast.setMessage('请填写标题');
toast.present(); toast.present();
return false return false
} }
if(this.desrc.usergroup == null){ if (this.desrc.usergroup == null) {
this.desrc.usergroup = 'all'; this.desrc.usergroup = 'all';
} }
if(this.desrc.isopen){ if (this.desrc.isopen) {
this.desrc.isopen = 1; this.desrc.isopen = 1;
}else{ } else {
this.desrc.isopen = 0; this.desrc.isopen = 0;
} }
this.appService.ObserverHttpPost('/wisdomgroup/modules/question/create',this.desrc) this.appService.ObserverHttpPost('/wisdomgroup/modules/question/create', this.desrc)
.subscribe( .subscribe(
(res)=>{ (res) => {
if(res){ if (res) {
toast.setMessage('创建成功'); toast.setMessage('创建成功');
toast.present(); toast.present();
this.navCtrl.push('EditPage',{temp:res.json()}); this.navCtrl.push('EditPage', {temp: res.json()});
} }
} }
) )
} }
//编辑 //编辑
submitEdit(){ submitEdit() {
if(this.desrc.isopen){ //是否匿名
if (this.isans == true || this.isans == 1) {
this.desrc.isans = 1;
} else {
this.desrc.isans = 2;
}
//是否公开问卷结果
if (this.isopen == true || this.isopen == 1) {
this.desrc.isopen = 1; this.desrc.isopen = 1;
}else{ } else {
this.desrc.isopen = 0; this.desrc.isopen = 0;
} }
const data = { const data = {
...@@ -90,13 +99,13 @@ export class DesicrPage { ...@@ -90,13 +99,13 @@ export class DesicrPage {
}) })
} }
selectPerson(){ selectPerson() {
let modal = this.modalCtrl.create(PersonPage); let modal = this.modalCtrl.create(PersonPage);
modal.onDidDismiss(data=>{ modal.onDidDismiss(data => {
if( data ){ if (data) {
this.desrc.usergroup = data.id; this.desrc.usergroup = data.id;
this.groupName = data.groupName; this.groupName = data.groupName;
}else{ } else {
this.desrc.usergroup = 'all'; this.desrc.usergroup = 'all';
this.groupName = '全体用户'; this.groupName = '全体用户';
} }
...@@ -105,9 +114,19 @@ export class DesicrPage { ...@@ -105,9 +114,19 @@ export class DesicrPage {
modal.present(); modal.present();
} }
getDetail(){ getDetail() {
this.appService.ObserverHttpPostAdd('/wisdomgroup/modules/question/edit/', this.id).subscribe((res) => { this.appService.ObserverHttpPostAdd('/wisdomgroup/modules/question/edit/', this.id).subscribe((res) => {
this.desrc = res.json().data; this.desrc = res.json().data;
if (this.desrc.isans == 1) {
this.isans = true;
} else {
this.isans = false;
}
if (this.desrc.isopen == 1) {
this.isopen = true;
} else {
this.isopen = false;
}
}); });
} }
......
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