Commit edc941fa authored by youjie's avatar youjie

酒店

parent 2eac0341
......@@ -51,20 +51,26 @@
<view class="row">
<view class="column">
<view class="hotelDetailRPrice">
{{subItem.Currency }} <text> {{getPrice(subItem.TotalPrice)}}</text>起/晚
{{subItem.Currency }} <text>
<!-- {{getPrice(subItem.TotalPrice)}} -->
{{subItem.TotalPrice}}
</text>起/晚
</view>
<view class="hotelDetailRPriceT">{{dayObj.day}}晚总价
<text>{{subItem.Currency}}{{ getPrice(subItem.TotalPrice)*dayObj.day }}</text>
<text>{{subItem.Currency}}
<!-- {{ getPrice(subItem.TotalPrice)*dayObj.day }} -->
{{ subItem.TotalPrice*dayObj.day }}
</text>
</view>
</view>
<view class="column hotelDetailRPriceBook"
:class="[!index?'active':'']">
<text v-if="!index" class="hotelDetailMinXiRS">剩2间</text>
<view class="hotelDetailMinXiRB" @click="goUrl(subItem)">
<view class="hotelDetailMinXiRB" @click="setOrder(subItem)">
</view>
</view>
<!-- <view class="hotelDetailRPriceBook" @click="goUrl(subItem)">
<!-- <view class="hotelDetailRPriceBook" @click="setOrder(subItem)">
</view> -->
</view>
......@@ -105,16 +111,22 @@
<view class="column">
<view class="hotelDetailMinXiRF"> </view>
<view class="hotelDetailMinXiRP">
{{subItem.Currency }} <text>{{getPrice(subItem.TotalPrice)}}</text>
{{subItem.Currency }} <text>
<!--{{getPrice(subItem.TotalPrice)}}-->
{{subItem.TotalPrice}}
</text>
</view>
<view class="hotelDetailMinXiRT">{{dayObj.day}}晚总价
<text>{{subItem.Currency}}{{ getPrice(subItem.TotalPrice)*dayObj.day }}</text>
<text>{{subItem.Currency}}
<!--{{ getPrice(subItem.TotalPrice)*dayObj.day }}-->
{{ subItem.TotalPrice*dayObj.day }}
</text>
</view>
</view>
<view class="column hotelDetailMinXiRBBox"
:class="[!subindex?'active':'']">
<text v-if="!subindex" class="hotelDetailMinXiRS">剩2间</text>
<view class="hotelDetailMinXiRB" @click="goUrl(subItem)">
<view class="hotelDetailMinXiRB" @click="setOrder(subItem)">
</view>
</view>
......@@ -126,13 +138,21 @@
</view>
</view>
</view>
<u-popup v-model="showSalePreviwe" mode="bottom"
border-radius="50" length="60%"
:safe-area-inset-bottom="true">
<orderService :msg="msg" :list="SaleList" @goReserce="goReserce"></orderService>
</u-popup>
</view>
</template>
<script>
import orderService from "@/components/serviceStaff/orderService";
export default {
props: ['roomMsg', 'dataList', 'search', 'rooms', 'day', 'qRoomType', 'qMealType'],
components: {},
props: ['roomMsg', 'dataList', 'search', 'rooms', 'day', 'qRoomType', 'qMealType','createById'],
components: {
orderService,
},
data() {
return {
optionsTitle: ["房型", "床型", "餐食"],
......@@ -151,6 +171,15 @@
},
qRoomTypeList: [],
qMealTypeList: [],
b2bUser: null,
SaleList: [],
msg:{
SaleName: '',
SaleId: 0,
},
createBy: 0,
showSalePreviwe: false,
subItem: null,
};
},
watch: {
......@@ -213,11 +242,55 @@
deep: true,
immediate: false,
},
createById: {
handler(val, oldval) {
if (val) {
this.createBy = val
}
},
deep: false,
immediate: false,
},
},
created() {
this.b2bUser = uni.getStorageSync("b2b_user");
this.getSale()
},
methods: {
goReserce(item){
this.msg.SaleName = item.SaleName
this.msg.SaleId = item.SaleId
this.showSalePreviwe = false;
this.goUrl()
},
getSale(){
if(!this.b2bUser.customerId) return
this.apipost(
"b2b_get_GetCustomerCreateByList",
{
CustomerId: this.b2bUser.customerId
},
(res) => {
if (res.resultCode == 1) {
if(res.data.length>0){
this.SaleList = res.data
if(res.data.length==1&&this.createBy==0){
this.msg.SaleName = res.data[0].EmName
this.msg.SaleId = res.data[0].CreateBy
}
}else{
this.msg.SaleName = ''
this.msg.SaleId = 0
}
} else {
}
},
(err) => {
}
);
},
clickShow(item) {
item.show = !item.show
this.$forceUpdate()
......@@ -298,7 +371,30 @@
}
return mealtypeName;
},
goUrl(subItem) {
setOrder(subItem) {
this.subItem = subItem
// #ifdef MP-AG
if (this.SaleList&&this.SaleList.length>1&&this.msg.SaleId==0&&this.createBy==0) {
// uni.showToast({
// title: "请选择服务人员",
// icon: "none",
// });
this.showSalePreviwe = true;
return;
}
// #endif
this.goUrl()
},
goUrl() {
let subItem = this.subItem
let createBy = 0
// #ifdef MP-DI
let employeeId = this.b2bUser.salesBaseInfo&&this.b2bUser.salesBaseInfo.employeeId?this.b2bUser.salesBaseInfo.employeeId:0
createBy = this.createBy>0?this.createBy:employeeId
// #endif
// #ifdef MP-AG
if(this.createBy>0||this.msg.SaleId) createBy = this.createBy>0?this.createBy:this.msg.SaleId
// #endif
let pHotel = {
hotelid: this.HotelInfo.hotelid,
name: this.HotelInfo.name,
......@@ -306,6 +402,7 @@
images: [],
destination: this.HotelInfo.location&&this.HotelInfo.location.destination&&this.HotelInfo.location.destination.name,
country: this.HotelInfo.location&&this.HotelInfo.location.country&&this.HotelInfo.location.country.name,
CreateBy: createBy,//服务人员
}
if (this.HotelInfo) {
if (this.HotelInfo.images && this.HotelInfo.images.length > 0) {
......
......@@ -227,6 +227,11 @@
</view>
</scroll-view>
<u-popup v-model="showSalePreviwe" mode="bottom"
border-radius="50" length="60%"
:safe-area-inset-bottom="true">
<orderService :msg="msg" :list="SaleList" @goReserce="goReserce"></orderService>
</u-popup>
<u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="89%" :safe-area-inset-bottom="true">
<CheckDate :msg="searchObj" @chosenDateResult="chosenDateResult"></CheckDate>
</u-popup>
......@@ -245,6 +250,7 @@
import hotelPolicy from "./components/hotelPolicy.vue";
import hotelFacilities from "./components/hotelFacilities.vue";
import CheckDate from "./components/time/date.vue";
import orderService from "@/components/serviceStaff/orderService";
export default {
components: {
auth,
......@@ -257,6 +263,7 @@
hotelFacilities,
hotelRoom,
CheckDate,
orderService,
},
data() {
return {
......@@ -378,6 +385,13 @@
U: {},
b2bUser: {},
is_show_auth: 0,
showSalePreviwe: false,
msg:{
SaleName: '',
SaleId: '',
},
SaleList: [],
createBy: 0,
};
},
computed: {
......@@ -468,10 +482,29 @@
0;
},
onLoad(options) {
if (!options.scene) {
this.id = options.id;
this.roomMsg.hotelid = options.id;
if (options.createBy) {
this.createBy = options.createBy
}
}else{
let t = decodeURIComponent(option.scene).split('&')
t.forEach(x => {
let item = x.split('=')
if (item.length === 2) {
if (item[0] === 'id') {
this.id = options.id;
this.roomMsg.hotelid = options.id;
} else if (item[0] === 'createBy') {
this.createBy = item[1]
}
}
})
}
this.U = uni.getStorageSync("mall_UserInfo");
this.b2bUser = uni.getStorageSync("b2b_user");
this.id = options.id;
this.roomMsg.hotelid = options.id;
let that = this;
uni.getSystemInfo({
success(res) {
......@@ -552,8 +585,37 @@
};
this.showAuth = true;
}
this.getSale()
},
methods: {
getSale(){
if(!this.b2bUser.customerId) return
this.apipost(
"b2b_get_GetCustomerCreateByList",
{
CustomerId: this.b2bUser.customerId
},
(res) => {
if (res.resultCode == 1) {
if(res.data.length>0){
this.SaleList = res.data
if(res.data.length==1&&this.createBy==0){
this.msg.SaleName = res.data[0].EmName
this.msg.SaleId = res.data[0].CreateBy
}
}else{
this.msg.SaleName = ''
this.msg.SaleId = 0
}
} else {
}
},
(err) => {
}
);
},
reloadUserinfo() {
const pages = getCurrentPages()
const curPage = pages[pages.length - 1]
......
......@@ -29,7 +29,9 @@
<view class="roomline"></view>
<view class="roomPrice">
<!-- {{ searchObj.peoples }} -->
{{RoomInfo.Currency}}{{getPrice(orderMsg.TotalPrice)}}
{{RoomInfo.Currency}}
<!-- {{getPrice(orderMsg.TotalPrice)}} -->
{{orderMsg.TotalPrice}}
<!-- /人 -->
</view>
</view>
......@@ -154,7 +156,10 @@
<text style="margin-right: 30rpx;">{{searchObj.peoples}}</text>
<text style="margin-right: 30rpx;">{{orderMsg.RoomCount}}间房</text>
<text
class="red">{{RoomInfo.Currency}}{{getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount}}</text>
class="red">{{RoomInfo.Currency}}
<!--{{getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount}}-->
{{orderMsg.TotalPrice*orderMsg.RoomCount}}
</text>
</view>
</view>
<view class="form-items PriceMinXi" style="border-bottom: none;">
......@@ -168,7 +173,9 @@
<text style="margin-right: 30rpx">房间</text>
</view>
<view style="text-align: right">
{{orderMsg.RoomCount}}间×{{RoomInfo.Currency}}{{ getPrice(orderMsg.TotalPrice) }}
{{orderMsg.RoomCount}}间×{{RoomInfo.Currency}}
<!--{{ getPrice(orderMsg.TotalPrice) }}-->
{{ orderMsg.TotalPrice }}
</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx"
......@@ -182,7 +189,9 @@
<view class="flex f12">
<view style="flex: 1">小计</view>
<view>
{{RoomInfo.Currency}}{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}
{{RoomInfo.Currency}}
<!--{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}-->
{{ (orderMsg.TotalPrice*orderMsg.RoomCount)-currentCoupon.discountMoney }}
</view>
</view>
</view>
......@@ -210,7 +219,9 @@
<template v-if="index1!=(roomRateDetails.CancellationPolicyList.length-1)">-
{{ getformatDateStr(roomRateDetails.CancellationPolicyList[index1+1].FromDate) }}
之间</template>
取消,收费 {{DanWei}}{{getPrice(itemCancella.Amount)}};</template>
取消,收费 {{DanWei}}
<!--{{getPrice(itemCancella.Amount)}}-->
{{itemCancella.Amount}};</template>
</template>
</template>
</text>
......@@ -223,7 +234,10 @@
<view class="box flex">
<view class="price">
<text class="f11">{{RoomInfo.Currency}}</text>
<text>{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}</text>
<text>
<!--{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}-->
{{ (orderMsg.TotalPrice*orderMsg.RoomCount)-currentCoupon.discountMoney }}
</text>
</view>
<view class="sum-detail">共计 {{orderMsg.RoomCount}}间房</view>
<u-button :ripple="true" :hair-line="false" :custom-style="submit?btnStyle2:btnStyle" @click="buyRoom"
......@@ -235,7 +249,10 @@
<u-toast ref="uToast" />
<u-picker mode="selector" v-model="showCountry" :default-selector="[0]" :range="countrys"
@confirm='(e)=>{changeDown(e,CountryType)}' range-key="label" @input="showCountry=false"></u-picker>
<coupon v-if="couponList.length > 0 && showCoupon" :price="getPrice(orderMsg.TotalPrice)" :list="couponList"
<!-- <coupon v-if="couponList.length > 0 && showCoupon" :price="getPrice(orderMsg.TotalPrice)" :list="couponList"
:current="useCouponIds" @close="closeCouponHandler" :order="orderMsg" :numberPeople="searchObj.peoples">
</coupon>-->
<coupon v-if="couponList.length > 0 && showCoupon" :price="orderMsg.TotalPrice" :list="couponList"
:current="useCouponIds" @close="closeCouponHandler" :order="orderMsg" :numberPeople="searchObj.peoples">
</coupon>
</view>
......@@ -299,6 +316,7 @@
roomType: 0,
CustomerId: 0, //同行Id
DirectCustomerId: 0, //直客Id
CreateBy: 0, //同业联系人
},
showtime: false,
paramsTime: {
......@@ -439,7 +457,7 @@
GoodsPic: "",
GoodsType: 9,
OrderMake: `${this.orderMsg.CheckInDate}入住;${this.orderMsg.CheckOutDate}离店 ${guestInfo}`,
TotalPrice: this.getPrice(this.orderMsg.TotalPrice),
TotalPrice: this.orderMsg.TotalPrice,//this.getPrice(this.orderMsg.TotalPrice)
PreferentialPrice: this.currentCoupon.discountMoney,
ErpOrderId: OrderId,
Country: 0,
......@@ -538,7 +556,7 @@
this.roomRateDetails = res.data.PriceDetails.HotelList[0];
this.orderMsg.BookingID = res.data.PriceDetails.ReferenceNo;
this.orderMsg.checkInTime = res.data.PriceDetails.CheckInDate;
this.orderMsg.TotalPrice = this.getPrice(this.roomRateDetails.TotalPrice);
this.orderMsg.TotalPrice = this.roomRateDetails.TotalPrice//this.getPrice(this.roomRateDetails.TotalPrice);
if (this.roomRateDetails.RatePlanList && this.roomRateDetails.RatePlanList.length > 0) {
this.orderMsg.roomType = this.roomRateDetails.RatePlanList[0].BedType
}
......@@ -765,10 +783,12 @@
})
return
}
if (this.submit) return;
this.submit = true;
let that = this;
var CreateBy = 0
// #ifdef MP-DI
that.orderMsg.DirectCustomerId = this.customer.customerId;
if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) {
......@@ -778,12 +798,14 @@
// #endif
// #ifdef MP-AG
CreateBy = this.CreateBy
that.orderMsg.CustomerId = this.customer.customerId
this.orderMsg.OrderSource = 5
if (this.customer && this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
this.orderMsg.EmployeeIdStr = this.customer.salesBaseInfo.employeeId
}
// #endif
that.orderMsg.CreateBy = CreateBy
console.log("酒店下单", that.orderMsg);
that.apipost('dmc_post_GetDiDaBookingConfirm', that.orderMsg,
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