Commit 6e89b2bf by 胡悦

提交角色

1 parent 789635c5
......@@ -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' }
]
......
......@@ -124,15 +124,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)
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!