Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b55dac2e
authored
Aug 16, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of 192.168.3.233:h5/account
2 parents
dab2e418
d5b9c01f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
355 additions
and
198 deletions
html/merchant/detail.html
html/merchant/edit.html
html/merchant/index.html
html/merchant/validPeriodForm.html
js/gtree.js
js/validator.js
html/merchant/detail.html
View file @
b55dac2
...
...
@@ -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
{
overflow-x
:
auto
;
width
:
calc
(
100vw
-
500px
-
20px
);
.merchant-right
{
overflow-x
:
auto
;
width
:
calc
(
100vw
-
500px
-
20px
);
}
.merchant-right
>
div
:first-child
{
position
:
relative
;
height
:
40px
;
line-height
:
40px
;
.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>
...
...
@@ -194,7 +205,7 @@
<h3
class=
"content-title"
>
功能权限
</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>
<div
class=
"layui-tab-content"
></div>
</div>
...
...
@@ -205,26 +216,26 @@
<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>
</div>
<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>
</div>
<div
class=
"merchant-right"
>
<div>
<span
class=
"companyName"
>
<span
id=
"merchantNameTable"
></span>
员工列表
</span>
<span
class=
"companyName"
>
<span
id=
"merchantNameTable"
></span>
员工列表
</span>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
placeholder=
"请输入员工姓名/手机号"
id=
"tableSearchForm"
/>
</div>
...
...
@@ -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"></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
}
// 列表配置
...
...
@@ -467,41 +496,41 @@
page
:
true
,
cols
:
[
[{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
200
,
align
:
'center'
},
{
field
:
'roleName'
,
title
:
'角色'
,
width
:
200
,
align
:
'center'
},
{
field
:
'staffPhone'
,
title
:
'登录账户'
,
width
:
200
,
align
:
'center'
},
{
field
:
'createdAccount'
,
title
:
'创建者'
,
width
:
200
,
align
:
'center'
},
{
field
:
'createdTime'
,
title
:
'创建时间'
,
width
:
200
,
align
:
'center'
}
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
200
,
align
:
'center'
},
{
field
:
'roleName'
,
title
:
'角色'
,
width
:
200
,
align
:
'center'
},
{
field
:
'staffPhone'
,
title
:
'登录账户'
,
width
:
200
,
align
:
'center'
},
{
field
:
'createdAccount'
,
title
:
'创建者'
,
width
:
200
,
align
:
'center'
},
{
field
:
'createdTime'
,
title
:
'创建时间'
,
width
:
200
,
align
:
'center'
}
]
]
})
...
...
@@ -513,6 +542,7 @@
getSecondTable
(
subMerchantTable
,
{
keyword
:
search
})
return
false
})
$
(
'#closeEl'
).
on
(
'click'
,
function
()
{
...
...
html/merchant/edit.html
View file @
b55dac2
...
...
@@ -61,6 +61,10 @@
transform
:
translate3d
(
-50%
,
-50%
,
0
);
}
.edit-box
.m-t-10
{
margin-top
:
10px
;
}
.edit-box
.upload-img-wh
{
width
:
120px
!important
;
height
:
80px
;
...
...
@@ -89,12 +93,20 @@
width
:
16px
;
border-radius
:
50%
;
}
.tips
{
display
:
inline-block
;
font-size
:
14px
;
color
:
#999
;
margin-left
:
160px
;
}
font-size
:
14px
;
color
:
#999
;
margin-left
:
160px
;
}
.form-right
{
position
:
absolute
;
right
:
0
;
top
:
0
;
transform
:
translateX
(
110%
);
}
.edit-box
#accountTypeEl
.layui-form-checked
span
,
#accountTypeEl
.layui-form-checked
:hover
span
{
...
...
@@ -267,35 +279,38 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<span
class=
"tips"
>
图片格式仅支持JPG,PNG格式,大小1M以内
</span>
<span
class=
"tips"
>
图片格式仅支持JPG,PNG格式,大小1M以内
</span>
</div>
<p
class=
"edit-title"
>
账户基本信息
</p>
<div
id=
"subMerchantEl"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
上级商户:
</label>
<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
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
账户类型:
</label>
<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
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
登录账户名:
</label>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"merchantLoginAccount"
maxlength=
"15"
placeholder=
"请输入登录账户名"
required
lay-verify=
"required
"
>
<input
class=
"layui-input"
id=
"merchantLoginAccountEl"
name=
"merchantLoginAccount"
maxlength=
"15"
placeholder=
"请输入登录账户名"
required
lay-verify=
"required|merchantLoginAccount
"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
登录密码:
</label>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
type=
"password"
name=
"merchantLoginPassword"
maxlength=
"15"
placeholder=
"请输入登录密码"
required
lay-verify=
"required"
>
<input
class=
"layui-input"
type=
"password"
id=
"password"
name=
"merchantLoginPassword"
maxlength=
"15"
placeholder=
"请输入登录密码"
required
lay-verify=
"required|merchantLoginPassword"
>
<button
type=
"button"
class=
"layui-btn form-right"
id=
"resetpsw"
>
重置密码
</button>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
@@ -372,6 +387,7 @@
// 是否工厂
var
isFactory
=
true
var
parentInfo
=
{}
var
isFreshSecond
=
true
var
merchantForm
=
{
channelId
:
''
,
...
...
@@ -430,6 +446,22 @@
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
()
// helper.store.set('merchantMapObj', {
...
...
@@ -442,9 +474,22 @@
// console.log(validator.PHONEREG)
// 校验
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
)
{
if
(
value
&&
!
validator
.
checkPhoneNumber
(
value
))
{
return
'请填入正确的驻店电话'
...
...
@@ -523,20 +568,27 @@
if
(
merchantForm
.
merchantFiles
.
length
)
{
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
}
if
(
editLevel
==
1
)
{
params
.
method
=
'cn.com.glsx.merchants.merchant.saveMerchant'
}
else
if
(
editLevel
==
2
)
{
if
(
merchantId
)
{
params
.
id
=
merchantId
if
(
!
isFactory
)
{
params
.
parentId
=
parentInfo
.
parentId
}
params
.
method
=
'cn.com.glsx.merchants.merchant.updateMerchant'
}
else
if
(
editLevel
==
1
)
{
params
.
method
=
'cn.com.glsx.merchants.merchant.saveMerchant'
}
else
if
(
editLevel
==
3
)
{
params
.
id
=
merchantId
}
else
if
(
editLevel
==
2
)
{
if
(
!
isFactory
)
{
params
.
parentId
=
parentInfo
.
parentId
}
params
.
method
=
'cn.com.glsx.merchants.merchant.
updat
eMerchant'
params
.
method
=
'cn.com.glsx.merchants.merchant.
sav
eMerchant'
}
// 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.过期
if
(
merchantForm
.
status
)
{
params
.
status
=
merchantForm
.
status
...
...
@@ -555,14 +607,26 @@
})
go
(
'merchant'
,
'index'
)
}
else
{
merchantId
=
res
.
data
if
(
!
merchantId
)
{
merchantId
=
res
.
data
}
merchantForm
.
merchantAccountLevel
=
parseInt
(
merchantForm
.
merchantAccountLevel
)
getMerchantApi
(
merchantId
,
function
(
respone
)
{
form
.
val
(
'merchantForm'
,
respone
.
data
)
merchantForm
=
respone
.
data
accountTypeVisible
=
true
var
el
=
$
(
'#accountTypeEl'
)
el
.
empty
()
// recoveryBusiScopeCus()
// getCarBrandTree()
recoveryFile
()
getAccountType
()
baseIsShow
(
false
)
treeIsShow
(
true
)
getById
()
if
(
isFreshSecond
)
{
getById
()
isFreshSecond
=
false
}
})
}
}
...
...
@@ -724,52 +788,69 @@
}
function
init
()
{
editLevel
=
qs
(
'editLevel'
)
isFactory
=
(
qs
(
'isFactory'
)
==
'true'
)
step
=
qs
(
'step'
)
getChannel
(
)
getPeriod
(
)
if
(
step
==
1
)
{
baseIsShow
(
true
)
treeIsShow
(
false
)
}
else
{
baseIsShow
(
false
)
treeIsShow
(
true
)
}
// 创建商户
if
(
editLevel
==
1
)
{
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
getBusiScope
()
getCarBrandTree
()
getAccountLevel
()
getAccountType
()
if
(
!
merchantId
)
{
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
getBusiScope
()
getCarBrandTree
()
getAccountLevel
()
getAccountType
()
}
else
{
$
(
'#validPeriodEl'
).
attr
(
'disabled'
,
true
)
$
(
'#merchantLoginAccountEl'
).
attr
(
'disabled'
,
true
)
}
}
else
{
merchantId
=
qs
(
'id'
)
$
(
'#preStep'
).
remove
()
if
(
!
merchantId
)
{
merchantId
=
qs
(
'id'
)
}
console
.
log
(
merchantId
)
if
(
editLevel
==
3
)
{
$
(
'#firstBtn'
).
text
(
'确定'
)
$
(
'#preStep'
).
remove
()
$
(
'#validPeriodEl'
).
attr
(
'disabled'
,
true
)
$
(
'#merchantLoginAccountEl'
).
attr
(
'disabled'
,
true
)
accountTypeVisible
=
true
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
}
else
{
getBusiScope
()
getCarBrandTree
()
if
(
!
merchantId
)
{
getBusiScope
()
getCarBrandTree
()
}
}
if
(
isFactory
)
{
getAccountLevel
()
getMerchantInfo
()
}
else
{
// 创建/编辑子商户
parentMerchantId
=
qs
(
'parentId'
)
// $('#validPeriodEl').attr('disabled', true)
if
(
!
parentMerchantId
)
{
parentMerchantId
=
qs
(
'parentId'
)
}
$
(
'#validPeriodEl'
).
attr
(
'disabled'
,
true
)
$
(
'#channelEl'
).
attr
(
'disabled'
,
true
)
getParentInfo
()
if
(
editLevel
==
3
||
(
editLevel
==
2
&&
!
merchantId
))
{
getParentInfo
()
}
else
{
$
(
'#merchantLoginAccountEl'
).
attr
(
'disabled'
,
true
)
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
}
}
}
if
(
isFactory
)
{
$
(
'#subMerchantEl'
).
hide
()
}
getChannel
()
getPeriod
()
}
function
bindEvent
()
{
...
...
@@ -819,13 +900,17 @@
var
data
=
res
.
data
parentInfo
=
{
parentId
:
data
.
id
,
parentName
:
data
.
merchantName
,
parentName
:
data
.
merchantName
+
'('
+
data
.
merchantNo
+
')'
,
parentAccountType
:
data
.
accountType
,
parentAccountTypeName
:
data
.
accountTypeNames
,
parentMerchantAccountLevel
:
data
.
merchantAccountLevel
,
channelId
:
data
.
channelId
,
effectiveTime
:
data
.
effectiveTime
}
var
attrList
=
[
'parentName'
,
'parentAccountTypeName'
]
$
.
each
(
attrList
,
function
(
index
,
item
)
{
$
(
'#'
+
item
).
text
(
parentInfo
[
item
])
})
form
.
val
(
'merchantForm'
,
parentInfo
)
if
(
editLevel
==
3
)
{
getMerchantInfo
()
...
...
@@ -1005,7 +1090,7 @@
// console.log(res.data, 'account_type')
baseData
.
accountTypeList
=
res
.
data
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
accountType
)
{
if
(
merchantId
&&
merchantForm
.
accountType
)
{
checkedList
=
merchantForm
.
accountType
.
split
(
','
)
}
var
el
=
$
(
'#accountTypeEl'
)
...
...
@@ -1023,7 +1108,7 @@
optionEl
.
attr
(
'disabled'
,
true
)
}
// 修改-回显
if
(
editLevel
==
3
)
{
if
(
merchantId
)
{
for
(
var
i
=
0
;
i
<=
checkedList
.
length
;
i
++
)
{
if
(
checkedList
[
i
]
==
item
.
dictValue
)
{
optionEl
.
attr
(
"checked"
,
true
)
...
...
@@ -1044,7 +1129,7 @@
optionEl
.
attr
(
'disabled'
,
true
)
}
// 修改-回显
if
(
editLevel
==
3
)
{
if
(
merchantId
)
{
for
(
var
i
=
0
;
i
<=
checkedList
.
length
;
i
++
)
{
if
(
checkedList
[
i
]
==
item
.
dictValue
)
{
optionEl
.
attr
(
"checked"
,
true
)
...
...
html/merchant/index.html
View file @
b55dac2
...
...
@@ -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=
"
nam
e"
lay-filter=
"nameFilter"
>
<select
name=
"
accountOrPhon
e"
lay-filter=
"nameFilter"
>
<option
value=
"0"
>
账号登录名
</option>
<option
value=
"1"
>
手机号
</option>
</select>
...
...
@@ -188,7 +193,7 @@
var
merchantTable
=
table
.
render
({
elem
:
'#merchantTable'
,
page
:
false
,
skin
:
'nob'
,
skin
:
'nob'
,
cols
:
[
[{
field
:
'index'
,
...
...
@@ -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,11 +378,16 @@
var
searchData
=
$
(
'#searchForm [name]'
).
serializeArray
()
// console.log(searchData)
$
.
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)
request
(
params
,
function
(
res
)
{
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
item
.
index
=
index
+
1
+
page
.
pageSize
*
(
page
.
pageNum
-
1
)
item
.
btn
=
{
...
...
html/merchant/validPeriodForm.html
View file @
b55dac2
...
...
@@ -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
)
{
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'
,
{
effectiveTime
:
vaildData
.
effectiveTime
...
...
js/gtree.js
View file @
b55dac2
...
...
@@ -25,9 +25,12 @@ layui.define(['ztree'], function (exports) {
var
p
=
gtree
.
opt
.
checkedList
if
(
p
.
indexOf
(
treeNode
.
id
)
!=
-
1
)
{
treeNode
.
checked
=
true
if
(
inst
)
{
inst
.
updateNode
(
treeNode
)
}
var
i
=
setInterval
(
function
(){
if
(
inst
)
{
clearInterval
(
i
)
inst
.
updateNode
(
treeNode
)
}
},
20
)
}
}
if
(
gtree
.
opt
&&
gtree
.
opt
.
chkDisabled
)
{
...
...
js/validator.js
View file @
b55dac2
...
...
@@ -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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment