Commit e243da46 authored by wangqinghua's avatar wangqinghua

抢购

parent 717c0366
...@@ -53,6 +53,7 @@ export class FoodPage { ...@@ -53,6 +53,7 @@ export class FoodPage {
ionViewDidEnter() { ionViewDidEnter() {
this.myApply(); this.myApply();
this.getApply(); this.getApply();
this.getGoodsInfo();
} }
ionViewDidLoad() { ionViewDidLoad() {
...@@ -119,6 +120,14 @@ export class FoodPage { ...@@ -119,6 +120,14 @@ export class FoodPage {
) )
} }
getGoodsInfo(){
this.serveSer.getGoodsInfo().subscribe(
(res)=>{
}
)
}
getDate(e) { getDate(e) {
this.date = e; this.date = e;
this.getApply(); this.getApply();
...@@ -182,7 +191,7 @@ export class FoodPage { ...@@ -182,7 +191,7 @@ export class FoodPage {
//抢购 每天的14:00-17:00 //抢购 每天的14:00-17:00
buy() { buy() {
const nowDate = new Date().getTime(); const nowDate = new Date().getTime();
const startTime = new Date(this.datePipe.transform(new Date(), 'yyyy-MM-dd') + ' 13:00:00').getTime(); const startTime = new Date(this.datePipe.transform(new Date(), 'yyyy-MM-dd') + ' 10:00:00').getTime();
const endTime = new Date(this.datePipe.transform(new Date(), 'yyyy-MM-dd') + ' 17:00:00').getTime(); const endTime = new Date(this.datePipe.transform(new Date(), 'yyyy-MM-dd') + ' 17:00:00').getTime();
if(startTime < nowDate && nowDate < endTime){ if(startTime < nowDate && nowDate < endTime){
this.commonSer.toast('开始抢购'); this.commonSer.toast('开始抢购');
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
<div class="left">数量:</div> <div class="left">数量:</div>
<div class="right num"> <div class="right num">
<span class="reduce" (click)="reduce()">-</span> <span class="reduce" (click)="reduce()">-</span>
<input type="number" value="1" [(ngModel)]="obj.amount"> <input type="number" value="1" [(ngModel)]="obj.peopleCount">
<span class="add" (click)="add()">+</span> <span class="add" (click)="add()">+</span>
</div> </div>
</div> </div>
<button class="submit-btn submit" (click)="save()">提交</button>
</ion-content> </ion-content>
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic-angular'; import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic-angular';
import {ServeService} from "../../serve.service";
import {CommonService} from "../../../../provide/common.service";
@Component({ @Component({
selector: 'page-rush-buy', selector: 'page-rush-buy',
...@@ -8,28 +10,42 @@ import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic- ...@@ -8,28 +10,42 @@ import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic-
export class RushBuyPage { export class RushBuyPage {
obj = { obj = {
amount: null, peopleCount: 10,
food: '', food: '',
foodText: '请选择', foodText: '请选择',
type: null,
unitPrice: null,
version: null
}; };
foodList; foodList;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams, private commonSer: CommonService,
private actionSheetCtrl: ActionSheetController) { private actionSheetCtrl: ActionSheetController, private serveSer: ServeService) {
} }
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad RushBuyPage'); console.log('ionViewDidLoad RushBuyPage');
this.getGoodsInfo();
}
getGoodsInfo() {
this.serveSer.getGoodsInfo().subscribe(
(res) => {
this.foodList = res.data;
}
)
} }
chooseFood() { chooseFood() {
const btnArr = this.foodList.map(e => { const btnArr = this.foodList.map(e => {
const data = { const data = {
text: e.name, text: e.goodsName,
role: e.id, role: e.id,
handler: () => { handler: () => {
// this.obj.orgId = e.id; this.obj.foodText = e.goodsName;
// this.obj.orgText = e.name; this.obj.version = e.version;
this.obj.unitPrice = e.unitPrice;
this.obj.type = e.id
} }
}; };
return data; return data;
...@@ -50,12 +66,32 @@ export class RushBuyPage { ...@@ -50,12 +66,32 @@ export class RushBuyPage {
//增加 //增加
add() { add() {
if (this.obj.amount < 10) this.obj.amount ++; if (this.obj.peopleCount < 10) this.obj.peopleCount++;
} }
//减少 //减少
reduce() { reduce() {
if (this.obj.amount > 1) this.obj.amount --; if (this.obj.peopleCount > 1) this.obj.peopleCount--;
}
save() {
const data = {
diffFlag: '2',
type: this.obj.type,
peopleCount: this.obj.peopleCount,
unitPrice: this.obj.unitPrice,
version: this.obj.version
}
this.serveSer.saveMeals(data).subscribe(
(res) => {
if (res.errcode == "1000") {
this.commonSer.toast('抢购成功');
this.navCtrl.pop();
} else {
this.commonSer.toast(res.errmsg);
}
}
)
} }
} }
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); } //申请审核 dealOrder(data, params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/dealOrder/' + params, this.commonSer.toFormData(data)); } //查询待提交 searchUnsubmit(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchUnsubmit', this.commonSer.toFormData(data)); } //查询待发放 searchSubmited(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchSubmited', this.commonSer.toFormData(data)); } //查询待发放 searchSubmitedForApp(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchSubmitedForApp', this.commonSer.toFormData(data)); } //已完成 searchDelivery(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchDelivery', this.commonSer.toFormData(data)); } //发放物品 delivery(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/delivery', this.commonSer.toFormData(data)); } //物品评价 orderScore(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordersuppy/score', data); } orderDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/personDetail/' + 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); } //查询已审核/未审核的申请 searchCheckList(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup//modules/meetingapply/searchCheckList', this.commonSer.toFormData(data)); } //审核通过/驳回 meetOperate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/operate', this.commonSer.toFormData(data)); } /** 用车申请 **/ //保存申请 saveCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/saveApply', data); } //获取司机 getCarList(): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/getCarList'); } //获取车辆 getDriverList(): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/getDriverList'); } //根据日期查询用车信息 queryCarApplyByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/queryCarApplyByDate', this.commonSer.toFormData(data)); } //查询用车申请详情 carDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/detail/' + params,); } //我的申请 myCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/myApply', this.commonSer.toFormData(data)); } //取消申请 cancelCarApply(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/cancel/' + params,); } //查询已审核/未审核的申请 searchCarCheckList(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup//modules/carapply/searchCheckList', this.commonSer.toFormData(data)); } //审核通过/驳回 carOperate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/operate', data); } /*****理发********/ //保存理发预约 saveHairApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/haircut/saveApply', data); } //取消预约 cancelHair(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/haircut/cancel/' + params,); } //预约详情 hairApplyDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/haircut/detail/' + params,); } //根据日期查询预约信息 queryAppointmentByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/haircut/queryAppointmentByDate', this.commonSer.toFormData(data)); } //我的预约 myAppointment(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/haircut/myAppointment', this.commonSer.toFormData(data)); } /**访客登记**/ //查询访客 searchVisitor(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/searchVisitor', this.commonSer.toFormData(data)); } //保存访客 saveVisitorApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/save', data); } //访客登记详情 editVisitorApply(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/visitor/editVisitor/' + params); } //我的访客 myVisitor(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/myVisitor', this.commonSer.toFormData(data) ); } //根据日期查询访客登记 findVisitorByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/findVisitorByDate', this.commonSer.toFormData(data)); } //取消预约 cancelVisitor(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/visitor/cancel/' + params); } //确认到访 confirmVisit(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/visitor/confirmVisit/' + params); } /** 业务制度 **/ //业务制度详情 businessDetail(params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/businessystem/detail/' + params, null); } //查询业务制度列表 searchBusinessSystem(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/businessystem/searchBusinessSystem', this.commonSer.toFormData(data)); } /**预约订餐**/ //保存订餐信息 saveMeals(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/save', data); } //取消订单 cancelMeals(params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/cancel/' + params, null); } //审核通过/驳回接口 operateMeals(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/operate/', this.commonSer.toFormData(data) ); } //我的订餐 myBook(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/myBook', this.commonSer.toFormData(data) ); } //日历查询订餐信息 mealsQueryByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/queryByDate', this.commonSer.toFormData(data)); } //查询已处理/未处理订餐 searchMealCheckList(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/searchCheckList', this.commonSer.toFormData(data)); } //订餐详情 detailMeals(params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/detail/' + params, null); } } 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); } //申请审核 dealOrder(data, params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/dealOrder/' + params, this.commonSer.toFormData(data)); } //查询待提交 searchUnsubmit(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchUnsubmit', this.commonSer.toFormData(data)); } //查询待发放 searchSubmited(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchSubmited', this.commonSer.toFormData(data)); } //查询待发放 searchSubmitedForApp(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchSubmitedForApp', this.commonSer.toFormData(data)); } //已完成 searchDelivery(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/searchDelivery', this.commonSer.toFormData(data)); } //发放物品 delivery(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/delivery', this.commonSer.toFormData(data)); } //物品评价 orderScore(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordersuppy/score', data); } orderDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/personDetail/' + 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); } //查询已审核/未审核的申请 searchCheckList(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup//modules/meetingapply/searchCheckList', this.commonSer.toFormData(data)); } //审核通过/驳回 meetOperate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/operate', this.commonSer.toFormData(data)); } /** 用车申请 **/ //保存申请 saveCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/saveApply', data); } //获取司机 getCarList(): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/getCarList'); } //获取车辆 getDriverList(): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/getDriverList'); } //根据日期查询用车信息 queryCarApplyByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/queryCarApplyByDate', this.commonSer.toFormData(data)); } //查询用车申请详情 carDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/detail/' + params,); } //我的申请 myCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/myApply', this.commonSer.toFormData(data)); } //取消申请 cancelCarApply(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/carapply/cancel/' + params,); } //查询已审核/未审核的申请 searchCarCheckList(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup//modules/carapply/searchCheckList', this.commonSer.toFormData(data)); } //审核通过/驳回 carOperate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/operate', data); } /*****理发********/ //保存理发预约 saveHairApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/haircut/saveApply', data); } //取消预约 cancelHair(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/haircut/cancel/' + params,); } //预约详情 hairApplyDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/haircut/detail/' + params,); } //根据日期查询预约信息 queryAppointmentByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/haircut/queryAppointmentByDate', this.commonSer.toFormData(data)); } //我的预约 myAppointment(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/haircut/myAppointment', this.commonSer.toFormData(data)); } /**访客登记**/ //查询访客 searchVisitor(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/searchVisitor', this.commonSer.toFormData(data)); } //保存访客 saveVisitorApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/save', data); } //访客登记详情 editVisitorApply(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/visitor/editVisitor/' + params); } //我的访客 myVisitor(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/myVisitor', this.commonSer.toFormData(data) ); } //根据日期查询访客登记 findVisitorByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/visitor/findVisitorByDate', this.commonSer.toFormData(data)); } //取消预约 cancelVisitor(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/visitor/cancel/' + params); } //确认到访 confirmVisit(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/visitor/confirmVisit/' + params); } /** 业务制度 **/ //业务制度详情 businessDetail(params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/businessystem/detail/' + params, null); } //查询业务制度列表 searchBusinessSystem(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/businessystem/searchBusinessSystem', this.commonSer.toFormData(data)); } /**预约订餐**/ //保存订餐信息 saveMeals(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/save', data); } //取消订单 cancelMeals(params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/cancel/' + params, null); } //审核通过/驳回接口 operateMeals(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/operate/', this.commonSer.toFormData(data) ); } //我的订餐 myBook(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/myBook', this.commonSer.toFormData(data) ); } //日历查询订餐信息 mealsQueryByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/queryByDate', this.commonSer.toFormData(data)); } //查询已处理/未处理订餐 searchMealCheckList(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/searchCheckList', this.commonSer.toFormData(data)); } //订餐详情 detailMeals(params): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/bookmeals/detail/' + params, null); } //查询订购的商品 getGoodsInfo(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/purchase/everydayPurchase/getGoodsInfo', null); } }
\ No newline at end of file \ No newline at end of file
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<div class="padding-6"> <div class="padding-6">
<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-datetime [disabled]="type == 'deal' " cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm" <ion-datetime (ionChange)="changeStartTime($event)" [disabled]="type == 'deal' " cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [max]="obj.endTime" [min]="nowDate" pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [max]="obj.endTimeChange" [min]="nowDate"
[(ngModel)]="obj.startTime"></ion-datetime> [(ngModel)]="obj.startTimeChange"></ion-datetime>
<ion-label class="right-arrow"> <ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon> <ion-icon name="arrow-forward"></ion-icon>
</ion-label> </ion-label>
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
</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-datetime [disabled]="type == 'deal' " cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm" <ion-datetime (ionChange)="changeEndTime($event)" [disabled]="type == 'deal' " cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [min]="obj.startTime" pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [min]="obj.startTimeChange"
[(ngModel)]="obj.endTime"></ion-datetime> [(ngModel)]="obj.endTimeChange"></ion-datetime>
<ion-label class="right-arrow"> <ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon> <ion-icon name="arrow-forward"></ion-icon>
</ion-label> </ion-label>
......
...@@ -14,7 +14,9 @@ export class CarApplyPage { ...@@ -14,7 +14,9 @@ export class CarApplyPage {
obj = { obj = {
startTime: null, startTime: null,
startTimeChange: null,
endTime: null, endTime: null,
endTimeChange: null,
carUser: '', carUser: '',
useReason: '', useReason: '',
useText: '请选择', useText: '请选择',
...@@ -59,11 +61,8 @@ export class CarApplyPage { ...@@ -59,11 +61,8 @@ export class CarApplyPage {
if (data) { if (data) {
} else { } else {
this.obj.startTime = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm'); this.obj.startTimeChange = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm'); this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
console.log(this.obj)
console.log(this.nowDate)
} }
} }
...@@ -91,6 +90,18 @@ export class CarApplyPage { ...@@ -91,6 +90,18 @@ export class CarApplyPage {
) )
} }
changeStartTime(e) {
const minute = e.minute > 9 ? e.minute : '0' + e.minute;
const hour = e.hour > 9 ? e.hour : '0' + e.hour;
this.obj.startTime = e.year + '-' + e.month + '-' + e.day + " " + hour + ":" + minute + ":00";
}
changeEndTime(e) {
const minute = e.minute > 9 ? e.minute : '0' + e.minute;
const hour = e.hour > 9 ? e.hour : '0' + e.hour;
this.obj.endTime = e.year + '-' + e.month + '-' + e.day + " " + hour + ":" + minute + ":00";
}
//选择事由 //选择事由
chooseReason() { chooseReason() {
const buttonsArr = [ const buttonsArr = [
...@@ -200,14 +211,15 @@ export class CarApplyPage { ...@@ -200,14 +211,15 @@ export class CarApplyPage {
carUser.push(e.id); carUser.push(e.id);
}); });
const data = <any>{ const data = <any>{
startTime: new Date(this.obj.startTime).getTime() - 8 * 60 * 60 * 1000, startTime: new Date(this.obj.startTime).getTime(),
endTime: new Date(this.obj.endTime).getTime() - 8 * 60 * 60 * 1000, endTime: new Date(this.obj.endTime).getTime(),
passengerCount: this.obj.passengerCount, passengerCount: this.obj.passengerCount,
carUser: carUser.join(","), carUser: carUser.join(","),
useReason: this.obj.useReason, useReason: this.obj.useReason,
fromTo: this.obj.fromTo, fromTo: this.obj.fromTo,
}; };
if (this.applyId) data.id = this.applyId; if (this.applyId) data.id = this.applyId;
console.log(data);
this.commonSer.alert('确认提交?', () => { this.commonSer.alert('确认提交?', () => {
this.serveSer.saveCarApply(data).subscribe( this.serveSer.saveCarApply(data).subscribe(
(res) => { (res) => {
......
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