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