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 cb1435eb
authored
Aug 09, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商户管理
1 parent
ec3f3fb0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
html/merchant/edit.html
js/request.js
html/merchant/edit.html
View file @
cb1435e
...
@@ -1148,13 +1148,23 @@
...
@@ -1148,13 +1148,23 @@
// 查询商户的菜单权限树
// 查询商户的菜单权限树
function
findMenuFunTreeByMerId
()
{
function
findMenuFunTreeByMerId
()
{
// console.log(merchantForm, '查询商户菜单权限树')
// console.log(merchantForm, '查询商户菜单权限树')
var
params
=
{
var
params
=
{}
if
(
parentMerchantId
)
{
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
id
:
merchantId
,
parentId
:
parentMerchantId
,
accountLevel
:
merchantForm
.
merchantAccountLevel
}
}
else
{
params
=
{
method
:
'cn.com.glsx.merchants.merchant.accountTypeSearchRequest'
,
method
:
'cn.com.glsx.merchants.merchant.accountTypeSearchRequest'
,
// method: 'org.ore.api.accountType.getProductTreeList',
// method: 'org.ore.api.accountType.getProductTreeList',
ids
:
merchantForm
.
accountType
,
ids
:
merchantForm
.
accountType
,
merchantId
:
merchantId
,
merchantId
:
merchantId
,
accountLevel
:
merchantForm
.
merchantAccountLevel
accountLevel
:
merchantForm
.
merchantAccountLevel
}
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
// callback(res.data)
// callback(res.data)
...
@@ -1185,10 +1195,11 @@
...
@@ -1185,10 +1195,11 @@
for
(
var
j
=
0
;
j
<
productData
.
products
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
productData
.
products
.
length
;
j
++
)
{
menuData
=
productData
.
products
[
j
]
menuData
=
productData
.
products
[
j
]
selectArr
.
push
(
menuData
.
productId
)
selectArr
.
push
(
menuData
.
productId
)
var
idList
=
menuData
.
menuIds
.
concat
(
menuData
.
functionIds
)
active
.
treeTabAdd
({
active
.
treeTabAdd
({
name
:
menuData
.
productName
,
name
:
menuData
.
productName
,
value
:
menuData
.
productId
value
:
menuData
.
productId
},
item
.
accounttypeId
,
item
.
products
,
menuData
.
idList
)
},
item
.
accounttypeId
,
item
.
products
,
idList
)
}
}
// // 产品的回显
// // 产品的回显
console
.
log
(
selectEl
[
item
.
accounttypeId
],
'\\\\\\\\\\\\\\\\\\'
)
console
.
log
(
selectEl
[
item
.
accounttypeId
],
'\\\\\\\\\\\\\\\\\\'
)
...
@@ -1237,6 +1248,7 @@
...
@@ -1237,6 +1248,7 @@
// 获取角色权限数据requestList
// 获取角色权限数据requestList
function
getAuthList
()
{
function
getAuthList
()
{
requestList
=
[]
for
(
var
key
in
treeData
)
{
for
(
var
key
in
treeData
)
{
var
accountObj
=
treeData
[
key
]
var
accountObj
=
treeData
[
key
]
var
productList
=
[]
var
productList
=
[]
...
@@ -1257,7 +1269,7 @@
...
@@ -1257,7 +1269,7 @@
// m.parentId
// m.parentId
var
findIdx
=
-
1
var
findIdx
=
-
1
$
.
each
(
functionIds
,
function
(
idn
,
n
)
{
$
.
each
(
functionIds
,
function
(
idn
,
n
)
{
if
(
n
.
i
d
==
m
.
parentId
)
{
if
(
n
.
mendI
d
==
m
.
parentId
)
{
findIdx
=
idn
findIdx
=
idn
}
}
})
})
...
@@ -1287,14 +1299,20 @@
...
@@ -1287,14 +1299,20 @@
$
(
'#draft'
).
on
(
'click'
,
function
()
{
$
(
'#draft'
).
on
(
'click'
,
function
()
{
getAuthList
()
getAuthList
()
console
.
log
(
requestList
)
var
params
=
{
var
params
=
{
merchantId
:
merchantId
,
merchantId
:
merchantId
,
accountTypes
:
JSON
.
stringify
(
requestList
),
accountTypes
:
JSON
.
stringify
(
requestList
),
method
:
'cn.com.glsx.merchants.merchant.
sav
ePermissions'
,
method
:
'cn.com.glsx.merchants.merchant.
updat
ePermissions'
,
status
:
1
status
:
merchantForm
.
status
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
}
})
})
return
false
return
false
})
})
...
@@ -1314,15 +1332,15 @@
...
@@ -1314,15 +1332,15 @@
merchantId
:
merchantId
,
merchantId
:
merchantId
,
accountTypes
:
JSON
.
stringify
(
requestList
)
accountTypes
:
JSON
.
stringify
(
requestList
)
}
}
if
(
merchantForm
.
status
==
1
)
{
params
.
method
=
'cn.com.glsx.merchants.merchant.savePermissions'
params
.
status
=
2
}
else
{
params
.
method
=
'cn.com.glsx.merchants.merchant.updatePermissions'
params
.
method
=
'cn.com.glsx.merchants.merchant.updatePermissions'
params
.
status
=
merchantForm
.
status
params
.
status
=
merchantForm
.
status
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
}
})
})
return
false
return
false
})
})
...
...
js/request.js
View file @
cb1435e
...
@@ -58,14 +58,12 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
...
@@ -58,14 +58,12 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
config
=
config
||
{}
config
=
config
||
{}
var
common
=
store
.
getEx
(
'external'
)
var
common
=
store
.
getEx
(
'external'
)
var
settings
=
helper
.
clone
(
true
,
defaultSettings
)
var
settings
=
helper
.
clone
(
true
,
defaultSettings
)
if
(
isOtherUrl
)
{
delete
settings
.
beforeSend
}
var
data
=
helper
.
clone
(
true
,
{
var
data
=
helper
.
clone
(
true
,
{
timestamp
:
new
Date
().
getTime
()
timestamp
:
new
Date
().
getTime
()
},
common
.
params
,
params
)
},
common
.
params
,
params
)
if
(
isOtherUrl
)
{
if
(
isOtherUrl
)
{
data
.
app_key
=
data
.
appKey
data
.
app_key
=
data
.
appKey
delete
settings
.
beforeSend
delete
data
.
appKey
delete
data
.
appKey
}
}
data
.
sign
=
sign
(
data
,
common
.
secret
,
noSignAttr
,
isOtherUrl
)
data
.
sign
=
sign
(
data
,
common
.
secret
,
noSignAttr
,
isOtherUrl
)
...
...
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