Commit 0818a0ee by cwq0219

isDxternal,user;权限判断

1 parent 5335e1fb
......@@ -365,7 +365,7 @@
'merchantAccountLevel', 'effectiveTime'
]
if (formData.isloginName == 'on') {
formData.isloginName = 1
params.isloginName = 1
}
if (formData.bussinessBegintime) {
merchantForm.bussinessBegintime = new Date(formData.bussinessBegintime)
......@@ -392,8 +392,6 @@
}, {
attr: 'accounttypeId',
toString: ','
// toString: false,
// toArray: true
}]
$.each(checkClassNameList, function (index, item) {
var checkedArr = []
......@@ -405,10 +403,6 @@
merchantForm[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')
......@@ -438,6 +432,7 @@
console.log(params)
request(params, function (res) {
console.log(res)
go('merchant', 'index')
})
return false
})
......@@ -599,6 +594,7 @@
} else {
list = checkedStr.split(',')
}
console.log(list)
$.each(list, function (index, item) {
$('input[class=' + attr + ']').attr("checked", true)
})
......@@ -692,8 +688,8 @@
el.append(optionEl)
form.render('checkbox')
// 修改-回显
if (editLevel == 3 && merchantForm.businessScopName) {
setCheckbox(merchantForm.businessScopName, 'businessScope')
if (editLevel == 3 && merchantForm.businessScope) {
setCheckbox(merchantForm.businessScope, 'businessScope')
}
})
})
......
......@@ -26,6 +26,10 @@
white-space: normal;
}
.merchant #searchForm .layui-inline {
margin-bottom: 5px;
}
.layui-btn-xs {
cursor: pointer;
}
......@@ -39,11 +43,34 @@
<!-- <div id="tree"></div> -->
<div class="context-block">
<div class="search-block">
<button class="layui-btn" id="addBtn" lay-filter="handleAdd">创建商户</button>
<form class="layui-form" lay-filter="searchFilter" id="searchForm">
<!-- <div>
<button class="layui-btn" lay-filter="handleAdd">创建商户</button>
</div> -->
<div class="layui-inline" id="operateEl">
<button class="layui-btn" id="addBtn">创建商户</button>
<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-input-inline" style="width: 120px;">
<select name="name" lay-filter="nameFilter">
......@@ -58,7 +85,7 @@
<div class="layui-inline">
<label class="layui-form-label">客户状态:</label>
<div class="layui-input-inline">
<select name="status" id="searchStatus">
<select name="status" id="searchStatusEl">
<option value="">请选择客户状态</option>
</select>
</div>
......@@ -90,100 +117,23 @@
<a class="layui-btn-xs" lay-event="handleVaildPeriod">修改账户有效期</a>
</script>
<script>
layui.use(['gtree', 'request', 'store', 'table', 'layer'], function () {
layui.use(['gtree', 'request', 'helper', 'table', 'layer'], function () {
var tree = layui.gtree
var request = layui.request
var table = layui.table
var form = layui.form
var $ = layui.$
var helper = layui.helper
var user = helper.store.get('user')
var isDxternal = helper.store.get('isDxternal')
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({
elem: '#merchantTable',
page: true,
......@@ -317,8 +267,7 @@
}
})
getVaildPeriod()
getTabelList()
init()
// form.on('handleAdd', function () {
// console.log('00000')
......@@ -329,6 +278,7 @@
go('merchant', 'edit', {
editLevel: 1
})
return false
})
// 搜索绑定事件
form.on('submit(searchSubmit)', function () {
......@@ -374,22 +324,75 @@
})
}
// 获取有效期
function getVaildPeriod() {
// 获取字典数据
function getDictData(dictType, fn) {
request({
method: 'cn.com.glsx.merchants.menu.findAllDictData',
dictType: 'merchant_status'
dictType: dictType
}, function (res) {
if (res.code === '0') {
baseData.statusList = res.data
var searchStatus = $("#searchStatus")
$.each(baseData.statusList, function (index, item) {
searchStatus.append(new Option(item.dictLabel, item.dictValue))
})
form.render('select')
}
fn && fn(res)
})
}
// 设置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')
}
// 获取有效期
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>
</body>
......
......@@ -43,6 +43,11 @@ function append() {
function isAppend() {
var _href = location.href.split('/')
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
}
......
......@@ -59,6 +59,7 @@
if (result.code == '0') {
var sessionId = result.data.sessionId
helper.store.set('token', sessionId)
helper.store.set('user', result.data)
go('merchant', 'index')
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!