Commit b55dac2e by 胡悦

Merge branch 'master' of 192.168.3.233:h5/account

2 parents dab2e418 d5b9c01f
......@@ -15,9 +15,11 @@
.pull-right {
float: right;
}
.merchant-headerMsg{
.merchant-headerMsg {
display: flex;
}
.merchant-content #secondmerchantName {
margin-left: 15px;
width: 250px;
......@@ -33,7 +35,7 @@
word-break: break-all;
}
.merchant-content >div:not(:first-child) {
.merchant-content>div:not(:first-child) {
margin-left: 15px;
height: 20px;
font-size: 12px;
......@@ -46,16 +48,19 @@
.layui-form {
margin-top: 20px;
}
.merchant-right{
.merchant-right {
overflow-x: auto;
width: calc(100vw - 500px - 20px);
}
.merchant-right > div:first-child {
.merchant-right>div:first-child {
position: relative;
height: 40px;
line-height: 40px;
}
.merchant-right .companyName{
.merchant-right .companyName {
display: inline-block;
width: 300px;
height: 36px;
......@@ -69,34 +74,40 @@
white-space: nowrap;
word-break: break-all;
}
.merchant-right .layui-btn{
.merchant-right .layui-btn {
position: absolute;
right: 0;
}
.merchant-right .layui-input-inline{
.merchant-right .layui-input-inline {
position: absolute;
right: 80px;
}
.updateRecord{
.updateRecord {
text-align: center;
color: #999;
}
.mb21{
.mb21 {
margin-bottom: 21px;
}
.bg-detail{
background-color: #fff!important;
.bg-detail {
background-color: #fff !important;
}
.tabmutiple-content{
.tabmutiple-content {
margin: 0 20px;
}
.fixed-btn {
position: fixed;
bottom: 30px;
}
</style>
</head>
......@@ -205,7 +216,7 @@
<div class="merchant-headerMsg">
<div class="merchantImg"><img src="../../css/img/merchantImg.png" alt=""></div>
<div class="merchant-content">
<div id="secondmerchantName" ></div>
<div id="secondmerchantName"></div>
<div>商户号:<span id="secondmerchantId"></span></div>
<div>您共有<span id="numberOfSubMerchants"></span>个子商户,共有<span id="numberOfStores"></span>家门店</div>
</div>
......@@ -215,9 +226,9 @@
<form class="layui-form" action="">
<div class="layui-inline">
<div class="layui-input-inline">
<input class="layui-input" placeholder="请输入" name="nameVal" />
<input class="layui-input" id="treeInput" placeholder="请输入" name="nameVal" />
</div>
<button class="layui-btn">查询</button>
<button type="button" id="merchantBtn" class="layui-btn">查询</button>
</div>
</form>
<ul id="merchantTree" class="ztree wrapper-tree"></ul>
......@@ -235,7 +246,7 @@
</div>
</div>
<div class="layui-tab-item updateRecord">
<span class="no-data" > 暂无记录</span>
<span class="no-data"> 暂无记录</span>
<!-- <ul class="layui-timeline">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
......@@ -354,8 +365,9 @@
if (res.code == '0') {
roleData = helper.clone(true, res.data)
for (var i in basicArr) {
if(basicArr[i] == 'businessScopName' && roleData.businessScopeCustomize) {
roleData.businessScopName = roleData.businessScopName ? (roleData.businessScopName + ',' + roleData.businessScopeCustomize) : roleData.businessScopeCustomize
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]] : '无')
}
......@@ -437,28 +449,45 @@
console.log(res.data)
var data = res.data
$('#secondmerchantName').text(data.merchantName)
$('#secondmerchantName').attr('title',data.merchantName);
$('#secondmerchantName').attr('title', data.merchantName);
$('#secondmerchantId').text(data.merchantNo)
$('#numberOfSubMerchants').text(data.numberOfSubMerchants)
$('#numberOfStores').text(data.numberOfStores)
$('#merchantNameTable').text(data.merchantName)
$('#merchantNameTable').attr('title',data.merchantName+'员工列表');
$('#merchantNameTable').attr('title', data.merchantName + '员工列表');
})
}
var all_nodes = null
var merchants = null
// 上下级商户 - 树
function getSecondTree() {
var treeParams = {
id: merchantId,
method: 'cn.com.glsx.merchants.merchant.findMerchantTree'
}
var merchants = {}
request(treeParams, function (res) {
if (res.code == '0') {
merchants = tree.create('merchantTree', res.data, null, false)
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
}
// 列表配置
......@@ -513,6 +542,7 @@
getSecondTable(subMerchantTable, {
keyword: search
})
return false
})
$('#closeEl').on('click', function () {
......
......@@ -25,7 +25,12 @@
.layui-btn-xs {
cursor: pointer;
}
.channel,.accountLevel,.accountType,.customerStatus,.searchInputBtn{
.channel,
.accountLevel,
.accountType,
.customerStatus,
.searchInputBtn {
margin-left: 20px;
}
</style>
......@@ -68,7 +73,7 @@
</div>
<div class="layui-inline loginName" pane>
<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="1">手机号</option>
</select>
......@@ -319,7 +324,8 @@
fixed: false, //不固定
// maxmin: true,
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) {
var body = layer.getChildFrame('body', index)
helper.store.set('isRefresh', false)
......@@ -372,7 +378,12 @@
var searchData = $('#searchForm [name]').serializeArray()
// console.log(searchData)
$.each(searchData, function () {
if (this.name == 'merchantLoginAccount') {
var attrName = params.accountOrPhone == '0' ? 'merchantLoginAccount' : 'merchantLegalPersonPhone'
params[attrName] = this.value
} else {
params[this.name] = this.value
}
})
// console.log(params)
request(params, function (res) {
......
......@@ -51,6 +51,10 @@
id: getQueryString('id'),
effectiveTime: getQueryString('effectiveTime')
}
// 1-工厂;2-省代;3-市代;4-门店
var merchantAccountLevel = getQueryString('merchantAccountLevel')
// 1-草稿;2-正常;3-注销;4-过期
var status = getQueryString('status')
getVaildPeriod()
......@@ -89,7 +93,31 @@
baseData.effectiveTimeList = res.data
var periodSelect = $('#periodSelect')
$.each(baseData.effectiveTimeList, function (index, item) {
// 工厂
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', {
effectiveTime: vaildData.effectiveTime
......
......@@ -25,9 +25,12 @@ layui.define(['ztree'], function (exports) {
var p = gtree.opt.checkedList
if (p.indexOf(treeNode.id) != -1) {
treeNode.checked = true
var i= setInterval(function(){
if (inst) {
clearInterval(i)
inst.updateNode(treeNode)
}
},20)
}
}
if (gtree.opt && gtree.opt.chkDisabled) {
......
......@@ -41,85 +41,85 @@ layui.define(['store'], function (exports) {
},
// 身份证验证
// 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
// }
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!