Commit 2442d7bc authored by zhengke's avatar zhengke

修改

parent 94816e4c
...@@ -2,18 +2,15 @@ ...@@ -2,18 +2,15 @@
<div> <div>
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="酒店" name="first">酒店</el-tab-pane> <el-tab-pane label="酒店" name="1"></el-tab-pane>
<el-tab-pane label="餐食" name="second">餐食</el-tab-pane> <el-tab-pane label="餐食" name="2"></el-tab-pane>
<el-tab-pane label="门票" name="third">门票</el-tab-pane> <el-tab-pane label="门票" name="3"></el-tab-pane>
</el-tabs> </el-tabs>
<template>
</template>
<el-input size="mini" v-model="msg.Name" placeholder="根据名称搜索" :clearable="true" <el-input size="mini" v-model="msg.Name" placeholder="根据名称搜索" :clearable="true"
@clear="msg.pageIndex=1,getHotelPage()" @keyup.enter.native="msg.pageIndex=1,getHotelPage()"> @clear="msg.pageIndex=1,getCommonSerch()" @keyup.enter.native="msg.pageIndex=1,getCommonSerch()">
<el-button slot="append" @click="msg.pageIndex=1,getHotelPage()">搜索</el-button> <el-button slot="append" @click="msg.pageIndex=1,getCommonSerch()">搜索</el-button>
</el-input> </el-input>
<template v-if="activeName=='1'">
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%" <el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<template v-if="isSingle"> <template v-if="isSingle">
...@@ -31,22 +28,72 @@ ...@@ -31,22 +28,72 @@
<el-table-column label="ID" width="80px"> <el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.HotelId }}</template> <template slot-scope="scope">{{ scope.row.HotelId }}</template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="CategoryList" label="分类" width="150px"> <el-table-column prop="HotelName" label="名称">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(subItem,SubIndex) in scope.row.CategoryList" :key="SubIndex"> <div flex="cross:center dir:left">
{{subItem.CategoryName}} <img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.HotelName }}</div>
</div> </div>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table>
</template>
<template v-if="activeName=='2'">
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange2">
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table-column>
</template>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.ID }}</template>
</el-table-column>
<el-table-column prop="HotelName" label="名称"> <el-table-column prop="HotelName" label="名称">
<template slot-scope="scope"> <template slot-scope="scope">
<div flex="cross:center dir:left"> <div flex="cross:center dir:left">
<img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" /> <img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.HotelName }}</div> <div>{{ scope.row.Name }}</div>
</div>
</template>
</el-table-column>
</el-table>
</template>
<template v-if="activeName=='3'">
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange3">
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table-column>
</template>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.ID }}</template>
</el-table-column>
<el-table-column prop="HotelName" label="名称">
<template slot-scope="scope">
<div flex="cross:center dir:left">
<img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.Name }}</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</template>
<el-pagination style="text-align:center" background @current-change="handleCurrentChange" :page-size="msg.pageSize" <el-pagination style="text-align:center" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
layout="prev, pager, next" :total="total"> layout="prev, pager, next" :total="total">
</el-pagination> </el-pagination>
...@@ -65,9 +112,12 @@ ...@@ -65,9 +112,12 @@
GoodsStatus: 1, //上架中 GoodsStatus: 1, //上架中
IsGetSpec: 0 IsGetSpec: 0
}, },
activeName: "first", activeName: "1",
total: 0, total: 0,
selectRow: [], selectRow:[],
selectRow1: [],
selectRow2:[],
selectRow3:[],
}; };
}, },
created() { created() {
...@@ -77,7 +127,29 @@ ...@@ -77,7 +127,29 @@
}, },
methods: { methods: {
handleClick() { handleClick() {
this.msg.Name='';
this.msg.pageIndex = 1;
if (this.activeName == '1') {
this.getHotelPage();
}
if (this.activeName == '2') {
this.getDinnerPage();
}
if (this.activeName == '3'){
this.getTicket();
}
},
//搜索
getCommonSerch() {
if (this.activeName == '1') {
this.getHotelPage();
}
if (this.activeName == '2') {
this.getDinnerPage();
}
if (this.activeName == '3'){
this.getTicket();
}
}, },
//获取酒店分页 //获取酒店分页
getHotelPage() { getHotelPage() {
...@@ -92,16 +164,39 @@ ...@@ -92,16 +164,39 @@
} }
this.dataList = JSON.parse(JSON.stringify(tempArray)); this.dataList = JSON.parse(JSON.stringify(tempArray));
} else { } else {
this.Info(res.data.message); this.Error(res.data.message);
} }
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectRow = JSON.parse(JSON.stringify(val)); this.selectRow1 = JSON.parse(JSON.stringify(val));
},
handleSelectionChange2(val){
this.selectRow2 = JSON.parse(JSON.stringify(val));
},
handleSelectionChange3(val){
this.selectRow3 = JSON.parse(JSON.stringify(val));
}, },
//获取餐食分页 //获取餐食分页
getDinnerPage() { getDinnerPage() {
this.apipost("/api/AppletDining/DiningPage", this.msg, res => { this.apipost("/api/AppletDining/GetDiningPage", this.msg, res => {
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
var tempArray = res.data.data.pageData;
if (tempArray && tempArray.length > 0) {
tempArray.forEach(item => {
item.IsChecked = false;
});
}
this.dataList = JSON.parse(JSON.stringify(tempArray));
} else {
this.Error(res.data.message);
}
})
},
//获取门票分页
getTicket(){
this.apipost("/api/AppletDining/GetTicketCouponsPage", this.msg, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.total = res.data.data.count; this.total = res.data.data.count;
var tempArray = res.data.data.pageData; var tempArray = res.data.data.pageData;
...@@ -112,7 +207,7 @@ ...@@ -112,7 +207,7 @@
} }
this.dataList = JSON.parse(JSON.stringify(tempArray)); this.dataList = JSON.parse(JSON.stringify(tempArray));
} else { } else {
this.Info(res.data.message); this.Error(res.data.message);
} }
}) })
}, },
...@@ -129,10 +224,12 @@ ...@@ -129,10 +224,12 @@
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getList(); this.getCommonSerch();
}, },
//父组件调用方法 //父组件调用方法
getChoicedGoods() { getChoicedDijie() {
this.selectRow=[];
this.selectRow = this.selectRow.concat(this.selectRow1).concat(this.selectRow2).concat(this.selectRow3) ;
return this.selectRow; return this.selectRow;
}, },
//清空多选方法 //清空多选方法
...@@ -147,7 +244,7 @@ ...@@ -147,7 +244,7 @@
}, },
}, },
mounted() { mounted() {
this.getList(); this.getHotelPage();
} }
}; };
......
...@@ -611,7 +611,7 @@ ...@@ -611,7 +611,7 @@
<choiceDmc ref="choiceDmc"></choiceDmc> <choiceDmc ref="choiceDmc"></choiceDmc>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowGoods=false">取 消</el-button> <el-button size="small" @click="isShowGoods=false">取 消</el-button>
<el-button size="small" type="danger" @click="getGoodsChoice()">确 定</el-button> <el-button size="small" type="danger" @click="getChoicedDijie()">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -801,6 +801,41 @@ ...@@ -801,6 +801,41 @@
this.isShowGoods = false; this.isShowGoods = false;
this.$refs.choiceGood.toggleSelection(); this.$refs.choiceGood.toggleSelection();
}, },
//选择地接服务
getChoicedDijie(){
var ckedArr = this.$refs.choiceDmc.getChoicedDijie();
console.log(ckedArr,'ckedArr');
var myArray = [];
if (ckedArr && ckedArr.length > 0) {
ckedArr.forEach(x => {
if(x.goodType==1){
myArray.push({
id: x.HotelId,
name: x.HotelName,
picUrl: x.CoverImg,
price: x.SalesPrice
});
}
if(x.goodType==2||x.goodType==3){
myArray.push({
id: x.ID,
name: x.Name,
picUrl: x.CoverImg,
price: x.SalesPrice
});
}
});
}
if (this.comIndex !== null) {
this.data.catList[this.comIndex].goodsList = this.data.catList[this.comIndex].goodsList.concat(myArray);
} else {
this.data.list = this.data.list.concat(myArray);
}
this.isShowGoods = false;
this.$refs.choiceDmc.toggleSelection();
},
//取消选择商品 //取消选择商品
quxiaoGoods() { quxiaoGoods() {
this.isShowGoods = false; this.isShowGoods = false;
......
...@@ -745,6 +745,7 @@ ...@@ -745,6 +745,7 @@
Id: 'goods', Id: 'goods',
isCked: false, isCked: false,
data: { data: {
goodType:1, //1酒店 2餐厅 3门票
showCat: false, //显示分类 showCat: false, //显示分类
catPosition: 'top', //分类栏位置 catPosition: 'top', //分类栏位置
catStyle: 1, //分类样式 catStyle: 1, //分类样式
......
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