Commit 8ff06b5b authored by wangqinghua's avatar wangqinghua

日历bug修复

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