Commit 8ff06b5b authored by wangqinghua's avatar wangqinghua

日历bug修复

parent 38bb0dd4
......@@ -23,8 +23,8 @@
<div class="item-box">
<div class="left"><span class="color-red">*</span>餐点:</div>
<div class="right" style="text-align: right">
<ion-checkbox color="danger" (click)="chooseTime(1)"></ion-checkbox> <span style="vertical-align: super;margin:10px 20px 0 5px">午餐</span>
<ion-checkbox color="danger" (click)="chooseTime(2)"></ion-checkbox> <span style="vertical-align: super;margin:10px 20px 0 5px">晚餐</span>
<ion-checkbox color="danger" (click)="chooseTime(1)" [checked]="obj.typeList.includes(1)"></ion-checkbox> <span style="vertical-align: super;margin:10px 40px 0 5px">午餐</span>
<ion-checkbox color="danger" (click)="chooseTime(2)" [checked]="obj.typeList.includes(2)"></ion-checkbox> <span style="vertical-align: super;margin:10px 20px 0 5px">晚餐</span>
</div>
</div>
<ion-item>
......@@ -35,11 +35,12 @@
</ion-item>
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>标准:</ion-label>
<ion-label (click)="chooseStandard()" [ngStyle]="{'color':obj.standardText == '请选择'?'#999':'#333'}"
<ion-label *ngIf="obj.standard != '3' " (click)="chooseStandard()" [ngStyle]="{'color':obj.standardText == '请选择'?'#999':'#333'}"
class="choose">{{obj.standardText}}</ion-label>
<ion-label class="right-arrow" (click)="chooseStandard()">
<ion-icon name="arrow-forward"></ion-icon>
</ion-label>
<ion-input class="padding-right-10" *ngIf="obj.standard == '3' " [(ngModel)]="obj.amount" placeholder="请选择用餐标准"></ion-input>
<ion-label *ngIf="checkObj.standard" class="check-tips">请选择标准</ion-label>
</ion-item>
<div class="item-box">
......
......@@ -14,7 +14,7 @@ export class FoodApplyPage {
obj = {
orderDate: null,
type: [],
typeList: [],
typeText: '请选择',
peopleCount: '',
standard: '',
......@@ -25,7 +25,7 @@ export class FoodApplyPage {
checkObj = {
orderDate: false,
type: false,
typeList: false,
peopleCount: false,
standard: false,
};
......@@ -61,12 +61,18 @@ export class FoodApplyPage {
}
}
//用详情
//用详情
meetDetail() {
this.serveSer.detailMeals(this.applyId).subscribe(
(res) => {
if (res) {
this.obj.orderDate = res.data.orderDate;
this.obj.standard = res.data.standard;
this.obj.standardText = res.data.standard +"元";
this.obj.peopleCount = res.data.peopleCount;
this.obj.amount = res.data.amount;
this.obj.typeList = res.data.typeList;
this.obj.remark = res.data.remark;
}
}
)
......@@ -74,11 +80,11 @@ export class FoodApplyPage {
// 选择时间点
chooseTime(type) {
const index = this.obj.type.indexOf(type);
if(index === -1){
this.obj.type.push(type);
}else{
this.obj.type.splice(index,0);
const index = this.obj.typeList.indexOf(type);
if (index === -1) {
this.obj.typeList.push(type);
} else {
this.obj.typeList.splice(index, 0);
}
}
......@@ -106,8 +112,6 @@ export class FoodApplyPage {
text: '其他',
handler: () => {
this.obj.standard = '3';
this.obj.standardText = '15元';
this.obj.amount = '15';
}
}, {
text: '取消',
......@@ -124,24 +128,6 @@ export class FoodApplyPage {
actionSheet.present();
}
//选择人员
choose() {
let modal = this.modalCtrl.create(PersonMulComponent, {
enterAnimation: 'modal-scale-enter',
leaveAnimation: 'modal-scale-leave'
});
modal.onDidDismiss(data => {
if (data) {
this.personList = data;
}
});
modal.present();
}
//移除人员
removePerson(index) {
this.personList.splice(index, 1);
}
//提交申请
submit() {
......@@ -165,15 +151,15 @@ export class FoodApplyPage {
this.personList.forEach(e => {
carUser.push(e.id);
});
const data = {
orderDate: this.datePipe.transform(this.obj.orderDate,'yyyy-MM-dd'),
type: this.obj.type,
const data =<any> {
orderDate: this.datePipe.transform(this.obj.orderDate, 'yyyy-MM-dd'),
typeList: this.obj.typeList,
peopleCount: this.obj.peopleCount,
standard: this.obj.peopleCount,
amount: this.obj.amount,
remark: this.obj.remark,
};
console.log(data);
if(this.applyId) data.id = this.applyId;
this.commonSer.alert('确认提交?', () => {
this.serveSer.saveMeals(data).subscribe(
(res) => {
......
......@@ -28,7 +28,7 @@
<ion-content>
<ion-content direction="y" scrollbar-y="true" class="bgc-e7e8ed">
<ng-container *ngIf="changeType == 1">
<ion-calendar [(ngModel)]="date"
<ion-calendar #calendar [(ngModel)]="date"
(onChange)="getDate($event)"
[options]="options"
type="string"
......@@ -50,7 +50,7 @@
<p>未审核</p>
<div class="morning">
<div class="morning-room">
<span (click)="goApply()" *ngFor="let item3 of room?.unCheckedList">
<span (click)="goApplyEdit(item3)" *ngFor="let item3 of room?.uncheckList">
<span *ngIf="item3?.type == 1">午餐</span>&nbsp;&nbsp;
<span *ngIf="item3?.type == 2">晚餐</span> {{item3.orgName}}等{{item3.peopleCount}}人,标准:{{item3.total}}元
</span>
......
import { Component } from '@angular/core';
import {Component, ViewChild} from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {CalendarComponentOptions} from "ion2-calendar";
import {CalendarComponent, CalendarComponentOptions} from "ion2-calendar";
import {monthCh, weekDay} from "../../../app/main";
import {AppGlobal} from "../../../service/http.service";
import {ServeService} from "../serve.service";
import {DatePipe} from "@angular/common";
import {CommonService} from "../../../provide/common.service";
import {AppMainService} from "../../../app/app.service";
import {RoomDealPage} from "../meet-room/room-deal/room-deal";
import {RoomApplyPage} from "../meet-room/room-apply/room-apply";
import {FoodApplyPage} from "./food-apply/food-apply";
import {FoodDealPage} from "./food-deal/food-deal";
......@@ -19,9 +17,10 @@ import {FoodDealPage} from "./food-deal/food-deal";
templateUrl: 'food.html',
})
export class FoodPage {
@ViewChild('calendar') calendar:CalendarComponent;
date;
changeType = 1;
date = new Date();
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
......@@ -35,7 +34,6 @@ export class FoodPage {
mineInfo;
room;
applyList = [];
selectDate;
pageNumber = 1;
pageSize = AppGlobal.pageCount;
......@@ -45,15 +43,17 @@ export class FoodPage {
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public datePipe: DatePipe,
private commonSer: CommonService, private appMainSer: AppMainService) {
console.log(this.calendar);
}
ionViewDidEnter(){
this.myApply();
this.selectDate = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply();
}
ionViewDidLoad() {
this.date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
//获取权限
this.appMainSer.role.subscribe(value => {
this.role = value;
......@@ -68,7 +68,7 @@ export class FoodPage {
//获取预定日程
getApply() {
const data = {'dateStr': this.selectDate};
const data = {'dateStr': this.date};
this.serveSer.mealsQueryByDate(data).subscribe(
(res) => {
this.room = res.data;
......@@ -77,7 +77,7 @@ export class FoodPage {
}
getDate(e) {
this.selectDate = e;
this.date = e;
this.getApply();
}
......@@ -127,7 +127,7 @@ export class FoodPage {
goApplyEdit(item) {
if (this.role.includes(0)) return false; //普通人不可编辑
if (this.role.includes(1) && item.orgName != this.mineInfo.orgName) return false; //内勤只能编辑本处室的
this.navCtrl.push(RoomApplyPage, {id: item.applyId});
this.navCtrl.push(FoodApplyPage, {id: item.id});
}
//新增申请
......
......@@ -19,7 +19,7 @@ import {TabsService} from "../../tabs/tabs.service";
export class HairCutPage {
changeType = 1;
date = new Date();
date;
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
......@@ -32,7 +32,6 @@ export class HairCutPage {
room;
applyList = [];
role = [];
selectDate;
pageNumber = 1;
pageSize = AppGlobal.pageCount;
......@@ -48,11 +47,11 @@ export class HairCutPage {
ionViewDidEnter() {
this.myApply();
this.selectDate = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply();
}
ionViewDidLoad() {
this.date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
//获取权限
this.appMainSer.role.subscribe(value => {
......@@ -70,7 +69,7 @@ export class HairCutPage {
//获取预定日程
getApply() {
const data = {'dateStr': this.selectDate};
const data = {'dateStr': this.date};
this.serveSer.queryAppointmentByDate(data).subscribe(
(res) => {
this.room = res.data;
......@@ -115,7 +114,7 @@ export class HairCutPage {
}
getDate(e) {
this.selectDate = e;
this.date = e;
this.getApply();
}
......@@ -130,7 +129,7 @@ export class HairCutPage {
let data;
if (item) {
data = {
date: this.selectDate,
date: this.date,
startEnd: item.startEnd
}
}
......
......@@ -18,7 +18,7 @@ import {RoomDealPage} from "./room-deal/room-deal";
export class MeetRoomPage {
changeType = 1;
date = new Date();
date;
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
......@@ -32,7 +32,6 @@ export class MeetRoomPage {
mineInfo;
room;
applyList = [];
selectDate;
pageNumber = 1;
pageSize = AppGlobal.pageCount;
......@@ -46,12 +45,13 @@ export class MeetRoomPage {
ionViewDidEnter(){
this.myApply();
this.selectDate = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply();
}
ionViewDidLoad() {
this.date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
//获取权限
this.appMainSer.role.subscribe(value => {
this.role = value;
......@@ -66,7 +66,7 @@ export class MeetRoomPage {
//获取预定日程
getApply() {
const data = {'dateStr': this.selectDate};
const data = {'dateStr': this.date};
this.serveSer.queryMeetingRoomByDate(data).subscribe(
(res) => {
this.room = res.data;
......@@ -75,7 +75,7 @@ export class MeetRoomPage {
}
getDate(e) {
this.selectDate = e;
this.date = e;
this.getApply();
}
......@@ -138,7 +138,7 @@ export class MeetRoomPage {
roomId: item.id,
roomName: item.name,
equipmervice:item.equipmervice,
startTime: this.selectDate + ' 9:00:00',
startTime: this.date + ' 9:00:00',
};
}
this.navCtrl.push(RoomApplyPage, {data: data});
......
......@@ -19,7 +19,7 @@ import {CarDealPage} from "./car-deal/car-deal";
export class UseCarPage {
changeType = 1;
date = new Date();
date;
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
......@@ -33,7 +33,6 @@ export class UseCarPage {
applyList = [];
role = [];
mineInfo;
selectDate;
pageNumber = 1;
pageSize = AppGlobal.pageCount;
......@@ -52,12 +51,11 @@ export class UseCarPage {
ionViewDidEnter(){
this.myApply();
this.selectDate = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply();
}
ionViewDidLoad() {
this.date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
//获取权限
this.appMainSer.role.subscribe(value => {
this.role = value;
......@@ -72,7 +70,7 @@ export class UseCarPage {
//获取预定日程
getApply() {
const data = {'dateStr': this.selectDate};
const data = {'dateStr': this.date};
this.serveSer.queryCarApplyByDate(data).subscribe(
(res) => {
this.checkObj.checkedApplyList = res.data.checkedApplyList;
......@@ -82,7 +80,7 @@ export class UseCarPage {
}
getDate(e) {
this.selectDate = e;
this.date = e;
this.getApply();
}
......
......@@ -19,7 +19,7 @@ import {VistorApplyPage} from "./vistor-apply/vistor-apply";
})
export class VistorRegisterPage {
changeType = 1;
date = new Date();
date;
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
......@@ -34,7 +34,6 @@ export class VistorRegisterPage {
room;
list;
myList;
selectDate;
pageNumber = 1;
pageSize = AppGlobal.pageCount;
......@@ -48,11 +47,11 @@ export class VistorRegisterPage {
ionViewDidEnter() {
this.myApply();
this.selectDate = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply();
}
ionViewDidLoad() {
this.date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
//获取权限
this.appMainSer.role.subscribe(value => {
this.role = value;
......@@ -65,7 +64,7 @@ export class VistorRegisterPage {
})
}
doRefresh(e){
doRefresh(e) {
this.pageNumber = 1;
this.myApply();
e.complete();
......@@ -73,7 +72,7 @@ export class VistorRegisterPage {
//获取预定日程
getApply() {
const data = {'dateStr': this.selectDate};
const data = {'dateStr': this.date};
this.serveSer.findVisitorByDate(data).subscribe(
(res) => {
this.list = res.data;
......@@ -82,7 +81,7 @@ export class VistorRegisterPage {
}
getDate(e) {
this.selectDate = e;
this.date = e;
this.getApply();
}
......
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