Commit 5d03e1a4 authored by 吴春's avatar 吴春
parents e77a3862 1f8be486
......@@ -414,8 +414,18 @@ var commonUtils = {
}
myDate = myDate.setDate(myDate.getDate() + day);
myDate = new Date(myDate);
//返回年月日
return myDate.getFullYear() + '-' + parseInt(myDate.getMonth() + 1) + "-" + myDate.getDate()
var seperator1 = "-";
var year = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var strDate = myDate.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
}
......
......@@ -110,7 +110,7 @@
</table>
</div>
<div>
<el-tabs type="border-card" v-loading="loading" v-if="IsShow">
<el-tabs type="border-card" v-loading="loading" v-if="qHotelType==1">
<el-tab-pane :label="item.ProvinceName" v-for="(item,index) in dataList" :key="item.subCode">
<div class="clearfix comCheckHotelV2">
<div class="comCk_list" v-for="(subItem,subIndex) in item.HotelList">
......@@ -124,6 +124,36 @@
</div>
</el-tab-pane>
</el-tabs>
<template v-else>
<table v-loading="loading" >
<thead>
<tr>
<th>选择</th>
<th>酒店名称</th>
<th>价格</th>
</tr>
</thead>
<tbody>
<tr v-for="item in ThirdHotelList">
<td width="50">
<input :id="item.hotelId" type="checkbox" />
</td>
<td width="150">{{item.hotelName}}</td>
<td width="150">{{item.lowrateTotal}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<el-pagination v-if="thirdHotelMsg.numberOfResultMatched>0" background @current-change="handleCurrentChange"
:current-page.sync="thirdHotelMsg.displayFrom" :page-size="thirdHotelMsg.numberOfResults"
layout="total,prev, pager, next, jumper" :total="thirdHotelMsg.numberOfResultMatched">
</el-pagination>
</td>
</tr>
</tfoot>
</table>
</template>
</div>
<input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存" />
</div>
......@@ -142,6 +172,34 @@
Name: "", //酒店名称
UseDate: "", //入住时间
},
thirdHotelMsg: {
displayFrom: 1, //当前页
numberOfResults: 5, //每页条数
numberOfResultMatched: 0, //总条数
arrivalDate: "", //入住时间
departureDate: "", //离店时间
//房间信息列表
searchroomGroup: [{
numberOfAdults: 1, //大人数,
numberOfChildren: 0, //儿童数
childAges: 0, //儿童年龄
roomNum: 1, //房间数
}],
searchHotelIdList: [], //酒店id,[1,2,3]
freeword: "", //关键字
//类型 1,地区,2-酒店名称
freewordType: 0,
reviewRatingUpperLimits: 0, //指定评论分数的上限
reviewRatingLowerLimits: 0, //指定评论分数的下限
searchHotelCategory: [], //酒店分类
searchHotelFeatures: [], //酒店的特征
searchRoomType: [], //类型的房间
searchMealType: [], //饮食条件搜索
searchMinRate: 0, //検索最小金額,
searchMinRate: 0, //検索最大金額
sort: 0, //排序
},
ThirdHotelList: [], //第三方酒店列表
IsShow: false,
ckedHotel: {}
};
......@@ -152,88 +210,88 @@
this.IsShow = false;
this.dataList = [];
this.HotelList = [];
this.ThirdHotelList=[];
//地接酒店
if (this.qHotelType == 1) {
this.apipost('hotel_post_GetHasStockHotelList_V2', {
//1-只查询有库存的酒店
IsMoreThanZero: 0,
Country: "651",
IsAllHotel: 1,
Province: this.qMsg.ProvinceId,
Name: this.qMsg.Name,
sDate: this.qMsg.UseDate
}, res => {
this.loading = false;
this.IsShow = true;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
this.dataList.forEach(x => {
x.HotelList.forEach(y => {
y.isChecked = false;
})
})
} else {
this.Error(res.data.message)
}
}, err => {})
this.GetDMCHotelList();
}
//第三方酒店
else {
var nQMsg = {
displayFrom: "1", //当前页
numberOfResults: "10", //每页条数
arrivalDate: this.qMsg.UseDate, //入住时间
departureDate: "", //离店时间
//房间信息列表
searchroomGroup: {
numberOfAdults: 2, //大人数,
numberOfChildren: 0, //儿童数
childAges: 0, //儿童年龄
},
searchHotelIdList:[],//酒店id,[1,2,3]
freeword:this.qMsg.Name,//关键字
//类型 1,地区,2-酒店名称
freewordType:0,
reviewRatingUpperLimits:0,//指定评论分数的上限
reviewRatingLowerLimits:0,//指定评论分数的下限
searchHotelCategory:[],//酒店分类
searchHotelFeatures:[],//酒店的特征
searchRoomType:[],//类型的房间
searchMealType:[],//饮食条件搜索
searchMinRate:0,//検索最小金額,
searchMinRate:100000,//検索最大金額
sort:0,//排序
};
if(nQMsg.arrivalDate=="")
{
this.Info("请选择入住时间!");
return;
}
else
{
nQMsg.departureDate=this.$commonUtils.AddDay(nQMsg.arrivalDate,1);
}
if(nQMsg.freeword!="")
{
nQMsg.freewordType=1;
}
else
{
nQMsg.freewordType=2;
nQMsg.freeword="";
this.GetThirdHotelList();
}
},
//查询地接酒店
GetDMCHotelList() {
this.apipost('hotel_post_GetHasStockHotelList_V2', {
//1-只查询有库存的酒店
IsMoreThanZero: 0,
Country: "651",
IsAllHotel: 1,
Province: this.qMsg.ProvinceId,
Name: this.qMsg.Name,
sDate: this.qMsg.UseDate
}, res => {
this.loading = false;
this.IsShow = true;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
this.dataList.forEach(x => {
x.HotelList.forEach(y => {
y.isChecked = false;
})
})
} else {
this.Error(res.data.message)
}
console.log("nQMsg",nQMsg);
//多了一个参数调用线上的就酒店数据
this.apipost('dmc_post_Get_GetJAPAN_HotelList', nQMsg, res => {
this.loading = false;
this.IsShow = true;
if (res.data.resultCode == 1) {
console.log("res.data",res.data);
}, err => {})
},
//查询第三方酒店
GetThirdHotelList() {
this.thirdHotelMsg.arrivalDate=this.qMsg.UseDate;
if (this.thirdHotelMsg.arrivalDate == "") {
this.Info("请选择入住时间!");
return;
} else {
this.thirdHotelMsg.departureDate = this.$commonUtils.AddDay(this.thirdHotelMsg.arrivalDate, 1);
}
this.thirdHotelMsg.freeword=this.qMsg.Name;
if (this.thirdHotelMsg.freeword == "") {
this.thirdHotelMsg.freewordType = 1;
if (this.qMsg.ProvinceId > 0) {
//获取当前选中的对象
let obj = {};
obj = this.ProvinceList.find(item => {
return item.ID === this.qMsg.ProvinceId; //筛选出匹配数据
});
if (obj != undefined) {
this.thirdHotelMsg.freeword = obj.Name;
} else {
this.Error(res.data.message)
this.thirdHotelMsg.freeword = this.ProvinceList[0].Name;
}
}, err => {},true)
} else {
this.thirdHotelMsg.freeword = this.ProvinceList[0].Name;
}
} else {
this.thirdHotelMsg.freewordType = 2;
this.thirdHotelMsg.freeword = this.qMsg.Name;
}
//多了一个参数调用线上的就酒店数据
this.apipost('dmc_post_Get_GetJAPAN_HotelList', this.thirdHotelMsg, res => {
this.loading = false;
this.IsShow = true;
if (res.data.resultCode == 1) {
//总条数
this.thirdHotelMsg.numberOfResultMatched = Number(res.data.data.numberOfResultMatched);
this.ThirdHotelList = res.data.data.hotelSummary;
} else {
this.Error(res.data.message)
}
}, err => {}, true)
},
handleCurrentChange(val) {
this.thirdHotelMsg.displayFrom = val;
this.GetThirdHotelList();
},
getCheck(hotelList, index) {
hotelList.forEach((x, subIndex) => {
......
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