Commit 50e9c99a by 胡悦

合并

2 parents b3493b99 f1bca57a
.bg-white { .bg-white {
background-color: #fff; /* background-color: #F7F7F7; */
margin: 20px; /* margin: 20px; */
} }
.content-title { .content-title {
......
/*------------------------------------- /*-------------------------------------
layui 样式自定义 layui 样式自定义
-------------------------------------*/ -------------------------------------*/
.layui-btn+.layui-btn {
margin-left: 20px;
}
.layui-input:focus, .layui-input:focus,
.layui-textarea:focus { .layui-textarea:focus {
border-color: #1989FA !important; border-color: #1989FA !important;
} }
.layui-input{
border-radius: 4px;
}
.layui-form-pane .layui-input{
border-radius: 0 4px 4px 0;
}
.layui-form-pane .layui-input-inline{
margin-left: -4px;
}
.layui-form-pane .layui-form-item[pane]{
border-style: none;
}
.layui-form-label.required::before { .layui-form-label.required::before {
content: '*'; content: '*';
display: inline-block; display: inline-block;
...@@ -16,6 +29,7 @@ ...@@ -16,6 +29,7 @@
.layui-laypage-btn,.layui-btn { .layui-laypage-btn,.layui-btn {
background-color: #1989FA !important; background-color: #1989FA !important;
border-radius: 4px;
color: #ffffff; color: #ffffff;
} }
...@@ -96,21 +110,61 @@ ...@@ -96,21 +110,61 @@
border-color:#1989FA!important; border-color:#1989FA!important;
} }
/* 分页器的修改 */ /* 分页器的修改 */
.layui-laypage button{
border-radius: 4px;
}
.layui-laypage .layui-laypage-skip input:focus{ .layui-laypage .layui-laypage-skip input:focus{
border-color: #1989FA!important; border-color: #1989FA!important;
} }
.layui-laypage a, .layui-laypage span,.layui-laypage .layui-laypage-skip{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
}
/* 表格行内容高度自适应 */ /* 表格行内容高度自适应 */
.layui-table-cell{ .layui-table-cell{
height: auto; height: auto;
overflow: visible; /* overflow: visible;
text-overflow: inherit; text-overflow: inherit; */
white-space: normal; white-space: normal;
/* 高度最多四行,超出省略号结尾 */
/* display: -webkit-box;
-webkit-box-orient: vertical;
line-clamp: 4;
overflow: hidden;
word-break: break-all; */
overflow: hidden;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
display: -webkit-box;
} }
.layui-table-cell li{ .layui-table-cell li{
list-style: disc; list-style-type: none;
list-style-position: inside; }
.layui-table-cell li::before{
/* list-style: disc;
list-style-position: inside; */
content: "\2022";
color: #1989FA;
margin-right: 5px;
} }
.layui-table-cell li::marker{ .layui-table-cell li::marker{
color:#1989FA ; /*谷歌浏览器有::marker伪元素,ie浏览器没有,故使用伪元素替代蓝色原点*/
/* color:#1989FA ; */
}
/* 表格去所有边框 */
.layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r,
.layui-table-grid-down, .layui-table-header, .layui-table-page,
.layui-table-tips-main, .layui-table-tool, .layui-table-total,
.layui-table-view, .layui-table[lay-skin=line], .layui-table[lay-skin=row]{
border-style: none;
}
.layui-table-body tbody tr:not(:last-child){
border-bottom: 1px solid #DCDFE6;
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,6 +10,7 @@ html, body { ...@@ -10,6 +10,7 @@ html, body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
background-color: #f7f7f7;
} }
header { header {
...@@ -25,7 +26,7 @@ main::-webkit-scrollbar { ...@@ -25,7 +26,7 @@ main::-webkit-scrollbar {
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 0 38px; padding: 0 20px;
} }
.header-nav { .header-nav {
...@@ -93,7 +94,22 @@ main { ...@@ -93,7 +94,22 @@ main {
flex: 1; flex: 1;
min-height: calc(100% - 60px - 30px); min-height: calc(100% - 60px - 30px);
overflow: auto; overflow: auto;
background-color: #f8f8f8; background-color: #F7F7F7;
/* ie浏览器滚动条 */
/* -ms-scroll-chaining: chained;
-ms-overflow-style: none; */
}
.search-block {
padding: 8px 20px;
background-color: #ffffff;
}
main .table-page{
background-color: #ffffff;
margin:15px 20px;
padding: 5px;
}
main .table-page tr th:last-child .layui-table-cell{
text-align: center;
} }
footer { footer {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
} }
.merchant-left { .merchant-left {
width: 500px; width: 500px;
box-sizing: border-box;
padding-left: 20px;
} }
.merchant-right { .merchant-right {
flex: 1; flex: 1;
......
...@@ -23,17 +23,18 @@ ...@@ -23,17 +23,18 @@
<div class="bread-crumb"></div> <div class="bread-crumb"></div>
</div> </div>
<script> <script>
layui.use(['element', 'request','helper'], function () { layui.use(['element', 'request', 'helper'], function () {
var element = layui.element var element = layui.element
var helper = layui.helper
element.init() element.init()
highlight() highlight()
bindEvents() bindEvents()
// console.log(isAppend()) var href = location.href.split('/')
// var href = location.href.split('/') var isDxternal = isAppend()
// console.log(href) if (isDxternal && href[href.length - 1] != 'login.html') {
// if () { var user = helper.store.get('user')
// var user = helper.store.get('user') $('#curMerchantName').text(user.merchantName)
// } }
}) })
function highlight() { function highlight() {
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<head>
<head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
...@@ -10,18 +11,32 @@ ...@@ -10,18 +11,32 @@
<link rel="stylesheet" type="text/css" href="/css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="stylesheet" type="text/css" href="/css/employee.css" /> <link rel="stylesheet" type="text/css" href="/css/employee.css" />
<title>员工管理</title> <title>员工管理</title>
</head> </head>
<body> <style>
.merchantNames,.searchInputBtn{
margin-left: 20px;
}
.creater,.status{
margin-right: 20px;
}
.selector{
width: 110px;
}
</style>
<body>
<div id="app"> <div id="app">
<main class="bg-white"> <main class="bg-white">
<div> <div>
<div class="search-block">
<form action="" class="layui-form layui-form-pane" lay-filter="employeeForm"> <form action="" class="layui-form layui-form-pane" lay-filter="employeeForm">
<div class="layui-form-item" pane> <div class="layui-form-item" >
<button type="button" class="layui-btn layui-btn-normal" id="addEmployee"> <button type="button" class="layui-btn layui-btn-normal" id="addEmployee">
<i class="layui-icon layui-icon-add-circle"></i> <i class="layui-icon layui-icon-add-circle"></i>
创建员工 创建员工
</button> </button>
<div class="layui-inline" pane> <div class="layui-inline merchantNames" pane>
<label class="layui-form-label">商户名称</label> <label class="layui-form-label">商户名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="merchantId" id="merchantName" lay-verify="required"> <select name="merchantId" id="merchantName" lay-verify="required">
...@@ -29,14 +44,15 @@ ...@@ -29,14 +44,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline creater">
<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="createdName" required lay-verify="required" placeholder="请输入创建者" autocomplete="off" class="layui-input" /> <input type="text" name="createdName" required lay-verify="required" placeholder="请输入创建者"
autocomplete="off" class="layui-input" />
</div> </div>
</div> </div>
<div class="layui-inline" pane> <div class="layui-inline status" pane>
<label class="layui-form-label">状态</label> <label class="layui-form-label ">状态</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="status" id="status" lay-verify="required" placeholder="请选择状态"> <select name="status" id="status" lay-verify="required" placeholder="请选择状态">
<!-- <option value="">全部</option> <!-- <option value="">全部</option>
...@@ -47,7 +63,7 @@ ...@@ -47,7 +63,7 @@
</div> </div>
</div> </div>
<div class="layui-inline" pane> <div class="layui-inline" pane>
<div class="layui-input-inline"> <div class="layui-input-inline selector">
<select name="type" lay-verify="required" placeholder="员工姓名/手机号"> <select name="type" lay-verify="required" placeholder="员工姓名/手机号">
<option value=""></option> <option value=""></option>
<option value="0">员工姓名</option> <option value="0">员工姓名</option>
...@@ -55,23 +71,27 @@ ...@@ -55,23 +71,27 @@
</select> </select>
</div> </div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="keywords" 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" style="float: rihg;" pane>
<button type="button" class="layui-btn layui-btn-normal" id="employeeSearch">查询</button> <button type="button" class="layui-btn layui-btn-normal searchInputBtn" id="employeeSearch">查询</button>
<button type="button" class="layui-btn layui-btn-normal" id="employeeExport">导出</button> <button type="button" class="layui-btn layui-btn-normal exportInputBtn" id="employeeExport">导出</button>
</div> </div>
</form> </form>
<table id="employeeTable" lay-filter="employeeTool" ></table> </div>
<div class="table-page">
<table id="employeeTable" lay-filter="employeeTool"></table>
<div id="employeePage" class="align-center"></div> <div id="employeePage" class="align-center"></div>
</div> </div>
</div>
</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(['table', 'request', 'form', 'helper', 'laypage'], function() { layui.use(['table', 'request', 'form', 'helper', 'laypage'], function () {
var request = layui.request var request = layui.request
var table = layui.table var table = layui.table
var form = layui.form var form = layui.form
...@@ -86,7 +106,7 @@ ...@@ -86,7 +106,7 @@
//创建table实例 //创建table实例
var employeeTable = table.render({ var employeeTable = table.render({
elem: '#employeeTable', elem: '#employeeTable',
skin:'line', skin: 'nob',
cols: [ cols: [
[ [
//表头 //表头
...@@ -95,12 +115,12 @@ ...@@ -95,12 +115,12 @@
{ field: 'staffCode', title: '员工号', align: 'center' }, { field: 'staffCode', title: '员工号', align: 'center' },
{ field: 'roleName', title: '角色', align: 'center' }, { field: 'roleName', title: '角色', align: 'center' },
{ field: 'staffPhone', title: '登录手机号', align: 'center', width: 125 }, { field: 'staffPhone', title: '登录手机号', align: 'center', width: 125 },
// { field: 'password', title: '登录密码', align: 'center' }, { field: 'password', title: '登录密码', align: 'center' },
{ field: 'statusName', title: '状态', align: 'center' }, { field: 'statusName', title: '状态', align: 'center' },
{ field: 'createdAccount', title: '创建者', align: 'center' }, { field: 'createdAccount', title: '创建者', align: 'center' },
{ field: 'merchantName', title: '商户名(商户号)', align: 'center', width: 160 }, { field: 'merchantName', title: '商户名(商户号)', align: 'center', width: 160 },
{ field: 'createdTime', title: '更新时间', align: 'center', width: 160 }, { field: 'createdTime', title: '更新时间', align: 'center', width: 120 },
{ fixed: 'right', title: '操作', width: 276, align: 'left', toolbar: '#employeeBar' } { fixed: 'right', title: '操作', width: 220, align: 'left', toolbar: '#employeeBar' }
] ]
] ]
}) })
...@@ -135,12 +155,13 @@ ...@@ -135,12 +155,13 @@
method: 'cn.com.glsx.merchants.staff.findStaffByPage' method: 'cn.com.glsx.merchants.staff.findStaffByPage'
}, search) }, search)
request(params, request(params,
function(res) { function (res) {
console.log(res) console.log(res)
// table.reload('testReload', { // table.reload('testReload', {
// data: res.data.data // data: res.data.data
// }) // })
var data = res.data // var data = res.data
var data = helper.formateNullFieldData(res.data)
var options = { var options = {
data: data.data data: data.data
} }
...@@ -154,16 +175,16 @@ ...@@ -154,16 +175,16 @@
) )
} }
// table工具条事件 // table工具条事件
table.on('tool(employeeTool)', function(obj) { table.on('tool(employeeTool)', function (obj) {
var data = obj.data var data = obj.data
var layEvent = obj.event var layEvent = obj.event
var tr = obj.tr var tr = obj.tr
if (layEvent === 'detail') { if (layEvent === 'detail') {
go('employee', 'detail', {id: data.id, merchantId: data.merchantId}) go('employee', 'detail', { id: data.id, merchantId: data.merchantId })
} else if (layEvent === 'edit') { } else if (layEvent === 'edit') {
go('employee', 'add', {id: data.id, merchantId: data.merchantId}) 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结构,并更新缓存
var params = { var params = {
method: 'cn.com.glsx.merchants.staff.deleteStaff', method: 'cn.com.glsx.merchants.staff.deleteStaff',
...@@ -206,25 +227,25 @@ ...@@ -206,25 +227,25 @@
} }
}) })
// 查询事件 // 查询事件
$('#employeeSearch').on('click', function() { $('#employeeSearch').on('click', function () {
var searchData = getSearch() var searchData = getSearch()
getTabelList(employeeTable, searchData, true) getTabelList(employeeTable, searchData, true)
}) })
// 新增点击事件 // 新增点击事件
$('#addEmployee').on('click', function() { $('#addEmployee').on('click', function () {
var value = merchantName.val() var value = merchantName.val()
if (value) { if (value) {
go('employee', 'add', {merchantId: value}) go('employee', 'add', { merchantId: value })
} else { } else {
layer.msg('请选择商户') layer.msg('请选择商户')
} }
}) })
// 导出 // 导出
$('#employeeExport').on('click', function() { $('#employeeExport').on('click', function () {
var searchData = getSearch() var searchData = getSearch()
var params = helper.clone(false, { method: 'cn.com.glsx.merchants.staff.exportData' }, searchData) var params = helper.clone(false, { method: 'cn.com.glsx.merchants.staff.exportData' }, searchData)
request(params, function(res) { request(params, function (res) {
if(res.code == '0') { if (res.code == '0') {
window.open(res.data) window.open(res.data)
} }
}) })
...@@ -268,7 +289,7 @@ ...@@ -268,7 +289,7 @@
method: 'cn.com.glsx.merchants.menu.findAllDictData', method: 'cn.com.glsx.merchants.menu.findAllDictData',
dictType: 'staff_status' dictType: 'staff_status'
} }
request(params, function(res) { request(params, function (res) {
if (res.code == '0') { if (res.code == '0') {
var list = res.data var list = res.data
list.unshift('') list.unshift('')
...@@ -291,5 +312,6 @@ ...@@ -291,5 +312,6 @@
<a class="layui-btn-xs" lay-event="updateTime">修改账户有效期</a> <a class="layui-btn-xs" lay-event="updateTime">修改账户有效期</a>
</div> </div>
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file \ No newline at end of file
...@@ -20,12 +20,17 @@ ...@@ -20,12 +20,17 @@
} }
.merchant-content #secondmerchantName { .merchant-content #secondmerchantName {
margin-left: 15px; margin-left: 15px;
width: 250px;
height: 24px; height: 24px;
font-size: 16px; font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 24px; line-height: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
} }
.merchant-content >div:not(:first-child) { .merchant-content >div:not(:first-child) {
...@@ -48,12 +53,18 @@ ...@@ -48,12 +53,18 @@
line-height: 40px; line-height: 40px;
} }
.merchant-right .companyName{ .merchant-right .companyName{
display: inline-block;
width: 300px;
height: 36px; height: 36px;
font-size: 16px; font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 36px; line-height: 36px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
} }
.merchant-right .layui-btn{ .merchant-right .layui-btn{
position: absolute; position: absolute;
...@@ -115,7 +126,7 @@ ...@@ -115,7 +126,7 @@
<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">
<div class="layui-form-mid layui-word-aux" id="merchantType"></div> <div class="layui-form-mid layui-word-aux" id="merchantTypeName"></div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
...@@ -168,7 +179,7 @@ ...@@ -168,7 +179,7 @@
<div class="merchant-headerMsg"> <div class="merchant-headerMsg">
<div class="merchantImg"><img src="../../css/img/merchantImg.png" alt=""></div> <div class="merchantImg"><img src="../../css/img/merchantImg.png" alt=""></div>
<div class="merchant-content"> <div class="merchant-content">
<div id="secondmerchantName"></div> <div id="secondmerchantName" ></div>
<div>商户号:<span id="secondmerchantId"></span></div> <div>商户号:<span id="secondmerchantId"></span></div>
<div>您共有<span id="numberOfSubMerchants"></span>个子商户,共有<span id="numberOfStores"></span>家门店</div> <div>您共有<span id="numberOfSubMerchants"></span>个子商户,共有<span id="numberOfStores"></span>家门店</div>
</div> </div>
...@@ -284,7 +295,7 @@ ...@@ -284,7 +295,7 @@
'accountLevelName', 'accountLevelName',
'merchantName', 'merchantName',
'merchantAbbreviation', 'merchantAbbreviation',
'merchantType', 'merchantTypeName',
'merchantOrgcode', 'merchantOrgcode',
'merchantAddress', 'merchantAddress',
'merchantLegalPerson', 'merchantLegalPerson',
...@@ -312,9 +323,13 @@ ...@@ -312,9 +323,13 @@
} }
request(params, function (res) { request(params, function (res) {
console.log(res, '账户信息') console.log(res, '账户信息')
// businessScopeCustomize
if (res.code == '0') { if (res.code == '0') {
roleData = helper.clone(true, res.data) roleData = helper.clone(true, res.data)
for (var i in basicArr) { for (var i in basicArr) {
if(basicArr[i] == 'businessScopName' && roleData.businessScopeCustomize) {
roleData.businessScopName = roleData.businessScopName ? (roleData.businessScopName + ',' + roleData.businessScopeCustomize) : roleData.businessScopeCustomize
}
$('#' + [basicArr[i]]).text(roleData[basicArr[i]] ? roleData[basicArr[i]] : '') $('#' + [basicArr[i]]).text(roleData[basicArr[i]] ? roleData[basicArr[i]] : '')
} }
callback(roleData.accountTypes) callback(roleData.accountTypes)
...@@ -393,10 +408,12 @@ ...@@ -393,10 +408,12 @@
console.log(res.data) console.log(res.data)
var data = res.data var data = res.data
$('#secondmerchantName').text(data.merchantName) $('#secondmerchantName').text(data.merchantName)
$('#secondmerchantName').attr('title',data.merchantName);
$('#secondmerchantId').text(data.merchantNo) $('#secondmerchantId').text(data.merchantNo)
$('#numberOfSubMerchants').text(data.numberOfSubMerchants) $('#numberOfSubMerchants').text(data.numberOfSubMerchants)
$('#numberOfStores').text(data.numberOfStores) $('#numberOfStores').text(data.numberOfStores)
$('#merchantNameTable').text(data.merchantName) $('#merchantNameTable').text(data.merchantName)
$('#merchantNameTable').attr('title',data.merchantName+'员工列表');
}) })
} }
...@@ -474,7 +491,7 @@ ...@@ -474,7 +491,7 @@
}) })
// 获取table列表接口 // 获取table列表接口
function getSecondTable(table, search, isResetPageNum = false) { function getSecondTable(table, search, isResetPageNum) {
var search = search || {} var search = search || {}
var params = helper.clone(false, { var params = helper.clone(false, {
method: 'cn.com.glsx.merchants.staff.findMerchantStaffList', method: 'cn.com.glsx.merchants.staff.findMerchantStaffList',
......
...@@ -10,26 +10,13 @@ ...@@ -10,26 +10,13 @@
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="/css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<style> <style>
.search-block { /*
padding: 8px 20px;
background-color: #ffffff;
}
.merchant .layui-table-view { .merchant .layui-table-view {
margin: 10px 20px; margin: -5px 20px;
}
/* .merchant .layui-table-cell {
height: auto;
overflow: visible;
text-overflow: inherit;
white-space: normal;
height: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} */ } */
.merchant .layui-table {
margin: 0;
}
.merchant #searchForm .layui-inline { .merchant #searchForm .layui-inline {
margin-bottom: 5px; margin-bottom: 5px;
...@@ -38,6 +25,9 @@ ...@@ -38,6 +25,9 @@
.layui-btn-xs { .layui-btn-xs {
cursor: pointer; cursor: pointer;
} }
.channel,.accountLevel,.accountType,.customerStatus,.searchInputBtn{
margin-left: 20px;
}
</style> </style>
<title>商户管理</title> <title>商户管理</title>
</head> </head>
...@@ -45,14 +35,13 @@ ...@@ -45,14 +35,13 @@
<body> <body>
<div class="merchant" id="app"> <div class="merchant" id="app">
<main class="bg-white"> <main class="bg-white">
<!-- <div id="tree"></div> -->
<div class="context-block"> <div class="context-block">
<div class="search-block"> <div class="search-block">
<form class="layui-form" lay-filter="searchFilter" id="searchForm"> <form class="layui-form layui-form-pane" lay-filter="searchFilter" id="searchForm">
<div class="layui-inline" id="operateEl"> <div class="layui-inline" id="operateEl">
<button class="layui-btn" id="addBtn"> <button class="layui-btn" id="addBtn">
<i class="layui-icon layui-icon-add-circle"></i> 创建商户</button> <i class="layui-icon layui-icon-add-circle"></i> 创建商户</button>
<div class="layui-inline"> <div class="layui-inline channel" pane>
<label class="layui-form-label">渠道:</label> <label class="layui-form-label">渠道:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="channelId" id="channelIdEl"> <select name="channelId" id="channelIdEl">
...@@ -60,7 +49,7 @@ ...@@ -60,7 +49,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline accountLevel" pane>
<label class="layui-form-label">账户等级:</label> <label class="layui-form-label">账户等级:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="merchantAccountLevel" id="accountLevelEl"> <select name="merchantAccountLevel" id="accountLevelEl">
...@@ -68,7 +57,7 @@ ...@@ -68,7 +57,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline accountType" pane>
<label class="layui-form-label">账户类型:</label> <label class="layui-form-label">账户类型:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="accounttypeId" id="accountTypeIdEl"> <select name="accounttypeId" id="accountTypeIdEl">
...@@ -77,18 +66,18 @@ ...@@ -77,18 +66,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline loginName" pane>
<div class="layui-input-inline" style="width: 120px;"> <div class="layui-input-inline" style="width: 120px;">
<select name="name" lay-filter="nameFilter"> <select name="name" lay-filter="nameFilter">
<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" style="width: 300px;"> <div class="layui-input-inline" style="width: 300px;margin-left: -5px;">
<input class="layui-input" placeholder="请输入" name="merchantLoginAccount"> <input class="layui-input" placeholder="请输入" name="merchantLoginAccount">
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline customerStatus" pane>
<label class="layui-form-label">客户状态:</label> <label class="layui-form-label">客户状态:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="status" id="searchStatusEl"> <select name="status" id="searchStatusEl">
...@@ -98,17 +87,19 @@ ...@@ -98,17 +87,19 @@
</div> </div>
<div style="float: right;"> <div style="float: right;">
<div class="layui-inline"> <div class="layui-inline">
<input class="layui-input" name="merchantName" placeholder="请输入客户名称"> <input class="layui-input" name="merchantName" placeholder="请输入商户名称">
</div> </div>
<div class="layui-inline"> <div class="layui-inline searchInputBtn">
<button class="layui-btn" lay-submit lay-filter="searchSubmit">查询</button> <button class="layui-btn" lay-submit lay-filter="searchSubmit">查询</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="table-page">
<table class="layui-table" id="merchantTable" lay-filter="merchant-table-filter"></table> <table class="layui-table" id="merchantTable" lay-filter="merchant-table-filter"></table>
<div id="merchantPage" class="align-center"></div> <div id="merchantPage" class="align-center"></div>
</div> </div>
</div>
</main> </main>
</div> </div>
...@@ -125,10 +116,9 @@ ...@@ -125,10 +116,9 @@
<li><span>{{item}}</span></li> <li><span>{{item}}</span></li>
<!-- <a class="layui-text" >{{d.accountTypeNames}}</a> --> <!-- <a class="layui-text" >{{d.accountTypeNames}}</a> -->
{{# }); }else{ }} {{# }); }else{ }}
<a class="layui-text" >-</a> <a class="layui-text">-</a>
{{# } }} {{# } }}
</ul> </ul>
</script> </script>
<script type="text/html" id="merchantBtns"> <script type="text/html" id="merchantBtns">
<div> <div>
...@@ -183,11 +173,10 @@ ...@@ -183,11 +173,10 @@
layout: ['count', 'page', 'skip'], layout: ['count', 'page', 'skip'],
jump: function (obj, first) { jump: function (obj, first) {
//obj包含了当前分页的所有参数,比如: //obj包含了当前分页的所有参数,比如:
console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。 // console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
console.log(obj.limit); //得到每页显示的条数 // console.log(obj.limit); //得到每页显示的条数
page.pageNum = obj.curr page.pageNum = obj.curr
page.pageSize = obj.limit page.pageSize = obj.limit
// getTabelList()
//首次不执行 //首次不执行
if (!first) { if (!first) {
//do something //do something
...@@ -199,10 +188,7 @@ ...@@ -199,10 +188,7 @@
var merchantTable = table.render({ var merchantTable = table.render({
elem: '#merchantTable', elem: '#merchantTable',
page: false, page: false,
skin:'line', skin: 'nob',
// done: function (res, curr, count) {
// console.log(res)
// },
cols: [ cols: [
[{ [{
field: 'index', field: 'index',
...@@ -221,6 +207,7 @@ ...@@ -221,6 +207,7 @@
field: 'accountTypeNames', field: 'accountTypeNames',
title: '账户类型', title: '账户类型',
align: 'left', align: 'left',
width: 100,
templet: '#accountTypeTpl' templet: '#accountTypeTpl'
}, { }, {
field: 'merchantLoginAccount', field: 'merchantLoginAccount',
...@@ -245,16 +232,18 @@ ...@@ -245,16 +232,18 @@
}, { }, {
field: 'merchantLegalPersonPhone', field: 'merchantLegalPersonPhone',
title: '手机号', title: '手机号',
align: 'center' align: 'center',
width: 100
}, { }, {
field: 'merchantAddress', field: 'merchantAddress',
title: '商户地址', title: '商户地址',
align: 'center', align: 'center',
width: 140 width: 160
}, { }, {
field: 'createdTime', field: 'createdTime',
title: '更新时间', title: '更新时间',
align: 'center' align: 'center',
width: 120
}, { }, {
align: 'left', align: 'left',
title: '操作', title: '操作',
...@@ -269,7 +258,7 @@ ...@@ -269,7 +258,7 @@
// console.log(obj) // console.log(obj)
var eventName = obj.event var eventName = obj.event
var row = obj.data var row = obj.data
console.log(row) // console.log(row)
switch (eventName) { switch (eventName) {
// 查看 // 查看
case 'handleDetail': case 'handleDetail':
...@@ -373,7 +362,7 @@ ...@@ -373,7 +362,7 @@
} }
// 获取表格数据 // 获取表格数据
function getTabelList(isResetPageNum = false) { function getTabelList(isResetPageNum) {
var params = { var params = {
pageNum: page.pageNum, pageNum: page.pageNum,
pageSize: page.pageSize, pageSize: page.pageSize,
...@@ -386,8 +375,7 @@ ...@@ -386,8 +375,7 @@
}) })
// console.log(params) // console.log(params)
request(params, function (res) { request(params, function (res) {
// console.log(res) var data = helper.formateNullFieldData(res.data)
var data = res.data
$.each(data.data, function (index, item) { $.each(data.data, function (index, item) {
item.index = index + 1 + page.pageSize * (page.pageNum - 1) item.index = index + 1 + page.pageSize * (page.pageNum - 1)
item.btn = { item.btn = {
...@@ -416,7 +404,7 @@ ...@@ -416,7 +404,7 @@
item.btn.createSubMerchant = true item.btn.createSubMerchant = true
} }
} else { // 下级商户 } else { // 下级商户
console.log(item) // console.log(item)
item.btn.edit = true item.btn.edit = true
item.btn.editPeriod = true item.btn.editPeriod = true
// 直属门店 // 直属门店
...@@ -430,9 +418,12 @@ ...@@ -430,9 +418,12 @@
} }
} else if (item.status != 3) { } else if (item.status != 3) {
item.btn.edit = true item.btn.edit = true
if (item.status == 4) {
item.btn.editPeriod = true
}
} }
} else { } else {
// 超管登陆 // 超管登录
if (item.status != 3) { if (item.status != 3) {
item.btn.edit = true item.btn.edit = true
} }
......
...@@ -9,18 +9,24 @@ ...@@ -9,18 +9,24 @@
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="/css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>角色管理</title> <title>角色管理</title>
<style>
.companyName,.searchBtn{
margin-left: 20px;
}
</style>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<main class="bg-white"> <main class="bg-white">
<div> <div>
<div class="search-block">
<form action="" class="layui-form layui-form-pane" lay-filter="roleForm"> <form action="" class="layui-form layui-form-pane" lay-filter="roleForm">
<div class="layui-form-item" pane> <div class="layui-form-item">
<button type="button" class="layui-btn layui-btn-normal" id="addRole" style="padding: 0 15px;"> <button type="button" class="layui-btn layui-btn-normal" id="addRole" style="padding: 0 15px;">
<i class="layui-icon layui-icon-add-circle"></i> <i class="layui-icon layui-icon-add-circle"></i>
创建角色 创建角色
</button> </button>
<div class="layui-inline" pane> <div class="layui-inline companyName" pane>
<label class="layui-form-label">商户名称</label> <label class="layui-form-label">商户名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="merchantId" id="merchantName" lay-verify="required"> <select name="merchantId" id="merchantName" lay-verify="required">
...@@ -34,13 +40,17 @@ ...@@ -34,13 +40,17 @@
<input type="text" name="roleName" placeholder="请输入角色名称" autocomplete="off" class="layui-input" /> <input type="text" name="roleName" placeholder="请输入角色名称" autocomplete="off" class="layui-input" />
</div> </div>
</div> </div>
<div class="layui-inline" pane> <div class="layui-inline searchBtn" pane >
<button type="button" class="layui-btn layui-btn-normal" id="roleSearch">查询</button> <button type="button" class="layui-btn layui-btn-normal" id="roleSearch">查询</button>
</div> </div>
</form> </form>
</div>
<div class="table-page">
<table id="roleTable" lay-filter="roleTool"></table> <table id="roleTable" lay-filter="roleTool"></table>
<div id="rolePage" class="align-center"></div> <div id="rolePage" class="align-center"></div>
</div> </div>
</div>
</main> </main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
...@@ -59,7 +69,7 @@ ...@@ -59,7 +69,7 @@
//创建table实例 //创建table实例
var roleTable = table.render({ var roleTable = table.render({
elem: '#roleTable', elem: '#roleTable',
skin:'line', skin:'nob',
cols: [ cols: [
[ [
//表头 //表头
...@@ -68,7 +78,7 @@ ...@@ -68,7 +78,7 @@
{ field: 'roleCode', title: '角色号', align: 'center' }, { field: 'roleCode', title: '角色号', align: 'center' },
{ field: 'merchantName', title: '所属商户名', align: 'center' }, { field: 'merchantName', title: '所属商户名', align: 'center' },
{ field: 'statusName', title: '状态', align: 'center' }, { field: 'statusName', title: '状态', align: 'center' },
{ field: 'updatedTime', title: '更新时间', align: 'center' }, { field: 'updatedTime', title: '更新时间', align: 'center' ,width: 120},
{ fixed: 'right', title: '操作', width: 160, align: 'center', toolbar: '#roleBar' } { fixed: 'right', title: '操作', width: 160, align: 'center', toolbar: '#roleBar' }
] ]
] ]
...@@ -100,7 +110,7 @@ ...@@ -100,7 +110,7 @@
getTabelList(roleTable) getTabelList(roleTable)
// 获取table列表接口 // 获取table列表接口
function getTabelList(table, search = {}, isResetPageNum) { function getTabelList(table, search , isResetPageNum) {
var params = helper.clone(false, { var params = helper.clone(false, {
pageNum: page.pageNum, pageNum: page.pageNum,
pageSize: page.pageSize, pageSize: page.pageSize,
...@@ -109,7 +119,8 @@ ...@@ -109,7 +119,8 @@
request(params, request(params,
function(res) { function(res) {
console.log(res) console.log(res)
var data = res.data // var data = res.data
var data = helper.formateNullFieldData(res.data)
var options = { var options = {
data: data.data data: data.data
} }
......
...@@ -43,8 +43,8 @@ layui.define(['store'], function (exports) { ...@@ -43,8 +43,8 @@ layui.define(['store'], function (exports) {
function debounce(fun, delay) { function debounce(fun, delay) {
return function (args) { return function (args) {
//获取函数的作用域和变量 //获取函数的作用域和变量
let that = this var that = this
let _args = args var _args = args
//每次事件被触发,都会清除当前的timeer,然后重写设置超时调用 //每次事件被触发,都会清除当前的timeer,然后重写设置超时调用
clearTimeout(fun.id) clearTimeout(fun.id)
fun.id = setTimeout(function () { fun.id = setTimeout(function () {
...@@ -52,9 +52,35 @@ layui.define(['store'], function (exports) { ...@@ -52,9 +52,35 @@ layui.define(['store'], function (exports) {
}, delay) }, delay)
} }
} }
//将后台返回数据中数值为空的字段全部替换为“-”
function formateNullFieldData (initialData) {
const isEmpty = function (val) {
if (String(val) === 'null') {
return '-';
}
return val;
}
if (initialData instanceof Array) {
initialData.forEach(function (val, key, array) {
array[key] = formateNullFieldData(val)
})
} else if (initialData instanceof Object) {
for (let pro in initialData) {
initialData[pro] = formateNullFieldData(initialData[pro])
}
} else {
//数据为基本类型时
initialData = isEmpty(initialData)
}
return initialData;
}
exports('helper', { exports('helper', {
clone: clone, clone: clone,
store: layui.store, store: layui.store,
debounce: debounce debounce: debounce,
formateNullFieldData:formateNullFieldData
}) })
}) })
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-07-15 15:46:53 * @Date: 2021-07-15 15:46:53
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-08-09 22:15:08 * @LastEditTime: 2021-08-11 11:46:34
* @FilePath: \account\js\load.js * @FilePath: \account\js\load.js
*/ */
;(function load() { ;(function load() {
...@@ -81,6 +81,7 @@ function loadConfig() { ...@@ -81,6 +81,7 @@ function loadConfig() {
}) })
} }
function goLogin() { function goLogin() {
if(!isAppend()) return
layui.use(['store'], function () { layui.use(['store'], function () {
layui.store.remove('external') layui.store.remove('external')
layui.store.remove('token') layui.store.remove('token')
......
This diff is collapsed. Click to expand it.
...@@ -74,7 +74,7 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -74,7 +74,7 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
success && success(result) success && success(result)
} else { } else {
msg(result.message) msg(result.message)
if(result.errId=='21'){ //TGT失效 if (result.errId == '21') { //TGT失效
goLogin && goLogin() goLogin && goLogin()
} }
} }
...@@ -112,8 +112,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -112,8 +112,8 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
} }
} }
arr.sort() arr.sort()
for (var key in arr) { for (var i = 0; i < arr.length; i++) {
var val = arr[key] var val = arr[i]
secretArr.push(val + params[val]) secretArr.push(val + params[val])
} }
var str = secretArr.join('') var str = secretArr.join('')
......
layui.define(['store'], function (exports) {
var validator = {
/* 手机号码格式校验正则 */
PHONEREG: /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/,
/* 同时包含字母和数字 */
ISNUMANDLETTERS: /^[a-zA-Z0-9]+$/,
/* 特殊字符正则 */
SPECIALLETTER: new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"),
/* 邮箱地址格式正则 */
// EMAILREG:/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/,
EMAILREG: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
/* 判断是否为中文 */
ISCHINESE: /^[\u0391-\uFFE5]+$/,
/* 判断是否为英文字母 */
ISENGLISH: /^[a-zA-Z]+$/,
/* 是否包含空格 */
ISHAVENULL: /^[^\s]*$/,
/* 保留两位小数 */
TWODECIMAL: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
/* 判断是否为正整数 */
ISDECIMAL: /^[0-9]*$/,
/**
* 账号管理-手机号码校验
*/
checkPhoneNumber: function (str) {
return validator.PHONEREG.test(str)
},
// 判断是否含有数字或字母
checkNumOrLetters: function (str) {
return validator.ISNUMANDLETTERS.test(str)
},
// 身份证验证
// checkIdCard: function (code) {
// var city = {
// 11: '北京',
// 12: '天津',
// 13: '河北',
// 14: '山西',
// 15: '内蒙古',
// 21: '辽宁',
// 22: '吉林',
// 23: '黑龙江',
// 31: '上海',
// 32: '江苏',
// 33: '浙江',
// 34: '安徽',
// 35: '福建',
// 36: '江西',
// 37: '山东',
// 41: '河南',
// 42: '湖北',
// 43: '湖南',
// 44: '广东',
// 45: '广西',
// 46: '海南',
// 50: '重庆',
// 51: '四川',
// 52: '贵州',
// 53: '云南',
// 54: '西藏',
// 61: '陕西',
// 62: '甘肃',
// 63: '青海',
// 64: '宁夏',
// 65: '新疆',
// 71: '台湾',
// 81: '香港',
// 82: '澳门',
// 91: '国外 '
// }
// // var tip = ''
// var pass = true
// // 身份证位数为15或18位
// // if (![15, 18].includes(code.length)) {
// if ((code.length != 15) || (code.length != 18)) {
// pass = false
// } else if (!code || (code.length === 18 && !/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code))) {
// // tip = '身份证号格式错误'
// pass = false
// } else if (code.length === 15 && !/^\d{6}\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}$/i.test(code)) {
// pass = false
// } else if (!city[code.substr(0, 2)]) {
// // tip = '地址编码错误'
// pass = false
// } else {
// // 18位身份证需要验证最后一位校验位
// if (code.length === 18) {
// code = code.split('')
// // ∑(ai×Wi)(mod 11)
// // 加权因子
// var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
// // 校验位
// var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
// var sum = 0
// var ai = 0
// var wi = 0
// for (var i = 0; i < 17; i++) {
// ai = code[i]
// wi = factor[i]
// sum += ai * wi
// }
// // var last = parity[sum % 11]
// if (parity[sum % 11] != code[17]) {
// // tip = '校验位错误'
// pass = false
// }
// }
// }
// // if (!pass) alert(tip)
// return pass
// }
}
exports('validator', validator)
})
\ No newline at end of file \ No newline at end of file
...@@ -65,22 +65,15 @@ ...@@ -65,22 +65,15 @@
var helper = layui.helper var helper = layui.helper
//监听提交 //监听提交
form.on('submit(formLogin)', function (data) { form.on('submit(formLogin)', function (data) {
var params = helper.clone(false, { method: 'org.ore.api.example.login' }, data.field) var params = helper.clone(false, {
method: 'org.ore.api.example.login'
}, data.field)
request(params, function (result) { request(params, function (result) {
if (result.code == '0') { if (result.code == '0') {
var sessionId = result.data.sessionId var sessionId = result.data.sessionId
helper.store.set('token', sessionId) helper.store.set('token', sessionId)
helper.store.set('user', result.data) helper.store.set('user', result.data)
go('merchant', 'index') go('merchant', 'index')
// function() {
console.log(isAppend())
if (isAppend()) {
console.log('_------')
var user = helper.store.get('user')
console.log(user)
document.getElementById('curMerchantName').innerHTML = user.merchantName || "";
}
// }
} }
}) })
return false return false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!