Commit 4bf815e1 authored by wangqinghua's avatar wangqinghua

color

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