Commit 0818a0ee by cwq0219

isDxternal,user;权限判断

1 parent 5335e1fb
...@@ -365,7 +365,7 @@ ...@@ -365,7 +365,7 @@
'merchantAccountLevel', 'effectiveTime' 'merchantAccountLevel', 'effectiveTime'
] ]
if (formData.isloginName == 'on') { if (formData.isloginName == 'on') {
formData.isloginName = 1 params.isloginName = 1
} }
if (formData.bussinessBegintime) { if (formData.bussinessBegintime) {
merchantForm.bussinessBegintime = new Date(formData.bussinessBegintime) merchantForm.bussinessBegintime = new Date(formData.bussinessBegintime)
...@@ -392,8 +392,6 @@ ...@@ -392,8 +392,6 @@
}, { }, {
attr: 'accounttypeId', attr: 'accounttypeId',
toString: ',' toString: ','
// toString: false,
// toArray: true
}] }]
$.each(checkClassNameList, function (index, item) { $.each(checkClassNameList, function (index, item) {
var checkedArr = [] var checkedArr = []
...@@ -405,10 +403,6 @@ ...@@ -405,10 +403,6 @@
merchantForm[item.attr] = checkedArr.join(item.toString) merchantForm[item.attr] = checkedArr.join(item.toString)
params[item.attr] = checkedArr.join(item.toString) params[item.attr] = checkedArr.join(item.toString)
} }
// else if (item.toArray) {
// merchantForm[item.attr] = checkedArr
// params[item.attr] = JSON.stringify(checkedArr)
// }
} }
}) })
var elList = $('.business-scope-cust') var elList = $('.business-scope-cust')
...@@ -438,6 +432,7 @@ ...@@ -438,6 +432,7 @@
console.log(params) console.log(params)
request(params, function (res) { request(params, function (res) {
console.log(res) console.log(res)
go('merchant', 'index')
}) })
return false return false
}) })
...@@ -599,6 +594,7 @@ ...@@ -599,6 +594,7 @@
} else { } else {
list = checkedStr.split(',') list = checkedStr.split(',')
} }
console.log(list)
$.each(list, function (index, item) { $.each(list, function (index, item) {
$('input[class=' + attr + ']').attr("checked", true) $('input[class=' + attr + ']').attr("checked", true)
}) })
...@@ -692,8 +688,8 @@ ...@@ -692,8 +688,8 @@
el.append(optionEl) el.append(optionEl)
form.render('checkbox') form.render('checkbox')
// 修改-回显 // 修改-回显
if (editLevel == 3 && merchantForm.businessScopName) { if (editLevel == 3 && merchantForm.businessScope) {
setCheckbox(merchantForm.businessScopName, 'businessScope') setCheckbox(merchantForm.businessScope, 'businessScope')
} }
}) })
}) })
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
white-space: normal; white-space: normal;
} }
.merchant #searchForm .layui-inline {
margin-bottom: 5px;
}
.layui-btn-xs { .layui-btn-xs {
cursor: pointer; cursor: pointer;
} }
...@@ -39,11 +43,34 @@ ...@@ -39,11 +43,34 @@
<!-- <div id="tree"></div> --> <!-- <div id="tree"></div> -->
<div class="context-block"> <div class="context-block">
<div class="search-block"> <div class="search-block">
<button class="layui-btn" id="addBtn" lay-filter="handleAdd">创建商户</button>
<form class="layui-form" lay-filter="searchFilter" id="searchForm"> <form class="layui-form" lay-filter="searchFilter" id="searchForm">
<!-- <div> <div class="layui-inline" id="operateEl">
<button class="layui-btn" lay-filter="handleAdd">创建商户</button> <button class="layui-btn" id="addBtn">创建商户</button>
</div> --> <div class="layui-inline">
<label class="layui-form-label">渠道:</label>
<div class="layui-input-inline">
<select name="channelId" id="channelIdEl">
<option value="">请选择渠道</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">账户等级:</label>
<div class="layui-input-inline">
<select name="merchantAccountLevel" id="accountLevelEl">
<option value="">请选择账户等级</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">账户类型:</label>
<div class="layui-input-inline">
<select name="accounttypeId" id="accountTypeIdEl">
<option value="">请选择账户类型</option>
</select>
</div>
</div>
</div>
<div class="layui-inline"> <div class="layui-inline">
<div class="layui-input-inline" style="width: 120px;"> <div class="layui-input-inline" style="width: 120px;">
<select name="name" lay-filter="nameFilter"> <select name="name" lay-filter="nameFilter">
...@@ -58,7 +85,7 @@ ...@@ -58,7 +85,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">客户状态:</label> <label class="layui-form-label">客户状态:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="status" id="searchStatus"> <select name="status" id="searchStatusEl">
<option value="">请选择客户状态</option> <option value="">请选择客户状态</option>
</select> </select>
</div> </div>
...@@ -90,100 +117,23 @@ ...@@ -90,100 +117,23 @@
<a class="layui-btn-xs" lay-event="handleVaildPeriod">修改账户有效期</a> <a class="layui-btn-xs" lay-event="handleVaildPeriod">修改账户有效期</a>
</script> </script>
<script> <script>
layui.use(['gtree', 'request', 'store', 'table', 'layer'], function () { layui.use(['gtree', 'request', 'helper', 'table', 'layer'], function () {
var tree = layui.gtree var tree = layui.gtree
var request = layui.request var request = layui.request
var table = layui.table var table = layui.table
var form = layui.form var form = layui.form
var $ = layui.$ var $ = layui.$
var helper = layui.helper
var user = helper.store.get('user')
var isDxternal = helper.store.get('isDxternal')
var baseData = { var baseData = {
statusList: [] statusList: [],
channelList: [],
accountLevelList: [],
accountTypeList: []
} }
// var list = [{
// confId: '1',
// confLabel: '账号登陆名'
// }, {
// confId: '2',
// confLabel: '手机号'
// }]
// var select = $("#searchName")
// $.each(list, function (index, item) {
// select.append(new Option(item.confLabel, item.confId))
// })
// form.render('select')
// request({
// a: 1
// })
var inst = tree.create('tree', [{
id: 1,
label: '一级菜单',
children: [{
id: 4,
label: '二级菜单',
children: [{
id: 9,
label: '三级功能',
children: [
// value: '1,2,3|人保,平安,寿险'
{
id: 111,
label: '人保',
logo: 'PR'
},
{
id: 112,
label: '平安',
logo: 'PR'
},
{
id: 113,
label: '寿险',
logo: 'PR'
}
]
},
{
id: 10,
label: '三级功能-1',
value: null
}
]
}]
},
{
id: 2,
label: '一级菜单2',
children: [{
id: 5,
label: '二级菜单2',
children: [
// value: '1,2,3|人保,平安,寿险'
{
id: 114,
label: '人保',
logo: 'PR'
},
{
id: 115,
label: '平安',
logo: 'PR'
},
{
id: 116,
label: '寿险',
logo: 'PR'
}
]
},
{
id: 6,
label: '二级菜单2.0'
}
]
}
])
var merchantTable = table.render({ var merchantTable = table.render({
elem: '#merchantTable', elem: '#merchantTable',
page: true, page: true,
...@@ -317,8 +267,7 @@ ...@@ -317,8 +267,7 @@
} }
}) })
getVaildPeriod() init()
getTabelList()
// form.on('handleAdd', function () { // form.on('handleAdd', function () {
// console.log('00000') // console.log('00000')
...@@ -329,6 +278,7 @@ ...@@ -329,6 +278,7 @@
go('merchant', 'edit', { go('merchant', 'edit', {
editLevel: 1 editLevel: 1
}) })
return false
}) })
// 搜索绑定事件 // 搜索绑定事件
form.on('submit(searchSubmit)', function () { form.on('submit(searchSubmit)', function () {
...@@ -374,22 +324,75 @@ ...@@ -374,22 +324,75 @@
}) })
} }
// 获取有效期 // 获取字典数据
function getVaildPeriod() { function getDictData(dictType, fn) {
request({ request({
method: 'cn.com.glsx.merchants.menu.findAllDictData', method: 'cn.com.glsx.merchants.menu.findAllDictData',
dictType: 'merchant_status' dictType: dictType
}, function (res) { }, function (res) {
if (res.code === '0') { fn && fn(res)
baseData.statusList = res.data })
var searchStatus = $("#searchStatus") }
$.each(baseData.statusList, function (index, item) {
searchStatus.append(new Option(item.dictLabel, item.dictValue)) // 设置option
function setSelectOption(elName, listName, optionId, optionLabel) {
var el = $(elName)
$.each(baseData[listName], function (index, item) {
el.append(new Option(item[optionLabel], item[optionId]))
}) })
form.render('select') form.render('select')
} }
// 获取有效期
function getVaildPeriod() {
getDictData('merchant_status', function (res) {
baseData.statusList = res.data
setSelectOption('#searchStatusEl', 'statusList', 'dictValue', 'dictLabel')
}) })
} }
// 获取渠道
function getChannel() {
getDictData('channel', function (res) {
baseData.channelList = res.data
setSelectOption('#channelIdEl', 'channelList', 'dictValue', 'dictLabel')
})
}
// 获取账户等级
function getAccountLevel() {
getDictData('account_level', function (res) {
baseData.accountLevelList = res.data
setSelectOption('#accountLevelEl', 'accountLevelList', 'dictValue', 'dictLabel')
})
}
// 获取账户类型
function getAccountType() {
getDictData('account_type', function (res) {
baseData.accountTypeList = res.data
setSelectOption('#accountTypeIdEl', 'accountTypeList', 'dictValue', 'dictLabel')
})
}
// 功能点按需出现
function elRemove() {
$('#operateEl').remove()
}
function init() {
// 运营系统
// if (!isDxternal) {
if (isDxternal) {
getChannel()
getAccountLevel()
getAccountType()
} else {
elRemove()
}
getVaildPeriod()
getTabelList()
}
}) })
</script> </script>
</body> </body>
......
...@@ -43,6 +43,11 @@ function append() { ...@@ -43,6 +43,11 @@ function append() {
function isAppend() { function isAppend() {
var _href = location.href.split('/') var _href = location.href.split('/')
var _path = _href.slice(_href.length - 1, _href.length).toString() var _path = _href.slice(_href.length - 1, _href.length).toString()
layui.use(['store'], function () {
var store = layui.store
// isDxternal: true - 外部独立系统;false - 运营平台
store.set('isDxternal', _path.split('?')[0] !== 'login.html' && self == top)
})
return _path.split('?')[0] !== 'login.html' && self == top return _path.split('?')[0] !== 'login.html' && self == top
} }
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
if (result.code == '0') { if (result.code == '0') {
var sessionId = result.data.sessionId var sessionId = result.data.sessionId
helper.store.set('token', sessionId) helper.store.set('token', sessionId)
helper.store.set('user', result.data)
go('merchant', 'index') go('merchant', 'index')
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!