Commit 331a59bd authored by youjie's avatar youjie

道旅酒店

parent 240fd202
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</div> </div>
<div :class="{'row justify-end':$q.platform.is.mobile}"> <div :class="{'row justify-end':$q.platform.is.mobile}">
<q-btn color="primary" :size="$q.platform.is.desktop?'md':'sm'" label="立即預訂" unelevated <q-btn color="primary" :size="$q.platform.is.desktop?'md':'sm'" label="立即預訂" unelevated
@click="goOrderHandler(index,indexs,subItem)" @click="goOrderHandler(item,subItem)"
:class="{'q-px-xs':$q.platform.is.desktop}"/> :class="{'q-px-xs':$q.platform.is.desktop}"/>
</div> </div>
</div> </div>
...@@ -310,21 +310,15 @@ ...@@ -310,21 +310,15 @@
null null
); );
}, },
goOrderHandler(item){ goOrderHandler(item,subItem){
let order = { subItem = {
msg: this.msg, RoomName_CN: item.RoomName_CN,
liveNvm: this.SimilarObj.liveNvm, RoomName: item.RoomName,
roomOptionCd: item, imageList: item.imageList,
...subItem
} }
let key = this.$md5(JSON.stringify(order)) this.$emit('placeOrder', subItem);
let pickuporderHotal = localStorage.getItem('pickuporderHotalDida')
pickuporderHotal = pickuporderHotal?JSON.parse(pickuporderHotal):[]
pickuporderHotal.push({
key,
order
})
localStorage.setItem("pickuporderHotalDida",JSON.stringify(pickuporderHotal))
this.CommonJump('/HotalDidaForm/'+key, {});
}, },
init() { init() {
this.chooseObj = null this.chooseObj = null
......
...@@ -437,7 +437,7 @@ ...@@ -437,7 +437,7 @@
> >
<div class="col q-mr-lg"> <div class="col q-mr-lg">
<div class="f30 bold row items-center"> <div class="f30 bold row items-center">
<span class="ellipsis-2-lines q-pr-lg">{{ hotelSummary.hotelName }}</span> <span class="ellipsis-2-lines q-pr-lg">{{ dataList.Name_CN }}</span>
<q-rating v-model="roomReviewRating" size="1em" <q-rating v-model="roomReviewRating" size="1em"
color="orange" :max="roomReviewRating" readonly /> color="orange" :max="roomReviewRating" readonly />
</div> </div>
...@@ -575,6 +575,7 @@ ...@@ -575,6 +575,7 @@
:HotelRoomTypes="HotelRoomTypes" :HotelRoomTypes="HotelRoomTypes"
:HotelMealTypes="HotelMealTypes" :HotelMealTypes="HotelMealTypes"
@change="changeChosenDateHandler" @change="changeChosenDateHandler"
@placeOrder="placeOrderHandler"
ref="RoomCard" ref="RoomCard"
></RoomCard> ></RoomCard>
...@@ -676,6 +677,7 @@ ...@@ -676,6 +677,7 @@
:HotelRoomTypes="HotelRoomTypes" :HotelRoomTypes="HotelRoomTypes"
:HotelMealTypes="HotelMealTypes" :HotelMealTypes="HotelMealTypes"
@change="changeChosenDateHandler" @change="changeChosenDateHandler"
@placeOrder="placeOrderHandler"
ref="RoomCard" ref="RoomCard"
></RoomCard> ></RoomCard>
</div> </div>
...@@ -1233,6 +1235,59 @@ export default { ...@@ -1233,6 +1235,59 @@ export default {
document.getElementsByTagName("body")[0].style = ""; document.getElementsByTagName("body")[0].style = "";
}, },
methods: { methods: {
placeOrderHandler(item){
// this.getDiDaPriceConfirmList(item)
let order = {
msg: {
hotelId: this.msg.hotelId,
CheckInDate: this.msg.CheckInDate,
CheckOutDate: this.msg.CheckOutDate,
ratePlanID: item.RatePlanID,
RoomCount: this.roomGroup,
AdultCount: this.numberOfAdults,
childNum: this.numberOfChildren,
searchroomGroup: this.msg.searchroomGroup,
},
liveNvm: this.SimilarObj.liveNvm,
roomOptionCd: item,
detail: this.dataList
}
let key = this.$md5(JSON.stringify(order))
let pickuporderHotal = localStorage.getItem('pickuporderHotalDida')
pickuporderHotal = pickuporderHotal?JSON.parse(pickuporderHotal):[]
pickuporderHotal.push({
key,
order
})
localStorage.setItem("pickuporderHotalDida",JSON.stringify(pickuporderHotal))
this.CommonJump('/HotalDidaForm/'+key, {});
},
// 获取道旅确认价格
getDiDaPriceConfirmList(item){
let msg = {
sort: 1,
displayFrom: 1,
CheckInDate: this.msg.CheckInDate,
CheckOutDate: this.msg.CheckOutDate,
searchroomGroup: this.msg.searchroomGroup,
ratePlanID: item.RatePlanID,
imgUrl: "",
RoomCount: this.roomGroup,
ChildCount: this.numberOfChildren,
AdultCount: this.numberOfAdults,
OccupancyDetails: [],
hotelId: this.msg.hotelId,
}
this.apipost('dmc_post_GetDiDaPriceConfirm', msg, (res) => {
if (res.data.resultCode == 1) {
console.log(res.data)
} else {
this.$message.error(res.data.message)
}
})
},
getQueryName(type){ getQueryName(type){
if(type==1){ if(type==1){
this.qMsg.RoomTypeName = this.qMsg.RoomTypeName!='房型(全部)'?this.qMsg.RoomTypeName:'' this.qMsg.RoomTypeName = this.qMsg.RoomTypeName!='房型(全部)'?this.qMsg.RoomTypeName:''
...@@ -1431,13 +1486,14 @@ export default { ...@@ -1431,13 +1486,14 @@ export default {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
var tempObj = res.data.data; var tempObj = res.data.data;
this.dataList = res.data.data this.dataList = res.data.data
this.dataList.images = tempObj.images.filter(x=>{ tempObj.images.filter(x=>{
this.checkImageExists(x, (exists) => { this.checkImageExists(x, (exists) => {
if(exists){ if(exists){
this.images.push(x) this.images.push(x)
} }
}); });
}) })
this.dataList.images = this.images
if (tempObj.HotelFacilityList && tempObj.HotelFacilityList.length > 0) { if (tempObj.HotelFacilityList && tempObj.HotelFacilityList.length > 0) {
this.Facilities = tempObj.HotelFacilityList; this.Facilities = tempObj.HotelFacilityList;
} }
...@@ -1451,7 +1507,7 @@ export default { ...@@ -1451,7 +1507,7 @@ export default {
// this.hotelDetails.hotelDescription.push(x.replace(/<\/?[^>]+(>|$)/g, "")) // this.hotelDetails.hotelDescription.push(x.replace(/<\/?[^>]+(>|$)/g, ""))
// }) // })
this.hotelDetails.hotelDescription = tempObj.description this.hotelDetails.hotelDescription = tempObj.description
this.roomReviewRating = Number(this.hotelDetails.roomReviewRating); this.roomReviewRating = Number(this.dataList.StarRating);
this.travelLngLat.push({ this.travelLngLat.push({
Lat: tempObj.Latitude, Lat: tempObj.Latitude,
Lng: tempObj.Longitude, Lng: tempObj.Longitude,
......
...@@ -73,82 +73,85 @@ ...@@ -73,82 +73,85 @@
<div class="text-subtitle1 text-weight-bolder q-mb-md">旅客資料</div> <div class="text-subtitle1 text-weight-bolder q-mb-md">旅客資料</div>
<div class="row"> <div class="row">
<q-img <q-img
:src="details.roomRateDetails?details.roomRateDetails.roomImageURL:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'" :src="details.imageList&&details.imageList.length?details.imageList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
class="rounded-borders" class="rounded-borders"
spinner-color="grey-3" spinner-color="grey-3"
style="width: 80px" style="width: 80px"
/> />
<div class="q-ml-md col"> <div class="q-ml-md col">
<div class="text-subtitle1 ellipsis"> <div class="text-subtitle1 ellipsis">
{{details.hotelName}} {{OrderDate.detail.Name_CN}}
</div> </div>
<div class="text-caption text-grey-6 ellipsis q-mt-sm"> <div class="text-caption text-grey-6 ellipsis q-mt-sm">
{{details.access}} {{OrderDate.detail.Address_CN}}
</div> </div>
</div> </div>
</div> </div>
<div class="q-mt-md row"> <div class="q-mt-md row">
<div class="text-grey-9"> <div class="text-grey-9">
<q-icon name="iconfont iconrili" size="20px" class="q-mr-sm" /> <q-icon name="iconfont iconrili" size="20px" class="q-mr-sm" />
<span>{{msg.arrivalDate}}{{msg.departureDate}}</span> <span>{{msg.CheckInDate}}{{msg.CheckOutDate}}</span>
</div> </div>
<span class="text-grey-9 q-ml-sm">
<div class="text-grey-9 q-ml-sm">
<q-icon name="iconfont icontime" size="20px" class="q-mr-xs q-ml-sm" /> <q-icon name="iconfont icontime" size="20px" class="q-mr-xs q-ml-sm" />
<span class="q-mr-sm"> <span class="q-mr-sm">
住宿時間 {{OrderDate.liveNvm}} 住宿時間 {{OrderDate.liveNvm}}
</span> </span>
<span v-if="details.roomRateDetails">( </span>
<span class="text-grey-9" v-if="msg.roomOptionCd">
(
<span class="fz15 text-weight-bold"> <span class="fz15 text-weight-bold">
<span v-if="details.roomRateDetails.roomType==1">{{getGradeType(details.roomRateDetails.gradeType)}}單人間</span> {{ msg.roomOptionCd.RoomName_CN }}
<span v-if="details.roomRateDetails.roomType==2">{{getGradeType(details.roomRateDetails.gradeType)}}雙人間</span>
<span v-if="details.roomRateDetails.roomType==3">{{getGradeType(details.roomRateDetails.gradeType)}}大床房</span>
<span v-if="details.roomRateDetails.roomType==4">{{getGradeType(details.roomRateDetails.gradeType)}}三人間</span>
<span v-if="details.roomRateDetails.roomType==5">{{getGradeType(details.roomRateDetails.gradeType)}}四人間</span>
<span v-if="details.roomRateDetails.roomType==6">{{getGradeType(details.roomRateDetails.gradeType)}}日式房</span>
<span v-if="details.roomRateDetails.roomType==7">{{getGradeType(details.roomRateDetails.gradeType)}}日式+西式混合房</span>
<span v-if="details.roomRateDetails.roomType==8">{{getGradeType(details.roomRateDetails.gradeType)}}大床房(小型)</span>
<span v-if="(details.roomRateDetails.roomType==9||details.roomRateDetails.roomType=='')&&details.roomRateDetails.gradeType==''">未知房型</span>
</span> </span>
<span class="fz13 text-grey-6 q-ml-sm" v-if="roomRateDetails.RatePlanList && roomRateDetails.RatePlanList.length > 0">
<span class="fz13 text-grey-6 q-ml-sm"> {{ getRoomType(roomRateDetails.RatePlanList[0].BedType) }}
<span v-if="details.roomRateDetails.smoking==0">禁煙, </span> <template v-for="( itemp, indexp ) in roomRateDetails.RatePlanList[0].PriceList">
<span v-if="details.roomRateDetails.smoking==1">可吸煙, </span> <template v-if="!indexp">
<span v-if="details.roomRateDetails.withBath==0">無浴室</span> {{getMealtype(itemp.MealType)}}
<span v-if="details.roomRateDetails.withBath==1">有浴室</span> <template v-if="itemp.MealAmount>0">
×{{itemp.MealAmount}}{{$t('salesModule.Fen')}}
</template>
</template>
</template>
</span> </span>
) )
</span> </span>
<q-icon name="iconfont jinggao1" size="20px"/><span>僅剩{{details.currentAllotment}}</span> <span class="text-grey-9">
<q-icon name="iconfont jinggao1" size="20px"/><span>
<template v-if="roomRateDetails&&roomRateDetails.RatePlanList.length">
<template v-for="(item, index) in roomRateDetails.RatePlanList">
僅剩{{item.InventoryCount}}
</template>
</template>
</span>
<span class="q-mr-sm"></span> <span class="q-mr-sm"></span>
<q-icon name="iconfont iconpeople" size="20px" class="q-mr-xs q-ml-sm" /> <q-icon name="iconfont iconpeople" size="20px" class="q-mr-xs q-ml-sm" />
<span class="q-mr-sm"> <span class="q-mr-sm">
成人 {{numberOfAdults}}<span class="q-pl-sm">兒童 {{numberOfChildren}}</span> 成人 {{numberOfAdults}}<span class="q-pl-sm">兒童 {{numberOfChildren}}</span>
</span> </span>
</span>
</div>
</div> </div>
<div class="rounded-borders bg-blue-1 q-px-md q-py-sm q-mt-sm column"> <div class="rounded-borders bg-blue-1 q-px-md q-py-sm q-mt-sm column">
<!-- <span class="text-orange-6 q-pb-xs">超过13岁视为成人处理</span> --> <span class="text-orange-6 q-pb-xs">超过13岁视为成人处理</span>
<!-- <span class="text-green-6">预定成功后房间将为您整晚保留</span> --> <span class="text-green-6">预定成功后房间将为您整晚保留</span>
<span class="text-red-6 q-pb-xs">所填姓名需和入住時所持證件一致</span> <span class="text-red-6 q-pt-xs" v-if="
<span class="text-orange-6 q-pb-xs" v-if="(details.cancellationPeriod1==-1||details.cancellationPeriod1==0)&&(details.cancellationType1==1||details.cancellationType1==2)"> roomRateDetails.CancellationPolicyList &&
<template v-if="details.cancellationPeriod1==-1">沒有通知取消,</template> roomRateDetails.CancellationPolicyList.length > 0
<template v-if="details.cancellationPeriod1==0">入住當日取消,</template> ">
<template v-if="details.cancellationType1==1">手續費:{{details.cancellation1}}%</template> <span v-for="(itemCancella, index1) in roomRateDetails.CancellationPolicyList">
<template v-if="details.cancellationType1==2">手續費:{{details.cancellation1}}</template> <span v-if="index1==0">{{ getformatDateStr(itemCancella.FromDate) }}之前免費取消
</span>
<span v-if="itemCancella.Amount==roomRateDetails.TotalPrice">
<span>{{ getformatDateStr(itemCancella.FromDate) }}起不可取消,取消將收取訂單全額費用;</span>
</span>
<span v-else>
<span>{{ getformatDateStr(itemCancella.FromDate) }}
<span v-if="index1!=(roomRateDetails.CancellationPolicyList.length-1)">-
{{ getformatDateStr(roomRateDetails.CancellationPolicyList[index1+1].FromDate) }}
之間</span>
取消,收費{{DanWei}}{{getPrice(itemCancella.Amount)}};</span>
</span> </span>
<span class="text-green-6 q-pb-xs" v-if="(details.cancellationPeriod2==-1||details.cancellationPeriod2==0)&&(details.cancellationType2==1||details.cancellationType2==2)">
<template v-if="details.cancellationPeriod2==-1">沒有通知取消,</template>
<template v-if="details.cancellationPeriod2==0">入住當日取消,</template>
<template v-if="details.cancellationType2==1">手續費:{{details.cancellation2}}%</template>
<template v-if="details.cancellationType2==2">手續費:{{details.cancellation2}}</template>
</span> </span>
<span class="text-green-6" v-if="(details.cancellationPeriod3==-1||details.cancellationPeriod3==0)&&(details.cancellationType3==1||details.cancellationType3==2)">
<template v-if="details.cancellationPeriod3==-1">沒有通知取消,</template>
<template v-if="details.cancellationPeriod3==0">入住當日取消,</template>
<template v-if="details.cancellationType3==1">手續費:{{details.cancellation3}}%</template>
<template v-if="details.cancellationType3==2">手續費:{{details.cancellation3}}</template>
</span> </span>
</div> </div>
...@@ -203,14 +206,14 @@ ...@@ -203,14 +206,14 @@
ref="guestAddress" ref="guestAddress"
></q-input> ></q-input>
</div> </div>
<div :class="filedGuestWidth"> <!-- <div :class="filedGuestWidth">
<q-input <q-input
class="q-pb-md" class="q-pb-md"
standout standout
:value="parameters.checkInTime" :value="parameters.CheckInDate"
label="入住時間" label="入住時間"
:rules="[(val) => !!val || `請选入住時間`]" :rules="[(val) => !!val || `請选入住時間`]"
ref="checkInTime" ref="CheckInDate"
readonly readonly
> >
<template v-slot:append> <template v-slot:append>
...@@ -218,58 +221,57 @@ ...@@ -218,58 +221,57 @@
</template> </template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy"> <q-popup-proxy :offset="[0, 0]" ref="qDateProxy">
<div class="row"> <div class="row">
<q-time format24h v-model="parameters.checkInTime" mask="HH:mm" <q-time format24h v-model="parameters.CheckInDate" mask="HH:mm"
@input="()=>$refs.qDateProxy.hide()"/> @input="()=>$refs.qDateProxy.hide()"/>
</div> </div>
</q-popup-proxy> </q-popup-proxy>
</q-input> </q-input>
</div> </div> -->
</div> </div>
</div> </div>
<q-separator color="grey-2" class="q-mt-md" /> <q-separator color="grey-2" class="q-mt-md" />
<div <div
class="bg-grey-1 rounded-borders q-pa-md q-mt-md guest-item" class="bg-grey-1 rounded-borders q-pa-md q-mt-md guest-item"
v-for="(x,i) in parameters.roomGroup" v-for="(x,i) in parameters.GuestList"
:key="i" :key="i"
> >
<div class="text-subtitle1 q-pb-md text-weight-bold"> <div class="text-subtitle1 q-pb-md text-weight-bold">
房間{{ x.roomCount }} 房間{{ x.RoomNum }}
</div> </div>
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md" v-for="(y,index) in x.GuestInfo"
:class="[index!=x.GuestInfo.length-1?'q-mb-md':'']">
<div :class="filedGuestWidth"> <div :class="filedGuestWidth">
<q-input <q-input
standout standout
v-model="x.roomMaleCount" v-model="y.LastName"
label="成人男" label="英文姓"
placeholder="" placeholder=""
mask="#" mask="A"
reverse-fill-mask reverse-fill-mask
:ref="`guest${i}Male`" :ref="`guest${i}_${index}Male`"
/> />
<!-- :ref="`guest${i}Male`" :rules="[(val) => !!val || '請輸成人數']"-->
</div> </div>
<div :class="filedGuestWidth"> <div :class="filedGuestWidth">
<q-input <q-input
standout standout
v-model="x.roomFemaleCount" v-model="y.FirstName"
label="成人女" label="英文名"
placeholder="" placeholder=""
mask="#" mask="A"
reverse-fill-mask reverse-fill-mask
:ref="`guest${i}Female`" :ref="`guest${i}_${index}Female`"
/> />
<!-- :ref="`guest${i}Female`" :rules="[(val) => !!val || '請輸成人女數']"-->
</div> </div>
<div :class="filedGuestWidth"> <div :class="filedGuestWidth">
<q-input <q-input
standout standout
v-model="x.roomChildCount" v-model="y.Age"
label="兒童" label="年龄(兒童必填)"
placeholder="" placeholder=""
mask="#" mask="#"
reverse-fill-mask reverse-fill-mask
:disable="!numberOfChildren?true:false" :disable="!y.numberOfChildren?true:false"
/> />
<!-- :rules="[(val) => !!val || '請輸儿童數']" --> <!-- :rules="[(val) => !!val || '請輸儿童數']" -->
</div> </div>
...@@ -315,10 +317,10 @@ ...@@ -315,10 +317,10 @@
/> />
<div class="q-ml-md col"> <div class="q-ml-md col">
<div class="text-subtitle1 ellipsis"> <div class="text-subtitle1 ellipsis">
{{details.hotelName}} {{details.Name_CN}}
</div> </div>
<div class="text-caption text-grey-6 ellipsis q-mt-sm"> <div class="text-caption text-grey-6 ellipsis q-mt-sm">
{{details.access}} {{details.Address_CN}}
</div> </div>
</div> </div>
</div> </div>
...@@ -327,22 +329,26 @@ ...@@ -327,22 +329,26 @@
<div style="width: 80px"> <div style="width: 80px">
入住時間:</div> 入住時間:</div>
<div class="q-ml-md"> <div class="q-ml-md">
{{checkInTimeH}} {{CheckInDateH}}
{{details.roomRateDetails.roomOptions['check-inStartTime']}} 之後 {{details.roomRateDetails.roomOptions['check-inStartTime']}} 之後
</br> </br>
{{checkInTimeQ+' '+details.roomRateDetails.roomOptions['finalCheck-outTime']}} 之前 {{CheckInDateQ+' '+details.roomRateDetails.roomOptions['finalCheck-outTime']}} 之前
</div> </div>
</div> </div>
</div> </div>
<q-separator color="grey-2" class="q-my-md"/> <q-separator color="grey-2" class="q-my-md"/>
<div class="text-grey-9"> <div class="text-grey-9">
<template v-for="(x,i) in details.roomGroup"> <template v-for="(x,i) in parameters.GuestList">
<template v-for="y in x.rateGroup"> <div class="row justify-between q-mb-sm">
<div class="row q-mb-sm"> <span>房間{{ x.RoomNum }}</span>
<div class="col">{{y.stayDate}}</div> <span>1間 * {{DanWei}}{{ Price }}</span>
</div>
<template v-for="y in x.GuestInfo">
<div class="row q-mb-sm" v-if="y.LastName!=''||y.FirstName!=''">
<div class="col">{{y.LastName}} {{ y.FirstName }}</div>
<div> <div>
<span v-if="y.perAdultRateBySetCurrency">CNY {{y.perAdultRateBySetCurrency}}/</span> <span>1成</span>
<span v-else="y.totalPerRoomRateBySetCurrency">CNY {{y.totalPerRoomRateBySetCurrency}}/晚</span> <span v-if="y.numberOfChildren">1兒童 </span>
</div> </div>
</div> </div>
</template> </template>
...@@ -354,7 +360,7 @@ ...@@ -354,7 +360,7 @@
<div class="row q-mb-sm items-center"> <div class="row q-mb-sm items-center">
<div class="col">總金額</div> <div class="col">總金額</div>
<div class="text-subtitle2 text-weight-bolder text-primary"> <div class="text-subtitle2 text-weight-bolder text-primary">
CNY {{ moneyFormat(sumPrice, 2) }} {{ DanWei }} {{ moneyFormat(sumPrice, 2) }}
</div> </div>
</div> </div>
<hr style="border:none;border-top:1px dashed #EEE !important;" class="bg-transparent q-mb-sm" /> <hr style="border:none;border-top:1px dashed #EEE !important;" class="bg-transparent q-mb-sm" />
...@@ -364,14 +370,14 @@ ...@@ -364,14 +370,14 @@
class="text-subtitle2 text-weight-bolder text-teal" class="text-subtitle2 text-weight-bolder text-teal"
v-if="parameters.DiscountMoney > 0" v-if="parameters.DiscountMoney > 0"
> >
CNY - {{ moneyFormat(parameters.DiscountMoney, 2) }} {{ DanWei }} - {{ moneyFormat(parameters.DiscountMoney, 2) }}
</div> </div>
<div class="text-grey-5" v-else>暫無優惠</div> <div class="text-grey-5" v-else>暫無優惠</div>
</div> </div>
<div class="row q-mb-sm items-center"> <div class="row q-mb-sm items-center">
<div class="col">支付金額</div> <div class="col">支付金額</div>
<div class="text-h6 text-weight-bolder text-primary product-price"> <div class="text-h6 text-weight-bolder text-primary product-price">
CNY {{ moneyFormat(parameters.totalChargeableRateInfo, 2) }} {{ DanWei }} {{ moneyFormat(parameters.TotalPrice, 2) }}
</div> </div>
</div> </div>
</div> </div>
...@@ -442,13 +448,26 @@ export default { ...@@ -442,13 +448,26 @@ export default {
countrys: [], countrys: [],
areaCodes: [], areaCodes: [],
loading: false, loading: false,
msg:null, msg:{
sort: 1,
displayFrom: 1,
CheckInDate: "",
CheckOutDate: "",
searchroomGroup: [],
ratePlanID: "",
imgUrl: "",
RoomCount: 1,
ChildCount: 0,
AdultCount: 1,
OccupancyDetails: [],
hotelId: 0
},
JapanIncrease: null, JapanIncrease: null,
numberOfAdults: 0, numberOfAdults: 0,
numberOfChildren: 0, numberOfChildren: 0,
roomRateDetails: [], roomRateDetails: [],
checkInTimeH: '', CheckInDateH: '',
checkInTimeQ: '', CheckInDateQ: '',
price: 0, price: 0,
guest: { guest: {
roomCount: 0,//房间编号 roomCount: 0,//房间编号
...@@ -465,40 +484,36 @@ export default { ...@@ -465,40 +484,36 @@ export default {
price: 0, price: 0,
SettlementPrice: 0,//实付 SettlementPrice: 0,//实付
parameters: { parameters: {
dataId:'',//订单id EmployeeIdStr: "",
hotelId:'',//酒店id CheckInDate: "",
totalRoomCount:'',//使用客房总数 RatePlanID: "",
arrivalDate:'',//开始时间 CheckOutDate: "",
checkInTime:'',//入住时间 RoomCount: "",
departureDate:'',//结束时间 guestLastName: "",
roomOptionCd:'',//房间计划CD guestFirstName: "",
totalChargeableRateInfo:'',//人民币合计费用 guestAddress: "",
guestRequestAppendix: 0,//费用合计(日元) guestPhoneNumber: "",
totalPriceJapanese:'',//日元合计费用 guestEmail: "",
comment: '',//评论 BookingID: "",
roomGroup:[],//每天住宿的费用明细 HotelName: "",
guestLastName:'',//姓 HotelPic: "",
guestFirstName:'',//名 GuestList: [],
guestAddress:'',//住宿代表地址 TotalPrice: 0,
guestPhoneNumber:'',//住宿代表电话 CustomerPayMoney: 0,
guestEmail:'',//住宿代表Email DiscountMoney: 0,
OrderSource: 2,
OrderForm: 1,
//备注 //备注
guestRequest:'', guestRequest: "",
CustomerId:0, hotelId: '',
HotelName:'',//酒店名称 roomType: 0,
HotelPic:'',//酒店图片 RoomName:"",//房型名称
EmployeeIdStr:'',
OldTotalPrice:0,
CustomerPayMoney:0,
DiscountMoney:0,//优惠
OrderSource: 3,//类型 1 来源内部 2 来源B2B 3 来源B2C
OrderForm:1,
CouponAllotIds: '',
}, },
TotalPeople: 0,//总人数 TotalPeople: 0,//总人数
HotelRoomTypes: [],//道旅床类型 HotelRoomTypes: [],//道旅床类型
HotelMealTypes: [],//道旅餐食类型 HotelMealTypes: [],//道旅餐食类型
DanWei: '',//单位
}; };
}, },
computed: { computed: {
...@@ -521,8 +536,9 @@ export default { ...@@ -521,8 +536,9 @@ export default {
this.getData() this.getData()
} }
// this.initGuestHandler(); this.getdidaBedType()
// this.getUserInfoHandler() this.getdidaMealType()
this.getUserInfoHandler()
}, },
methods: { methods: {
//获取道旅床类型列表 //获取道旅床类型列表
...@@ -564,6 +580,18 @@ export default { ...@@ -564,6 +580,18 @@ export default {
}); });
} }
return roomtypeName; return roomtypeName;
},
//获取餐型
getMealtype(mealtypeId) {
let mealtypeName = "";
if (mealtypeId > 0) {
this.HotelMealTypes.forEach((item) => {
if (item.ID == mealtypeId) {
mealtypeName = item.Name_CN;
}
});
}
return mealtypeName;
}, },
changeDiscountHandler(coupon) { changeDiscountHandler(coupon) {
if (coupon) { if (coupon) {
...@@ -593,125 +621,62 @@ export default { ...@@ -593,125 +621,62 @@ export default {
let date = (dt.getDate()).toString().padStart(2, "0"); let date = (dt.getDate()).toString().padStart(2, "0");
return month + "-" + date + "(" + this.WeekList[dt.getDay()] + ")"; return month + "-" + date + "(" + this.WeekList[dt.getDay()] + ")";
}, },
//日期格式化
getformatDateStr(value) {
var dt = new Date(value);
let year = dt.getFullYear();
let month = (dt.getMonth() + 1).toString().padStart(2, "0");
let date = (dt.getDate()).toString().padStart(2, "0");
return year + "-" + month + "-" + date;
},
getPrice(price) {
return Math.ceil(price);
},
// 获取商品详情 // 获取商品详情
getData() { getData() {
this.$q.loading.show(); this.$q.loading.show();
this.apipost( this.apipost(
"dmc_post_GetDiDaPriceConfirm", "dmc_post_GetDiDaPriceConfirm",
this.msg, this.msg,
(r) => { (res) => {
this.$q.loading.hide(); this.$q.loading.hide();
if (r.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data.PriceDetails;
this.details = r.data.data; this.roomRateDetails = res.data.data.PriceDetails.HotelList[0];
this.parameters.HotelName = this.details.hotelName this.parameters.BookingID = res.data.data.PriceDetails.ReferenceNo;
this.parameters.CheckInDate = res.data.data.PriceDetails.CheckInDate;
this.parameters.HotelPic = this.details.roomRateDetails.roomImageURL this.parameters.TotalPrice = this.roomRateDetails.TotalPrice;
this.JapanIncrease = r.data.data.JapanIncrease this.parameters.RoomCount = this.msg.RoomCount;
if(Object.prototype.toString.call(this.details.roomGroup) == '[object Object]'){ this.DanWei = res.data.data.PriceDetails.HotelList[0].RatePlanList[0].Currency;
if (
Object.prototype.toString.call(this.dataList.HotelList) ==
"[object Object]"
) {
let arr = []; let arr = [];
arr.push(this.details.roomGroup); arr.push(this.dataList.HotelList);
this.details.roomGroup=arr; this.dataList.HotelList = arr;
} }
this.TotalChildCount = 0; this.TotalChildCount = 0;
let rateGrouoLen = 0;
//无价格 只有房间价格
this.sumPrice = 0
this.parameters.totalChargeableRateInfo = 0
this.parameters.totalPriceJapanese = 0
this.details.roomGroup.forEach((x,index)=>{
if(Object.prototype.toString.call(x.rateGroup) == '[object Object]'){
let arr = [];
arr.push(x.rateGroup);
x.rateGroup= arr;
}
let tt = 0;
let tt2 = 0;
let AdultTotalPrice = 0;
let childToTalPrice = 0;
let AdultCount = 0;
let childCount = 0;
let AdultJapanPrice = 0;
let ChildJapanPrice = 0;
let AdultJapanCount = 0;
let childJapanCount = 0;
//原始成人 this.details = {
let oldAount=0; ...this.OrderDate.roomOptionCd,
let childAount=0; ...res.data.data
let oldAuditPrice=0; };
let oldChildPrice=0;
this.TotalChildCount+=x.roomChildCount*x.rateGroup.length;
rateGrouoLen+= x.rateGroup.length;
this.chekedChildCount = this.numberOfChildren*rateGrouoLen;
if(this.TotalChildCount<this.chekedChildCount){
this.isBaoChild=true;
}
let onlyRoomPrice=0;
let onlyJanpnase=0;
x.rateGroup.forEach(z=>{
if(z.perAdultRateBySetCurrency){
z.oldAuditPrice = z.perAdultRateBySetCurrency;
z.oldchildPrice = z.perChildRateBySetCurrency;
z.perAdultRateBySetCurrency = Math.ceil(z.perAdultRateBySetCurrency/this.details.JapanIncrease);
z.perChildRateBySetCurrency = Math.ceil(z.perChildRateBySetCurrency/this.details.JapanIncrease);
if(x.roomAdultCount>0){
AdultTotalPrice+=parseFloat(z.perAdultRateBySetCurrency);
oldAuditPrice+=parseFloat(z.oldAuditPrice);
AdultJapanPrice+=parseFloat(z.perAdultRate);
}
if(x.roomChildCount>0){
childToTalPrice+=parseFloat(z.perChildRateBySetCurrency);
oldChildPrice+=parseFloat(z.oldchildPrice);
ChildJapanPrice+=parseFloat(z.perChildRate);
}
}
if(z.totalPerRoomRateBySetCurrency){
z.totalPerRoomRateBySetCurrency = Math.ceil(z.totalPerRoomRateBySetCurrency/this.details.JapanIncrease);
onlyRoomPrice+=parseFloat(z.totalPerRoomRateBySetCurrency);
onlyJanpnase+=parseFloat(z.totalPerRoomRate);
}
if(z.perAdultRateBySetCurrency){
this.sumPrice+=Number(z.perAdultRateBySetCurrency)
}else if(z.totalPerRoomRateBySetCurrency){
this.sumPrice+=Number(z.totalPerRoomRateBySetCurrency)
}
})
AdultCount+=AdultTotalPrice*x.roomAdultCount;
childCount+=childToTalPrice*x.roomChildCount;
// AdultCount+=AdultTotalPrice;
// childCount+=childToTalPrice;
oldAount+=oldAuditPrice;
childAount+=childAount;
this.parameters.totalChargeableRateInfo += parseFloat(AdultCount+childCount+onlyRoomPrice);
this.parameters.OldTotalPrice+=parseFloat(oldAount+childAount+onlyRoomPrice);
AdultJapanCount+=AdultJapanPrice*x.roomAdultCount;
childJapanCount+=ChildJapanPrice*x.roomChildCount;
this.SettlementPrice=this.parameters.totalChargeableRateInfo;
this.SettlementPrice=this.parameters.totalChargeableRateInfo;
this.price=this.parameters.totalChargeableRateInfo;
// AdultJapanCount+=AdultJapanPrice;
// childJapanCount+=ChildJapanPrice;
this.parameters.roomGroup[index].rateGroup = x.rateGroup
this.parameters.totalPriceJapanese += parseFloat(AdultJapanCount+childJapanCount+onlyJanpnase);
this.sumPrice = 0
this.roomRateDetails.RatePlanList[0].PriceList.forEach((item) => {
this.sumPrice+= (this.parameters.GuestList.length*Number(item.Price))
this.Price = Number(item.Price)
}) })
let hTIme = date.formatDate(date.addToDate(new Date(this.parameters.arrivalDate), { days: 1 }), 'YYYY/MM/DD') console.log(this.roomRateDetails,'-------"dmc_post_GetDiDaPriceConfirm"')
let qTime = date.formatDate(date.addToDate(new Date(hTIme), { days: -1 }), 'YYYY/MM/DD')
this.checkInTimeH = qTime
this.checkInTimeQ = hTIme
} else { } else {
this.$message.error(r.data.message) this.$message.error(res.data.message)
this.CommonJump('/detailHotalDida', {
id: this.msg.hotelId,
qsearchKey: this.OrderDate.detail.Name_CN,
qsearchDate: this.msg.CheckInDate,
qsearchEndDate: this.msg.CheckOutDate,
});
} }
}, },
...@@ -723,38 +688,49 @@ export default { ...@@ -723,38 +688,49 @@ export default {
if (this.$route.params && this.$route.params.id) { if (this.$route.params && this.$route.params.id) {
let key = this.$route.params.id; let key = this.$route.params.id;
let pickuporderHotal = localStorage.getItem("pickuporderHotalDida"); let pickuporderHotal = localStorage.getItem("pickuporderHotalDida");
pickuporderHotal = pickuporderHotal ? JSON.parse(pickuporderHotal) : []; pickuporderHotal = pickuporderHotal ? JSON.parse(pickuporderHotal) : [];
if (pickuporderHotal.length > 0) { if (pickuporderHotal.length > 0) {
this.order = pickuporderHotal.find((x) => x.key == key); this.order = pickuporderHotal.find((x) => x.key == key);
if (this.order) { if (this.order) {
this.orderKey = key; this.orderKey = key;
this.OrderDate = this.order.order this.OrderDate = this.order.order
this.msg = this.OrderDate.msg this.msg = {
...this.msg,
this.parameters.arrivalDate = this.msg.arrivalDate ...this.OrderDate.msg
this.parameters.departureDate = this.msg.departureDate
this.parameters.totalRoomCount = this.msg.searchroomGroup.length
this.parameters.roomGroup=[];
for(let i=0;i<this.parameters.totalRoomCount;i++){
var obj = {
roomCount:i+1,
roomMaleCount:0,
roomFemaleCount:0,
roomChildCount:0,
roomInfantCount:0,
rateGroup:[]
}
this.parameters.roomGroup.push(JSON.parse(JSON.stringify(obj)))
} }
this.numberOfAdults = 0 this.numberOfAdults = 0
this.numberOfChildren = 0, this.numberOfChildren = 0,
this.msg.roomOptionCd = this.OrderDate.roomOptionCd this.msg.roomOptionCd = this.OrderDate.roomOptionCd
this.parameters.roomOptionCd = this.OrderDate.roomOptionCd this.parameters.roomOptionCd = this.OrderDate.roomOptionCd
this.parameters.hotelId = this.msg.hotelId this.parameters.hotelId = this.msg.hotelId
this.msg.searchroomGroup.forEach(x=>{ console.log(this.OrderDate.detail,'--------this.msg')
this.parameters.GuestList = []
this.msg.searchroomGroup.forEach((x,index)=>{
this.numberOfAdults+=Number(x.numberOfAdults) this.numberOfAdults+=Number(x.numberOfAdults)
this.numberOfChildren+=Number(x.numberOfChildren) this.numberOfChildren+=Number(x.numberOfChildren)
var guestInfoList = [];
let allprople = x.numberOfAdults + x.numberOfChildren
for (let i = 0; i < allprople; i++) {
let obj = {
LastName: "",
FirstName: "",
Age: ""
};
guestInfoList.push(obj);
}
var obj = {
RoomNum: index + 1,
numberOfAdults: x.numberOfAdults,
numberOfChildren: x.numberOfChildren,
GuestInfo: guestInfoList
};
this.parameters.GuestList.push(obj);
}) })
console.log(this.parameters.GuestList,'--------this.parameters.GuestList')
} }
} }
} }
...@@ -769,40 +745,48 @@ export default { ...@@ -769,40 +745,48 @@ export default {
return this.orderKey != ""; return this.orderKey != "";
}, },
async submit() { async submit() {
let roomGroupLen = this.msg.searchroomGroup.length;
//判断选择的人数与入住人数 //判断选择的人数与入住人数
let Count1=0 let Count1=0
let roomGroup = this.parameters.roomGroup let roomGroup = this.parameters.GuestList
roomGroup.forEach(x=>{ roomGroup.forEach(x=>{
Count1+= Number(x.roomMaleCount)+Number(x.roomFemaleCount)+Number(x.roomChildCount) Count1+= Number(x.numberOfAdults)+Number(x.numberOfChildren)
}) })
let Count2=this.numberOfChildrenNumber?this.numberOfChildrenNumber:0; let Count2=this.numberOfChildren?this.numberOfChildren:0;
Count2= Number(this.numberOfAdults); Count2+= Number(this.numberOfAdults);
if(Count1!=Count2){ if(Count1!=Count2){
this.$message.error('入住人數與總入住數不匹配'); this.$message.error('入住人數與總入住數不匹配');
return; return;
} }
for (let i = 0; i < roomGroup.length; i++) { for (let i = 0; i < roomGroup.length; i++) {
roomGroup[i].roomMaleCount = roomGroup[i].roomMaleCount?roomGroup[i].roomMaleCount:0 if(!roomGroup[i].numberOfAdults){
roomGroup[i].roomFemaleCount = roomGroup[i].roomFemaleCount?roomGroup[i].roomFemaleCount:0
roomGroup[i].roomChildCount = roomGroup[i].roomChildCount?roomGroup[i].roomChildCount:0
if(!roomGroup[i].roomMaleCount&&!roomGroup[i].roomMaleCount){
this.$message.error('一個房間至少入住一人'); this.$message.error('一個房間至少入住一人');
return; return;
} }
} }
this.parameters.CustomerId = this.userInfo.Id; this.parameters.CustomerId = this.userInfo.Id;
this.parameters.EmployeeIdStr = this.userInfo.Surname+this.userInfo.Name this.parameters.EmployeeIdStr = this.userInfo.Id//`${this.userInfo.Surname?this.userInfo.Surname:''}${this.userInfo.Name?this.userInfo.Name:' '}`
console.log(this.parameters,'--------this.parameters.EmployeeIdStr')
this.$refs.mail.validate() this.$refs.mail.validate()
this.$refs.SurName.validate() this.$refs.SurName.validate()
this.$refs.Name.validate() this.$refs.Name.validate()
this.$refs.Mobile.validate() this.$refs.Mobile.validate()
this.$refs.guestAddress.validate() this.$refs.guestAddress.validate()
this.$refs.checkInTime.validate() // this.$refs.CheckInDate.validate()
this.parameters.guestEmail = this.userInfo.Mailbox this.parameters.guestEmail = this.userInfo.Mailbox
for (let i = 0; i < this.parameters.GuestList.length; i++) {
let GuestList = this.parameters.GuestList[i]
for (let j = 0; j < GuestList.GuestInfo.length; j++) {
let GuestInfo = GuestList.GuestInfo[j]
if(GuestInfo.LastName==''||GuestInfo.FirstName==''){
this.$message.error('請填寫姓或名');
return;
}
}
}
...@@ -823,7 +807,7 @@ export default { ...@@ -823,7 +807,7 @@ export default {
SetCarOrder(){ SetCarOrder(){
this.loading = true this.loading = true
this.apipost( this.apipost(
"dmc_post_GetJAPAN_HotelBookingB2C", "dmc_post_GetDiDaBookingConfirm",
this.parameters, this.parameters,
(r) => { (r) => {
if (r.data.resultCode == 1) { if (r.data.resultCode == 1) {
...@@ -846,11 +830,11 @@ export default { ...@@ -846,11 +830,11 @@ export default {
ContactNumber: this.parameters.guestPhoneNumber?this.parameters.guestPhoneNumber:this.userInfo.Mobile,// 联系电话 ContactNumber: this.parameters.guestPhoneNumber?this.parameters.guestPhoneNumber:this.userInfo.Mobile,// 联系电话
Mailbox: this.parameters.guestEmail?this.parameters.guestEmail:this.userInfo.Mailbox,//邮箱 Mailbox: this.parameters.guestEmail?this.parameters.guestEmail:this.userInfo.Mailbox,//邮箱
GoodsId: this.parameters.hotelId,//商品id GoodsId: this.parameters.hotelId,//商品id
GoodsName: this.parameters.HotelName,//商品名称 GoodsName: this.OrderDate.dateil.Name_CN,//商品名称
GoodsPic: this.parameters.HotelPic,//商品图片 GoodsPic: this.OrderDate.dateil.images[0],//商品图片
GoodsType: this.productType, GoodsType: this.productType,
OrderMake: this.parameters.arrivalDate,//订单摘要(例如出行时间) OrderMake: this.parameters.CheckInDate,//订单摘要(例如出行时间)
TotalPrice: this.parameters.totalChargeableRateInfo,//总价格 TotalPrice: this.parameters.TotalPrice,//总价格
PreferentialPrice: this.parameters.DiscountMoney,// 优惠总金额 PreferentialPrice: this.parameters.DiscountMoney,// 优惠总金额
ErpOrderId: ErpOrderId,//erp订单id ErpOrderId: ErpOrderId,//erp订单id
Country: this.userInfo.Country,//国家id Country: this.userInfo.Country,//国家id
...@@ -904,9 +888,6 @@ export default { ...@@ -904,9 +888,6 @@ export default {
// //
seekedChangeHandler(e) { seekedChangeHandler(e) {
},
initGuestHandler() {
}, },
//获取价格 //获取价格
getPrice(price) { getPrice(price) {
...@@ -968,6 +949,7 @@ export default { ...@@ -968,6 +949,7 @@ export default {
this.apipost("GetCustomerInfo_post", { Id: u.id }, (r) => { this.apipost("GetCustomerInfo_post", { Id: u.id }, (r) => {
if (r.data.resultCode == 1) { if (r.data.resultCode == 1) {
this.userInfo = r.data.data; this.userInfo = r.data.data;
console.log(this.userInfo,'-----------');
if(r.data.data.Moblie){ if(r.data.data.Moblie){
this.parameters.guestEmail = r.data.data.Moblie this.parameters.guestEmail = r.data.data.Moblie
this.userInfo.Mobile = r.data.data.Moblie this.userInfo.Mobile = r.data.data.Moblie
......
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