Commit d5bf8476 authored by 黄奎's avatar 黄奎

页面修改

parent 851b4aca
...@@ -116,10 +116,19 @@ ...@@ -116,10 +116,19 @@
<td v-if="childIndex==0" :rowspan="5"> <td v-if="childIndex==0" :rowspan="5">
<table class="hotelTable"> <table class="hotelTable">
<tr> <tr>
<td width="70" style="text-align:right;">酒店</td> <td width="70" style="text-align:center;" colspan="2">
<td> <span style="color:red">{{subItem.NewHotelName}}</span>
<!--:disabled="subItem.OPState==1"--> <el-popover placement="right" width="500" trigger="click" v-model="subItem.isShowPop">
<el-select class='w120 sel' v-model='subItem.NewHotelId' filterable <comCheckHotel :ref="'comCheckHotel'+index+subIndex+''" v-on:childHotel="childHotelList" :UseDate="item.UseTimeStr">
</comCheckHotel>
<el-button size="small" type="danger" :data-index="'comCheckHotel'+index+subIndex+''"
slot="reference" style="cursor:pointer;"
@click="getChildHotel(index,subIndex),subItem.isShowPop=true">
酒店选择
</el-button>
</el-popover>
<!-- <el-select class='w120 sel' v-model='subItem.NewHotelId' filterable
:placeholder="$t('pub.pleaseSel')" @visible-change='getHotelList(subItem)' :placeholder="$t('pub.pleaseSel')" @visible-change='getHotelList(subItem)'
@change='sendValue(subItem)'> @change='sendValue(subItem)'>
<el-option v-for='itemHotel in subItem.hotelList' :label='itemHotel.Name' :value='itemHotel.ID' <el-option v-for='itemHotel in subItem.hotelList' :label='itemHotel.Name' :value='itemHotel.ID'
...@@ -127,7 +136,7 @@ ...@@ -127,7 +136,7 @@
<span style="float: left">{{itemHotel.Name}}</span> <span style="float: left">{{itemHotel.Name}}</span>
<span style="float: right; color:red; font-size: 13px">{{itemHotel.Inventory }}</span> <span style="float: right; color:red; font-size: 13px">{{itemHotel.Inventory }}</span>
</el-option> </el-option>
</el-select> </el-select> -->
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -282,7 +291,7 @@ ...@@ -282,7 +291,7 @@
<el-tooltip class="item" effect="dark" content="新增" placement="top-start"> <el-tooltip class="item" effect="dark" content="新增" placement="top-start">
<el-button @click='AddHotel(item,subIndex)' icon="iconfont icon-tianjia" type="primary"></el-button> <el-button @click='AddHotel(item,subIndex)' icon="iconfont icon-tianjia" type="primary"></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip v-if="item.HotelOrderList.length>1||index==0" class="item" effect="dark" content="删除" <el-tooltip v-if="item.HotelOrderList.length>1" class="item" effect="dark" content="删除"
placement="top-start"> placement="top-start">
<el-button type="primary" icon="iconfont icon-shanchu" @click='DeleteHotel(item,subIndex)'> <el-button type="primary" icon="iconfont icon-shanchu" @click='DeleteHotel(item,subIndex)'>
</el-button> </el-button>
...@@ -300,6 +309,7 @@ ...@@ -300,6 +309,7 @@
</div> </div>
</template> </template>
<script> <script>
import comCheckHotel from "../commonPage/comCheckHotel.vue";
export default { export default {
data() { data() {
return { return {
...@@ -327,9 +337,36 @@ ...@@ -327,9 +337,36 @@
IsOperation: '', IsOperation: '',
//供应商列表 //供应商列表
SupplierList: [], SupplierList: [],
ckedHotelId: 0,
ckedHotelName: '',
showHotelList: false,
findex: 0,
childIndex: 0,
} }
}, },
components: {
comCheckHotel
},
methods: { methods: {
childHotelList(ckedObj) {
this.list.forEach(x => {
x.HotelOrderList.forEach(y => {
y.isShowPop = false;
})
})
this.list[this.findex].HotelOrderList[this.childIndex].Address = ckedObj.Address;
this.list[this.findex].HotelOrderList[this.childIndex].NewHotelName = ckedObj.Name;
this.list[this.findex].HotelOrderList[this.childIndex].Tel = ckedObj.Tel;
this.list[this.findex].HotelOrderList[this.childIndex].NewHotelId = ckedObj.ID;
this.list[this.findex].HotelOrderList[this.childIndex].PayStyle = ckedObj.PayStyle;
this.list[this.findex].HotelOrderList[this.childIndex].PayStyleExt = ckedObj.PayStyle;
},
getChildHotel(index, subIndex) {
this.findex = index;
this.childIndex = subIndex;
let str = `comCheckHotel${index}${subIndex}`
this.$refs[str][0].getCheckHotel();
},
getItem(index, subIndex) { getItem(index, subIndex) {
this.checkedIndex = index this.checkedIndex = index
this.checkedsubIndex = subIndex this.checkedsubIndex = subIndex
...@@ -465,6 +502,8 @@ ...@@ -465,6 +502,8 @@
if (subItem.ReserveNo == '' || subItem.ReserveNo == null) { if (subItem.ReserveNo == '' || subItem.ReserveNo == null) {
subItem.ReserveNo = this.$route.query.NewCombinationNum; subItem.ReserveNo = this.$route.query.NewCombinationNum;
} }
subItem.isShowPop = false;
subItem.ckedHotelName = "";
}) })
}); });
this.list = list; this.list = list;
......
<style> <style>
.comCheckHotel{
padding-bottom:20px; .comCheckHotel>div {
border-bottom:1px solid #d1d1d1; width: 100%;
} height: 150px;
.comCheckHotel>div{
width:100%;
height:200px;
overflow: auto overflow: auto
} }
.comCk_list{
.comCk_list {
cursor: pointer; cursor: pointer;
padding:0 20px; padding: 0 20px;
margin:0 15px 5px 0; margin: 0 15px 5px 0;
} }
.cm_Inventory{
margin-left:20px; .cm_Inventory {
color:red; margin-left: 20px;
color: red;
display: inline-block; display: inline-block;
} }
.cm_hotelTitle{
width:100%; .cm_hotelTitle {
width: 100%;
text-align: center; text-align: center;
margin-bottom:20px; margin-bottom: 20px;
border-bottom: 1px solid #d1d1d1; border-bottom: 1px solid #d1d1d1;
padding:0 20px 10px 20px; padding: 0 20px 10px 20px;
} }
.com_SaveBtn{
margin:10px 20px 0 45%; .com_SaveBtn {
margin: 10px 20px 0 45%;
} }
.ckedList{
.ckedList {
background-color: #E95252; background-color: #E95252;
color:#fff; color: #fff;
}
.Ck_hotelInfo{
width:100%;
height:40px;
background-color: #F6F8FB;
text-align: center;
line-height: 40px;
margin-bottom:10px;
} }
</style> </style>
<template> <template>
<div> <div>
<div class="Ck_hotelInfo">
<span style="color:red">{{UseDate}}</span> 酒店库存信息
</div>
<div class="cm_hotelTitle"> <div class="cm_hotelTitle">
<el-select filterable v-model="selHotelId" @change="getChangeHotel(selHotelId)" :placeholder="$t('pub.pleaseSel')"> 地区筛选:
<el-select filterable v-model="ProvinceId" @change="getCheckHotel()" :placeholder="$t('pub.pleaseSel')">
<el-option label="不限" :value='0'></el-option> <el-option label="不限" :value='0'></el-option>
<el-option v-for="item in ProvinceList" :label='item.Name' :value='item.ID' <el-option v-for="item in ProvinceList" :label='item.Name' :value='item.ID' :key='item.ID'>
:key='item.ID'>
</el-option> </el-option>
</el-select> </el-select>
酒店信息
</div> </div>
<div> <div>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <el-tabs type="border-card" v-loading="loading">
<el-tab-pane :label="item.ProvinceName" v-for="item in dataList"></el-tab-pane> <el-tab-pane :label="item.ProvinceName" v-for="(item,index) in dataList" >
</el-tabs>
</div>
<div class="clearfix comCheckHotel"> <div class="clearfix comCheckHotel">
<div> <div>
<div class="comCk_list" v-for="(item,index) in HotelList"> <div class="comCk_list" v-for="(subItem,subIndex) in item.HotelList">
<input type="checkbox" v-model="item.isChecked" @click="getCheck(item,index)" style=""/> <input type="checkbox" v-model="subItem.isChecked" @click="getCheck(item.HotelList,subIndex)"
{{item.Name}}<span class="cm_Inventory">{{item.Inventory}}</span> style="" />
{{subItem.Name}}<span class="cm_Inventory">{{subItem.Inventory}}</span>
</div> </div>
</div> </div>
</div> </div>
<input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存"/> </el-tab-pane>
</el-tabs>
</div>
<input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存" />
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: ["UseDate"],
data() { data() {
return { return {
dataList:[], loading:false,
HotelList:[], dataList: [],
ckindexOne:-1, ProvinceList: [],
ckindexTwo:-1, ProvinceId: 0, //选择个省份编号
ID:0,
HotelName:'',
ProvinceList:[],
selHotelId:0,
activeName:'',
}; };
}, },
methods: { methods: {
getCheckHotel(sDate){ getCheckHotel() {
this.loading=true;
this.dataList = [];
this.HotelList = [];
this.apipost('hotel_post_GetHasStockHotelList_V2', { this.apipost('hotel_post_GetHasStockHotelList_V2', {
//1-只查询有库存的酒店 //1-只查询有库存的酒店
IsMoreThanZero: 0, IsMoreThanZero: 0,
Country: "651", Country: "651",
IsAllHotel: 1, IsAllHotel: 1,
sDate: sDate Province: this.ProvinceId,
sDate: this.UseDate
}, res => { }, res => {
this.loading=false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data; this.dataList = res.data.data;
this.dataList.forEach(x=>{ this.dataList.forEach(x => {
x.HotelList.forEach(y=>{ x.HotelList.forEach(y => {
y.isChecked=false; y.isChecked = false;
}) })
}) })
console.log(this.dataList,'datalist');
} else { } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}, err => {}) }, err => {})
}, },
getCheck(item,index){ getCheck(hotelList, index) {
this.HotelList.forEach((x,subIndex)=>{ hotelList.forEach((x, subIndex) => {
if(index==subIndex){ if (index == subIndex) {
x.isChecked = !x.isChecked; x.isChecked = !x.isChecked;
}else{ } else {
x.isChecked = false; x.isChecked = false;
} }
}) })
this.$forceUpdate(); this.$forceUpdate();
}, },
//向父组件传递选中酒店 //向父组件传递选中酒店
sendCkedHotel(){ sendCkedHotel() {
var ckHotelObj = {}; var ckHotelObj = {};
this.HotelList.forEach((x,index)=>{ this.dataList.forEach((x, index) => {
if(x.isChecked){ x.HotelList.forEach(subItem => {
ckHotelObj.ID = x.ID; if (subItem.isChecked) {
ckHotelObj.Address = x.Address; ckHotelObj.ID = subItem.ID;
ckHotelObj.Inventory = x.Inventory; ckHotelObj.Address = subItem.Address;
ckHotelObj.Name = x.Name; ckHotelObj.Inventory = subItem.Inventory;
ckHotelObj.PayStyle = x.PayStyle; ckHotelObj.Name = subItem.Name;
ckHotelObj.Tel = x.Tel; ckHotelObj.PayStyle = subItem.PayStyle;
ckHotelObj.Tel = subItem.Tel;
} }
});
}) })
this.$emit("childHotel", ckHotelObj); this.$emit("childHotel", ckHotelObj);
}, },
//获取日本下面的市->下拉框用 //获取日本下面的市->下拉框用
getProvinceList(){ getProvinceList() {
let msg = { let msg = {
Id:651 Id: 651
}; };
this.apipost("dict_post_Destination_GetChildList", msg,res => { this.apipost("dict_post_Destination_GetChildList", msg, res => {
if(res.data.resultCode == 1){ if (res.data.resultCode == 1) {
this.ProvinceList = res.data.data; this.ProvinceList = res.data.data;
}else{ } else {
this.Error(res.data.message);
}
},
err => {}
);
},
getChangeHotel(id){
let msg = {
Province:id
}
this.apipost(
"hotel_post_GetHasStockHotelList_V2",msg,res => {
if(res.data.resultCode==1){
this.dataList = res.data.data;
this.HotelList = [];
this.dataList.forEach(x=>{
x.HotelList.forEach(y=>{
y.isChecked=false;
})
})
console.log(this.dataList,'dataList');
}else{
this.Error(res.data.message); this.Error(res.data.message);
} }
}, },
err => {} err => {}
); );
}, },
handleClick() {
this.HotelList = this.dataList[this.activeName].HotelList;
}
}, },
mounted() { mounted() {
this.getProvinceList();
} }
}; };
</script> </script>
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