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
3a4149a1
authored
Jan 16, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化下拉框
parent
6a303652
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
31 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/SkuController.php
resources/views/web/BatchUpdateEncoded.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
3a4149a1
...
@@ -55,16 +55,16 @@ class SkuApiController extends Controller
...
@@ -55,16 +55,16 @@ class SkuApiController extends Controller
$supplierCode
=
$request
->
get
(
'supplier_code'
);
$supplierCode
=
$request
->
get
(
'supplier_code'
);
$brandId
=
$request
->
get
(
'brand_ids'
);
$brandId
=
$request
->
get
(
'brand_ids'
);
$brandId
=
str_replace
(
','
,
''
,
$brandId
);
$brandId
=
str_replace
(
','
,
''
,
$brandId
);
// $updateTime = $request->get('update_time');
// $updateTime = $request->get('update_time');
if
(
empty
(
$supplierCode
))
{
if
(
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'请选择供应商'
);
$this
->
response
(
-
1
,
'请选择供应商'
);
}
}
// $startTime = $endTime = 0;
// $startTime = $endTime = 0;
// if ($updateTime) {
// if ($updateTime) {
// $updateTime = explode('~', $updateTime);
// $updateTime = explode('~', $updateTime);
// $startTime = $updateTime[0];
// $startTime = $updateTime[0];
// $endTime = $updateTime[1];
// $endTime = $updateTime[1];
// }
// }
$uploadLogId
=
SkuUploadLogModel
::
where
(
'supplier_code'
,
$supplierCode
)
$uploadLogId
=
SkuUploadLogModel
::
where
(
'supplier_code'
,
$supplierCode
)
->
where
(
'status'
,
SkuUploadLogModel
::
STATUS_HANDLED
)
->
orderBy
(
'id'
,
'desc'
)
->
where
(
'status'
,
SkuUploadLogModel
::
STATUS_HANDLED
)
->
orderBy
(
'id'
,
'desc'
)
...
@@ -79,7 +79,6 @@ class SkuApiController extends Controller
...
@@ -79,7 +79,6 @@ class SkuApiController extends Controller
//改成队列
//改成队列
(
new
SkuService
())
->
batchOffShelfSkuQueue
(
$data
);
(
new
SkuService
())
->
batchOffShelfSkuQueue
(
$data
);
$this
->
response
(
0
,
'批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
$this
->
response
(
0
,
'批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
}
}
...
@@ -95,8 +94,7 @@ class SkuApiController extends Controller
...
@@ -95,8 +94,7 @@ class SkuApiController extends Controller
$this
->
response
(
-
1
,
'请选择供内部编码(采购员)'
);
$this
->
response
(
-
1
,
'请选择供内部编码(采购员)'
);
}
}
//判断采购员是否属于该供应商
//判断采购员是否属于该供应商
$flag
=
SupplierChannelModel
::
where
(
'supplier_code'
,
$canal
)
->
$flag
=
SupplierChannelModel
::
where
(
'supplier_code'
,
$canal
)
->
where
(
'channel_uid'
,
'like'
,
"%
$encoded
%"
)
->
exists
();
where
(
'channel_uid'
,
'like'
,
"%
$encoded
%"
)
->
exists
();
if
(
!
$flag
)
{
if
(
!
$flag
)
{
$this
->
response
(
-
1
,
'选择的采购员不属于该供应商,请重新选择'
);
$this
->
response
(
-
1
,
'选择的采购员不属于该供应商,请重新选择'
);
}
}
...
@@ -107,7 +105,6 @@ class SkuApiController extends Controller
...
@@ -107,7 +105,6 @@ class SkuApiController extends Controller
//改成队列
//改成队列
(
new
SkuService
())
->
batchUpdateEncodedQueue
(
$data
);
(
new
SkuService
())
->
batchUpdateEncodedQueue
(
$data
);
$this
->
response
(
0
,
'批量修改内部编码任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
$this
->
response
(
0
,
'批量修改内部编码任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
}
}
...
@@ -177,14 +174,14 @@ class SkuApiController extends Controller
...
@@ -177,14 +174,14 @@ class SkuApiController extends Controller
$skuIds
=
$request
->
get
(
'sku_ids'
);
$skuIds
=
$request
->
get
(
'sku_ids'
);
$skuTags
=
$request
->
get
(
'sku_tags'
);
$skuTags
=
$request
->
get
(
'sku_tags'
);
if
(
$type
==
1
&&
empty
(
$skuIds
))
{
if
(
$type
==
1
&&
empty
(
$skuIds
))
{
$this
->
response
(
-
1
,
'按型号设置标签,必须先选择型号'
);
$this
->
response
(
-
1
,
'按型号设置标签,必须先选择型号'
);
}
}
if
(
$type
==
2
&&
empty
(
$supplierCode
))
{
if
(
$type
==
2
&&
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'按供应商设置标签,必须先选择供应商'
);
$this
->
response
(
-
1
,
'按供应商设置标签,必须先选择供应商'
);
}
}
(
new
SkuService
())
->
batchAddSkuTags
(
$type
,
$supplierCode
,
$skuIds
,
$skuTags
);
(
new
SkuService
())
->
batchAddSkuTags
(
$type
,
$supplierCode
,
$skuIds
,
$skuTags
);
$text
=
$type
==
1
?
'设置标签成功'
:
'批量设置供应商SKU标签任务已开始,请等待任务完成'
;
$text
=
$type
==
1
?
'设置标签成功'
:
'批量设置供应商SKU标签任务已开始,请等待任务完成'
;
$this
->
response
(
0
,
$text
);
$this
->
response
(
0
,
$text
);
}
}
...
@@ -197,17 +194,17 @@ class SkuApiController extends Controller
...
@@ -197,17 +194,17 @@ class SkuApiController extends Controller
$skuIds
=
$request
->
get
(
'sku_ids'
);
$skuIds
=
$request
->
get
(
'sku_ids'
);
$goodsLabel
=
$request
->
get
(
'goods_label'
);
$goodsLabel
=
$request
->
get
(
'goods_label'
);
if
(
$type
==
1
&&
empty
(
$skuIds
))
{
if
(
$type
==
1
&&
empty
(
$skuIds
))
{
$this
->
response
(
-
1
,
'按型号设置显示类型,必须先选择型号'
);
$this
->
response
(
-
1
,
'按型号设置显示类型,必须先选择型号'
);
}
}
if
(
$type
==
2
&&
empty
(
$supplierCode
))
{
if
(
$type
==
2
&&
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'按供应商设置显示类型,必须先选择供应商'
);
$this
->
response
(
-
1
,
'按供应商设置显示类型,必须先选择供应商'
);
}
}
if
(
empty
(
$goodsLabel
))
{
if
(
empty
(
$goodsLabel
))
{
$this
->
response
(
-
1
,
'请选择显示类型'
);
$this
->
response
(
-
1
,
'请选择显示类型'
);
}
}
(
new
SkuService
())
->
batchUpdateGoodsLabel
(
$type
,
$supplierCode
,
$skuIds
,
$goodsLabel
);
(
new
SkuService
())
->
batchUpdateGoodsLabel
(
$type
,
$supplierCode
,
$skuIds
,
$goodsLabel
);
$text
=
$type
==
1
?
'设置显示类型成功'
:
'批量设置供应SKU商显示类型任务已开始,请等待任务完成'
;
$text
=
$type
==
1
?
'设置显示类型成功'
:
'批量设置供应SKU商显示类型任务已开始,请等待任务完成'
;
$this
->
response
(
0
,
$text
);
$this
->
response
(
0
,
$text
);
}
}
...
...
app/Http/Controllers/SkuController.php
View file @
3a4149a1
...
@@ -95,6 +95,8 @@ class SkuController extends Controller
...
@@ -95,6 +95,8 @@ class SkuController extends Controller
}
}
$this
->
data
[
'supplierCodes'
]
=
$supplierCodes
;
$this
->
data
[
'supplierCodes'
]
=
$supplierCodes
;
$this
->
data
[
'userCodes'
]
=
$userCodes
;
$this
->
data
[
'userCodes'
]
=
$userCodes
;
$supplierData
=
SupplierService
::
getSupplierCodeListForXmSelect
();
$this
->
data
[
'supplierData'
]
=
$supplierData
;
return
$this
->
view
(
'批量修改内部编码'
);
return
$this
->
view
(
'批量修改内部编码'
);
}
}
...
...
resources/views/web/BatchUpdateEncoded.blade.php
View file @
3a4149a1
...
@@ -7,26 +7,29 @@
...
@@ -7,26 +7,29 @@
<div
class=
"layui-card-body"
>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('multiSelectorPresenter', 'App\Presenters\MultiSelectorPresenter')
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $multiSelectorPresenter->render('canal', '供应商选择', '', $supplierData, [
{!! $statusPresenter->render('canal','供应商选择 : ',null,
'required' => true,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
'radio' => 'true',
</div>
'width' => '400px',
]) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
<div
class=
"layui-inline"
style=
""
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
@inject('statusPresenter', 'App\Presenters\StatusPresenter')
{!! $statusPresenter->render('encoded','内部编码 : ',null,
{!! $statusPresenter->render('encoded', '内部编码 : ', null, $userCodes, [
$userCodes,['required'=>true,'width'=>'400px']) !!}
'required' => true,
'width' => '400px',
]) !!}
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"batchUpdateEncoded"
>
确认
lay-filter=
"batchUpdateEncoded"
>
确认
</button>
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
lay-filter=
"cancel"
>
取消
</button>
</button>
</div>
</div>
</div>
</div>
...
...
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