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 98010574
authored
Jan 12, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
员工特殊商户的修改
1 parent
ba3db8c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
14 deletions
html/employee/add.html
html/employee/add.html
View file @
9801057
...
...
@@ -173,8 +173,8 @@
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
可见商户:
</label>
<
!-- <div style="line-height: 32px;">全部商户</div> --
>
<div
class=
"layui-input-block"
>
<
div
class=
"hide"
id=
"allMerchant"
style=
"line-height: 32px;"
>
全部商户
</div
>
<div
class=
"layui-input-block"
id=
"otherMerchant"
>
<input
class=
"layui-input"
placeholder=
"可见商户"
id=
"searchMerchant"
/>
<div
style=
"position: absolute; top: 0; left: 380px"
>
<button
type=
"button"
class=
"layui-btn"
id=
"checkAll"
>
全选
</button>
...
...
@@ -254,7 +254,8 @@
var
visibleMerchant
=
{}
pwd
.
attr
(
'readonly'
,
false
)
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
// 是否是特殊商户
var
specialVisible
=
''
// 禁用所有input框的回车事件
var
inputs
=
document
.
getElementsByTagName
(
'input'
)
for
(
let
i
=
0
;
i
<
inputs
.
length
;
i
++
)
{
...
...
@@ -413,18 +414,24 @@
// 提交表单
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
if
(
specialVisible
!=
'-1'
&&
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
layer
.
msg
(
'可见商户必选'
,
{
icon
:
2
})
return
false
}
var
visibleInferiorMer
=
visibleMerchant
.
getCheckedNodes
(
true
)
.
map
(
function
(
i
)
{
return
i
.
id
})
.
join
(
','
)
var
visibleInferiorMer
=
''
if
(
specialVisible
==
'-1'
)
{
visibleInferiorMer
=
'-1'
}
else
{
visibleInferiorMer
=
visibleMerchant
.
getCheckedNodes
(
true
)
.
map
(
function
(
i
)
{
return
i
.
id
})
.
join
(
','
)
}
var
otherParams
=
{
visibleInferiorMer
:
visibleInferiorMer
,
merchantId
:
merchantId
...
...
@@ -440,6 +447,7 @@
}
var
params
=
helper
.
clone
(
true
,
data
.
field
,
otherParams
)
delete
params
.
merhcnatImg
console
.
log
(
params
)
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
...
...
@@ -482,25 +490,46 @@
function
getVisibleMerchant
(
merchantId
)
{
var
visibleMerchantParams
=
{
id
:
merchantId
,
method
:
'merchants.api.merchant.findMerchantTree'
}
request
(
visibleMerchantParams
,
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
const
data
=
res
.
data
if
(
id
)
{
findAllMerchant
(
function
(
result
)
{
if
(
result
)
{
getById
(
function
(
checkedList
)
{
createMerchant
(
checkedList
,
res
.
data
)
if
(
data
.
length
==
1
&&
data
[
0
].
id
==
-
1
)
{
$
(
'#allMerchant'
).
removeClass
(
'hide'
)
specialVisible
=
data
[
0
].
id
// createMerchant(data[0].id, data)
$
(
'#otherMerchant'
).
addClass
(
'hide'
)
}
else
{
createMerchant
(
checkedList
,
res
.
data
)
}
})
}
})
}
else
{
const
arr
=
[]
arr
.
push
(
+
merchantId
)
createMerchant
(
arr
,
res
.
data
)
if
(
data
.
length
==
1
&&
data
[
0
].
id
==
-
1
)
{
$
(
'#allMerchant'
).
removeClass
(
'hide'
)
specialVisible
=
data
[
0
].
id
// createMerchant(data[0].id, data)
$
(
'#otherMerchant'
).
addClass
(
'hide'
)
}
else
{
const
arr
=
[]
arr
.
push
(
+
merchantId
)
createMerchant
(
arr
,
res
.
data
)
specialVisible
=
''
$
(
'#otherMerchant'
).
removeClass
(
'hide'
)
$
(
'#allMerchant'
).
addClass
(
'hide'
)
}
}
}
})
}
function
createMerchant
(
arr
,
data
)
{
console
.
log
(
arr
,
data
)
visibleMerchant
=
tree
.
create
(
'visibleInferiorMerTree'
,
data
,
null
,
{
check
:
{
enable
:
true
,
...
...
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