Commit 2d3643da by 胡悦

员工可见商户添加全选,详情添加本商户显示

1 parent 388ef069
...@@ -174,6 +174,9 @@ ...@@ -174,6 +174,9 @@
<label class="layui-form-label required">可见商户:</label> <label class="layui-form-label required">可见商户:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input" placeholder="可见商户" id="searchMerchant" /> <input class="layui-input" placeholder="可见商户" id="searchMerchant" />
<div style="position: absolute; top: 0; left: 380px">
<button type="button" class="layui-btn" id="checkAll">全选</button>
</div>
<ul id="visibleInferiorMerTree" style="max-height: 200px; overflow-y: auto" class="ztree wrapper-tree"> <ul id="visibleInferiorMerTree" style="max-height: 200px; overflow-y: auto" class="ztree wrapper-tree">
</ul> </ul>
</div> </div>
...@@ -380,6 +383,22 @@ ...@@ -380,6 +383,22 @@
pwd.attr('readonly', false) pwd.attr('readonly', false)
pwd.val('') pwd.val('')
}) })
var checkAll = false
var checkBtn = $('#checkAll')
// 全选可见商户
checkBtn.on('click', function () {
if (!merchantId) {
layer.msg('请选择所属商户!')
} else {
checkAll = !checkAll
visibleMerchant.checkAllNodes(checkAll)
if (checkAll) {
checkBtn.html('全不选')
} else {
checkBtn.html('全选')
}
}
})
// 刷新 // 刷新
$('#refresh').on('click', function () { $('#refresh').on('click', function () {
......
...@@ -343,7 +343,11 @@ ...@@ -343,7 +343,11 @@
if (employeeData.visibleInferiorMerName) { if (employeeData.visibleInferiorMerName) {
var visibleName = employeeData.visibleInferiorMerName.split(',') var visibleName = employeeData.visibleInferiorMerName.split(',')
$.each(visibleName, function (idx, i) { $.each(visibleName, function (idx, i) {
visibleInferiorMerName.append('<li class="visibleMerchant">' + i + '</li>') if (employeeData.merchantName.indexOf(i) != -1) {
visibleInferiorMerName.append('<li class="visibleMerchant">' + i + '(本商户)' + '</li>')
} else {
visibleInferiorMerName.append('<li class="visibleMerchant">' + i + '</li>')
}
}) })
} else { } else {
visibleInferiorMerName.remove() visibleInferiorMerName.remove()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!