Commit 7f0f027c authored by youjie's avatar youjie

酒店订单

parent 6f1abe91
...@@ -85,6 +85,48 @@ ...@@ -85,6 +85,48 @@
orderInfo: null, orderInfo: null,
showModal: false, showModal: false,
currentData: null, currentData: null,
orderMsg: {
ArrivalTime: '14:00', //预计到达时间
EmployeeIdStr: "", //销售id
CheckInDate: "", //到店时间
RatePlanID: "",
CheckOutDate: "", //离店时间
RoomCount: "", //房间数量
guestLastName: "张", //英文姓
guestFirstName: "无误", //英文名
guestAddress: "",
guestPhoneNumber: "13344445555",
guestEmail: "123@qq.com", //Email
BookingID: "",
HotelName: "", //酒店名称
HotelPic: "", //酒店封面
GuestList: [],
TotalPrice: 0, //总价
CustomerPayMoney: 0,
DiscountMoney: 0, //优惠
CouponAllotIds: '', //优惠券Id
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
OrderForm: 4, //订单来源
//备注
guestRequest: "",
hotelId: '', //酒店Id
roomType: 0,
CustomerId: 0, //同行Id
DirectCustomerId: 0, //直客Id
Remarks: '', //备注
},
orderData:{},
} }
}, },
watch: { watch: {
...@@ -125,6 +167,137 @@ ...@@ -125,6 +167,137 @@
}) })
this.submit = false this.submit = false
}); });
// if(item.goodsType > 7 && item.goodsType < 12){
// this.getOrderDetail(item.erpOrderId)
// }else{
// this.apipost("GetCodeByOrderNo_post", {
// OrderNo: item.orderNo,
// MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
// }, (res) => {
// if (res.resultCode == 1) {
// this.orderInfo = JSON.parse(res.data.sPayInfo)
// this.goPayHandler(item);
// }
// }, e => {
// uni.hideLoading()
// uni.showToast({
// title: '无法发起支付,请稍后',
// icon: 'none',
// duration: 3000
// })
// this.submit = false
// });
// }
},
getOrderDetail(id) {
let msg = {
orderId: id,
};
this.apipost("dmc_post_Get_GetJAPAN_OrderDetail", msg,
(res) => {
if (res.resultCode == 1) {
this.orderData = res.data
let RoomInfo = res.data.parmResultRoomInfo
this.orderMsg= {
ArrivalTime: RoomInfo.ArrivalTime, //预计到达时间
EmployeeIdStr: RoomInfo.EmployeeIdStr, //销售id
CheckInDate: RoomInfo.CheckInDate, //到店时间
RatePlanID: RoomInfo.RatePlanID,
CheckOutDate: RoomInfo.CheckOutDate, //离店时间
RoomCount: RoomInfo.RoomCount, //房间数量
guestLastName: RoomInfo.guestLastName, //英文姓
guestFirstName: RoomInfo.guestFirstName, //英文名
guestAddress: RoomInfo.guestAddress,
guestPhoneNumber: RoomInfo.guestPhoneNumber,
guestEmail: RoomInfo.guestEmail, //Email
BookingID: RoomInfo.BookingID,
HotelName: RoomInfo.HotelName, //酒店名称
HotelPic: RoomInfo.HotelPic, //酒店封面
GuestList: RoomInfo.GuestList,
TotalPrice: RoomInfo.TotalPrice, //总价
CustomerPayMoney: RoomInfo.CustomerPayMoney,
DiscountMoney: RoomInfo.DiscountMoney, //优惠
CouponAllotIds: RoomInfo.CouponAllotIds, //优惠券Id
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
OrderForm: 4, //订单来源
//备注
guestRequest: RoomInfo.guestRequest,
hotelId: RoomInfo.hotelId, //酒店Id
roomType: RoomInfo.roomType,
CustomerId: RoomInfo.CustomerId, //同行Id
DirectCustomerId: RoomInfo.DirectCustomerId, //直客Id
Remarks: RoomInfo.Remarks, //备注
}
this.submitB2COrderHandler()
}
}, err => {
}
);
},
submitB2COrderHandler(){
let userInfo = uni.getStorageSync("mall_UserInfo");
let model = this.orderData.parmResultRoomInfo
let RoomInfo = this.orderData.parmResultRoomInfo
let directOrder = this.orderData.directOrder
let msg = {
SurName: RoomInfo.SurName,
Name: RoomInfo.Name,
ContactNumber: RoomInfo.guestPhoneNumber,
Mailbox: RoomInfo.guestEmail,
GoodsId: RoomInfo.hotelId,
GoodsName: RoomInfo.HotelName,
GoodsPic: model.HotelPic,
GoodsType: directOrder.GoodsType,
OrderMake: `${directOrder.OrderMake}`,
TotalPrice: RoomInfo.TotalPrice,
PreferentialPrice: RoomInfo.DiscountMoney,
CouponAllotIds:"",
ErpOrderId: 0,
Country: 0,
PlatformTax: 0,
Income: 0,
Refund: 0,
MallBaseId: userInfo.MallBaseId,
CreateBy: 0,
// #ifdef MP-DI
DOrderType: 1,
// #endif
// #ifdef MP-AG
DOrderType: 2,
OpenId: userInfo.OpenId?userInfo.OpenId:'',
// #endif
CreateBy:directOrder.CreateBy,
DiDaHotelParams: {},
};
//道旅酒店参数
msg.DiDaHotelParams = this.orderMsg;
this.apipost("AddOrderInfo_post", msg, (res) => {
this.submit = false;
if (res.resultCode == 1) {
this.orderInfo = JSON.parse(res.data.sPayInfo)
this.goPayHandler();
}
}, err => {
uni.showToast({
title: err.message,
icon: 'none',
})
this.submit = false;
});
}, },
goPayHandler(item) { goPayHandler(item) {
let that = this; let that = this;
...@@ -161,7 +334,7 @@ ...@@ -161,7 +334,7 @@
} else if (item.goodsType > 3 && item.goodsType < 8) { //景点门票 } else if (item.goodsType > 3 && item.goodsType < 8) { //景点门票
} else if (item.goodsType > 7 && item.goodsType < 12) { //酒店住宿 } else if (item.goodsType > 7 && item.goodsType < 12) { //酒店住宿
isFrom = 5
} else if (item.goodsType > 11 && item.goodsType < 15) { //目的地用车 } else if (item.goodsType > 11 && item.goodsType < 15) { //目的地用车
} else if (item.goodsType == 15) { //签证 } else if (item.goodsType == 15) { //签证
...@@ -182,6 +355,7 @@ ...@@ -182,6 +355,7 @@
// 再来一单 // 再来一单
AnotherOrder(item) { AnotherOrder(item) {
let url = '' let url = ''
// #ifdef MP-DI
if (item.goodsType > 0 && item.goodsType < 4) { //线路 if (item.goodsType > 0 && item.goodsType < 4) { //线路
const pts = ['', 2, 0, 1] const pts = ['', 2, 0, 1]
const productType = pts[item.goodsType] const productType = pts[item.goodsType]
...@@ -197,6 +371,27 @@ ...@@ -197,6 +371,27 @@
} else if (item.goodsType == 16) { //机票 } else if (item.goodsType == 16) { //机票
url = "airTicket/airIndex" url = "airTicket/airIndex"
} }
// #endif
// #ifdef MP-AG
if (item.goodsType==2) { //线路
const pts = ['', 2, 0, 1]
const productType = pts[item.goodsType]
url = `jiuzhai/jz_Line?teamType=${productType}`
} else if (item.goodsType==4) { //景点门票
} else if (item.goodsType==3) { //酒店住宿
} else if (item.goodsType==7) { //道旅酒店住宿
url = "hotel/list"
} else if (item.goodsTyp==5) { //目的地用车
} else if (item.goodsType == 6) { //签证
url = "visa/visaList"
} else if (item.goodsType == 1) { //机票
url = "airTicket/airIndex"
}
// #endif
if (url) { if (url) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/${url}`, url: `/pages/${url}`,
...@@ -225,7 +420,7 @@ ...@@ -225,7 +420,7 @@
else if (item.goodsType == 4) { //景点门票 else if (item.goodsType == 4) { //景点门票
} else if (item.goodsType == 3) { //酒店住宿 } else if (item.goodsType == 3) { //酒店住宿
} else if (item.goodsType == 7) { //酒店住宿 } else if (item.goodsType == 7) { //道旅酒店住宿
url = `hotel/orderdetails?`; url = `hotel/orderdetails?`;
} else if (item.goodsType == 5) { //目的地用车 } else if (item.goodsType == 5) { //目的地用车
} else if (item.goodsType == 6) url = `visa/visa_SureOrder?` //签证 } else if (item.goodsType == 6) url = `visa/visa_SureOrder?` //签证
......
...@@ -242,6 +242,7 @@ export default { ...@@ -242,6 +242,7 @@ export default {
}) })
} }
} }
obj.fewDays = this.dayObj.fewDays
this.$emit('chosenDateResult',this.parameters,obj) this.$emit('chosenDateResult',this.parameters,obj)
}, },
} }
......
...@@ -228,6 +228,8 @@ export default { ...@@ -228,6 +228,8 @@ export default {
} }
}, },
fail: () => { fail: () => {
this.nowDay = new Date().getDate()
this.nowMonth = new Date().getMonth()+1
this.start = this.setDefaultDate(this.getDefaultDate(0)); this.start = this.setDefaultDate(this.getDefaultDate(0));
this.end = this.setDefaultDate(this.getDefaultDate(1)); this.end = this.setDefaultDate(this.getDefaultDate(1));
console.log(this.start,this.end) console.log(this.start,this.end)
......
...@@ -562,6 +562,7 @@ ...@@ -562,6 +562,7 @@
key: "Time", key: "Time",
success: (res) => { success: (res) => {
let obj = JSON.parse(res.data); let obj = JSON.parse(res.data);
console.log(obj,'--------')
this.roomMsg.StartDate = obj.start; this.roomMsg.StartDate = obj.start;
this.roomMsg.EndDate = obj.end; this.roomMsg.EndDate = obj.end;
this.startDay = obj.startDay; this.startDay = obj.startDay;
......
...@@ -524,8 +524,14 @@ ...@@ -524,8 +524,14 @@
Refund: 0, Refund: 0,
MallBaseId: userInfo.MallBaseId, MallBaseId: userInfo.MallBaseId,
CreateBy: 0, CreateBy: 0,
// #ifdef MP-DI
DOrderType: 1, DOrderType: 1,
OpenId: "", // #endif
// #ifdef MP-AG
DOrderType: 2,
OpenId: userInfo.OpenId?userInfo.OpenId:"",
// #endif
DiDaHotelParams: {}, DiDaHotelParams: {},
}; };
let CouponAllotIds = '' let CouponAllotIds = ''
...@@ -536,24 +542,13 @@ ...@@ -536,24 +542,13 @@
if (this.HotelInfo.images && this.HotelInfo.images.length > 0) { if (this.HotelInfo.images && this.HotelInfo.images.length > 0) {
msg.GoodsPic = this.HotelInfo.images[0].Path; msg.GoodsPic = this.HotelInfo.images[0].Path;
} }
// #ifdef MP-DI
msg.DOrderType = 1;
if (this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
msg.CreateBy = this.customer.salesBaseInfo.employeeId;
}
// #endif
// #ifdef MP-AG
msg.DOrderType = 2; //同业订单
if (userInfo && userInfo.OpenId) {
msg.OpenId = userInfo.OpenId;
}
// #endif
//道旅酒店参数 //道旅酒店参数
let that = this; let that = this;
var CreateBy = 0 var CreateBy = 0
// #ifdef MP-DI // #ifdef MP-DI
if (this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
msg.CreateBy = this.customer.salesBaseInfo.employeeId;
}
that.orderMsg.DirectCustomerId = this.customer.customerId; that.orderMsg.DirectCustomerId = this.customer.customerId;
if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) { if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) {
that.orderMsg.EmployeeIdStr = this.customer.erpBaseInfo.employeeId; that.orderMsg.EmployeeIdStr = this.customer.erpBaseInfo.employeeId;
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
取消 取消
</button> </button>
<button v-if="orderData.model.OrderStatus==1" class="jz_OrderReNow" style="margin-left: 20rpx;" <button v-if="orderData.model.OrderStatus==1" class="jz_OrderReNow" style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit"> @click="submitB2COrderHandler" :disabled="submit" :loading="submit">
立即支付 立即支付
</button> </button>
<!-- #endif --> <!-- #endif -->
...@@ -277,6 +277,48 @@ ...@@ -277,6 +277,48 @@
roomNum: 0, roomNum: 0,
RatePlanList: null, RatePlanList: null,
HotelMealTypes: [], HotelMealTypes: [],
orderMsg: {
ArrivalTime: '14:00', //预计到达时间
EmployeeIdStr: "", //销售id
CheckInDate: "", //到店时间
RatePlanID: "",
CheckOutDate: "", //离店时间
RoomCount: "", //房间数量
guestLastName: "张", //英文姓
guestFirstName: "无误", //英文名
guestAddress: "",
guestPhoneNumber: "13344445555",
guestEmail: "123@qq.com", //Email
BookingID: "",
HotelName: "", //酒店名称
HotelPic: "", //酒店封面
GuestList: [],
TotalPrice: 0, //总价
CustomerPayMoney: 0,
DiscountMoney: 0, //优惠
CouponAllotIds: '', //优惠券Id
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
OrderForm: 4, //订单来源
//备注
guestRequest: "",
hotelId: '', //酒店Id
roomType: 0,
CustomerId: 0, //同行Id
DirectCustomerId: 0, //直客Id
Remarks: '', //备注
},
customer: {},
}; };
}, },
created() { created() {
...@@ -296,11 +338,67 @@ ...@@ -296,11 +338,67 @@
}; };
}, },
}); });
this.customer = uni.getStorageSync("b2b_user")
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
if (this.id) this.getOrderDetail(this.id); if (this.id) this.getOrderDetail(this.id);
this.getdidaMealType() this.getdidaMealType()
}, },
methods: { methods: {
submitB2COrderHandler(){
let userInfo = uni.getStorageSync("mall_UserInfo");
let model = this.orderData.model
let RoomInfo = this.orderData.parmResultRoomInfo
let directOrder = this.orderData.directOrder
let msg = {
SurName: RoomInfo.SurName,
Name: RoomInfo.Name,
ContactNumber: RoomInfo.guestPhoneNumber,
Mailbox: RoomInfo.guestEmail,
GoodsId: RoomInfo.hotelId,
GoodsName: RoomInfo.HotelName,
GoodsPic: model.HotelPic,
GoodsType: directOrder.GoodsType,
OrderMake: `${directOrder.OrderMake}`,
TotalPrice: RoomInfo.TotalPrice,
PreferentialPrice: RoomInfo.DiscountMoney,
CouponAllotIds:"",
ErpOrderId: 0,
Country: 0,
PlatformTax: 0,
Income: 0,
Refund: 0,
MallBaseId: userInfo.MallBaseId,
CreateBy: 0,
// #ifdef MP-DI
DOrderType: 1,
// #endif
// #ifdef MP-AG
DOrderType: 2,
OpenId: userInfo.OpenId?userInfo.OpenId:'',
// #endif
CreateBy:directOrder.CreateBy,
DiDaHotelParams: {},
};
//道旅酒店参数
msg.DiDaHotelParams = this.orderMsg;
this.submit = true
this.apipost("AddOrderInfo_post", msg, (res) => {
this.submit = false;
if (res.resultCode == 1) {
this.orderInfo = JSON.parse(res.data.sPayInfo)
this.goPayHandler(res.data);
} else {
uni.showToast({
title: res.message,
icon: 'none',
duration: 3000
})
}
}, fail => {
this.submit = false;
});
},
submitGetCodeByOrderNo() { submitGetCodeByOrderNo() {
if (this.submit || this.submitCancel) return; if (this.submit || this.submitCancel) return;
this.submit = true this.submit = true
...@@ -348,9 +446,6 @@ ...@@ -348,9 +446,6 @@
title: "支付成功", title: "支付成功",
}); });
setTimeout(() => { setTimeout(() => {
// (that.getPrice(that.orderMsg.TotalPrice) - that
// .currentCoupon.discountMoney).toFixed(2) +
// "&isFrom=5
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
(that.orderData.model.TotalPrice-that.orderData.model.DiscountMoney).toFixed(2) + (that.orderData.model.TotalPrice-that.orderData.model.DiscountMoney).toFixed(2) +
...@@ -465,15 +560,60 @@ ...@@ -465,15 +560,60 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.hideLoading(); uni.hideLoading();
this.orderData = res.data this.orderData = res.data
if(res.data.parmResult&&res.data.parmResult.Success){
this.RatePlanList = res.data.parmResult.Success.BookingDetails.Hotel.RatePlanList this.RatePlanList = res.data.parmResult.Success.BookingDetails.Hotel.RatePlanList
this.DanWei = res.data.parmResult.Success.BookingDetails.Hotel.RatePlanList[0].Currency this.DanWei = res.data.parmResult.Success.BookingDetails.Hotel.RatePlanList[0].Currency
this.roomRateDetails = res.data.parmResult.Success.BookingDetails.Hotel this.roomRateDetails = res.data.parmResult.Success.BookingDetails.Hotel
}
console.log(this.orderData,'-----')
res.data.parmResultRoomInfo.GuestList.forEach((item, index) => { res.data.parmResultRoomInfo.GuestList.forEach((item, index) => {
this.roomNum++ this.roomNum++
item.GuestInfo.forEach((items, i) => { item.GuestInfo.forEach((items, i) => {
this.peopleNum++ this.peopleNum++
}) })
}) })
let RoomInfo = res.data.parmResultRoomInfo
this.orderMsg= {
ArrivalTime: RoomInfo.ArrivalTime, //预计到达时间
EmployeeIdStr: RoomInfo.EmployeeIdStr, //销售id
CheckInDate: RoomInfo.CheckInDate, //到店时间
RatePlanID: RoomInfo.RatePlanID,
CheckOutDate: RoomInfo.CheckOutDate, //离店时间
RoomCount: RoomInfo.RoomCount, //房间数量
guestLastName: RoomInfo.guestLastName, //英文姓
guestFirstName: RoomInfo.guestFirstName, //英文名
guestAddress: RoomInfo.guestAddress,
guestPhoneNumber: RoomInfo.guestPhoneNumber,
guestEmail: RoomInfo.guestEmail, //Email
BookingID: RoomInfo.BookingID,
HotelName: RoomInfo.HotelName, //酒店名称
HotelPic: RoomInfo.HotelPic, //酒店封面
GuestList: RoomInfo.GuestList,
TotalPrice: RoomInfo.TotalPrice, //总价
CustomerPayMoney: RoomInfo.CustomerPayMoney,
DiscountMoney: RoomInfo.DiscountMoney, //优惠
CouponAllotIds: RoomInfo.CouponAllotIds, //优惠券Id
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
OrderForm: 4, //订单来源
//备注
guestRequest: RoomInfo.guestRequest,
hotelId: RoomInfo.hotelId, //酒店Id
roomType: RoomInfo.roomType,
CustomerId: RoomInfo.CustomerId, //同行Id
DirectCustomerId: RoomInfo.DirectCustomerId, //直客Id
Remarks: RoomInfo.Remarks, //备注
}
this.formatStatus(res.data.model.OrderStatus); this.formatStatus(res.data.model.OrderStatus);
} }
}, err => { }, err => {
......
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