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 0c5e60f0
authored
Nov 23, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
b9d9d1b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
43 deletions
html/employee/add.html
html/merchant/edit.html
html/merchant/index.html
html/employee/add.html
View file @
0c5e60f
This diff is collapsed.
Click to expand it.
html/merchant/edit.html
View file @
0c5e60f
...
@@ -11,14 +11,25 @@
...
@@ -11,14 +11,25 @@
<style>
<style>
/* 为禁用状态保持高亮样式 */
/* 为禁用状态保持高亮样式 */
.highlighted-disabled
span
{
/* .layui-form-checked + div > span:first-child {
background-color
:
#f0f0f0
;
/* 确保这与 .highlighted 中的样式相同 */
background-color: var(--btnBlue) !important;
border-color
:
blue
;
/* 确保这与 .highlighted 中的样式相同 */
color: #fff !important;
opacity
:
1
;
/* 重置可能由于禁用状态而降低的透明度 */
} */
/* 更多需要保持的样式 */
.layui-form-checked
>
span
:first-child
{
background-color
:
var
(
--btnBlue
)
!important
;
color
:
#fff
!important
;
}
}
/* .layui-form-checked + div > span:first-child:hover {
background-color: red;
color: #fff !important;
} */
/* .highlighted-disabled + div > span:first-child:hover {
background-color: var(--btnBlue) !important;
color: inherit !important;
} */
.marCheckbox
{
.marCheckbox
{
display
:
flex
;
display
:
flex
;
}
}
...
@@ -801,7 +812,6 @@ var mySelect = layui.xmSelect.render({
...
@@ -801,7 +812,6 @@ var mySelect = layui.xmSelect.render({
}
}
},
},
on
:
function
(
data
)
{
on
:
function
(
data
)
{
_superMerchantInfo
=
data
?.
arr
[
0
]
_superMerchantInfo
=
data
?.
arr
[
0
]
var
handleAccountTypeToArray
=
data
?.
arr
[
0
]?.
accountType
.
split
(
','
)
var
handleAccountTypeToArray
=
data
?.
arr
[
0
]?.
accountType
.
split
(
','
)
renderAccountTypes
(
handleAccountTypeToArray
,
merchantForm
.
accountType
,
merchantForm
.
subAccountTypeList
,
_currentMerchantLevel
)
renderAccountTypes
(
handleAccountTypeToArray
,
merchantForm
.
accountType
,
merchantForm
.
subAccountTypeList
,
_currentMerchantLevel
)
...
@@ -838,8 +848,9 @@ function resetXmSelectSearch() {
...
@@ -838,8 +848,9 @@ function resetXmSelectSearch() {
// // 重新加载数据
// // 重新加载数据
loadSuperiorMerchants
(
currentPage
).
then
(
function
(
list
)
{
loadSuperiorMerchants
(
currentPage
).
then
(
function
(
list
)
{
mySelect
.
update
({
data
:
list
});
mySelect
.
update
({
data
:
list
});
mySelect
.
setValue
([{
name
:
superiorMerchant
[
0
]?.
name
,
value
:
superiorMerchant
[
0
]?.
value
}]);
if
(
_currentMerchantLevel
!=
1
){
mySelect
.
setValue
([{
name
:
superiorMerchant
[
0
]?.
name
,
value
:
superiorMerchant
[
0
]?.
value
}]);
}
});
});
}
}
var
debouncedScroll
=
debounce
(
function
()
{
var
debouncedScroll
=
debounce
(
function
()
{
...
@@ -900,6 +911,9 @@ function removeScrollListener() {
...
@@ -900,6 +911,9 @@ function removeScrollListener() {
}
}
attachScrollListener
();
attachScrollListener
();
// 定义一个防抖版本的 prepareExecuteFindMenuFun
var
debouncedPrepareExecuteFindMenuFun
=
debounce
(
prepareExecuteFindMenuFun
,
800
);
// 800ms 作为防抖时间
form
.
on
(
'checkbox'
,
function
(
data
)
{
form
.
on
(
'checkbox'
,
function
(
data
)
{
var
selectedValues
=
[];
var
selectedValues
=
[];
...
@@ -917,7 +931,7 @@ if (!$(data.elem).closest('[id^=project]').length) {
...
@@ -917,7 +931,7 @@ if (!$(data.elem).closest('[id^=project]').length) {
// 只有当点击的复选框未被禁用,且不是"project"相关的复选框时,执行后续操作
// 只有当点击的复选框未被禁用,且不是"project"相关的复选框时,执行后续操作
if
(
!
data
.
elem
.
disabled
)
{
if
(
!
data
.
elem
.
disabled
)
{
clearRoleAuthTabContent
();
clearRoleAuthTabContent
();
p
repareExecuteFindMenuFun
()
debouncedP
repareExecuteFindMenuFun
()
}
}
}
}
});
});
...
@@ -1018,34 +1032,86 @@ function clearRoleAuthTabContent() {
...
@@ -1018,34 +1032,86 @@ function clearRoleAuthTabContent() {
// 监听账户等级下拉框的选择事件
// 监听账户等级下拉框的选择事件
form
.
on
(
'select(accountLevelFilter)'
,
function
(
data
)
{
// form.on('select(accountLevelFilter)', function(data) {
if
(
data
.
value
==
1
||
data
.
value
==
4
){
// if(data.value == 1 || data.value ==4){
$
(
'#accountLevelElTab option[value="1"]'
).
prop
(
'disabled'
,
false
)
// $('#accountLevelElTab option[value="1"]').prop('disabled',false)
$
(
'#accountLevelElTab option[value="2"]'
).
prop
(
'disabled'
,
false
)
// $('#accountLevelElTab option[value="2"]').prop('disabled',false)
$
(
'#accountLevelElTab option[value="3"]'
).
prop
(
'disabled'
,
false
)
// $('#accountLevelElTab option[value="3"]').prop('disabled',false)
$
(
'#accountLevelElTab option[value="4"]'
).
prop
(
'disabled'
,
false
)
// $('#accountLevelElTab option[value="4"]').prop('disabled',false)
}
// }
// 如果选中的是“工厂”
// // 如果选中的是“工厂”
if
(
data
.
value
==
'1'
)
{
// if (data.value == '1') {
// 隐藏上级商户的表单项
// // 隐藏上级商户的表单项
$
(
'#superiorMerchantContainer'
).
hide
();
// $('#superiorMerchantContainer').hide();
}
else
{
// } else {
// 显示上级商户的表单项
// // 显示上级商户的表单项
$
(
'#superiorMerchantContainer'
).
show
();
// $('#superiorMerchantContainer').show();
}
// }
_currentMerchantLevel
=
data
.
value
// _currentMerchantLevel = data.value
if
(
data
.
value
==
3
)
$
(
'#accountLevelElTab option[value="2"]'
).
prop
(
'disabled'
,
true
)
// if(data.value == 3) $('#accountLevelElTab option[value="2"]').prop('disabled',true)
if
(
data
.
value
==
2
)
$
(
'#accountLevelElTab option[value="3"]'
).
prop
(
'disabled'
,
true
)
// if(data.value == 2) $('#accountLevelElTab option[value="3"]').prop('disabled',true)
if
(
data
.
value
==
2
&&
_subMerchantNoList
?.
length
>
0
||
data
.
value
==
3
&&
_subMerchantNoList
?.
length
>
0
){
// if(data.value ==2 && _subMerchantNoList?.length>0 || data.value ==3 && _subMerchantNoList?.length>0 ){
$
(
"#accountLevelElTab"
).
attr
(
"disabled"
,
"disabled"
);
// $("#accountLevelElTab").attr("disabled", "disabled");
$
(
"#accountLevelElTab"
).
attr
(
"style"
,
"background-color: #EEEEEE;"
);
// $("#accountLevelElTab").attr("style", "background-color: #EEEEEE;");
}
// }
renderAccountTypes
(
_superMerchantInfo
?.
accountType
?.
split
(
','
),
merchantForm
.
accountType
,
merchantForm
.
subAccountTypeList
,
_currentMerchantLevel
);
// renderAccountTypes(_superMerchantInfo?.accountType?.split(','), merchantForm.accountType, merchantForm.subAccountTypeList,_currentMerchantLevel);
clearRoleAuthTabContent
();
// clearRoleAuthTabContent();
prepareExecuteFindMenuFun
()
// prepareExecuteFindMenuFun()
form
.
render
();
// 可选,根据需要重新渲染表单
// form.render(); // 可选,根据需要重新渲染表单
// });
// Listen for the account level dropdown selection event
form
.
on
(
'select(accountLevelFilter)'
,
function
(
data
)
{
var
$accountLevelElTab
=
$
(
'#accountLevelElTab'
);
var
$options
=
$accountLevelElTab
.
find
(
'option'
);
var
$superiorMerchantContainer
=
$
(
'#superiorMerchantContainer'
);
var
_currentMerchantLevel
=
data
.
value
;
function
setOptionsDisabled
(
disabled
)
{
$options
.
each
(
function
()
{
var
value
=
$
(
this
).
attr
(
'value'
);
$
(
this
).
prop
(
'disabled'
,
disabled
.
includes
(
value
));
});
});
}
function
toggleMerchantContainerDisplay
(
show
)
{
if
(
show
)
{
$superiorMerchantContainer
.
show
();
}
else
{
$superiorMerchantContainer
.
hide
();
}
}
switch
(
_currentMerchantLevel
)
{
case
'1'
:
case
'4'
:
setOptionsDisabled
([]);
toggleMerchantContainerDisplay
(
_currentMerchantLevel
!==
'1'
);
break
;
case
'2'
:
setOptionsDisabled
([
'3'
]);
toggleMerchantContainerDisplay
(
true
);
break
;
case
'3'
:
setOptionsDisabled
([
'2'
]);
toggleMerchantContainerDisplay
(
true
);
break
;
}
if
((
_currentMerchantLevel
===
'2'
||
_currentMerchantLevel
===
'3'
)
&&
_subMerchantNoList
?.
length
>
0
)
{
$accountLevelElTab
.
prop
(
'disabled'
,
true
).
css
(
'background-color'
,
'#EEEEEE'
);
}
else
{
$accountLevelElTab
.
prop
(
'disabled'
,
false
).
css
(
'background-color'
,
''
);
}
renderAccountTypes
(
_superMerchantInfo
?.
accountType
?.
split
(
','
),
merchantForm
.
accountType
,
merchantForm
.
subAccountTypeList
,
_currentMerchantLevel
);
clearRoleAuthTabContent
();
prepareExecuteFindMenuFun
();
form
.
render
();
});
// 校验
// 校验
form
.
verify
({
form
.
verify
({
...
@@ -1919,15 +1985,17 @@ function uniqueNodes(nodes) {
...
@@ -1919,15 +1985,17 @@ function uniqueNodes(nodes) {
loadSuperiorMerchants
(
currentPage
).
then
(
function
(
list
)
{
loadSuperiorMerchants
(
currentPage
).
then
(
function
(
list
)
{
_xmSelectData
=
list
_xmSelectData
=
list
mySelect
.
update
({
data
:
list
});
mySelect
.
update
({
data
:
list
});
if
(
accountLevel
!=
=
1
){
if
(
accountLevel
!=
1
){
_superMerchantInfo
=
{
name
:
merchantForm
.
superiorMerchantName
,
_superMerchantInfo
=
{
name
:
merchantForm
.
superiorMerchantName
,
value
:
merchantForm
.
superiorMerchantNo
,
value
:
merchantForm
.
superiorMerchantNo
,
parentId
:
merchantForm
.
parentId
,
parentId
:
merchantForm
.
parentId
,
accountType
:
merchantForm
.
superiorAccountType
accountType
:
merchantForm
.
superiorAccountType
}
}
mySelect
.
setValue
([{
name
:
merchantForm
.
superiorMerchantName
,
value
:
merchantForm
.
superiorMerchantNo
}]);
mySelect
.
setValue
([{
name
:
merchantForm
.
superiorMerchantName
,
value
:
merchantForm
.
superiorMerchantNo
}]);
}
else
{
mySelect
.
setValue
([])
}
}
});
});
// 省市回显
// 省市回显
...
@@ -2007,7 +2075,7 @@ loadSuperiorMerchants(currentPage).then(function(list) {
...
@@ -2007,7 +2075,7 @@ loadSuperiorMerchants(currentPage).then(function(list) {
// 设置为选中和禁用,并添加高亮类
// 设置为选中和禁用,并添加高亮类
if
(
isChecked
)
{
if
(
isChecked
)
{
checkboxHtml
.
attr
(
'checked'
,
true
)
checkboxHtml
.
attr
(
'checked'
,
true
)
.
addClass
(
'highlighted'
).
attr
(
'disabled'
,
true
)
}
}
if
(
isDisable
){
if
(
isDisable
){
checkboxHtml
.
attr
(
'disabled'
,
true
).
addClass
(
'highlighted-disabled'
)
checkboxHtml
.
attr
(
'disabled'
,
true
).
addClass
(
'highlighted-disabled'
)
...
@@ -2491,10 +2559,6 @@ loadSuperiorMerchants(currentPage).then(function(list) {
...
@@ -2491,10 +2559,6 @@ loadSuperiorMerchants(currentPage).then(function(list) {
// 查询商户的菜单权限树
// 查询商户的菜单权限树
function
findMenuFunTreeByMerId
(
rolePageParams
)
{
function
findMenuFunTreeByMerId
(
rolePageParams
)
{
var
params
=
{}
var
params
=
{}
console
.
log
(
'parentMerchantId'
,
parentMerchantId
)
console
.
log
(
'merchantId'
,
merchantId
)
console
.
log
(
'accountlevel'
,
merchantForm
.
merchantAccountLevel
)
console
.
log
(
'ids'
,
merchantForm
.
accountType
)
if
(
rolePageParams
){
if
(
rolePageParams
){
params
=
rolePageParams
params
=
rolePageParams
}
else
{
}
else
{
...
@@ -2758,7 +2822,9 @@ loadSuperiorMerchants(currentPage).then(function(list) {
...
@@ -2758,7 +2822,9 @@ loadSuperiorMerchants(currentPage).then(function(list) {
}
else
{
}
else
{
params
.
status
=
merchantForm
.
status
params
.
status
=
merchantForm
.
status
}
}
console
.
log
(
params
.
accountTypes
)
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
layer
.
msg
(
'操作成功'
,
{
icon
:
1
icon
:
1
...
...
html/merchant/index.html
View file @
0c5e60f
...
@@ -806,6 +806,7 @@
...
@@ -806,6 +806,7 @@
if
(
!
res
.
data
){
if
(
!
res
.
data
){
layer
.
msg
(
'处理成功,系统已自动创建商户,可返回列表查看'
);
layer
.
msg
(
'处理成功,系统已自动创建商户,可返回列表查看'
);
layer
.
close
(
index
);
// 可以选择是否关闭弹出层
layer
.
close
(
index
);
// 可以选择是否关闭弹出层
getTabelList
(
true
)
}
else
{
}
else
{
layer
.
msg
(
'处理失败,可点击 下载失败模版 查看失败原因'
);
layer
.
msg
(
'处理失败,可点击 下载失败模版 查看失败原因'
);
$
(
layero
).
find
(
'#loadingText'
).
hide
();
$
(
layero
).
find
(
'#loadingText'
).
hide
();
...
...
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