Commit 4ee53324 by cwq0219

商户详情

1 parent f9e168cc
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</div> </div>
</div> </div>
<div class="layui-tab-item"> <div class="layui-tab-item">
<ul class="layui-timeline"> <!-- <ul class="layui-timeline">
<li class="layui-timeline-item"> <li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis">&#xe63f;</i> <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
<div class="layui-timeline-content layui-text"> <div class="layui-timeline-content layui-text">
...@@ -193,11 +193,12 @@ ...@@ -193,11 +193,12 @@
<div class="layui-timeline-title">过去</div> <div class="layui-timeline-title">过去</div>
</div> </div>
</li> </li>
</ul> </ul> -->
</div> </div>
</div> </div>
<div class="footer-close">
<button class="layui-btn" id="closeEl">关闭</button></div>
</div> </div>
<div></div>
</main> </main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
...@@ -213,7 +214,8 @@ ...@@ -213,7 +214,8 @@
var laytpl = layui.laytpl var laytpl = layui.laytpl
var element = layui.element var element = layui.element
var merchantId = qs('merchantId') var merchantId = qs('merchantId')
var merchantInfo = {} var parentId = ''
var merchantForm = {}
var templateData = {} var templateData = {}
var treeData = {} var treeData = {}
var menuFunTreeData = [] var menuFunTreeData = []
...@@ -243,8 +245,6 @@ ...@@ -243,8 +245,6 @@
getSecondTable(subMerchantTable) getSecondTable(subMerchantTable)
} }
// 查询角色详情 // 查询角色详情
function getFirstInfo(callback) { function getFirstInfo(callback) {
var params = { var params = {
...@@ -265,17 +265,35 @@ ...@@ -265,17 +265,35 @@
// 获取功能权限基础数据 // 获取功能权限基础数据
function findMenuFunTreeByMerId() { function findMenuFunTreeByMerId() {
var params = { request({
method: 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId', method: 'cn.com.glsx.merchants.merchant.findMerchantDetail',
id: merchantId id: merchantId
}, function (res) {
merchantForm = res.data
parentId = merchantForm.parentId
var params = {}
if (parentId) {
params = {
method: 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId',
id: merchantId,
parentId: parentId,
accountLevel: merchantForm.merchantAccountLevel
}
} else {
params = {
method: 'cn.com.glsx.merchants.merchant.accountTypeSearchRequest',
ids: merchantForm.accountType,
merchantId: merchantId,
accountLevel: merchantForm.merchantAccountLevel
} }
request(params, function(res) { }
request(params, function (res) {
if (res.code == '0') { if (res.code == '0') {
menuFunTreeData = res.data menuFunTreeData = res.data
getFirstInfo(function(responseList) { getFirstInfo(function (responseList) {
console.log('responseList:', responseList) console.log('responseList:', responseList)
if (responseList && responseList.length != 0) { if (responseList && responseList.length != 0) {
$.each(menuFunTreeData, function(index, item) { $.each(menuFunTreeData, function (index, item) {
for (var i = 0; i < responseList.length; i++) { for (var i = 0; i < responseList.length; i++) {
var productData = responseList[i] var productData = responseList[i]
if (item.accounttypeId == productData.accounttypeId) { if (item.accounttypeId == productData.accounttypeId) {
...@@ -284,7 +302,7 @@ ...@@ -284,7 +302,7 @@
value: item.accounttypeId value: item.accounttypeId
}) })
var menuData = [] var menuData = []
for(var j = 0; j < productData.products.length; j++) { for (var j = 0; j < productData.products.length; j++) {
menuData = productData.products[j] menuData = productData.products[j]
var idList = menuData.menuIds.concat(menuData.functionIds) var idList = menuData.menuIds.concat(menuData.functionIds)
active.treeTabAdd({ active.treeTabAdd({
...@@ -293,7 +311,8 @@ ...@@ -293,7 +311,8 @@
}, item.accounttypeId, item.products, idList) }, item.accounttypeId, item.products, idList)
} }
var filterName = 'treeTab' + item.accounttypeId var filterName = 'treeTab' + item.accounttypeId
var productId = 'tab_' + item.accounttypeId + '_' + item.products[0].productId var productId = 'tab_' + item.accounttypeId + '_' + item.products[0]
.productId
active.tabChange(filterName, productId) active.tabChange(filterName, productId)
} }
} }
...@@ -303,6 +322,7 @@ ...@@ -303,6 +322,7 @@
}) })
} }
}) })
})
} }
// 上下级商户 - 信息 // 上下级商户 - 信息
...@@ -382,10 +402,16 @@ ...@@ -382,10 +402,16 @@
}) })
// table搜索 // table搜索
$('#tableSearch').on('click', function() { $('#tableSearch').on('click', function () {
var search = $('#tableSearchForm').val() var search = $('#tableSearchForm').val()
console.log(search) console.log(search)
getSecondTable(subMerchantTable, { keyword: search }) getSecondTable(subMerchantTable, {
keyword: search
})
})
$('#closeEl').on('click', function() {
go('merchant', 'index')
}) })
// 获取table列表接口 // 获取table列表接口
...@@ -402,8 +428,7 @@ ...@@ -402,8 +428,7 @@
data: data data: data
} }
subMerchantTable.reload(options) subMerchantTable.reload(options)
} })
)
} }
var active = { var active = {
...@@ -420,7 +445,7 @@ ...@@ -420,7 +445,7 @@
* productList:复选下拉框的list,修改过的数据{name: '', value: ''} * productList:复选下拉框的list,修改过的数据{name: '', value: ''}
* products:对应的菜单下的产品list,包含了对应的权限树,原始数据,需作为参数传入treeTabAdd中,在实例化tree时传入的数据使用 * products:对应的菜单下的产品list,包含了对应的权限树,原始数据,需作为参数传入treeTabAdd中,在实例化tree时传入的数据使用
*/ */
tabAdd: function(item) { tabAdd: function (item) {
// 渠道的id,一层选项卡的id // 渠道的id,一层选项卡的id
var id = item.value var id = item.value
// roleAuth 一层选项卡过滤器的名称 // roleAuth 一层选项卡过滤器的名称
...@@ -431,20 +456,21 @@ ...@@ -431,20 +456,21 @@
// 选项卡标题的lay-id属性值 // 选项卡标题的lay-id属性值
id: id id: id
}) })
var getTpl ='<div id="select{{d.id}}"></div> <div class="layui-tab layui-tab-brief" lay-filter="treeTab{{d.id}}"><ul class="layui-tab-title"></ul> <div class="layui-tab-content"></div></div>' var getTpl =
'<div id="select{{d.id}}"></div> <div class="layui-tab layui-tab-brief" lay-filter="treeTab{{d.id}}"><ul class="layui-tab-title"></ul> <div class="layui-tab-content"></div></div>'
// var getTpl = tpl//rolesAuth.innerHTML, // 模板内容 // var getTpl = tpl//rolesAuth.innerHTML, // 模板内容
view = document.getElementById('role' + id) view = document.getElementById('role' + id)
templateData.id = id // 渲染模版的数据 templateData.id = id // 渲染模版的数据
laytpl(getTpl).render(templateData, function(html) { laytpl(getTpl).render(templateData, function (html) {
view.innerHTML = html view.innerHTML = html
}) })
}, },
// tab删除 // tab删除
tabDelete: function(name, id) { tabDelete: function (name, id) {
element.tabDelete(name, id) element.tabDelete(name, id)
}, },
// tab Change // tab Change
tabChange: function(name, id) { tabChange: function (name, id) {
element.tabChange(name, id) element.tabChange(name, id)
}, },
/** /**
...@@ -457,7 +483,7 @@ ...@@ -457,7 +483,7 @@
* products:产品list数组 * products:产品list数组
* defaultList:编辑时传入,默认勾选中的数组。(举例:[1,2,3]) * defaultList:编辑时传入,默认勾选中的数组。(举例:[1,2,3])
*/ */
treeTabAdd: function(item, id, products, defaultList) { treeTabAdd: function (item, id, products, defaultList) {
console.log(defaultList) console.log(defaultList)
var productId = 'tab_' + id + '_' + item.value var productId = 'tab_' + id + '_' + item.value
var filterName = 'treeTab' + id // 过滤器的名称 lay-filter var filterName = 'treeTab' + id // 过滤器的名称 lay-filter
...@@ -473,17 +499,20 @@ ...@@ -473,17 +499,20 @@
treeData[id][item.value] = treeData[id][item.value] || {} treeData[id][item.value] = treeData[id][item.value] || {}
treeData[id][item.value].id = productId // 渲染模版的数据 treeData[id][item.value].id = productId // 渲染模版的数据
treeData[id][item.value].productId = item.value treeData[id][item.value].productId = item.value
laytpl(getTreeTpl).render(treeData[id][item.value], function(html) { laytpl(getTreeTpl).render(treeData[id][item.value], function (html) {
treeView.innerHTML = html treeView.innerHTML = html
}) })
var treeListData = [] var treeListData = []
$.each(products, function(index, i) { $.each(products, function (index, i) {
if (item.value == i.productId) { if (item.value == i.productId) {
treeListData = i.merchantProTreeResponses treeListData = i.merchantProTreeResponses
} }
}) })
var treedom = 'tree_' + productId var treedom = 'tree_' + productId
treeData[id][item.value].treeObj = tree.create(treedom, treeListData, {checkedList: defaultList, chkDisabled: true}) treeData[id][item.value].treeObj = tree.create(treedom, treeListData, {
checkedList: defaultList,
chkDisabled: true
})
} }
} }
}) })
......
...@@ -621,7 +621,6 @@ ...@@ -621,7 +621,6 @@
parent.append(subParent) parent.append(subParent)
}, },
handleFirstCancel() { handleFirstCancel() {
console.log('??????????')
go('merchant', 'index') go('merchant', 'index')
return false return false
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!