Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3cf30cd2
authored
Aug 11, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化和修复bug
parent
c766cc51
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
7 deletions
app/Http/Controllers/Api/SupplierAccountApiController.php
resources/views/script/SaveSupplierSubAccountScript.blade.php
resources/views/script/SupplierSubAccountListScript.blade.php
resources/views/web/SaveSupplierSubAccount.blade.php
app/Http/Controllers/Api/SupplierAccountApiController.php
View file @
3cf30cd2
...
...
@@ -187,6 +187,8 @@ class SupplierAccountApiController extends Controller
$this
->
response
(
-
1
,
$validator
->
errors
()
->
first
());
}
$data
[
'user_rule'
]
=
$data
[
'user_rule'
]
?:
[];
dd
(
$data
[
'user_rule'
]);
$data
[
'user_rule'
]
=
json_encode
(
$data
[
'user_rule'
]);
$data
[
'user_message_rule'
]
=
$data
[
'user_message_rule'
]
?:
[];
$data
[
'user_message_rule'
]
=
json_encode
(
$data
[
'user_message_rule'
]);
...
...
resources/views/script/SaveSupplierSubAccountScript.blade.php
View file @
3cf30cd2
...
...
@@ -34,7 +34,6 @@
});
let
permTreeData
=
{
!!
json_encode
(
$menuPerms
)
!!
};
console
.
log
(
permTreeData
);
// 渲染树形组件
let
permTree
=
tree
.
render
({
elem
:
'#permTree'
,
...
...
@@ -57,6 +56,8 @@
}
});
let
isAllSelectPem
=
false
;
let
isAllSelectMessagePem
=
false
;
function
allSelect
(
data
)
{
$
.
each
(
data
,
function
(
index
,
item
)
{
...
...
@@ -69,17 +70,49 @@
})
}
})
});
return
data
;
}
function
excludeAllSelect
(
data
)
{
$
.
each
(
data
,
function
(
index
,
item
)
{
if
(
!
item
.
disabled
)
{
item
.
checked
=
false
;
}
if
(
item
.
children
.
length
)
{
$
.
each
(
item
.
children
,
function
(
index2
,
item2
)
{
if
(
item2
.
checked
)
{
item2
.
checked
=
false
;
}
})
}
});
return
data
;
}
$
(
'#selectAllPerm'
).
click
(
function
()
{
allSelect
(
permTreeData
);
tree
.
reload
(
'permTree'
);
if
(
!
isAllSelectPem
)
{
allSelect
(
permTreeData
);
}
else
{
excludeAllSelect
(
permTreeData
);
}
isAllSelectPem
=
!
isAllSelectPem
;
tree
.
reload
(
'permTree'
,
{
data
:
permTreeData
});
$
(
'#permTree .layui-checkbox-disbaled'
).
addClass
(
'layui-form-checked'
);
});
$
(
'#selectAllMessagePerm'
).
click
(
function
()
{
allSelect
(
messagePermTreeData
);
tree
.
reload
(
'messagePermTree'
);
if
(
!
isAllSelectMessagePem
)
{
messagePermTreeData
=
allSelect
(
messagePermTreeData
);
}
else
{
messagePermTreeData
=
excludeAllSelect
(
messagePermTreeData
);
}
isAllSelectMessagePem
=
!
isAllSelectMessagePem
;
tree
.
reload
(
'messagePermTree'
,
{
data
:
messagePermTreeData
});
});
$
(
function
()
{
...
...
resources/views/script/SupplierSubAccountListScript.blade.php
View file @
3cf30cd2
...
...
@@ -21,6 +21,8 @@
return '
<
span
>
' + '
**********
' + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="password_raw" id="' + data.id + '"></
span
>
'
}
},
{field: '
name
', title: '
联系人
', align: '
center
', width: 100},
{field: '
status_cn
', title: '
状态
', align: '
center
', width: 80},
{field: '
create_type_cn
', title: '
创建人
', align: '
center
', width: 150},
{field: '
create_time_cn
', title: '
创建时间
', align: '
center
', width: 150},
{field: '
update_time_cn
', title: '
修改时间
', align: '
center
', width: 150},
...
...
resources/views/web/SaveSupplierSubAccount.blade.php
View file @
3cf30cd2
...
...
@@ -43,7 +43,7 @@
<div
class=
"layui-col-md3"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
名称
:
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
联系人
:
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"name"
id=
"name"
placeholder=
"请输入名称"
class=
"layui-input"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment