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 c2f71c41
authored
Aug 09, 2021
by
limin
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/h5/account
into master
2 parents
e3a6429b
f9e168cc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
205 additions
and
132 deletions
css/main.css
html/employee/detail.html
html/merchant/detail.html
html/merchant/edit.html
html/merchant/index.html
html/role/add.html
html/role/detail.html
css/main.css
View file @
c2f71c4
...
@@ -117,4 +117,7 @@ footer {
...
@@ -117,4 +117,7 @@ footer {
.op1
{
.op1
{
opacity
:
1
;
opacity
:
1
;
}
.footer-close
{
text-align
:
center
;
}
}
\ No newline at end of file
\ No newline at end of file
html/employee/detail.html
View file @
c2f71c4
...
@@ -44,6 +44,9 @@
...
@@ -44,6 +44,9 @@
<h3
class=
"content-title"
>
可见下级商户
</h3>
<h3
class=
"content-title"
>
可见下级商户
</h3>
<ul
id=
"tree"
class=
"ztree wrapper-tree"
></ul>
<ul
id=
"tree"
class=
"ztree wrapper-tree"
></ul>
</div>
</div>
<div
class=
"footer-close"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"return"
>
关闭
</button>
</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,6 +62,11 @@
...
@@ -59,6 +62,11 @@
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'roleName'
,
'roleIds'
]
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'roleName'
,
'roleIds'
]
var
employeeData
=
{}
var
employeeData
=
{}
getById
()
getById
()
$
(
'#return'
).
on
(
'click'
,
function
()
{
window
.
history
.
back
()
})
// 查询员工详情
// 查询员工详情
function
getById
()
{
function
getById
()
{
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
...
@@ -78,17 +86,12 @@
...
@@ -78,17 +86,12 @@
var
treeParams
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantTree'
}
var
treeParams
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantTree'
}
var
merchants
=
{}
var
merchants
=
{}
request
(
treeParams
,
function
(
res
)
{
request
(
treeParams
,
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
var
arr
=
employeeData
.
visibleInferiorMer
.
split
(
','
)
var
arr
=
employeeData
.
visibleInferiorMer
.
split
(
','
)
$
.
each
(
arr
,
function
(
index
,
item
)
{
$
.
each
(
arr
,
function
(
index
,
item
)
{
arr
[
index
]
=
+
item
arr
[
index
]
=
+
item
})
})
console
.
log
(
arr
)
merchants
=
tree
.
create
(
'tree'
,
res
.
data
,
{
checkedList
:
arr
,
chkDisabled
:
true
})
merchants
=
tree
.
create
(
'tree'
,
res
.
data
,
{
checkedList
:
arr
,
chkDisabled
:
true
})
// var id = 32
// var node = merchants.getNodeByParam("id",id)
// merchants.checkNode(node, true, true)
}
}
})
})
}
}
...
...
html/merchant/detail.html
View file @
c2f71c4
...
@@ -11,6 +11,11 @@
...
@@ -11,6 +11,11 @@
<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/merchant.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/merchant.css"
/>
<title>
商户管理
</title>
<title>
商户管理
</title>
<style>
.pull-right
{
float
:
right
;
}
</style>
</head>
</head>
<body>
<body>
...
@@ -26,74 +31,74 @@
...
@@ -26,74 +31,74 @@
<div
class=
"layui-tab-item layui-show"
>
<div
class=
"layui-tab-item layui-show"
>
<h3
class=
"content-title"
>
账户信息
</h3>
<h3
class=
"content-title"
>
账户信息
</h3>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label
required
"
>
登录账户名:
</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=
"merchantLoginAccount"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantLoginAccount"
></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"
>
账户类型:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"accountTypeNames"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"accountTypeNames"
></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"
>
账户等级:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"accountLevelName"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"accountLevelName"
></div>
</div>
</div>
</div>
</div>
<h3
class=
"content-title"
>
企业信息
</h3>
<h3
class=
"content-title"
>
企业信息
</h3>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label
required
"
>
商户名称:
</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=
"merchantName"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantName"
></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"
>
简称:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantAbbreviation"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantAbbreviation"
></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"
>
商户类型:
</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=
"merchantType"
></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"
>
组织机构代码:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantOrgcode"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantOrgcode"
></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"
>
地址:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantAddress"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantAddress"
></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"
>
联系人:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantLegalPerson"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantLegalPerson"
></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"
>
联系电话:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantLegalPersonPhone"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantLegalPersonPhone"
></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"
>
营业范围:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"businessScopName"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"businessScopName"
></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"
>
主营品牌:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantBrandName"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"merchantBrandName"
></div>
</div>
</div>
...
@@ -110,8 +115,8 @@
...
@@ -110,8 +115,8 @@
<div
class=
"wrapper-merchant"
>
<div
class=
"wrapper-merchant"
>
<div
class=
"merchant-left"
>
<div
class=
"merchant-left"
>
<div
id=
"secondmerchantName"
></div>
<div
id=
"secondmerchantName"
></div>
<div
id=
"secondmerchantId"
>
商户号
</div>
<div
>
商户号:
<span
id=
"secondmerchantId"
></span>
</div>
<div
id=
""
>
宁接口了接口了就
</div>
<div
>
您共有
<span
id=
"numberOfSubMerchants"
></span>
个子商户,共有
<span
id=
"numberOfStores"
></span>
家门店
</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"
>
...
@@ -123,7 +128,13 @@
...
@@ -123,7 +128,13 @@
<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>
深圳XXX汽车股份有限公司员工列表
</div>
<div>
<span
id=
"merchantNameTable"
></span>
员工列表
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
placeholder=
"请输入员工姓名/手机号"
id=
"tableSearchForm"
/>
</div>
<button
class=
"layui-btn"
id=
"tableSearch"
>
查询
</button>
</div>
<table
id=
"subMerchantTable"
lay-filter=
"subMerchantTool"
></table>
<table
id=
"subMerchantTable"
lay-filter=
"subMerchantTool"
></table>
</div>
</div>
</div>
</div>
...
@@ -251,7 +262,8 @@
...
@@ -251,7 +262,8 @@
}
}
})
})
}
}
// 获取功能权限基础数据
function
findMenuFunTreeByMerId
()
{
function
findMenuFunTreeByMerId
()
{
var
params
=
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
...
@@ -301,11 +313,11 @@
...
@@ -301,11 +313,11 @@
},
function
(
res
)
{
},
function
(
res
)
{
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
var
data
=
res
.
data
var
data
=
res
.
data
var
arr
=
[
'merchantName'
,
'merchantId'
,
''
]
$
(
'#secondmerchantName'
).
text
(
data
.
merchantName
)
$
.
each
(
arr
,
function
(
index
,
item
)
{
$
(
'#secondmerchantId'
).
text
(
data
.
merchantNo
)
console
.
log
(
data
[
item
]
)
$
(
'#numberOfSubMerchants'
).
text
(
data
.
numberOfSubMerchants
)
$
(
'#second'
+
item
).
text
(
data
[
item
]
)
$
(
'#numberOfStores'
).
text
(
data
.
numberOfStores
)
}
)
$
(
'#merchantNameTable'
).
text
(
data
.
merchantName
)
})
})
}
}
...
@@ -318,7 +330,7 @@
...
@@ -318,7 +330,7 @@
var
merchants
=
{}
var
merchants
=
{}
request
(
treeParams
,
function
(
res
)
{
request
(
treeParams
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
merchants
=
tree
.
create
(
'merchantTree'
,
res
.
data
)
merchants
=
tree
.
create
(
'merchantTree'
,
res
.
data
,
null
,
false
)
merchants
.
expandAll
(
true
)
merchants
.
expandAll
(
true
)
}
}
})
})
...
@@ -327,7 +339,7 @@
...
@@ -327,7 +339,7 @@
// 列表配置
// 列表配置
var
subMerchantTable
=
table
.
render
({
var
subMerchantTable
=
table
.
render
({
elem
:
'#subMerchantTable'
,
elem
:
'#subMerchantTable'
,
page
:
fals
e
,
page
:
tru
e
,
cols
:
[
cols
:
[
[{
[{
field
:
''
,
field
:
''
,
...
@@ -369,13 +381,21 @@
...
@@ -369,13 +381,21 @@
]
]
})
})
// table搜索
$
(
'#tableSearch'
).
on
(
'click'
,
function
()
{
var
search
=
$
(
'#tableSearchForm'
).
val
()
console
.
log
(
search
)
getSecondTable
(
subMerchantTable
,
{
keyword
:
search
})
})
// 获取table列表接口
// 获取table列表接口
function
getSecondTable
(
table
,
isResetPageNum
=
false
)
{
function
getSecondTable
(
table
,
search
,
isResetPageNum
=
false
)
{
request
({
var
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.findMerchantStaffList'
,
method
:
'cn.com.glsx.merchants.staff.findMerchantStaffList'
,
merchantId
:
merchantId
merchantId
:
merchantId
},
},
search
)
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
var
data
=
res
.
data
var
data
=
res
.
data
var
options
=
{
var
options
=
{
...
...
html/merchant/edit.html
View file @
c2f71c4
...
@@ -295,8 +295,8 @@
...
@@ -295,8 +295,8 @@
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
style=
"text-align: center;"
>
<div
class=
"layui-form-item"
style=
"text-align: center;"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"handle
Submit"
>
下一步
</button>
<button
id=
"firstBtn"
class=
"layui-btn"
lay-submit
lay-filter=
"handleFirst
Submit"
>
下一步
</button>
<button
class=
"layui-btn"
data-type=
"handleCancel"
>
取消
</button>
<button
class=
"layui-btn"
data-type=
"handle
First
Cancel"
>
取消
</button>
</div>
</div>
</form>
</form>
</div>
</div>
...
@@ -377,7 +377,7 @@
...
@@ -377,7 +377,7 @@
var
startDate
=
laydate
.
render
({
var
startDate
=
laydate
.
render
({
elem
:
'#startDate'
,
//指定元素
elem
:
'#startDate'
,
//指定元素
type
:
'
dat
e'
,
type
:
'
tim
e'
,
done
:
function
(
value
,
date
)
{
//监听日期被切换
done
:
function
(
value
,
date
)
{
//监听日期被切换
if
(
value
!=
""
)
{
if
(
value
!=
""
)
{
date
.
month
=
date
.
month
-
1
date
.
month
=
date
.
month
-
1
...
@@ -390,7 +390,7 @@
...
@@ -390,7 +390,7 @@
})
})
var
endDate
=
laydate
.
render
({
var
endDate
=
laydate
.
render
({
elem
:
'#endDate'
,
//指定元素
elem
:
'#endDate'
,
//指定元素
type
:
'
dat
e'
,
type
:
'
tim
e'
,
done
:
function
(
value
,
date
)
{
//监听日期被切换
done
:
function
(
value
,
date
)
{
//监听日期被切换
if
(
value
!=
""
)
{
if
(
value
!=
""
)
{
date
.
month
=
date
.
month
-
1
date
.
month
=
date
.
month
-
1
...
@@ -409,15 +409,9 @@
...
@@ -409,15 +409,9 @@
// lng: '39.90923',
// lng: '39.90923',
// merchantAddress: '深圳'
// merchantAddress: '深圳'
// })
// })
helper
.
store
.
set
(
'merchantMapObj'
,
merchantForm
)
//
helper.store.set('merchantMapObj', merchantForm)
form
.
on
(
'submit(handleSubmit)'
,
function
(
data
)
{
form
.
on
(
'submit(handleFirstSubmit)'
,
function
(
data
)
{
//---------------
// baseIsShow(false)
// treeIsShow(true)
// getMenuList()
// findMenuFunTreeByMerId()
//-------------------
// console.log(editLevel)
// console.log(editLevel)
// console.log(data.field)
// console.log(data.field)
var
formData
=
data
.
field
var
formData
=
data
.
field
...
@@ -434,12 +428,12 @@
...
@@ -434,12 +428,12 @@
params
.
isloginName
=
1
params
.
isloginName
=
1
}
}
if
(
formData
.
bussinessBegintime
)
{
if
(
formData
.
bussinessBegintime
)
{
merchantForm
.
bussinessBegintime
=
new
Date
(
formData
.
bussinessBegintime
)
merchantForm
.
bussinessBegintime
=
formData
.
bussinessBegintime
params
.
bussinessBegintime
=
new
Date
(
formData
.
bussinessBegintime
)
params
.
bussinessBegintime
=
formData
.
bussinessBegintime
}
}
if
(
formData
.
bussinessEndtime
)
{
if
(
formData
.
bussinessEndtime
)
{
merchantForm
.
bussinessEndtime
=
new
Date
(
formData
.
bussinessEndtime
)
merchantForm
.
bussinessEndtime
=
formData
.
bussinessEndtime
params
.
bussinessEndtime
=
new
Date
(
formData
.
bussinessEndtime
)
params
.
bussinessEndtime
=
formData
.
bussinessEndtime
}
}
if
(
merchantForm
.
lat
)
{
if
(
merchantForm
.
lat
)
{
params
.
lat
=
merchantForm
.
lat
params
.
lat
=
merchantForm
.
lat
...
@@ -505,16 +499,38 @@
...
@@ -505,16 +499,38 @@
}
}
console
.
log
(
editLevel
)
console
.
log
(
editLevel
)
console
.
log
(
params
)
console
.
log
(
params
)
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
// merchantId = 58
// merchantForm.merchantAccountLevel = parseInt(merchantForm.merchantAccountLevel)
// getMerchantApi(merchantId, function (res) {
// form.val('merchantForm', res.data)
// merchantForm = res.data
// baseIsShow(false)
// treeIsShow(true)
// getById()
// })
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
// authorityTree
// authorityTree
if
(
editLevel
==
3
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
if
(
editLevel
==
3
)
{
icon
:
1
layer
.
msg
(
'操作成功'
,
{
})
icon
:
1
go
(
'merchant'
,
'index'
)
})
}
else
{
go
(
'merchant'
,
'index'
)
}
else
{
merchantId
=
res
.
data
merchantForm
.
merchantAccountLevel
=
parseInt
(
merchantForm
.
merchantAccountLevel
)
getMerchantApi
(
merchantId
,
function
(
res
)
{
form
.
val
(
'merchantForm'
,
res
.
data
)
merchantForm
=
res
.
data
baseIsShow
(
false
)
treeIsShow
(
true
)
getById
()
})
}
}
}
})
})
return
false
return
false
...
@@ -604,8 +620,14 @@
...
@@ -604,8 +620,14 @@
subParent
.
append
(
child2
)
subParent
.
append
(
child2
)
parent
.
append
(
subParent
)
parent
.
append
(
subParent
)
},
},
handleFirstCancel
()
{
console
.
log
(
'??????????'
)
go
(
'merchant'
,
'index'
)
return
false
},
handleCancel
()
{
handleCancel
()
{
go
(
'merchant'
,
'index'
)
go
(
'merchant'
,
'index'
)
return
false
}
}
}
}
...
@@ -668,45 +690,49 @@
...
@@ -668,45 +690,49 @@
function
init
()
{
function
init
()
{
editLevel
=
qs
(
'editLevel'
)
editLevel
=
qs
(
'editLevel'
)
isFactory
=
(
qs
(
'isFactory'
)
==
'true'
)
isFactory
=
(
qs
(
'isFactory'
)
==
'true'
)
// console.log(isFactory)
if
(
isFactory
)
{
merchantId
=
qs
(
'id'
)
$
(
'#subMerchantEl'
).
hide
()
getAccountLevel
()
getMerchantInfo
()
}
else
{
// 创建/编辑子商户
parentMerchantId
=
qs
(
'parentId'
)
if
(
editLevel
==
3
)
{
merchantId
=
qs
(
'id'
)
}
$
(
'#validPeriodEl'
).
attr
(
'disabled'
,
true
)
$
(
'#channelEl'
).
attr
(
'disabled'
,
true
)
getParentInfo
()
}
step
=
qs
(
'step'
)
step
=
qs
(
'step'
)
if
(
step
==
1
)
{
if
(
step
==
1
)
{
treeIsShow
(
false
)
treeIsShow
(
false
)
}
else
{
}
else
{
baseIsShow
(
false
)
baseIsShow
(
false
)
// getMenuList()
// getById()
// findMenuFunTreeByMerId()
}
}
if
(
editLevel
==
3
)
{
// merchantName = qs('merchantName')
// 创建商户
// getMerchantInfo()
if
(
editLevel
==
1
)
{
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
}
else
{
getBusiScope
()
getBusiScope
()
getCarBrandTree
()
getCarBrandTree
()
getAccountLevel
()
getAccountType
()
getAccountType
()
}
else
{
merchantId
=
qs
(
'id'
)
$
(
'#preStep'
).
remove
()
if
(
editLevel
==
3
)
{
$
(
'#firstBtn'
).
text
(
'确定'
)
$
(
'#accountLevelEl'
).
attr
(
'disabled'
,
true
)
}
else
{
getBusiScope
()
getCarBrandTree
()
getAccountType
()
}
if
(
isFactory
)
{
getAccountLevel
()
getMerchantInfo
()
}
else
{
// 创建/编辑子商户
parentMerchantId
=
qs
(
'parentId'
)
// $('#validPeriodEl').attr('disabled', true)
$
(
'#channelEl'
).
attr
(
'disabled'
,
true
)
getParentInfo
()
}
}
if
(
isFactory
)
{
$
(
'#subMerchantEl'
).
hide
()
}
}
getChannel
()
getChannel
()
getPeriod
()
getPeriod
()
bindEvent
()
}
}
function
bindEvent
()
{
function
bindEvent
()
{
...
@@ -775,17 +801,20 @@
...
@@ -775,17 +801,20 @@
getMerchantApi
(
merchantId
,
function
(
res
)
{
getMerchantApi
(
merchantId
,
function
(
res
)
{
form
.
val
(
'merchantForm'
,
res
.
data
)
form
.
val
(
'merchantForm'
,
res
.
data
)
merchantForm
=
res
.
data
merchantForm
=
res
.
data
if
(
merchantForm
.
status
!=
1
)
{
$
(
'#draft'
).
remove
()
}
console
.
log
(
merchantForm
)
console
.
log
(
merchantForm
)
getBusiScope
()
getBusiScope
()
getCarBrandTree
()
getCarBrandTree
()
getAccountType
()
getAccountType
()
recoveryBusiScopeCus
()
recoveryBusiScopeCus
()
recoveryFile
()
recoveryFile
()
if
(
merchantForm
.
status
==
1
)
{
//
if (merchantForm.status == 1) {
findMenuFunTreeByMerId
()
//
findMenuFunTreeByMerId()
}
else
{
//
} else {
getById
()
getById
()
}
//
}
})
})
}
}
...
@@ -813,6 +842,7 @@
...
@@ -813,6 +842,7 @@
treeObj
=
tree
.
create
(
'carBrandTree'
,
res
.
data
,
{
treeObj
=
tree
.
create
(
'carBrandTree'
,
res
.
data
,
{
checkedList
:
checkedList
checkedList
:
checkedList
})
})
bindEvent
()
})
})
}
}
// 获取字典数据
// 获取字典数据
...
@@ -843,6 +873,7 @@
...
@@ -843,6 +873,7 @@
function
getAccountLevel
()
{
function
getAccountLevel
()
{
getDictData
(
'account_level'
,
function
(
res
)
{
getDictData
(
'account_level'
,
function
(
res
)
{
baseData
.
accountLevelList
=
res
.
data
baseData
.
accountLevelList
=
res
.
data
console
.
log
(
baseData
.
accountLevelList
)
if
(
!
isFactory
)
{
if
(
!
isFactory
)
{
var
tempList
=
[]
var
tempList
=
[]
$
.
each
(
baseData
.
accountLevelList
,
function
(
index
,
item
)
{
$
.
each
(
baseData
.
accountLevelList
,
function
(
index
,
item
)
{
...
@@ -955,30 +986,10 @@
...
@@ -955,30 +986,10 @@
})
})
})
})
}
}
// 树--
// function getMenuList() {
// request({
// method: 'cn.com.glsx.merchants.merchant.findPermissionsByMerId',
// id: merchantId
// }, function(res) {
// console.log(res.data)
// menuList = res.data
// })
// }
// 树
// console.log(merchantId)
// if (merchantId) {
// getById()
// } else {
// findMenuFunTreeByMerId()
// }
// start
//
数 -
start
var
laytpl
=
layui
.
laytpl
var
laytpl
=
layui
.
laytpl
var
xmSelect
=
layui
.
xmSelect
var
xmSelect
=
layui
.
xmSelect
// var tree = layui.gtree
// var helper = layui.helper
var
check_arr
=
[]
var
check_arr
=
[]
var
requestList
=
[]
var
requestList
=
[]
var
templateData
=
{}
var
templateData
=
{}
...
@@ -1147,7 +1158,8 @@
...
@@ -1147,7 +1158,8 @@
// 查询商户的菜单权限树
// 查询商户的菜单权限树
function
findMenuFunTreeByMerId
()
{
function
findMenuFunTreeByMerId
()
{
// console.log(merchantForm, '查询商户菜单权限树')
console
.
log
(
merchantForm
,
'查询商户菜单权限树'
)
console
.
log
(
parentMerchantId
,
'parentMerchantId'
)
var
params
=
{}
var
params
=
{}
if
(
parentMerchantId
)
{
if
(
parentMerchantId
)
{
params
=
{
params
=
{
...
@@ -1165,22 +1177,22 @@
...
@@ -1165,22 +1177,22 @@
accountLevel
:
merchantForm
.
merchantAccountLevel
accountLevel
:
merchantForm
.
merchantAccountLevel
}
}
}
}
console
.
log
(
params
.
method
)
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
// callback(res.data)
// callback(res.data)
menuFunTreeData
=
res
.
data
menuFunTreeData
=
res
.
data
console
.
log
(
menuFunTreeData
)
//
console.log(menuFunTreeData)
var
accountType
=
$
(
'#accountType'
)
var
accountType
=
$
(
'#accountType'
)
$
.
each
(
menuFunTreeData
,
function
(
index
,
item
)
{
$
.
each
(
menuFunTreeData
,
function
(
index
,
item
)
{
// console.log(item)
// console.log(item)
var
str
=
$
(
'<input lay-filter="switch" type="checkbox" name="accounttypeId" value="'
+
item
var
str
=
$
(
'<input lay-filter="switch" type="checkbox" name="accounttypeId" value="'
+
item
.
accounttypeId
+
'" title="'
+
item
.
accounttypeName
+
'" />'
)
.
accounttypeId
+
'" title="'
+
item
.
accounttypeName
+
'" />'
)
accountType
.
append
(
str
)
accountType
.
append
(
str
)
console
.
log
(
check_arr
,
'0000000000'
)
//
console.log(check_arr, '0000000000')
if
(
merchantId
)
{
if
(
merchantId
)
{
// 角色权限的check
// 角色权限的check
for
(
var
i
=
0
;
i
<
check_arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
check_arr
.
length
;
i
++
)
{
console
.
log
(
check_arr
[
i
])
if
(
check_arr
[
i
].
accounttypeId
==
item
.
accounttypeId
)
{
if
(
check_arr
[
i
].
accounttypeId
==
item
.
accounttypeId
)
{
var
productData
=
check_arr
[
i
]
var
productData
=
check_arr
[
i
]
str
.
attr
(
"checked"
,
true
)
str
.
attr
(
"checked"
,
true
)
...
@@ -1188,7 +1200,6 @@
...
@@ -1188,7 +1200,6 @@
title
:
item
.
accounttypeName
,
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
value
:
item
.
accounttypeId
}
}
console
.
log
(
obj
)
active
.
tabAdd
(
obj
)
active
.
tabAdd
(
obj
)
var
selectArr
=
[]
var
selectArr
=
[]
var
menuData
=
[]
var
menuData
=
[]
...
@@ -1202,7 +1213,6 @@
...
@@ -1202,7 +1213,6 @@
},
item
.
accounttypeId
,
item
.
products
,
idList
)
},
item
.
accounttypeId
,
item
.
products
,
idList
)
}
}
// // 产品的回显
// // 产品的回显
console
.
log
(
selectEl
[
item
.
accounttypeId
],
'\\\\\\\\\\\\\\\\\\'
)
selectEl
[
item
.
accounttypeId
].
setValue
(
selectArr
)
selectEl
[
item
.
accounttypeId
].
setValue
(
selectArr
)
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
...
@@ -1223,7 +1233,6 @@
...
@@ -1223,7 +1233,6 @@
// 根据id获取角色详情
// 根据id获取角色详情
function
getById
()
{
function
getById
()
{
console
.
log
(
'getById---'
)
var
params
=
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findPermissionsByMerId'
,
method
:
'cn.com.glsx.merchants.merchant.findPermissionsByMerId'
,
// method: 'org.ore.api.role.getById',
// method: 'org.ore.api.role.getById',
...
...
html/merchant/index.html
View file @
c2f71c4
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
</form>
</form>
</div>
</div>
<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"
></div>
</div>
</div>
</main>
</main>
</div>
</div>
...
@@ -131,10 +132,11 @@
...
@@ -131,10 +132,11 @@
{{
#
}
}}
{{
#
}
}}
</script>
</script>
<script>
<script>
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'table'
,
'layer'
],
function
()
{
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'table'
,
'lay
page'
,
'lay
er'
],
function
()
{
var
tree
=
layui
.
gtree
var
tree
=
layui
.
gtree
var
request
=
layui
.
request
var
request
=
layui
.
request
var
table
=
layui
.
table
var
table
=
layui
.
table
var
laypage
=
layui
.
laypage
var
form
=
layui
.
form
var
form
=
layui
.
form
var
$
=
layui
.
$
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
...
@@ -148,9 +150,33 @@
...
@@ -148,9 +150,33 @@
accountTypeList
:
[]
accountTypeList
:
[]
}
}
var
page
=
{
pageNum
:
1
,
pageSize
:
10
}
var
pageOptions
=
{
elem
:
'merchantPage'
,
groups
:
5
,
layout
:
[
'limit'
,
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
);
//得到当前页,以便向服务端请求对应页的数据。
console
.
log
(
obj
.
limit
);
//得到每页显示的条数
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
// getTabelList()
//首次不执行
if
(
!
first
)
{
//do something
getTabelList
()
}
}
}
var
merchantTable
=
table
.
render
({
var
merchantTable
=
table
.
render
({
elem
:
'#merchantTable'
,
elem
:
'#merchantTable'
,
page
:
tru
e
,
page
:
fals
e
,
// done: function (res, curr, count) {
// done: function (res, curr, count) {
// console.log(res)
// console.log(res)
// },
// },
...
@@ -222,9 +248,11 @@
...
@@ -222,9 +248,11 @@
switch
(
eventName
)
{
switch
(
eventName
)
{
// 查看
// 查看
case
'handleDetail'
:
case
'handleDetail'
:
go
(
'merchant'
,
'detail'
,
{
merchantId
:
row
.
id
})
go
(
'merchant'
,
'detail'
,
{
merchantId
:
row
.
id
})
break
break
// 修改
// 修改
case
'handleEdit'
:
case
'handleEdit'
:
// editLevel - 1-创建新商户;2-创建子商户;3-修改
// editLevel - 1-创建新商户;2-创建子商户;3-修改
// step - 1-基本信息;2-权限树
// step - 1-基本信息;2-权限树
...
@@ -250,7 +278,7 @@
...
@@ -250,7 +278,7 @@
step
:
2
step
:
2
})
})
break
break
// 创建子商户/门店
// 创建子商户/门店
case
'handleAddMerchant'
:
case
'handleAddMerchant'
:
// 1-创建新商户;2-创建子商户;3-修改
// 1-创建新商户;2-创建子商户;3-修改
go
(
'merchant'
,
'edit'
,
{
go
(
'merchant'
,
'edit'
,
{
...
@@ -260,13 +288,13 @@
...
@@ -260,13 +288,13 @@
step
:
1
step
:
1
})
})
break
break
// 创建员工
// 创建员工
case
'handleAddStaff'
:
case
'handleAddStaff'
:
go
(
'employee'
,
'add'
,
{
go
(
'employee'
,
'add'
,
{
merchantId
:
row
.
id
merchantId
:
row
.
id
})
})
break
break
// 修改账户有效期
// 修改账户有效期
case
'handleVaildPeriod'
:
case
'handleVaildPeriod'
:
// console.log(row)
// console.log(row)
layer
.
open
({
layer
.
open
({
...
@@ -299,10 +327,6 @@
...
@@ -299,10 +327,6 @@
init
()
init
()
// form.on('handleAdd', function () {
// console.log('00000')
// return false
// })
$
(
'#addBtn'
).
on
(
'click'
,
function
()
{
$
(
'#addBtn'
).
on
(
'click'
,
function
()
{
// 1-创建新商户;2-创建子商户;3-修改
// 1-创建新商户;2-创建子商户;3-修改
go
(
'merchant'
,
'edit'
,
{
go
(
'merchant'
,
'edit'
,
{
...
@@ -325,11 +349,9 @@
...
@@ -325,11 +349,9 @@
// 获取表格数据
// 获取表格数据
function
getTabelList
(
isResetPageNum
=
false
)
{
function
getTabelList
(
isResetPageNum
=
false
)
{
var
pageNum
=
isResetPageNum
?
1
:
merchantTable
.
config
.
index
var
pageSize
=
merchantTable
.
config
.
limit
var
params
=
{
var
params
=
{
pageNum
:
pageNum
,
pageNum
:
page
.
page
Num
,
pageSize
:
pageSize
,
pageSize
:
page
.
page
Size
,
method
:
'cn.com.glsx.merchants.menu.findMerchantByPage'
method
:
'cn.com.glsx.merchants.menu.findMerchantByPage'
}
}
var
searchData
=
$
(
'#searchForm [name]'
).
serializeArray
()
var
searchData
=
$
(
'#searchForm [name]'
).
serializeArray
()
...
@@ -342,7 +364,7 @@
...
@@ -342,7 +364,7 @@
// console.log(res)
// console.log(res)
var
data
=
res
.
data
var
data
=
res
.
data
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
item
.
index
=
index
+
1
+
page
Size
*
(
pageNum
-
1
)
item
.
index
=
index
+
1
+
page
.
pageSize
*
(
page
.
pageNum
-
1
)
item
.
btn
=
{
item
.
btn
=
{
edit
:
false
,
edit
:
false
,
createSubMerchant
:
false
,
createSubMerchant
:
false
,
...
@@ -403,11 +425,11 @@
...
@@ -403,11 +425,11 @@
var
options
=
{
var
options
=
{
data
:
data
.
data
data
:
data
.
data
}
}
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
if
(
isResetPageNum
)
{
options
.
page
=
{
pageOptions
.
curr
=
1
curr
:
1
}
}
}
laypage
.
render
(
pageOptions
)
merchantTable
.
reload
(
options
)
merchantTable
.
reload
(
options
)
})
})
}
}
...
...
html/role/add.html
View file @
c2f71c4
...
@@ -9,6 +9,15 @@
...
@@ -9,6 +9,15 @@
<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>
.show
{
display
:
inline-block
;
}
.hide
{
display
:
none
;
}
</style>
</head>
</head>
<body>
<body>
...
...
html/role/detail.html
View file @
c2f71c4
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
<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>
<div
class=
"footer-close"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"return"
>
关闭
</button>
</div>
</div>
</div>
</main>
</main>
</div>
</div>
...
@@ -66,6 +69,10 @@
...
@@ -66,6 +69,10 @@
// 查询角色详情
// 查询角色详情
// getById()
// getById()
findMenuFunTreeByMerId
()
findMenuFunTreeByMerId
()
$
(
'#return'
).
on
(
'click'
,
function
()
{
window
.
history
.
back
()
})
// form.on('select(accountSelect)', function(data){
// form.on('select(accountSelect)', function(data){
// console.log(data.elem); //得到select原始DOM对象
// console.log(data.elem); //得到select原始DOM对象
// console.log(data.value); //得到被选中的值
// console.log(data.value); //得到被选中的值
...
...
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