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
b91b2ba2
authored
May 13, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
设置sku有效期加上权限区分
parent
92529de4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
app/Http/Controllers/SkuController.php
app/Http/Services/SupplierService.php
resources/views/web/SetSupplierSkuCpTimeLimit.blade.php
app/Http/Controllers/SkuController.php
View file @
b91b2ba2
...
...
@@ -155,10 +155,19 @@ class SkuController extends Controller
$supplier
=
$supplier
->
toArray
();
$supplierCodes
[
$supplier
[
'supplier_code'
]]
=
$supplier
[
'supplier_name'
]
.
'('
.
$supplier
[
'supplier_code'
]
.
')'
;
}
$supplierData
=
SupplierService
::
getSupplierCodeListForXmSelect
();
$onlyOwn
=
!
checkPerm
(
'BatchSetAllSupplierSkuCpTimeLimit'
);
$supplierData
=
SupplierService
::
getSupplierCodeListForXmSelect
(
$onlyOwn
);
$this
->
data
[
'supplierData'
]
=
$supplierData
;
$this
->
data
[
'title'
]
=
'商品有效期配置'
;
$this
->
data
[
'supplierCodes'
]
=
$supplierCodes
;
//判断是否有批量设置的权限,有的话才给批量设置的按钮
$settingOperation
=
[
2
=>
'单个设置'
];
if
(
\checkPerm
(
'BatchSetSupplierSkuCpTimeLimit'
))
{
$settingOperation
[
1
]
=
'批量设置'
;
}
$this
->
data
[
'settingOperation'
]
=
$settingOperation
;
return
$this
->
view
(
'商品有效期配置'
);
}
}
app/Http/Services/SupplierService.php
View file @
b91b2ba2
...
...
@@ -942,11 +942,22 @@ class SupplierService
}
//获取供应商编码给xm-select使用
public
static
function
getSupplierCodeListForXmSelect
()
public
static
function
getSupplierCodeListForXmSelect
(
$onlyOwn
=
false
)
{
$supplierList
=
SupplierChannelModel
::
where
(
'status'
,
'!='
,
SupplierChannelModel
::
STATUS_DISABLE
)
->
select
([
'supplier_code'
,
'supplier_name'
,
'supplier_id'
])
->
get
()
->
toArray
();
if
(
$onlyOwn
)
{
$codeId
=
request
()
->
user
->
codeId
;
$userId
=
request
()
->
user
->
userId
;
$supplierList
=
SupplierChannelModel
::
where
(
'status'
,
'!='
,
SupplierChannelModel
::
STATUS_DISABLE
)
->
where
(
function
(
$query
)
use
(
$codeId
,
$userId
)
{
$query
->
where
(
'channel_uid'
,
'like'
,
"%
{
$codeId
}
%"
)
->
orWhere
(
'purchase_uid'
,
$codeId
)
->
orWhere
(
'create_uid'
,
$userId
);
})
->
select
([
'supplier_code'
,
'supplier_name'
,
'supplier_id'
])
->
get
()
->
toArray
();
}
else
{
$supplierList
=
SupplierChannelModel
::
where
(
'status'
,
'!='
,
SupplierChannelModel
::
STATUS_DISABLE
)
->
select
([
'supplier_code'
,
'supplier_name'
,
'supplier_id'
])
->
get
()
->
toArray
();
}
$data
=
[];
foreach
(
$supplierList
as
$supplier
)
{
$data
[]
=
[
...
...
resources/views/web/SetSupplierSkuCpTimeLimit.blade.php
View file @
b91b2ba2
...
...
@@ -8,16 +8,18 @@
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
style=
"margin-left: -13px"
>
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('set_type','',
1,[1=>'批量设置',2=>'单个设置']
) !!}
{!! $singleSelectPresenter->render('set_type','',
2,$settingOperation
) !!}
</div>
<div
class=
"layui-form-item"
id=
"supplier_group_div"
>
@if(checkPerm('BatchSetAllSupplierSkuCpTimeLimit'))
<div
class=
"layui-form-item"
id=
"supplier_group_div"
style=
"display: none"
>
<div
class=
"layui-inline"
style=
"margin-left: 73px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_group','供应商性质',null,
config('fixed.SupplierGroup'),['required'=>true,'width'=>'150px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
style=
"display: none"
id=
"supplier_code_div"
>
@endif
<div
class=
"layui-form-item"
id=
"supplier_code_div"
>
<div
class=
"layui-inline"
style=
"margin-left: 73px;"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('supplier_code','供应商选择','',$supplierData,['required'=>true,'radio'=>'true','width'=>'400px']) !!}
...
...
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