Commit 89089c66 authored by wangqinghua's avatar wangqinghua

预定会议 > 我的预定

parent 43d9cbce
...@@ -32,6 +32,7 @@ export class PersonMulComponent { ...@@ -32,6 +32,7 @@ export class PersonMulComponent {
.subscribe((res) => { .subscribe((res) => {
this.perList = res.json().list; this.perList = res.json().list;
this.perList.forEach(e => { this.perList.forEach(e => {
e.userName = e.name;
e.checkbox = false; e.checkbox = false;
}) })
}) })
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<ion-content> <ion-content>
<ion-content direction="y" scrollbar-y="true"> <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 [(ngModel)]="date"
(onChange)="getApply($event)" (onChange)="getApply($event)"
...@@ -80,6 +80,46 @@ ...@@ -80,6 +80,46 @@
</ng-container> </ng-container>
<ng-container *ngIf="changeType == 2"> <ng-container *ngIf="changeType == 2">
<div class="duty-content"> <div class="duty-content">
<ion-list class="myItem">
<ion-item-sliding class="apply" *ngFor="let item of applyList">
<ion-item>
<p>
<span *ngIf="item.applyStatus == 1">已申请</span>
<span *ngIf="item.applyStatus == 2">已通过</span>
<span *ngIf="item.applyStatus == 3">已驳回</span>
<span float-end>申请时间:
<span>{{item.applyTime | date:'yyyy-MM-dd HH:mm'}}</span>
</span>
</p>
<p>
<span class="apply-room">会议室:
<span>{{item.roomName}}</span>
</span>
<span class="meet-type">
<span *ngIf="item.meetingType == 1">工作会议</span>
<span *ngIf="item.meetingType == 2">座谈会</span>
<span *ngIf="item.meetingType == 3">中心组学习</span>
<span *ngIf="item.meetingType == 4">访谈</span>
</span>
</p>
<p>
<span class="order-time">预定时间:
<span>{{item.startTime | date:'yyyy-MM-dd HH:mm'}}</span>
</span>
</p>
</ion-item>
<ion-item-options>
<button ion-button color="danger" (click)="removeItem(item)">删除</button>
</ion-item-options>
</ion-item-sliding>
</ion-list>
<ion-list text-center style="margin-top: 10rem;color: #666666"
*ngIf="!isLoad && applyList.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无预订
</p>
</ion-list>
</div> </div>
</ng-container> </ng-container>
</ion-content> </ion-content>
......
...@@ -83,6 +83,7 @@ page-meet-room { ...@@ -83,6 +83,7 @@ page-meet-room {
.room { .room {
padding: 15px; padding: 15px;
background-color: #fff;
} }
.morning, .afternoon { .morning, .afternoon {
...@@ -145,9 +146,10 @@ page-meet-room { ...@@ -145,9 +146,10 @@ page-meet-room {
.notYet { .notYet {
margin-top: 15px; margin-top: 15px;
.morning,.afternoon{
.morning-room{ .morning, .afternoon {
span{ .morning-room {
span {
background-color: #f2f2f2; background-color: #f2f2f2;
border: 1px solid #f2f2f2; border: 1px solid #f2f2f2;
color: #666666; color: #666666;
...@@ -155,4 +157,54 @@ page-meet-room { ...@@ -155,4 +157,54 @@ page-meet-room {
} }
} }
} }
.duty-content {
padding: 15px;
ion-item{
p{
padding: 0 10px 10px 10px;
span{
color: #333333;
font-weight: 500;
span{
color: #666666;
font-weight: 400;
}
}
}
p:first-child{
border-bottom: 1px solid #cccccc;
margin-bottom: 10px;
}
}
}
.apply {
font-size: 1.4rem;
border-radius: 5px;
.apply-room {
font-size: 1.4rem;
}
.meet-type {
font-size: 1.4rem;
margin-left: 20px;
span {
font-size: 1.4rem;
}
}
.order-time {
font-size: 1.4rem;
}
}
.apply + .apply{
margin-top: 8px;
}
.list-ios .item-block .item-inner{
padding: 0;
}
} }
...@@ -5,6 +5,8 @@ import {monthCh, weekDay} from "../../../app/main"; ...@@ -5,6 +5,8 @@ import {monthCh, weekDay} from "../../../app/main";
import {RoomApplyPage} from "./room-apply/room-apply"; import {RoomApplyPage} from "./room-apply/room-apply";
import {ServeService} from "../serve.service"; import {ServeService} from "../serve.service";
import {DatePipe} from "@angular/common"; import {DatePipe} from "@angular/common";
import {AppGlobal} from "../../../service/http.service";
import {CommonService} from "../../../provide/common.service";
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -25,18 +27,27 @@ export class MeetRoomPage { ...@@ -25,18 +27,27 @@ export class MeetRoomPage {
}; };
room; room;
applyList = [];
pageNumber = 1;
pageSize = AppGlobal.pageCount;
total;
isLoad = true;
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) {
} }
ionViewDidEnter() { ionViewDidEnter() {
const date = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); const date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply(date); this.getApply(date);
this.myApply();
} }
//获取预定日程
getApply(date) { getApply(date) {
const data = {'dateStr': date} const data = {'dateStr': date};
this.serveSer.queryMeetingRoomByDate(data).subscribe( this.serveSer.queryMeetingRoomByDate(data).subscribe(
(res) => { (res) => {
this.room = res.data; this.room = res.data;
...@@ -44,18 +55,51 @@ export class MeetRoomPage { ...@@ -44,18 +55,51 @@ export class MeetRoomPage {
) )
} }
//我的预定
myApply() {
const data = {
P_pageNumber: this.pageNumber,
P_pageSize: this.pageSize,
}
this.serveSer.queryMyApply(data).subscribe(
(res) => {
this.isLoad = false;
this.applyList = res.list;
this.total = res.total;
}
)
}
//取消预定
removeItem(item) {
this.serveSer.cancelApply(item.id).subscribe(
(res) => {
if (res.errcode == 1000) {
this.commonSer.toast('取消预定成功');
this.myApply();
} else {
this.commonSer.toast(res.errmsg);
}
}
)
}
//新增预定
addMeet() { addMeet() {
this.navCtrl.push(RoomApplyPage); this.navCtrl.push(RoomApplyPage);
} }
//改变
change(type) { change(type) {
this.changeType = type; this.changeType = type;
} }
//编辑申请
goApplyEdit(item) { goApplyEdit(item) {
this.navCtrl.push(RoomApplyPage, {id: item.applyId}); this.navCtrl.push(RoomApplyPage, {id: item.applyId});
} }
//新增申请
goApply() { goApply() {
this.navCtrl.push(RoomApplyPage); this.navCtrl.push(RoomApplyPage);
} }
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
</ion-item> </ion-item>
<ion-item> <ion-item>
<ion-label class="item-left">会议室:</ion-label> <ion-label class="item-left">会议室:</ion-label>
<ion-select [(ngModel)]="obj.room" (ngModelChange)="roomMax = '会议室可容纳'+ $event.accommodation +'人' " cancelText="取消" okText="确定" placeholder="请选择"> <ion-select [(ngModel)]="obj.roomId" cancelText="取消" okText="确定" placeholder="请选择">
<ion-option *ngFor="let item of roomList" [value]="item">{{item.name}}</ion-option> <ion-option *ngFor="let item of roomList" [value]="item.id" (ionSelect)="roomMax = '会议室可容纳'+ item.accommodation +'人' ">{{item.name}}</ion-option>
</ion-select> </ion-select>
</ion-item> </ion-item>
<ion-item> <ion-item>
<ion-label class="item-left">申请处室:</ion-label> <ion-label class="item-left">申请处室:</ion-label>
<ion-select [(ngModel)]="obj.org" cancelText="取消" okText="确定" placeholder="请选择"> <ion-select [(ngModel)]="obj.orgId" cancelText="取消" okText="确定" placeholder="请选择">
<ion-option *ngFor="let item of orgList" [value]="item">{{item.name}}</ion-option> <ion-option *ngFor="let item of orgList" [value]="item.id">{{item.name}}</ion-option>
</ion-select> </ion-select>
</ion-item> </ion-item>
<ion-item> <ion-item>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<button color="danger" ion-button small (click)="choose()">选择</button> <button color="danger" ion-button small (click)="choose()">选择</button>
<div class="div-tag"> <div class="div-tag">
<span *ngFor="let item of personList;let i = index"> <span *ngFor="let item of personList;let i = index">
{{item.name}} {{item.userName}}
<ion-icon (click)="removePerson(i)" name="close"></ion-icon> <ion-icon (click)="removePerson(i)" name="close"></ion-icon>
</span> </span>
</div> </div>
......
...@@ -4,6 +4,7 @@ import {ServeService} from "../../serve.service"; ...@@ -4,6 +4,7 @@ import {ServeService} from "../../serve.service";
import {FilterComponent} from "../../../../components/filter/filter"; import {FilterComponent} from "../../../../components/filter/filter";
import {PersonMulComponent} from "../../../../components/person-mul/person-mul"; import {PersonMulComponent} from "../../../../components/person-mul/person-mul";
import {CommonService} from "../../../../provide/common.service"; import {CommonService} from "../../../../provide/common.service";
import {DatePipe} from "@angular/common";
@Component({ @Component({
selector: 'page-room-apply', selector: 'page-room-apply',
...@@ -12,9 +13,9 @@ import {CommonService} from "../../../../provide/common.service"; ...@@ -12,9 +13,9 @@ import {CommonService} from "../../../../provide/common.service";
export class RoomApplyPage { export class RoomApplyPage {
obj = { obj = {
meetingType: '', meetingType: '1',
room: null, roomId: null,
org: null, orgId: null,
startTime: '', startTime: '',
endTime: '', endTime: '',
orgLeader: [], orgLeader: [],
...@@ -26,20 +27,20 @@ export class RoomApplyPage { ...@@ -26,20 +27,20 @@ export class RoomApplyPage {
meetTypeList = [ meetTypeList = [
{id: 1, name: '工作会议'}, {id: '1', name: '工作会议'},
{id: 2, name: '座谈会'}, {id: '2', name: '座谈会'},
{id: 3, name: '中心组学习'}, {id: '3', name: '中心组学习'},
{id: 4, name: '访谈'}, {id: '4', name: '访谈'},
]; ];
equipList = [ equipList = [
{id: 1, name: '投影仪'}, {id: '1', name: '投影仪'},
{id: 2, name: '互联网'}, {id: '2', name: '互联网'},
{id: 3, name: '政务外网'}, {id: '3', name: '政务外网'},
{id: 4, name: '话筒'}, {id: '4', name: '话筒'},
{id: 5, name: '茶水'}, {id: '5', name: '茶水'},
{id: 6, name: '矿泉水'}, {id: '6', name: '矿泉水'},
{id: 7, name: '毛巾'}, {id: '7', name: '毛巾'},
{id: 8, name: '水果'}, {id: '8', name: '水果'},
]; ];
roomList = []; roomList = [];
orgList = []; orgList = [];
...@@ -52,7 +53,7 @@ export class RoomApplyPage { ...@@ -52,7 +53,7 @@ export class RoomApplyPage {
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public modalCtrl: ModalController, private serveSer: ServeService, public modalCtrl: ModalController,
private commonSer: CommonService) { private commonSer: CommonService,private datePipe:DatePipe) {
} }
ionViewDidLoad() { ionViewDidLoad() {
...@@ -69,13 +70,15 @@ export class RoomApplyPage { ...@@ -69,13 +70,15 @@ export class RoomApplyPage {
(res) => { (res) => {
if (res) { if (res) {
this.personList = res.participants; this.personList = res.participants;
this.leaderList = res.leaders; this.obj.orgLeader = res.leaders;
this.obj.meetingType = res.meetingType; this.obj.meetingType = res.meetingType;
this.obj.startTime = this.datePipe.transform(res.startTime,'yyyy-MM-dd HH:mm');
this.obj.remark = res.remark; this.obj.remark = res.remark;
this.obj.equipmervice = res.equipmervice; this.obj.equipmervice = res.equipmervice.split(',');
this.obj.participantAmount = res.participantAmount; this.obj.participantAmount = res.participantAmount;
this.obj.org = {orgId: res.orgId, orgName: res.orgName}; this.obj.orgId = res.orgId;
this.obj.room = {roomId: res.roomId, roomName: res.roomName}; this.obj.roomId = res.roomId;
console.log(this.obj);
} }
} }
) )
...@@ -110,13 +113,14 @@ export class RoomApplyPage { ...@@ -110,13 +113,14 @@ export class RoomApplyPage {
} }
} }
//选择部领导 //选择设备
chooseEquip(item, index) { chooseEquip(item, index) {
if (this.obj.equipmervice.indexOf(item.id) > -1) { if (this.obj.equipmervice.indexOf(item.id) > -1) {
this.obj.equipmervice.splice(index, 1); this.obj.equipmervice.splice(index, 1);
} else { } else {
this.obj.equipmervice.push(item.id); this.obj.equipmervice.push(item.id);
} }
console.log(this.obj);
} }
//选择人员 //选择人员
...@@ -140,11 +144,17 @@ export class RoomApplyPage { ...@@ -140,11 +144,17 @@ export class RoomApplyPage {
} }
submit() { submit() {
let orgName;
this.orgList.forEach(e => {
if (this.obj.orgId == e.id) {
orgName = e.name;
}
});
const data = { const data = {
meetingType: this.obj.meetingType, meetingType: this.obj.meetingType,
roomId: this.obj.room.id, roomId: this.obj.roomId,
orgId: this.obj.org.id, orgId: this.obj.orgId,
orgName: this.obj.org.name, orgName: orgName,
startTime: new Date(this.obj.startTime).getTime(), startTime: new Date(this.obj.startTime).getTime(),
endTime: new Date(this.obj.endTime).getTime(), endTime: new Date(this.obj.endTime).getTime(),
orgLeader: this.obj.orgLeader.join(','), orgLeader: this.obj.orgLeader.join(','),
...@@ -155,6 +165,7 @@ export class RoomApplyPage { ...@@ -155,6 +165,7 @@ export class RoomApplyPage {
participantAmount: this.obj.participantAmount, participantAmount: this.obj.participantAmount,
equipmervice: this.obj.equipmervice.join(','), equipmervice: this.obj.equipmervice.join(','),
}; };
if(this.applyId) data['id'] = this.applyId;
console.log(data); console.log(data);
this.commonSer.alert('确定提交申请?', () => { this.commonSer.alert('确定提交申请?', () => {
this.serveSer.saveApply(data).subscribe( this.serveSer.saveApply(data).subscribe(
......
import {Injectable} from "@angular/core";import {HttpClient} from "@angular/common/http";import {Http} from "@angular/http";import {Observable} from "rxjs/Observable";import {AppGlobal} from "../../service/http.service";import {CommonService} from "../../provide/common.service"; @Injectable()export class ServeService { constructor( private http: HttpClient, //该请求 将结果转为json private commonSer: CommonService, private https: Http, //该请求不转json ) { } getAllOrganization(data): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/sysmanagement/org/getAllOrganization?' + this.commonSer.toQuery(data)); } /** 物品领用 **/ //办公用品列表 searchSupplies(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/searchSupplies', this.commonSer.toFormData(data)); } //物品详情 supplyDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/detail/' + params); } //保存订单 saveOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrder', data); } //查询订单 myOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/myOrder', this.commonSer.toFormData(data)); } //类型列表 getTypeList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/getTypeList', null); } //购物车 shoppingCar(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/shoppingCar', this.commonSer.toFormData(data)); } //更新购物车 saveOrderSuppy(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrderSuppy', data); } //删除购物车物品 deleteOrderSuppy(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/deleteOrderSuppy/' + params); } /** 会议室预定 **/ queryMeetingRoomByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/queryMeetingRoomByDate', this.commonSer.toFormData(data)); } //预定详情 meetDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/detail/' + params); } //会议室列表 getRoomList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getRoomList', null); } //部领导列表 getLeaders(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getLeaders', null); } //保存会议申请 saveApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/saveApply', data); } /** 用车申请 **/ saveCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/saveApply', data); } } import {Injectable} from "@angular/core";import {HttpClient} from "@angular/common/http";import {Http} from "@angular/http";import {Observable} from "rxjs/Observable";import {AppGlobal} from "../../service/http.service";import {CommonService} from "../../provide/common.service"; @Injectable()export class ServeService { constructor( private http: HttpClient, //该请求 将结果转为json private commonSer: CommonService, private https: Http, //该请求不转json ) { } getAllOrganization(data): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/sysmanagement/org/getAllOrganization?' + this.commonSer.toQuery(data)); } /** 物品领用 **/ //办公用品列表 searchSupplies(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/searchSupplies', this.commonSer.toFormData(data)); } //物品详情 supplyDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/detail/' + params); } //保存订单 saveOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrder', data); } //查询订单 myOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/myOrder', this.commonSer.toFormData(data)); } //类型列表 getTypeList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/getTypeList', null); } //购物车 shoppingCar(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/shoppingCar', this.commonSer.toFormData(data)); } //更新购物车 saveOrderSuppy(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrderSuppy', data); } //删除购物车物品 deleteOrderSuppy(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/deleteOrderSuppy/' + params); } /** 会议室预定 **/ queryMeetingRoomByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/queryMeetingRoomByDate', this.commonSer.toFormData(data)); } //预定详情 meetDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/detail/' + params); } //会议室列表 getRoomList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getRoomList', null); } //部领导列表 getLeaders(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getLeaders', null); } //保存会议申请 saveApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/saveApply', data); } //我的预定列表 queryMyApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/queryMyApply', this.commonSer.toFormData(data)); } //取消预定 cancelApply(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/cancel/' + params); } /** 用车申请 **/ saveCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/saveApply', data); } }
\ No newline at end of file \ No newline at end of file
......
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