Commit 6e89b2bf by 胡悦

提交角色

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