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

门票增加分类

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