Commit b55dac2e by 胡悦

Merge branch 'master' of 192.168.3.233:h5/account

2 parents dab2e418 d5b9c01f
...@@ -15,9 +15,11 @@ ...@@ -15,9 +15,11 @@
.pull-right { .pull-right {
float: right; float: right;
} }
.merchant-headerMsg{
.merchant-headerMsg {
display: flex; display: flex;
} }
.merchant-content #secondmerchantName { .merchant-content #secondmerchantName {
margin-left: 15px; margin-left: 15px;
width: 250px; width: 250px;
...@@ -33,7 +35,7 @@ ...@@ -33,7 +35,7 @@
word-break: break-all; word-break: break-all;
} }
.merchant-content >div:not(:first-child) { .merchant-content>div:not(:first-child) {
margin-left: 15px; margin-left: 15px;
height: 20px; height: 20px;
font-size: 12px; font-size: 12px;
...@@ -46,16 +48,19 @@ ...@@ -46,16 +48,19 @@
.layui-form { .layui-form {
margin-top: 20px; margin-top: 20px;
} }
.merchant-right{
overflow-x: auto; .merchant-right {
width: calc(100vw - 500px - 20px); overflow-x: auto;
width: calc(100vw - 500px - 20px);
} }
.merchant-right > div:first-child {
position: relative; .merchant-right>div:first-child {
height: 40px; position: relative;
line-height: 40px; height: 40px;
line-height: 40px;
} }
.merchant-right .companyName{
.merchant-right .companyName {
display: inline-block; display: inline-block;
width: 300px; width: 300px;
height: 36px; height: 36px;
...@@ -69,34 +74,40 @@ ...@@ -69,34 +74,40 @@
white-space: nowrap; white-space: nowrap;
word-break: break-all; word-break: break-all;
} }
.merchant-right .layui-btn{
.merchant-right .layui-btn {
position: absolute; position: absolute;
right: 0; right: 0;
} }
.merchant-right .layui-input-inline{
.merchant-right .layui-input-inline {
position: absolute; position: absolute;
right: 80px; right: 80px;
} }
.updateRecord{
.updateRecord {
text-align: center; text-align: center;
color: #999; color: #999;
} }
.mb21{
.mb21 {
margin-bottom: 21px; margin-bottom: 21px;
} }
.bg-detail{
background-color: #fff!important; .bg-detail {
background-color: #fff !important;
} }
.tabmutiple-content{
.tabmutiple-content {
margin: 0 20px; margin: 0 20px;
} }
.fixed-btn { .fixed-btn {
position: fixed; position: fixed;
bottom: 30px; bottom: 30px;
} }
</style> </style>
</head> </head>
...@@ -194,7 +205,7 @@ ...@@ -194,7 +205,7 @@
<h3 class="content-title"> <h3 class="content-title">
功能权限 功能权限
</h3> </h3>
<div class="layui-tab tabmutiple-content" lay-filter="roleAuth"> <div class="layui-tab tabmutiple-content" lay-filter="roleAuth">
<ul class="layui-tab-title"></ul> <ul class="layui-tab-title"></ul>
<div class="layui-tab-content"></div> <div class="layui-tab-content"></div>
</div> </div>
...@@ -205,26 +216,26 @@ ...@@ -205,26 +216,26 @@
<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>
</div> </div>
<form class="layui-form" action=""> <form class="layui-form" action="">
<div class="layui-inline"> <div class="layui-inline">
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" placeholder="请输入" name="nameVal" /> <input class="layui-input" id="treeInput" placeholder="请输入" name="nameVal" />
</div> </div>
<button class="layui-btn">查询</button> <button type="button" id="merchantBtn" class="layui-btn">查询</button>
</div> </div>
</form> </form>
<ul id="merchantTree" class="ztree wrapper-tree"></ul> <ul id="merchantTree" class="ztree wrapper-tree"></ul>
</div> </div>
<div class="merchant-right"> <div class="merchant-right">
<div> <div>
<span class="companyName"> <span id="merchantNameTable"></span>员工列表</span> <span class="companyName"> <span id="merchantNameTable"></span>员工列表</span>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" placeholder="请输入员工姓名/手机号" id="tableSearchForm" /> <input class="layui-input" placeholder="请输入员工姓名/手机号" id="tableSearchForm" />
</div> </div>
...@@ -235,7 +246,7 @@ ...@@ -235,7 +246,7 @@
</div> </div>
</div> </div>
<div class="layui-tab-item updateRecord"> <div class="layui-tab-item updateRecord">
<span class="no-data" > 暂无记录</span> <span class="no-data"> 暂无记录</span>
<!-- <ul class="layui-timeline"> <!-- <ul class="layui-timeline">
<li class="layui-timeline-item"> <li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis">&#xe63f;</i> <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
...@@ -354,8 +365,9 @@ ...@@ -354,8 +365,9 @@
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) { if (basicArr[i] == 'businessScopName' && roleData.businessScopeCustomize) {
roleData.businessScopName = roleData.businessScopName ? (roleData.businessScopName + ',' + roleData.businessScopeCustomize) : 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]] : '无')
} }
...@@ -437,28 +449,45 @@ ...@@ -437,28 +449,45 @@
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); $('#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+'员工列表'); $('#merchantNameTable').attr('title', data.merchantName + '员工列表');
}) })
} }
var all_nodes = null
var merchants = null
// 上下级商户 - 树 // 上下级商户 - 树
function getSecondTree() { function getSecondTree() {
var treeParams = { var treeParams = {
id: merchantId, id: merchantId,
method: 'cn.com.glsx.merchants.merchant.findMerchantTree' method: 'cn.com.glsx.merchants.merchant.findMerchantTree'
} }
var merchants = {}
request(treeParams, function (res) { request(treeParams, function (res) {
if (res.code == '0') { if (res.code == '0') {
merchants = tree.create('merchantTree', res.data, null, false) merchants = tree.create('merchantTree', res.data, null, false)
merchants.expandAll(true) merchants.expandAll(true)
all_nodes = merchants.getNodes()
bindEvent()
}
})
}
function bindEvent() {
$('#merchantBtn').on('click', function () {
var txt = $('#treeInput').val()
if (!txt) {
merchants.showNodes(all_nodes)
} else {
var show_nodes = merchants.getNodesByParamFuzzy('label', txt)
merchants.hideNodes(all_nodes)
merchants.showNodes(show_nodes)
} }
}) })
return false
} }
// 列表配置 // 列表配置
...@@ -467,41 +496,41 @@ ...@@ -467,41 +496,41 @@
page: true, page: true,
cols: [ cols: [
[{ [{
field: '', field: '',
title: '序号', title: '序号',
type: 'numbers', type: 'numbers',
width: 80 width: 80
}, },
{ {
field: 'staffName', field: 'staffName',
title: '员工姓名', title: '员工姓名',
width: 200, width: 200,
align: 'center' align: 'center'
}, },
{ {
field: 'roleName', field: 'roleName',
title: '角色', title: '角色',
width: 200, width: 200,
align: 'center' align: 'center'
}, },
{ {
field: 'staffPhone', field: 'staffPhone',
title: '登录账户', title: '登录账户',
width: 200, width: 200,
align: 'center' align: 'center'
}, },
{ {
field: 'createdAccount', field: 'createdAccount',
title: '创建者', title: '创建者',
width: 200, width: 200,
align: 'center' align: 'center'
}, },
{ {
field: 'createdTime', field: 'createdTime',
title: '创建时间', title: '创建时间',
width: 200, width: 200,
align: 'center' align: 'center'
} }
] ]
] ]
}) })
...@@ -513,6 +542,7 @@ ...@@ -513,6 +542,7 @@
getSecondTable(subMerchantTable, { getSecondTable(subMerchantTable, {
keyword: search keyword: search
}) })
return false
}) })
$('#closeEl').on('click', function () { $('#closeEl').on('click', function () {
......
...@@ -25,7 +25,12 @@ ...@@ -25,7 +25,12 @@
.layui-btn-xs { .layui-btn-xs {
cursor: pointer; cursor: pointer;
} }
.channel,.accountLevel,.accountType,.customerStatus,.searchInputBtn{
.channel,
.accountLevel,
.accountType,
.customerStatus,
.searchInputBtn {
margin-left: 20px; margin-left: 20px;
} }
</style> </style>
...@@ -68,7 +73,7 @@ ...@@ -68,7 +73,7 @@
</div> </div>
<div class="layui-inline loginName" pane> <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="accountOrPhone" lay-filter="nameFilter">
<option value="0">账号登录名</option> <option value="0">账号登录名</option>
<option value="1">手机号</option> <option value="1">手机号</option>
</select> </select>
...@@ -188,7 +193,7 @@ ...@@ -188,7 +193,7 @@
var merchantTable = table.render({ var merchantTable = table.render({
elem: '#merchantTable', elem: '#merchantTable',
page: false, page: false,
skin: 'nob', skin: 'nob',
cols: [ cols: [
[{ [{
field: 'index', field: 'index',
...@@ -319,7 +324,8 @@ ...@@ -319,7 +324,8 @@
fixed: false, //不固定 fixed: false, //不固定
// maxmin: true, // maxmin: true,
btn: ['确定', '取消'], btn: ['确定', '取消'],
content: 'validPeriodForm.html?id=' + row.id + '&effectiveTime=' + row.effectiveTime, content: 'validPeriodForm.html?id=' + row.id + '&effectiveTime=' + row.effectiveTime +
'&merchantAccountLevel=' + row.merchantAccountLevel + '&status=' + row.status,
yes: function (index, layero) { yes: function (index, layero) {
var body = layer.getChildFrame('body', index) var body = layer.getChildFrame('body', index)
helper.store.set('isRefresh', false) helper.store.set('isRefresh', false)
...@@ -372,11 +378,16 @@ ...@@ -372,11 +378,16 @@
var searchData = $('#searchForm [name]').serializeArray() var searchData = $('#searchForm [name]').serializeArray()
// console.log(searchData) // console.log(searchData)
$.each(searchData, function () { $.each(searchData, function () {
params[this.name] = this.value if (this.name == 'merchantLoginAccount') {
var attrName = params.accountOrPhone == '0' ? 'merchantLoginAccount' : 'merchantLegalPersonPhone'
params[attrName] = this.value
} else {
params[this.name] = this.value
}
}) })
// console.log(params) // console.log(params)
request(params, function (res) { request(params, function (res) {
var data = helper.formateNullFieldData(res.data) var data = helper.formateNullFieldData(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 = {
......
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
id: getQueryString('id'), id: getQueryString('id'),
effectiveTime: getQueryString('effectiveTime') effectiveTime: getQueryString('effectiveTime')
} }
// 1-工厂;2-省代;3-市代;4-门店
var merchantAccountLevel = getQueryString('merchantAccountLevel')
// 1-草稿;2-正常;3-注销;4-过期
var status = getQueryString('status')
getVaildPeriod() getVaildPeriod()
...@@ -89,7 +93,31 @@ ...@@ -89,7 +93,31 @@
baseData.effectiveTimeList = res.data baseData.effectiveTimeList = res.data
var periodSelect = $('#periodSelect') var periodSelect = $('#periodSelect')
$.each(baseData.effectiveTimeList, function (index, item) { $.each(baseData.effectiveTimeList, function (index, item) {
periodSelect.append(new Option(item.dictLabel, item.dictValue)) // 工厂
if (merchantAccountLevel == 1) {
// 状态 - 正常
if (status == 2) {
// 永久有效
if (vaildData.effectiveTime == 0) {
if (item.dictValue == -1) {
periodSelect.append(new Option(item.dictLabel, item.dictValue))
}
} else if ((item.dictValue == 0) ||
(item.dictValue == -1) ||
(vaildData.effectiveTime < item.dictValue)) {
periodSelect.append(new Option(item.dictLabel, item.dictValue))
}
} else {
// 状态 - 过期/注销
if (vaildData.effectiveTime != item.dictValue) {
periodSelect.append(new Option(item.dictLabel, item.dictValue))
}
}
} else {
if ((item.dictValue == 0) || (item.dictValue == -1)) {
periodSelect.append(new Option(item.dictLabel, item.dictValue))
}
}
}) })
form.val('periodFilter', { form.val('periodFilter', {
effectiveTime: vaildData.effectiveTime effectiveTime: vaildData.effectiveTime
......
...@@ -25,9 +25,12 @@ layui.define(['ztree'], function (exports) { ...@@ -25,9 +25,12 @@ layui.define(['ztree'], function (exports) {
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
if (inst) { var i= setInterval(function(){
inst.updateNode(treeNode) if (inst) {
} clearInterval(i)
inst.updateNode(treeNode)
}
},20)
} }
} }
if (gtree.opt && gtree.opt.chkDisabled) { if (gtree.opt && gtree.opt.chkDisabled) {
......
...@@ -41,85 +41,85 @@ layui.define(['store'], function (exports) { ...@@ -41,85 +41,85 @@ layui.define(['store'], function (exports) {
}, },
// 身份证验证 // 身份证验证
// checkIdCard: function (code) { checkIdCard: function (code) {
// var city = { var city = {
// 11: '北京', 11: '北京',
// 12: '天津', 12: '天津',
// 13: '河北', 13: '河北',
// 14: '山西', 14: '山西',
// 15: '内蒙古', 15: '内蒙古',
// 21: '辽宁', 21: '辽宁',
// 22: '吉林', 22: '吉林',
// 23: '黑龙江', 23: '黑龙江',
// 31: '上海', 31: '上海',
// 32: '江苏', 32: '江苏',
// 33: '浙江', 33: '浙江',
// 34: '安徽', 34: '安徽',
// 35: '福建', 35: '福建',
// 36: '江西', 36: '江西',
// 37: '山东', 37: '山东',
// 41: '河南', 41: '河南',
// 42: '湖北', 42: '湖北',
// 43: '湖南', 43: '湖南',
// 44: '广东', 44: '广东',
// 45: '广西', 45: '广西',
// 46: '海南', 46: '海南',
// 50: '重庆', 50: '重庆',
// 51: '四川', 51: '四川',
// 52: '贵州', 52: '贵州',
// 53: '云南', 53: '云南',
// 54: '西藏', 54: '西藏',
// 61: '陕西', 61: '陕西',
// 62: '甘肃', 62: '甘肃',
// 63: '青海', 63: '青海',
// 64: '宁夏', 64: '宁夏',
// 65: '新疆', 65: '新疆',
// 71: '台湾', 71: '台湾',
// 81: '香港', 81: '香港',
// 82: '澳门', 82: '澳门',
// 91: '国外 ' 91: '国外 '
// } }
// // var tip = '' // var tip = ''
// var pass = true var pass = true
// // 身份证位数为15或18位 // 身份证位数为15或18位
// // if (![15, 18].includes(code.length)) { // if (![15, 18].includes(code.length)) {
// if ((code.length != 15) || (code.length != 18)) { if ((code.length != 15) || (code.length != 18)) {
// pass = false 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))) { } 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 = '身份证号格式错误' // tip = '身份证号格式错误'
// pass = false 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)) { } 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 pass = false
// } else if (!city[code.substr(0, 2)]) { } else if (!city[code.substr(0, 2)]) {
// // tip = '地址编码错误' // tip = '地址编码错误'
// pass = false pass = false
// } else { } else {
// // 18位身份证需要验证最后一位校验位 // 18位身份证需要验证最后一位校验位
// if (code.length === 18) { if (code.length === 18) {
// code = code.split('') code = code.split('')
// // ∑(ai×Wi)(mod 11) // ∑(ai×Wi)(mod 11)
// // 加权因子 // 加权因子
// var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] 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 parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
// var sum = 0 var sum = 0
// var ai = 0 var ai = 0
// var wi = 0 var wi = 0
// for (var i = 0; i < 17; i++) { for (var i = 0; i < 17; i++) {
// ai = code[i] ai = code[i]
// wi = factor[i] wi = factor[i]
// sum += ai * wi sum += ai * wi
// } }
// // var last = parity[sum % 11] // var last = parity[sum % 11]
// if (parity[sum % 11] != code[17]) { if (parity[sum % 11] != code[17]) {
// // tip = '校验位错误' // tip = '校验位错误'
// pass = false pass = false
// } }
// } }
// } }
// // if (!pass) alert(tip) // if (!pass) alert(tip)
// return pass return pass
// } }
} }
exports('validator', validator) exports('validator', validator)
}) })
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!