Commit 0cdc0ca1 authored by 沈良进's avatar 沈良进

酒店增加分类

parent 32490063
......@@ -422,7 +422,8 @@ export const admin={ //行政
hotel_resourceType:'リソースタイプ',        
hotel_dataReport:'データレポート',          
hotel_ReturnRoomNumber:'チエックアウト数',    
hotel_zanwu:'暫く改訂レポート無',          
hotel_zanwu:'暫く改訂レポート無',
hotel_type: '酒店类型',         
}
export const leader = {
......
......@@ -468,6 +468,7 @@ export const admin={ //行政
hotel_dataReport:'資料包表',
hotel_ReturnRoomNumber:'還房數量',
hotel_zanwu:'暫無修改日誌',
hotel_type: '酒店类型',
}
export const leader = {
......
......@@ -470,6 +470,7 @@ export const admin={ //行政
hotel_dataReport:'数据报表',
hotel_ReturnRoomNumber:'还房数量',
hotel_zanwu:'暂无修改日志',
hotel_type: '酒店类型',
}
export const leader = {
......
......@@ -105,6 +105,19 @@
</el-col>
</el-row>
</div>
<span class="resource-lititle sheshi">{{$t('hotel.hotel_type')}}</span>
<div class="res-span">
<el-tree
:data="categoryTree"
:props="{label: 'CategoryName', children: 'SubList'}"
show-checkbox
node-key="Id"
ref="treeForm"
check-strictly
@check-change="handleNodeClick"
>
</el-tree>
</div>
</div>
<div class="resource-imginfo">
<div class="resourcerightTop">
......@@ -290,6 +303,7 @@
export default {
data() {
return {
categoryTree: [],
imageOptions: {
navbar: false,
title: false
......@@ -523,6 +537,7 @@
this.addMsg.HotelImageList = this.HotelImageArray;
this.addMsg.DeleteImageList = this.DeleteImageArray;
this.addMsg.WebSiteCategoryIds = this.checkedId.join(',')
this.apipost(
"hotel_post_Set",
this.addMsg,
......@@ -614,6 +629,42 @@
});
}
},
initCategoryTree() {
var msg = {};
this.getDinnerList();
var _self = this;
this.apipost(
"ws_post_GetCategoryTreeList",
msg,
res => {
if (res.data.resultCode == 1) {
let categoryTree = res.data.data.filter(item => item.CategoryName === '住宿')
this.addParentId(categoryTree, [])
this.categoryTree = categoryTree
console.log('this.categoryTree', this.categoryTree)
} else {
_self.Error(res.data.message);
}
},
null
);
},
addParentId(tree, idArr) {
tree.forEach(item => {
item.ids = [...idArr, item.Id]
if(item.SubList && item.SubList.length) {
this.addParentId(item.SubList, item.ids)
}
})
},
handleNodeClick(data, checked, node) {
if(checked === true) {
console.log('data, checked, node', data, checked, node)
this.checkedId = data.ids;
this.$refs.treeForm.setCheckedKeys([data.Id]);
}
},
initHotelData() {
var msg = {
hotelID: this.hotelID
......@@ -625,6 +676,8 @@
msg,
res => {
if (res.data.resultCode == 1) {
this.checkedId = res.data.data.WebSiteCategoryIds
this.$refs.treeForm.setCheckedKeys([res.data.data.WebSiteCategoryIds.split(',').pop()]);
_self.addMsg = res.data.data;
if (_self.addMsg.Country > 0) {
this.GetSubAreaList(_self.addMsg.Country, 1, 1);
......@@ -897,6 +950,7 @@
if (this.hotelID > 0) {
this.initHotelData();
}
this.initCategoryTree()
}
};
......
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