Commit 76269b21 authored by 沈良进's avatar 沈良进

门票增加分类

parent a87695fb
...@@ -676,7 +676,7 @@ handleNodeClick(data, checked, node) { ...@@ -676,7 +676,7 @@ handleNodeClick(data, checked, node) {
msg, msg,
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.checkedId = res.data.data.WebSiteCategoryIds || [] this.checkedId = res.data.data.WebSiteCategoryIds.split(',') || []
this.$refs.treeForm.setCheckedKeys([res.data.data.WebSiteCategoryIds.split(',').pop()]); this.$refs.treeForm.setCheckedKeys([res.data.data.WebSiteCategoryIds.split(',').pop()]);
_self.addMsg = res.data.data; _self.addMsg = res.data.data;
if (_self.addMsg.Country > 0) { if (_self.addMsg.Country > 0) {
...@@ -929,7 +929,7 @@ handleNodeClick(data, checked, node) { ...@@ -929,7 +929,7 @@ handleNodeClick(data, checked, node) {
}, },
mounted() { mounted() {this.checkedId = []
let userInfo = this.getLocalStorage() let userInfo = this.getLocalStorage()
//有权限操作的部门 //有权限操作的部门
if (userInfo.RB_Department_Id == 240 || userInfo.RB_Department_Id == 1 || userInfo.RB_Department_Id == 3 || if (userInfo.RB_Department_Id == 240 || userInfo.RB_Department_Id == 1 || userInfo.RB_Department_Id == 3 ||
......
...@@ -699,6 +699,12 @@ ...@@ -699,6 +699,12 @@
border-top-right-radius: 0 !important; border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important; border-bottom-right-radius: 0 !important;
} }
.el-tree {
background: transparent;
}
.margin-bottom {
margin-bottom: 10px;
}
</style> </style>
<template> <template>
<div class="flexOne scenicSpotInfoManage"> <div class="flexOne scenicSpotInfoManage">
...@@ -879,6 +885,19 @@ ...@@ -879,6 +885,19 @@
class="w300" class="w300"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<span class="resource-lititle sheshi">{{$t('hotel.hotel_type')}}</span>
<div class="res-span margin-bottom">
<el-tree
:data="categoryTree"
:props="{label: 'CategoryName', children: 'SubList'}"
show-checkbox
node-key="Id"
ref="treeForm"
check-strictly
@check-change="handleNodeClick"
>
</el-tree>
</div>
<span class="resource-lititle sheshi">{{ <span class="resource-lititle sheshi">{{
$t("restaurant.res_detailInformation") $t("restaurant.res_detailInformation")
}}</span> }}</span>
...@@ -1246,6 +1265,7 @@ import DMCchooseImg from "../commonPage/DMCchooseImg.vue"; ...@@ -1246,6 +1265,7 @@ import DMCchooseImg from "../commonPage/DMCchooseImg.vue";
export default { export default {
data() { data() {
return { return {
categoryTree: [],
imageOptions: { imageOptions: {
navbar: false, navbar: false,
title: false, title: false,
...@@ -1400,6 +1420,40 @@ export default { ...@@ -1400,6 +1420,40 @@ export default {
DMCchooseImg: DMCchooseImg, DMCchooseImg: DMCchooseImg,
}, },
methods: { methods: {
initCategoryTree() {
var msg = {};
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]);
}
},
inited(viewer) { inited(viewer) {
this.$viewer = viewer; this.$viewer = viewer;
}, },
...@@ -1481,6 +1535,7 @@ export default { ...@@ -1481,6 +1535,7 @@ export default {
this.addMsg.GeographicTag = this.Geographic.join(","); this.addMsg.GeographicTag = this.Geographic.join(",");
this.addMsg.TicketCouponsImageList = this.TicketCouponsImageArray; this.addMsg.TicketCouponsImageList = this.TicketCouponsImageArray;
this.addMsg.DeleteImageList = this.DeleteImageArray; this.addMsg.DeleteImageList = this.DeleteImageArray;
this.addMsg.WebSiteCategoryIds = this.checkedId.join(',')
this.apipost( this.apipost(
"ticketcoupons_post_Set", "ticketcoupons_post_Set",
this.addMsg, this.addMsg,
...@@ -1543,7 +1598,8 @@ export default { ...@@ -1543,7 +1598,8 @@ export default {
"ticketcoupons_post_Get", "ticketcoupons_post_Get",
msg, msg,
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {this.checkedId = res.data.data.WebSiteCategoryIds.split(',') || []
this.$refs.treeForm.setCheckedKeys([res.data.data.WebSiteCategoryIds.split(',').pop()]);
this.addMsg = res.data.data; this.addMsg = res.data.data;
if (this.addMsg.Country > 0) { if (this.addMsg.Country > 0) {
this.GetSubAreaList(this.addMsg.Country, 1); this.GetSubAreaList(this.addMsg.Country, 1);
...@@ -1785,6 +1841,7 @@ export default { ...@@ -1785,6 +1841,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.checkedId = []
let userInfo = this.getLocalStorage(); let userInfo = this.getLocalStorage();
//有权限操作的部门 //有权限操作的部门
if ( if (
...@@ -1802,6 +1859,7 @@ export default { ...@@ -1802,6 +1859,7 @@ export default {
if (typeof this.ID != "undefined") { if (typeof this.ID != "undefined") {
this.initHotelData(); this.initHotelData();
} }
this.initCategoryTree()
}, },
}; };
</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