Commit c37b9679 by limin

Merge branch 'master' of http://192.168.3.233:8090/h5/account into master

2 parents ba909778 44e25ab1
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<div class="layui-input-block"> <div class="layui-input-block">
<div class="upload-img-box"> <div class="upload-img-box">
<div class="icon-add img-add show">+</div> <div class="icon-add img-add show">+</div>
<img class="upload-img upload-img-wh hide" id="img" src=""> <img class="upload-img upload-img-wh hide" id="img">
<input type="file" id="upload" name="merhcnatImg" ref="file" <input type="file" id="upload" name="merhcnatImg" ref="file"
class="upload upload-img-box upload-img-wh" accept="image/png, image/jpeg, image/gif, image/jpg" class="upload upload-img-box upload-img-wh" accept="image/png, image/jpeg, image/gif, image/jpg"
data-idx="0" style="opacity: 0;"> data-idx="0" style="opacity: 0;">
...@@ -157,8 +157,6 @@ ...@@ -157,8 +157,6 @@
if (id) { if (id) {
resetpsw.removeClass('hide') resetpsw.removeClass('hide')
resetpsw.addClass('show') resetpsw.addClass('show')
} else {
// resetpsw.addClass('hide')
} }
// 重置密码 // 重置密码
resetpsw.on('click', function() { resetpsw.on('click', function() {
...@@ -222,7 +220,9 @@ ...@@ -222,7 +220,9 @@
staffEmail: data.staffEmail, staffEmail: data.staffEmail,
staffJob: data.staffJob, staffJob: data.staffJob,
} }
merchantFileRequest = {fileName: data.merchantFileResponse.fileName, fileUrl: data.merchantFileResponse.fileUrl} if (data.merchantFileResponse) {
merchantFileRequest = { fileName: data.merchantFileResponse.fileName, fileUrl: data.merchantFileResponse.fileUrl }
}
var imgEl = $('#img') var imgEl = $('#img')
var addEl = $('.img-add') var addEl = $('.img-add')
imgEl.attr('src', merchantFileRequest.fileUrl) imgEl.attr('src', merchantFileRequest.fileUrl)
...@@ -230,8 +230,8 @@ ...@@ -230,8 +230,8 @@
imgEl.addClass('show') imgEl.addClass('show')
addEl.removeClass('show') addEl.removeClass('show')
addEl.addClass('hide') addEl.addClass('hide')
// var visibleInferiorMerArr = data.visibleInferiorMer.split(',') var visibleInferiorMerArr = data.visibleInferiorMer.split(',')
var visibleInferiorMerArr = "34,38".split(',') // var visibleInferiorMerArr = [32, 38]
callback(visibleInferiorMerArr) callback(visibleInferiorMerArr)
} }
console.log(employeeForm) console.log(employeeForm)
...@@ -279,12 +279,22 @@ ...@@ -279,12 +279,22 @@
}).join(',') }).join(',')
var otherParams = { var otherParams = {
visibleInferiorMer: visibleInferiorMer, visibleInferiorMer: visibleInferiorMer,
merchantFileRequest: JSON.stringify(merchantFileRequest) // merchantFileRequest: JSON.stringify(merchantFileRequest),
merchantId: merchantId
}
if (merchantFileRequest.fileName) {
otherParams.merchantFileRequest = JSON.stringify(merchantFileRequest)
} else
if (id) {
otherParams.id = id
otherParams.method = 'cn.com.glsx.merchants.staff.updateStaff'
} else {
otherParams.method = 'cn.com.glsx.merchants.staff.saveStaff'
} }
var params = helper.clone(true, { method: 'cn.com.glsx.merchants.staff.saveStaff', merchantId: merchantId }, data.field, otherParams) var params = helper.clone(true, data.field, otherParams)
request(params, function (result) { request(params, function (result) {
if (result.code == '0') { if (result.code == '0') {
window.history.back() // window.history.back()
layer.msg('操作成功', { layer.msg('操作成功', {
icon: 1 icon: 1
}) })
......
...@@ -88,13 +88,13 @@ ...@@ -88,13 +88,13 @@
//表头 //表头
{ field: '', title: '序号', type: 'numbers', width: 80, fixed: 'left' }, { field: '', title: '序号', type: 'numbers', width: 80, fixed: 'left' },
{ field: 'staffName', title: '员工姓名', width: 120 }, { field: 'staffName', title: '员工姓名', width: 120 },
{ field: 'id', title: '员工号' }, { field: 'staffCode', title: '员工号' },
{ field: 'roleIds', title: '角色' }, { field: 'roleName', title: '角色' },
{ field: 'staffPhone', title: '登录手机号', width: 125 }, { field: 'staffPhone', title: '登录手机号', width: 125 },
{ field: 'experience', title: '登录密码' }, { field: 'password', title: '登录密码' },
{ field: 'statusName', title: '状态' }, { field: 'statusName', title: '状态' },
{ field: 'createdAccount', title: '创建者' }, { field: 'createdAccount', title: '创建者' },
{ field: 'merchantId', title: '商户名(商户号)', width: 160 }, { field: 'merchantName', title: '商户名(商户号)', width: 160 },
{ field: 'createdTime', title: '更新时间', width: 160 }, { field: 'createdTime', title: '更新时间', width: 160 },
{ fixed: 'right', title: '操作', width: 240, align: 'center', toolbar: '#employeeBar' } { fixed: 'right', title: '操作', width: 240, align: 'center', toolbar: '#employeeBar' }
] ]
...@@ -176,26 +176,19 @@ ...@@ -176,26 +176,19 @@
fixed: false, //不固定 fixed: false, //不固定
// maxmin: true, // maxmin: true,
btn: ['确定', '取消'], btn: ['确定', '取消'],
content: 'validPeriod.html?id=' + data.id, content: 'validPeriod.html?id=' + data.id + '&effectiveTime=' + data.effectiveTime,
yes: function (index, layero) { yes: function (index, layero) {
// console.log(layero)
// var res = window["layui-layer-iframe" + index].callbackdata()
// console.log(res)
// 获取iframe层的body
var body = layer.getChildFrame('body', index) var body = layer.getChildFrame('body', index)
body.contents().find('#isValid').attr('value', 'no') helper.store.set('isRefresh', false)
body.find('#periodVerifyBtn').click() body.find('#periodVerifyBtn').click()
if (body.contents().find('#isValid').val() == 'yes') {
console.log('+++++++++++')
layer.msg('操作成功', {
icon: 1
})
layer.close(index)
}
}, },
cancel: function (index, layero) { end: function () {
// layer.close(index) var isRefresh = helper.store.get('isRefresh')
if (isRefresh) {
getTabelList(employeeTable)
} }
helper.store.remove('isRefresh')
},
}) })
} }
}) })
......
...@@ -40,21 +40,22 @@ ...@@ -40,21 +40,22 @@
</div> --> </div> -->
</div> </div>
</form> </form>
<input type="text" id="isValid" name="isValid" value="no" style="display: none;" class="layui-input">
</main> </main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="/js/load.js"></script> <script src="/js/load.js"></script>
<script> <script>
layui.use(['form', 'request'], function () { layui.use(['form', 'request', 'helper'], function () {
var form = layui.form var form = layui.form
var request = layui.request var request = layui.request
var $ = layui.$ var $ = layui.$
var helper = layui.helper
var currLayerIdx = parent.layer.getFrameIndex(window.name) var currLayerIdx = parent.layer.getFrameIndex(window.name)
var baseData = {} var baseData = {}
var vaildData = { var vaildData = {
id: getQueryString('id') id: getQueryString('id'),
effectiveTime: getQueryString('effectiveTime')
} }
...@@ -67,21 +68,14 @@ ...@@ -67,21 +68,14 @@
effectiveTime: data.field.validPeriod, effectiveTime: data.field.validPeriod,
id: vaildData.id id: vaildData.id
} }
updateVal(params, function(e) {
console.log(e, '============kkkkk')
if (e) {
$('#isValid').attr('value', 'yes')
}
})
return false
})
function updateVal(params, callback) {
request(params, function (res) { request(params, function (res) {
if (res.code == '0') { if (res.code == '0') {
callback(true) helper.store.set('isRefresh', true)
parent.layer.close(currLayerIdx)
} }
}) })
} return false
})
// function callbackdata() { // function callbackdata() {
// return vaildData // return vaildData
......
...@@ -354,6 +354,7 @@ ...@@ -354,6 +354,7 @@
helper.store.set('merchantMapObj', merchantForm) helper.store.set('merchantMapObj', merchantForm)
form.on('submit(handleSubmit)', function (data) { form.on('submit(handleSubmit)', function (data) {
console.log(editLevel)
// console.log(data.field) // console.log(data.field)
var formData = data.field var formData = data.field
var params = { var params = {
...@@ -414,13 +415,16 @@ ...@@ -414,13 +415,16 @@
merchantForm.businessScopeCustomize = tempList.join(',') merchantForm.businessScopeCustomize = tempList.join(',')
params.businessScopeCustomize = tempList.join(',') params.businessScopeCustomize = tempList.join(',')
merchantForm.merchantBrand = treeObj.getCheckedNodes(true) merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
params.merchantBrand = findId(merchantForm.merchantBrand, []).join(',') params.merchantBrand = findId(merchantForm.merchantBrand).join(',')
if (merchantForm.merchantFiles.length) {
params.merchantFiles = JSON.stringify(merchantForm.merchantFiles) params.merchantFiles = JSON.stringify(merchantForm.merchantFiles)
}
if (editLevel == 1) { if (editLevel == 1) {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant' params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
} else if (editLevel == 2) { } else if (editLevel == 2) {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant' params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
} else if (editLevel == 3) { } else if (editLevel == 3) {
params.id = id
params.method = 'cn.com.glsx.merchants.merchant.updateMerchant' params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
} }
// 保存状态 1.草稿 2.发布 3.注销 4.过期 // 保存状态 1.草稿 2.发布 3.注销 4.过期
...@@ -433,19 +437,18 @@ ...@@ -433,19 +437,18 @@
console.log(params) console.log(params)
request(params, function (res) { request(params, function (res) {
console.log(res) console.log(res)
go('merchant', 'index') layer.msg('操作成功', {
icon: 1
})
// go('merchant', 'index')
}) })
return false return false
}) })
function findId(nodeList, idList) { function findId(nodeList) {
// var idList = [] var idList = []
$.each(nodeList, function (index, item) { $.each(nodeList, function (index, item) {
if (item.children) {
findId(item.children, idList)
} else {
idList.push(item.id) idList.push(item.id)
}
}) })
return idList return idList
} }
...@@ -479,7 +482,7 @@ ...@@ -479,7 +482,7 @@
var body = layer.getChildFrame('body', index) var body = layer.getChildFrame('body', index)
body.find('#mapBtn').click() body.find('#mapBtn').click()
var res = helper.store.get('merchantMapObj') var res = helper.store.get('merchantMapObj')
console.log(res) // console.log(res)
merchantForm.lat = res.lat merchantForm.lat = res.lat
merchantForm.lng = res.lng merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress merchantForm.merchantAddress = res.merchantAddress
...@@ -625,9 +628,6 @@ ...@@ -625,9 +628,6 @@
getBusiScope() getBusiScope()
getCarBrandTree() getCarBrandTree()
getAccountType() getAccountType()
// if (merchantForm.accountTypes.length) {
// setCheckbox(merchantForm.accountTypes, 'accounttypeId')
// }
}) })
} }
...@@ -644,9 +644,24 @@ ...@@ -644,9 +644,24 @@
request({ request({
method: 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree' method: 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree'
}, function (res) { }, function (res) {
// console.log(res.data)
baseData.carBrandTreeList = res.data baseData.carBrandTreeList = res.data
treeObj = tree.create('carBrandTree', res.data) treeObj = tree.create('carBrandTree', res.data)
all_nodes = treeObj.getNodes() all_nodes = treeObj.getNodes()
var checkedList = []
if (editLevel == 3) {
checkedList = merchantForm.merchantBrand.split(',')
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
// 修改-回显
// if (editLevel == 3) {
// checkedList = merchantForm.merchantBrand.split(',')
// for (var i = 0; i <= checkedList.length; i++) {
// treeObj.checkNode(treeObj.getNodeByParam("id", checkedList[i]), true)
// }
// }
}) })
} }
// 获取字典数据 // 获取字典数据
...@@ -693,17 +708,26 @@ ...@@ -693,17 +708,26 @@
function getBusiScope() { function getBusiScope() {
getDictData('business_scope', function (res) { getDictData('business_scope', function (res) {
baseData.busiScopeList = res.data baseData.busiScopeList = res.data
var checkedList = []
if (editLevel == 3) {
checkedList = merchantForm.businessScope.split(',')
}
var el = $('#busiScopeEl') var el = $('#busiScopeEl')
$.each(baseData.busiScopeList, function (index, item) { $.each(baseData.busiScopeList, function (index, item) {
var optionEl = $('<input type="checkbox" class="businessScope" name="businessScope[' + item var optionEl = $('<input type="checkbox" class="businessScope" name="businessScope[' + item
.dictValue + ']" title=' + .dictValue + ']" title=' +
item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">') item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">')
el.append(optionEl)
form.render('checkbox')
// 修改-回显 // 修改-回显
if (editLevel == 3 && merchantForm.businessScope) { if (editLevel == 3) {
setCheckbox(merchantForm.businessScope, 'businessScope') for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true)
break
}
} }
}
el.append(optionEl)
form.render('checkbox')
}) })
}) })
} }
...@@ -713,17 +737,26 @@ ...@@ -713,17 +737,26 @@
getDictData('account_type', function (res) { getDictData('account_type', function (res) {
// console.log(res.data) // console.log(res.data)
baseData.accountTypeList = res.data baseData.accountTypeList = res.data
var checkedList = []
if (editLevel == 3) {
checkedList = merchantForm.accountType.split(',')
}
var el = $('#accountTypeEl') var el = $('#accountTypeEl')
$.each(baseData.accountTypeList, function (index, item) { $.each(baseData.accountTypeList, function (index, item) {
var optionEl = $('<input type="checkbox" class="accounttypeId" name="accountType[' + item var optionEl = $('<input type="checkbox" class="accounttypeId" name="accountType[' + item
.dictValue + ']" title=' + .dictValue + ']" title=' +
item.dictLabel + ' value="' + item.dictValue + '">') item.dictLabel + ' value="' + item.dictValue + '">')
el.append(optionEl)
form.render('checkbox')
// 修改-回显 // 修改-回显
if (editLevel == 3 && merchantForm.accountTypes.length) { if (editLevel == 3) {
setCheckbox(merchantForm.accountTypes, 'accounttypeId') for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true)
break
} }
}
}
el.append(optionEl)
form.render('checkbox')
}) })
}) })
} }
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</div> </div>
<div style="float: right;"> <div style="float: right;">
<div class="layui-inline"> <div class="layui-inline">
<input class="layui-input" placeholder="请输入客户名称"> <input class="layui-input" name="merchantName" placeholder="请输入客户名称">
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<button class="layui-btn" lay-submit lay-filter="searchSubmit">查询</button> <button class="layui-btn" lay-submit lay-filter="searchSubmit">查询</button>
...@@ -335,6 +335,7 @@ ...@@ -335,6 +335,7 @@
item.btn.createSubMerchant = true item.btn.createSubMerchant = true
} }
} else { // 下级商户 } else { // 下级商户
console.log(item)
item.btn.edit = true item.btn.edit = true
item.btn.editPeriod = true item.btn.editPeriod = true
// 直属门店 // 直属门店
......
...@@ -16,23 +16,28 @@ ...@@ -16,23 +16,28 @@
<div> <div>
<h3 class="content-title">员工基本信息</h3> <h3 class="content-title">员工基本信息</h3>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">角色名称:</label> <label class="layui-form-label">角色名称:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="roleName"></div> <div class="layui-form-mid layui-word-aux" id="roleName"></div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">角色号:</label> <label class="layui-form-label">角色号:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="id"></div> <div class="layui-form-mid layui-word-aux" id="id"></div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">角色说明:</label> <label class="layui-form-label">角色说明:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="roleDescription "></div> <div class="layui-form-mid layui-word-aux" id="roleDescription "></div>
</div> </div>
</div> </div>
<h3 class="content-title">角色权限</h3>
<div class="layui-tab" lay-filter="roleAuth">
<ul class="layui-tab-title"></ul>
<div class="layui-tab-content"></div>
</div>
</div> </div>
</main> </main>
</div> </div>
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
{ field: 'roleName', title: '角色名称' }, { field: 'roleName', title: '角色名称' },
{ field: 'id', title: '角色号' }, { field: 'id', title: '角色号' },
{ field: 'merchantName', title: '所属商户名' }, { field: 'merchantName', title: '所属商户名' },
{ field: 'delFlag', title: '状态' }, { field: 'statusName', title: '状态' },
{ field: 'createdTime', title: '更新时间' }, { field: 'createdTime', title: '更新时间' },
{ fixed: 'right', title: '操作', width: 160, align: 'center', toolbar: '#roleBar' } { fixed: 'right', title: '操作', width: 160, align: 'center', toolbar: '#roleBar' }
] ]
...@@ -77,8 +77,7 @@ ...@@ -77,8 +77,7 @@
var params = helper.clone(false, { var params = helper.clone(false, {
pageNum: table.config.index, pageNum: table.config.index,
pageSize: table.config.limit, pageSize: table.config.limit,
method: 'org.ore.api.role.page', method: 'org.ore.api.role.page'
merchantId: 31
}, search) }, search)
request(params, request(params,
function(res) { function(res) {
...@@ -124,15 +123,23 @@ ...@@ -124,15 +123,23 @@
} else if (layEvent === 'del') { } else if (layEvent === 'del') {
layer.confirm('真的删除行么', function(index) { layer.confirm('真的删除行么', function(index) {
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存 // obj.del() //删除对应行(tr)的DOM结构,并更新缓存
var params = {
method: 'org.ore.api.role.deleteById',
id: data.id
}
request(params, function (res) {
if (res.code == '0') {
layer.close(index) layer.close(index)
console.log('shanchu') console.log('shanchu')
getTabelList(employeeTable) getTabelList(roleTable)
//向服务端发送删除指令 }
})
}) })
} }
}) })
// 新增点击事件 // 新增点击事件
$('#addRole').on('click', function() { $('#addRole').on('click', function() {
var value = merchantName.val()
var params = { merchantId: value } var params = { merchantId: value }
if (value) { if (value) {
go('role', 'add', params) go('role', 'add', params)
......
...@@ -23,9 +23,11 @@ layui.define(['ztree'], function (exports) { ...@@ -23,9 +23,11 @@ layui.define(['ztree'], function (exports) {
} }
if (gtree.opt && gtree.opt.checkedList) { if (gtree.opt && gtree.opt.checkedList) {
var p = gtree.opt.checkedList var p = gtree.opt.checkedList
if (p.indexOf(treeNode.id+'') != -1) { if (p.indexOf(treeNode.id) != -1) {
treeNode.checked = true treeNode.checked = true
inst.updateNode(treeNode); if (inst) {
inst.updateNode(treeNode)
}
} }
} }
} }
......
...@@ -58,6 +58,9 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -58,6 +58,9 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
config = config || {} config = config || {}
var common = store.getEx('external') var common = store.getEx('external')
var settings = helper.clone(true, defaultSettings) var settings = helper.clone(true, defaultSettings)
if (isOtherUrl) {
delete settings.beforeSend
}
var data = helper.clone(true, { var data = helper.clone(true, {
timestamp: new Date().getTime() timestamp: new Date().getTime()
}, common.params, params) }, common.params, params)
...@@ -94,6 +97,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -94,6 +97,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
} }
delete params.sign delete params.sign
var arr = [] var arr = []
var secretArr = []
for (var key in params) { for (var key in params) {
var isPush = false var isPush = false
$.each(noSignAttr, function (index, item) { $.each(noSignAttr, function (index, item) {
...@@ -102,12 +107,17 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -102,12 +107,17 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
} }
}) })
if (!isPush) { if (!isPush) {
arr.push(key + params[key]) arr.push(key)
}
} }
arr.sort()
for (var key in arr) {
var val = arr[key]
secretArr.push(val + params[val])
} }
var str = arr.sort().join('') var str = secretArr.join('')
return isMd5 ? md5(secret + str + secret).toUpperCase() : SHA1(secret + str + secret).toUpperCase() return isMd5 ? md5(secret + str + secret).toUpperCase() : SHA1(secret + str + secret).toUpperCase()
return SHA1(secret + str + secret).toUpperCase() // return SHA1(secret + str + secret).toUpperCase()
} }
function msg(msg) { function msg(msg) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!