Commit 9fcf2a44 by cwq0219

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

2 parents 3b6d33c9 789635c5
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
var _href = '/html/' + _path var _href = '/html/' + _path
$('.header-nav-item').each(function (i, e) { $('.header-nav-item').each(function (i, e) {
var _hr = $(e).find('a').attr('href') var _hr = $(e).find('a').attr('href')
if (_hr.startsWith(_href)) { if (_hr.indexOf(_href) !== -1) {
// if (_hr.startsWith(_href)) {
$(e).addClass('active').siblings().removeClass('active') $(e).addClass('active').siblings().removeClass('active')
return false return false
} }
......
...@@ -109,15 +109,12 @@ ...@@ -109,15 +109,12 @@
data-idx="0" style="opacity: 0;"> data-idx="0" style="opacity: 0;">
</div> </div>
<span class="tips">图片格式仅支持JPG,PNG格式,大小1M以内</span> <span class="tips">图片格式仅支持JPG,PNG格式,大小1M以内</span>
<!-- <div class="layui-upload-img" id="uploadImg">
<i class="layui-icon">&#xe624;</i>
</div> -->
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">邮箱:</label> <label class="layui-form-label">邮箱:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="staffEmail" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input" /> <input type="text" name="staffEmail" lay-verify="" placeholder="请输入邮箱" autocomplete="off" class="layui-input" />
</div> </div>
</div> </div>
...@@ -142,7 +139,9 @@ ...@@ -142,7 +139,9 @@
//Demo //Demo
layui.use(['form', 'upload', 'gtree', 'request', 'helper'], function() { layui.use(['form', 'upload', 'gtree', 'request', 'helper'], function() {
console.log(qs('id')) console.log(qs('merchantId'))
var merchantId = qs('merchantId')
var id = qs('id')
var form = layui.form var form = layui.form
var upload = layui.upload var upload = layui.upload
var tree = layui.gtree var tree = layui.gtree
...@@ -150,14 +149,12 @@ ...@@ -150,14 +149,12 @@
var helper = layui.helper var helper = layui.helper
var $ = layui.$ var $ = layui.$
var merchantFileRequest = {} var merchantFileRequest = {}
var id = null
var employeeForm = {} var employeeForm = {}
var pwd = $('#password') // 密码输入框 var pwd = $('#password') // 密码输入框
var resetpsw = $('#resetpsw') var resetpsw = $('#resetpsw')
pwd.attr('readonly', false) pwd.attr('readonly', false)
if (qs('id')) { if (id) {
id = qs('id')
resetpsw.removeClass('hide') resetpsw.removeClass('hide')
resetpsw.addClass('show') resetpsw.addClass('show')
} else { } else {
...@@ -173,7 +170,7 @@ ...@@ -173,7 +170,7 @@
findRoleList() findRoleList()
// 查询角色权限列表 // 查询角色权限列表
function findRoleList() { function findRoleList() {
var params = { method: 'org.ore.api.role.list', id: 31 } var params = { method: 'org.ore.api.role.list', id: merchantId }
request(params, function(res) { request(params, function(res) {
if (res.code == '0') { if (res.code == '0') {
var list = res.data var list = res.data
...@@ -187,23 +184,23 @@ ...@@ -187,23 +184,23 @@
} }
// 可见商户 // 可见商户
var visibleMerchantParams = { id: 31, method: 'cn.com.glsx.merchants.merchant.findMerchantTree' } var visibleMerchantParams = { id: merchantId, method: 'cn.com.glsx.merchants.merchant.findMerchantTree' }
var visibleMerchant = {} var visibleMerchant = {}
request(visibleMerchantParams, function(res) { request(visibleMerchantParams, function(res) {
if (res.code == '0') { if (res.code == '0') {
if (id) { if (id) {
getById(function(p) { getById(function(checkedList) {
visibleMerchant = tree.create('visibleInferiorMerTree', res.data, { onNodeCreated: function(event, treeId, treeNode) { visibleMerchant = tree.create('visibleInferiorMerTree', res.data, {checkedList: checkedList}
if (p.indexOf(treeNode.id+'') != -1) { // { onNodeCreated: function(event, treeId, treeNode) {
treeNode.checked = true // if (p.indexOf(treeNode.id+'') != -1) {
visibleMerchant.updateNode(treeNode); // treeNode.checked = true
} // visibleMerchant.updateNode(treeNode);
}}) // }
visibleMerchant.expandAll(true) // }}
)
}) })
} else { } else {
visibleMerchant = tree.create('visibleInferiorMerTree', res.data) visibleMerchant = tree.create('visibleInferiorMerTree', res.data)
visibleMerchant.expandAll(true)
} }
} }
}) })
...@@ -221,7 +218,7 @@ ...@@ -221,7 +218,7 @@
staffPhone: data.staffPhone, staffPhone: data.staffPhone,
password: data.password, password: data.password,
// visibleInferiorMer: "1", // visibleInferiorMer: "1",
roleIds: data.roleIds.join(''), roleIds: +data.roleIds.join(''),
staffEmail: data.staffEmail, staffEmail: data.staffEmail,
staffJob: data.staffJob, staffJob: data.staffJob,
} }
...@@ -284,7 +281,7 @@ ...@@ -284,7 +281,7 @@
visibleInferiorMer: visibleInferiorMer, visibleInferiorMer: visibleInferiorMer,
merchantFileRequest: JSON.stringify(merchantFileRequest) merchantFileRequest: JSON.stringify(merchantFileRequest)
} }
var params = helper.clone(true, { method: 'cn.com.glsx.merchants.staff.saveStaff', merchantId: 31 }, data.field, otherParams) var params = helper.clone(true, { method: 'cn.com.glsx.merchants.staff.saveStaff', merchantId: merchantId }, 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()
......
...@@ -12,20 +12,6 @@ ...@@ -12,20 +12,6 @@
<title>员工管理</title> <title>员工管理</title>
</head> </head>
<body> <body>
<form action="" class="layui-form layui-form-pane" id="updateTime" style="display: none; text-align: center; margin: 20px;">
<div class="layui-inline" pane>
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<select name="city" lay-verify="required">
<option value="">1天</option>
<option value="0">7天</option>
<option value="1">1个月</option>
<option value="2">永久有效</option>
</select>
</div>
</div>
<div>(注:永久有效不超过所属工厂商户的有效期)</div>
</form>
<div id="app"> <div id="app">
<main> <main>
<div class="bg-white"> <div class="bg-white">
...@@ -62,14 +48,14 @@ ...@@ -62,14 +48,14 @@
</div> </div>
<div class="layui-inline" pane> <div class="layui-inline" pane>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="city" lay-verify="required"> <select name="type" lay-verify="required">
<option value=""></option> <option value=""></option>
<option value="0">员工姓名</option> <option value="0">员工姓名</option>
<option value="1">手机号</option> <option value="1">手机号</option>
</select> </select>
</div> </div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="staffName" required lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" /> <input type="text" name="keywords" required lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" />
</div> </div>
</div> </div>
<div class="layui-inline" pane> <div class="layui-inline" pane>
...@@ -116,7 +102,8 @@ ...@@ -116,7 +102,8 @@
}) })
getTabelList(employeeTable) getTabelList(employeeTable)
// 获取table列表接口 // 获取table列表接口
function getTabelList(table, search = {}, isResetPageNum = false) { function getTabelList(table, search, isResetPageNum) {
search = search || {}
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,
...@@ -164,7 +151,7 @@ ...@@ -164,7 +151,7 @@
if (layEvent === 'detail') { if (layEvent === 'detail') {
go('employee', 'detail', {id: data.id}) go('employee', 'detail', {id: data.id})
} else if (layEvent === 'edit') { } else if (layEvent === 'edit') {
go('employee', 'add', {id: data.id}) go('employee', 'add', {id: data.id, merchantId: data.merchantId})
} else if (layEvent === 'del') { } else if (layEvent === 'del') {
layer.confirm('真的删除行么', function(index) { layer.confirm('真的删除行么', function(index) {
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存 // obj.del() //删除对应行(tr)的DOM结构,并更新缓存
...@@ -213,13 +200,33 @@ ...@@ -213,13 +200,33 @@
} }
}) })
// 新增点击事件 // 新增点击事件
$(document).on('click', '#addEmployee', function() { $('#addEmployee').on('click', function() {
go('employee', 'add') var value = merchantName.val()
if (value) {
go('employee', 'add', {merchantId: value})
} else {
layer.msg('请选择商户')
}
}) })
// 查询事件 // 查询事件
$(document).on('click', '#employeeSearch', function() { $('#employeeSearch').on('click', function() {
var searchData = form.val('employeeForm') var formVal = form.val('employeeForm')
var searchData = helper.clone(false, formVal)
console.log(formVal)
if (searchData.type == 0) {
searchData.staffName = formVal.keywords
searchData.staffPhone = ''
} else if (searchData.type == 1) {
searchData.staffName = ''
searchData.staffPhone = formVal.keywords
} else {
searchData.staffName = ''
searchData.staffPhone = ''
}
delete searchData.type
delete searchData.keywords
console.log(searchData) console.log(searchData)
getTabelList(employeeTable, searchData)
}) })
}) })
</script> </script>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
{ field: 'merchantName', title: '所属商户名' }, { field: 'merchantName', title: '所属商户名' },
{ field: 'delFlag', title: '状态' }, { field: 'delFlag', title: '状态' },
{ field: 'createdTime', title: '更新时间' }, { field: 'createdTime', title: '更新时间' },
{ fixed: 'right', title: '操作', width: 280, align: 'center', toolbar: '#roleBar' } { fixed: 'right', title: '操作', width: 160, align: 'center', toolbar: '#roleBar' }
] ]
] ]
}) })
...@@ -117,9 +117,10 @@ ...@@ -117,9 +117,10 @@
var layEvent = obj.event var layEvent = obj.event
var tr = obj.tr var tr = obj.tr
if (layEvent === 'detail') { if (layEvent === 'detail') {
go('merchant', 'detail', {id: data.id}) go('role', 'detail', {id: data.id})
} else if (layEvent === 'edit') { } else if (layEvent === 'edit') {
go('role', 'add', {id: 1}) var params = { id: data.id, merchantId: data.merchantId }
go('role', 'add', params)
} else if (layEvent === 'del') { } else if (layEvent === 'del') {
layer.confirm('真的删除行么', function(index) { layer.confirm('真的删除行么', function(index) {
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存 // obj.del() //删除对应行(tr)的DOM结构,并更新缓存
...@@ -131,9 +132,13 @@ ...@@ -131,9 +132,13 @@
} }
}) })
// 新增点击事件 // 新增点击事件
$(document).on('click', '#addRole', function() { $('#addRole').on('click', function() {
console.log('创建') var params = { merchantId: value }
go('role', 'add') if (value) {
go('role', 'add', params)
} else {
layer.msg('请选择商户')
}
}) })
// 查询事件 // 查询事件
$(document).on('click', '#roleSearch', function() { $(document).on('click', '#roleSearch', function() {
......
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="修改有效期" />
<meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,商户管理" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<style>
.valid-period {
text-align: center;
padding: 20px 20px;
background-color: #ffffff;
}
</style>
<title>tree</title>
</head>
<body>
<div id="app">
<main>fdasfda</main>
</div>
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="/js/load.js"></script>
<script>
console.log(qs('id'))
</script>
</body>
</html>
...@@ -11,7 +11,7 @@ layui.define(['ztree'], function (exports) { ...@@ -11,7 +11,7 @@ layui.define(['ztree'], function (exports) {
var $ = layui.$ var $ = layui.$
var tree = layui.ztree var tree = layui.ztree
function onNodeCreated(event, treeId, treeNode) { function onNodeCreated(event, treeId, treeNode) {
if (treeNode.logo == 'PR') { if (treeNode.logo == 'function') {
var tId = treeNode.getParentNode().tId var tId = treeNode.getParentNode().tId
var $parentUl = $('#' + tId + '_ul') var $parentUl = $('#' + tId + '_ul')
if (!$parentUl.hasClass('pr-parent-ul')) { if (!$parentUl.hasClass('pr-parent-ul')) {
...@@ -21,8 +21,12 @@ layui.define(['ztree'], function (exports) { ...@@ -21,8 +21,12 @@ layui.define(['ztree'], function (exports) {
$switchs.not(':eq(0)').addClass('op0') $switchs.not(':eq(0)').addClass('op0')
} }
} }
if (gtree.opt && gtree.opt.onNodeCreated) { if (gtree.opt && gtree.opt.checkedList) {
gtree.opt.onNodeCreated(event, treeId, treeNode) var p = gtree.opt.checkedList
if (p.indexOf(treeNode.id+'') != -1) {
treeNode.checked = true
inst.updateNode(treeNode);
}
} }
} }
var setting = { var setting = {
...@@ -53,6 +57,7 @@ layui.define(['ztree'], function (exports) { ...@@ -53,6 +57,7 @@ layui.define(['ztree'], function (exports) {
$treeDom.addClass('ztree') $treeDom.addClass('ztree')
if (check == 0) setting.check.enable = false if (check == 0) setting.check.enable = false
inst = tree.init($treeDom, setting, nodes) inst = tree.init($treeDom, setting, nodes)
inst.expandAll(true)
return inst return inst
} }
} }
......
...@@ -26,6 +26,8 @@ function goLogin() { ...@@ -26,6 +26,8 @@ function goLogin() {
function loadLayConfig() { function loadLayConfig() {
layui.config({ layui.config({
base: '/js/' base: '/js/'
}).extend({
xmSelect: 'xm-select'
}) })
} }
function loadHeaderFooter() { function loadHeaderFooter() {
......
...@@ -52,7 +52,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -52,7 +52,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
} }
} }
function request(params, success, config, noSignAttr = [], isOtherUrl = false) { function request(params, success, config, noSignAttr, isOtherUrl) {
noSignAttr = noSignAttr || []
params = params || {} params = params || {}
config = config || {} config = config || {}
var common = store.getEx('external') var common = store.getEx('external')
...@@ -89,7 +90,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -89,7 +90,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
return $.ajax(settings) return $.ajax(settings)
} }
function sign(params, secret, noSignAttr = [], isMd5 = false) { function sign(params, secret, noSignAttr, isMd5) {
noSignAttr = noSignAttr || []
if (!params || $.isEmptyObject(params)) { if (!params || $.isEmptyObject(params)) {
return '' return ''
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!