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
9fd45750
authored
Aug 11, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
权限问题
parent
d770f77b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
9 deletions
app/Http/Controllers/Filter/SupplierAccountFilter.php
resources/views/script/SupplierAccountListScript.blade.php
resources/views/script/SupplierSubAccountListScript.blade.php
resources/views/web/SupplierAccountList.blade.php
resources/views/web/SupplierSubAccountList.blade.php
app/Http/Controllers/Filter/SupplierAccountFilter.php
View file @
9fd45750
...
...
@@ -3,8 +3,11 @@
namespace
App\Http\Controllers\Filter
;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\DepartmentService
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Support\Facades\DB
;
class
SupplierAccountFilter
{
...
...
@@ -13,11 +16,23 @@ class SupplierAccountFilter
{
$map
=
$request
->
all
();
$model
=
new
SupplierAccountModel
();
$query
=
$model
->
where
(
'parent_id'
,
0
)
->
orderBy
(
'id'
,
'desc'
);
$query
=
$model
->
where
(
'parent_id'
,
0
)
->
orderBy
(
'id'
,
'desc'
);
if
(
!
checkPerm
(
'ViewAllSupplierAccount'
))
{
$supplierIds
=
SupplierChannelModel
::
where
(
'yunxin_channel_uid'
,
$request
->
user
->
codeId
)
->
pluck
(
'supplier_id'
)
->
toArray
();
if
(
checkPerm
(
'ViewSubSupplierAccount'
))
{
$departmentService
=
new
DepartmentService
();
//下属用户id(结果包括自己的id)
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$request
->
user
->
userId
);
$adminUserService
=
new
AdminUserService
();
$subordinateCodeIds
=
$adminUserService
->
getCodeIdsByUserIds
(
$subordinateUserIds
);
$subordinateCodeIds
=
$subordinateCodeIds
->
toArray
();
$supplierIds
=
SupplierChannelModel
::
whereIn
(
'yunxin_channel_uid'
,
$subordinateCodeIds
)
->
pluck
(
'supplier_id'
)
->
toArray
();
$query
->
whereIn
(
'supplier_id'
,
$supplierIds
);
}
else
{
//否则只能查看自己的
$supplierIds
=
SupplierChannelModel
::
where
(
'yunxin_channel_uid'
,
$request
->
user
->
codeId
)
->
pluck
(
'supplier_id'
)
->
toArray
();
$query
->
whereIn
(
'supplier_id'
,
$supplierIds
);
}
}
if
(
!
empty
(
$map
[
'supplier_name'
]))
{
...
...
resources/views/script/SupplierAccountListScript.blade.php
View file @
9fd45750
...
...
@@ -11,19 +11,23 @@
let
whereCondition
=
initCondition
;
let
type
=
'all'
;
let
canViewAccountInfo
=
{{
checkPerm
(
"ViewSupplierAccountInfo"
)?
1
:
0
}};
let
cols
=
[
{
type
:
'radio'
},
{
field
:
'id'
,
title
:
'ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'mobile'
,
title
:
'账号'
,
align
:
'center'
,
width
:
170
,
templet
:
function
(
data
)
{
return
'
<
span
>
' + data.mobile + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="mobile" id="' + data.id + '">查看</
span
>
'
let
text
=
canViewAccountInfo
?
'查看'
:
''
;
return
'
<
span
>
' + data.mobile + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="mobile" id="' + data.id + '">' + text + '</
span
>
';
}
},
{
field: '
password_raw
', title: '
密码
', align: '
center
', width: 170,
templet: function (data) {
return '
<
span
>
' + data.password_raw + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="password_raw" id="' + data.id + '">查看</
span
>
'
let text = canViewAccountInfo ? '
查看
' : '';
return '
<
span
>
' + data.password_raw + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="password_raw" id="' + data.id + '">' + text + '</
span
>
';
}
},
{
...
...
resources/views/script/SupplierSubAccountListScript.blade.php
View file @
9fd45750
...
...
@@ -196,7 +196,7 @@
}
else
{
let
id
=
$
(
this
).
attr
(
'id'
);
let
type
=
$
(
this
).
attr
(
'type'
);
let
resp
=
ajax
(
'/api/supplier_account/GetSupplier
Sub
Account'
,
{
id
:
id
,
type
:
type
});
let
resp
=
ajax
(
'/api/supplier_account/GetSupplierAccount'
,
{
id
:
id
,
type
:
type
});
if
(
!
resp
)
{
layer
.
msg
(
'网络连接失败'
,
{
'icon'
:
5
});
return
false
;
...
...
@@ -208,8 +208,8 @@
case
'mobile'
:
$
(
this
).
prev
().
text
(
resp
.
data
.
mobile
);
break
;
case
'
password_raw
'
:
$
(
this
).
prev
().
text
(
resp
.
data
.
password_raw
);
case
'
email
'
:
$
(
this
).
prev
().
text
(
resp
.
data
.
email
);
break
;
}
console
.
log
(
resp
);
...
...
resources/views/web/SupplierAccountList.blade.php
View file @
9fd45750
...
...
@@ -47,12 +47,15 @@
</form>
</div>
<div
style=
"margin-left: 20px;margin-right: 20px"
>
@if(checkPerm('OperateSupplierAccount'))
<div
class=
"layui-btn-group demoTable"
style=
"margin-top: 15px"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"add_supplier_account"
>
新增账号
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"update_supplier_account"
>
修改
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"enable_supplier_account"
>
启用
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"disable_supplier_account"
>
禁用
</button>
</div>
@endif
<table
class=
"layui-table"
id=
"supplierAccountList"
lay-filter=
"supplierAccountList"
></table>
</div>
...
...
resources/views/web/SupplierSubAccountList.blade.php
View file @
9fd45750
...
...
@@ -49,8 +49,18 @@
<tbody>
<tr>
<td>
{{$supplierAccount['contacts_name']}}
</td>
<td>
{{$supplierAccount['mobile']}}
</td>
<td>
{{$supplierAccount['email']}}
</td>
<td>
<span>
{{$supplierAccount['mobile']}}
</span>
@if(checkPerm('ViewSupplierAccountInfo')
&&
!empty($supplierAccount['mobile']))
<span
style=
"color: dodgerblue;margin-left: 10px"
class=
"viewAccount"
type=
"mobile"
id=
"{{$supplierAccount['id']}}"
>
查看
</span>
@endif
</td>
<td>
<span>
{{$supplierAccount['email']}}
</span>
@if(checkPerm('ViewSupplierAccountInfo')
&&
!empty($supplierAccount['email']))
<span
style=
"color: dodgerblue;margin-left: 10px"
class=
"viewAccount"
type=
"email"
id=
"{{$supplierAccount['id']}}"
>
查看
</span>
@endif
</td>
<td>
{{$supplierAccount['create_time']}}
</td>
<td>
<button
class=
"layui-btn layui-btn-sm"
id=
"saveSupplierAccountMessagePerm"
>
详情
</button>
...
...
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