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{
.merchant-right {
overflow-x: auto; overflow-x: auto;
width: calc(100vw - 500px - 20px); width: calc(100vw - 500px - 20px);
} }
.merchant-right > div:first-child {
.merchant-right>div:first-child {
position: relative; position: relative;
height: 40px; height: 40px;
line-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>
...@@ -205,7 +216,7 @@ ...@@ -205,7 +216,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>
...@@ -215,9 +226,9 @@ ...@@ -215,9 +226,9 @@
<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>
...@@ -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
} }
// 列表配置 // 列表配置
...@@ -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 () {
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0);
} }
.edit-box .m-t-10 {
margin-top: 10px;
}
.edit-box .upload-img-wh { .edit-box .upload-img-wh {
width: 120px !important; width: 120px !important;
height: 80px; height: 80px;
...@@ -89,6 +93,7 @@ ...@@ -89,6 +93,7 @@
width: 16px; width: 16px;
border-radius: 50%; border-radius: 50%;
} }
.tips { .tips {
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
...@@ -96,6 +101,13 @@ ...@@ -96,6 +101,13 @@
margin-left: 160px; margin-left: 160px;
} }
.form-right {
position: absolute;
right: 0;
top: 0;
transform: translateX(110%);
}
.edit-box #accountTypeEl .layui-form-checked span, .edit-box #accountTypeEl .layui-form-checked span,
#accountTypeEl .layui-form-checked:hover span { #accountTypeEl .layui-form-checked:hover span {
background-color: #1989FA !important; background-color: #1989FA !important;
...@@ -267,35 +279,38 @@ ...@@ -267,35 +279,38 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<span class="tips" >图片格式仅支持JPG,PNG格式,大小1M以内</span> <span class="tips">图片格式仅支持JPG,PNG格式,大小1M以内</span>
</div> </div>
<p class="edit-title">账户基本信息</p> <p class="edit-title">账户基本信息</p>
<div id="subMerchantEl"> <div id="subMerchantEl">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">上级商户:</label> <label class="layui-form-label required">上级商户:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input layui-btn-disabled" name="parentName" placeholder="请输入上级商户" disabled> <!-- <input class="layui-input layui-btn-disabled" name="parentName" placeholder="请输入上级商户" disabled> -->
<div class="m-t-10" id="parentName"></div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">账户类型:</label> <label class="layui-form-label required">账户类型:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input layui-btn-disabled" name="parentAccountTypeName" placeholder="请输入账户类型"> <!-- <input class="layui-input layui-btn-disabled" name="parentAccountTypeName" placeholder="请输入账户类型"> -->
<div class="m-t-10" id="parentAccountTypeName"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">登录账户名:</label> <label class="layui-form-label required">登录账户名:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" name="merchantLoginAccount" maxlength="15" placeholder="请输入登录账户名" required <input class="layui-input" id="merchantLoginAccountEl" name="merchantLoginAccount" maxlength="15"
lay-verify="required"> placeholder="请输入登录账户名" required lay-verify="required|merchantLoginAccount">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">登录密码:</label> <label class="layui-form-label required">登录密码:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" type="password" name="merchantLoginPassword" maxlength="15" <input class="layui-input" type="password" id="password" name="merchantLoginPassword" maxlength="15"
placeholder="请输入登录密码" required lay-verify="required"> placeholder="请输入登录密码" required lay-verify="required|merchantLoginPassword">
<button type="button" class="layui-btn form-right" id="resetpsw">重置密码</button>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
...@@ -372,6 +387,7 @@ ...@@ -372,6 +387,7 @@
// 是否工厂 // 是否工厂
var isFactory = true var isFactory = true
var parentInfo = {} var parentInfo = {}
var isFreshSecond = true
var merchantForm = { var merchantForm = {
channelId: '', channelId: '',
...@@ -430,6 +446,22 @@ ...@@ -430,6 +446,22 @@
lay('#endDate').html(value) lay('#endDate').html(value)
} }
}) })
editLevel = qs('editLevel')
isFactory = (qs('isFactory') == 'true')
step = qs('step')
var pwd = $('#password') // 密码输入框
var resetpsw = $('#resetpsw')
// pwd.attr('readonly', false)
// if (id) {
// resetpsw.removeClass('hide')
// resetpsw.addClass('show')
// }
// 重置密码
resetpsw.on('click', function () {
pwd.attr('readonly', false)
pwd.val('')
})
init() init()
// helper.store.set('merchantMapObj', { // helper.store.set('merchantMapObj', {
...@@ -442,9 +474,22 @@ ...@@ -442,9 +474,22 @@
// console.log(validator.PHONEREG) // console.log(validator.PHONEREG)
// 校验 // 校验
form.verify({ form.verify({
// merchantOrgcode: function(value) { // merchantOrgcode: function (value) {
// var merchantType = $('#merchantTypeEl option:selected').val()
// if(value && (merchantType == '1') && !validator.checkIdCard(value)) {
// return '请填入正确的身份证'
// }
// }, // },
merchantLoginAccount: function (value) {
if (value && value.length < 3) {
return '登录账户名请填入3-15位字符'
}
},
merchantLoginPassword: function (value) {
if (value && value.length < 6) {
return '登录账户名请填入6-15位字符'
}
},
residentPhone: function (value) { residentPhone: function (value) {
if (value && !validator.checkPhoneNumber(value)) { if (value && !validator.checkPhoneNumber(value)) {
return '请填入正确的驻店电话' return '请填入正确的驻店电话'
...@@ -523,20 +568,27 @@ ...@@ -523,20 +568,27 @@
if (merchantForm.merchantFiles.length) { if (merchantForm.merchantFiles.length) {
params.merchantFiles = JSON.stringify(merchantForm.merchantFiles) params.merchantFiles = JSON.stringify(merchantForm.merchantFiles)
} }
if (editLevel == 1) { if (merchantId) {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant' params.id = merchantId
} else if (editLevel == 2) {
if (!isFactory) { if (!isFactory) {
params.parentId = parentInfo.parentId params.parentId = parentInfo.parentId
} }
params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
} else if (editLevel == 1) {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant' params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
} else if (editLevel == 3) { } else if (editLevel == 2) {
params.id = merchantId
if (!isFactory) { if (!isFactory) {
params.parentId = parentInfo.parentId params.parentId = parentInfo.parentId
} }
params.method = 'cn.com.glsx.merchants.merchant.updateMerchant' params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
} }
// else if (editLevel == 3) {
// params.id = merchantId
// if (!isFactory) {
// params.parentId = parentInfo.parentId
// }
// params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
// }
// 保存状态 1.草稿 2.发布 3.注销 4.过期 // 保存状态 1.草稿 2.发布 3.注销 4.过期
if (merchantForm.status) { if (merchantForm.status) {
params.status = merchantForm.status params.status = merchantForm.status
...@@ -555,14 +607,26 @@ ...@@ -555,14 +607,26 @@
}) })
go('merchant', 'index') go('merchant', 'index')
} else { } else {
if (!merchantId) {
merchantId = res.data merchantId = res.data
}
merchantForm.merchantAccountLevel = parseInt(merchantForm.merchantAccountLevel) merchantForm.merchantAccountLevel = parseInt(merchantForm.merchantAccountLevel)
getMerchantApi(merchantId, function (respone) { getMerchantApi(merchantId, function (respone) {
form.val('merchantForm', respone.data) form.val('merchantForm', respone.data)
merchantForm = respone.data merchantForm = respone.data
accountTypeVisible = true
var el = $('#accountTypeEl')
el.empty()
// recoveryBusiScopeCus()
// getCarBrandTree()
recoveryFile()
getAccountType()
baseIsShow(false) baseIsShow(false)
treeIsShow(true) treeIsShow(true)
if (isFreshSecond) {
getById() getById()
isFreshSecond = false
}
}) })
} }
} }
...@@ -724,52 +788,69 @@ ...@@ -724,52 +788,69 @@
} }
function init() { function init() {
editLevel = qs('editLevel')
isFactory = (qs('isFactory') == 'true') getChannel()
step = qs('step') getPeriod()
if (step == 1) { if (step == 1) {
baseIsShow(true)
treeIsShow(false) treeIsShow(false)
} else { } else {
baseIsShow(false) baseIsShow(false)
treeIsShow(true)
} }
// 创建商户 // 创建商户
if (editLevel == 1) { if (editLevel == 1) {
if (!merchantId) {
$('#accountLevelEl').attr('disabled', true) $('#accountLevelEl').attr('disabled', true)
getBusiScope() getBusiScope()
getCarBrandTree() getCarBrandTree()
getAccountLevel() getAccountLevel()
getAccountType() getAccountType()
} else { } else {
$('#validPeriodEl').attr('disabled', true)
$('#merchantLoginAccountEl').attr('disabled', true)
}
} else {
if (!merchantId) {
merchantId = qs('id') merchantId = qs('id')
$('#preStep').remove() }
console.log(merchantId)
if (editLevel == 3) { if (editLevel == 3) {
$('#firstBtn').text('确定') $('#firstBtn').text('确定')
$('#preStep').remove()
$('#validPeriodEl').attr('disabled', true) $('#validPeriodEl').attr('disabled', true)
$('#merchantLoginAccountEl').attr('disabled', true)
accountTypeVisible = true accountTypeVisible = true
$('#accountLevelEl').attr('disabled', true) $('#accountLevelEl').attr('disabled', true)
} else { } else {
if (!merchantId) {
getBusiScope() getBusiScope()
getCarBrandTree() getCarBrandTree()
} }
}
if (isFactory) { if (isFactory) {
getAccountLevel() getAccountLevel()
getMerchantInfo() getMerchantInfo()
} else { } else {
// 创建/编辑子商户 // 创建/编辑子商户
if (!parentMerchantId) {
parentMerchantId = qs('parentId') parentMerchantId = qs('parentId')
// $('#validPeriodEl').attr('disabled', true) }
$('#validPeriodEl').attr('disabled', true)
$('#channelEl').attr('disabled', true) $('#channelEl').attr('disabled', true)
if (editLevel == 3 || (editLevel == 2 && !merchantId)) {
getParentInfo() getParentInfo()
} else {
$('#merchantLoginAccountEl').attr('disabled', true)
$('#accountLevelEl').attr('disabled', true)
}
} }
} }
if (isFactory) { if (isFactory) {
$('#subMerchantEl').hide() $('#subMerchantEl').hide()
} }
getChannel()
getPeriod()
} }
function bindEvent() { function bindEvent() {
...@@ -819,13 +900,17 @@ ...@@ -819,13 +900,17 @@
var data = res.data var data = res.data
parentInfo = { parentInfo = {
parentId: data.id, parentId: data.id,
parentName: data.merchantName, parentName: data.merchantName + '(' + data.merchantNo + ')',
parentAccountType: data.accountType, parentAccountType: data.accountType,
parentAccountTypeName: data.accountTypeNames, parentAccountTypeName: data.accountTypeNames,
parentMerchantAccountLevel: data.merchantAccountLevel, parentMerchantAccountLevel: data.merchantAccountLevel,
channelId: data.channelId, channelId: data.channelId,
effectiveTime: data.effectiveTime effectiveTime: data.effectiveTime
} }
var attrList = ['parentName', 'parentAccountTypeName']
$.each(attrList, function (index, item) {
$('#' + item).text(parentInfo[item])
})
form.val('merchantForm', parentInfo) form.val('merchantForm', parentInfo)
if (editLevel == 3) { if (editLevel == 3) {
getMerchantInfo() getMerchantInfo()
...@@ -1005,7 +1090,7 @@ ...@@ -1005,7 +1090,7 @@
// console.log(res.data, 'account_type') // console.log(res.data, 'account_type')
baseData.accountTypeList = res.data baseData.accountTypeList = res.data
var checkedList = [] var checkedList = []
if (editLevel == 3 && merchantForm.accountType) { if (merchantId && merchantForm.accountType) {
checkedList = merchantForm.accountType.split(',') checkedList = merchantForm.accountType.split(',')
} }
var el = $('#accountTypeEl') var el = $('#accountTypeEl')
...@@ -1023,7 +1108,7 @@ ...@@ -1023,7 +1108,7 @@
optionEl.attr('disabled', true) optionEl.attr('disabled', true)
} }
// 修改-回显 // 修改-回显
if (editLevel == 3) { if (merchantId) {
for (var i = 0; i <= checkedList.length; i++) { for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) { if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true) optionEl.attr("checked", true)
...@@ -1044,7 +1129,7 @@ ...@@ -1044,7 +1129,7 @@
optionEl.attr('disabled', true) optionEl.attr('disabled', true)
} }
// 修改-回显 // 修改-回显
if (editLevel == 3) { if (merchantId) {
for (var i = 0; i <= checkedList.length; i++) { for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) { if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true) optionEl.attr("checked", true)
......
...@@ -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>
...@@ -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,7 +378,12 @@ ...@@ -372,7 +378,12 @@
var searchData = $('#searchForm [name]').serializeArray() var searchData = $('#searchForm [name]').serializeArray()
// console.log(searchData) // console.log(searchData)
$.each(searchData, function () { $.each(searchData, function () {
if (this.name == 'merchantLoginAccount') {
var attrName = params.accountOrPhone == '0' ? 'merchantLoginAccount' : 'merchantLegalPersonPhone'
params[attrName] = this.value
} else {
params[this.name] = this.value params[this.name] = this.value
}
}) })
// console.log(params) // console.log(params)
request(params, function (res) { request(params, function (res) {
......
...@@ -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) {
// 工厂
if (merchantAccountLevel == 1) {
// 状态 - 正常
if (status == 2) {
// 永久有效
if (vaildData.effectiveTime == 0) {
if (item.dictValue == -1) {
periodSelect.append(new Option(item.dictLabel, item.dictValue)) 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
var i= setInterval(function(){
if (inst) { if (inst) {
clearInterval(i)
inst.updateNode(treeNode) 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!