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
a3f73892
authored
Dec 09, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化
parent
fe22708b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
25 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/SkuController.php
app/Http/Services/SupplierService.php
app/Http/Services/SyncSupplierService.php
app/Presenters/MultiSelectorPresenter.php
resources/views/script/SupplierDetailScript.blade.php
resources/views/web/BatchUpdateGoodsLabel.blade.php
resources/views/web/SupplierDetail.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
a3f73892
...
...
@@ -205,8 +205,6 @@ class SkuApiController extends Controller
if
(
empty
(
$goodsLabel
))
{
$this
->
response
(
-
1
,
'请选择显示类型'
);
}
(
new
SkuService
())
->
batchUpdateGoodsLabel
(
$type
,
$supplierCode
,
$skuIds
,
$goodsLabel
);
$text
=
$type
==
1
?
'设置显示类型成功'
:
'批量设置供应SKU商显示类型任务已开始,请等待任务完成'
;
...
...
app/Http/Controllers/SkuController.php
View file @
a3f73892
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
App\Http\Controllers\Filter\LogFilter
;
use
App\Http\Controllers\Filter\SupplierLogFilter
;
use
App\Http\Services\LogService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierTagService
;
use
App\Model\BrandModel
;
use
App\Model\IntracodeModel
;
...
...
@@ -131,21 +132,13 @@ class SkuController extends Controller
$this
->
data
[
'isIedge'
]
=
$orgId
==
1
?
false
:
true
;
$this
->
data
[
'orgId'
]
=
$orgId
;
$this
->
data
[
'title'
]
=
'批量设置sku显示类型'
;
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'status'
,
2
)
->
select
([
'supplier_name'
,
'supplier_code'
])
->
get
();
$supplierCodes
=
[];
foreach
(
$suppliers
as
$supplier
)
{
$supplier
=
$supplier
->
toArray
();
$supplierCodes
[
$supplier
[
'supplier_code'
]]
=
$supplier
[
'supplier_name'
]
.
'('
.
$supplier
[
'supplier_code'
]
.
')'
;
}
$skuIds
=
$request
->
input
(
'sku_ids'
);
if
(
!
empty
(
$skuIds
))
{
$skuIds
=
explode
(
','
,
$skuIds
);
$this
->
data
[
'skuIds'
]
=
$skuIds
;
}
$this
->
data
[
'supplier
Codes'
]
=
$supplierCodes
;
$supplierData
=
SupplierService
::
getSupplierCodeListForXmSelect
();
$this
->
data
[
'supplier
Data'
]
=
$supplierData
;
return
$this
->
view
(
'批量设置sku显示类型'
);
}
...
...
app/Http/Services/SupplierService.php
View file @
a3f73892
...
...
@@ -222,7 +222,6 @@ class SupplierService
$supplierAddressService
->
saveShippingAddress
(
$supplierId
,
$shippingAddress
);
}
else
{
/**这里的是更新供应商的操作**/
$supplierId
=
$this
->
newSupplierId
=
$channel
[
'supplier_id'
];
...
...
@@ -886,7 +885,7 @@ class SupplierService
{
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$originSupplierName
=
$supplier
[
'supplier_name'
];
//修改名称,
只有驳回状态下才可以修改,
修改后要重新提交数据给一体化那边进行审核
//修改名称,修改后要重新提交数据给一体化那边进行审核
$businessLicense
=
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'field_name'
,
'business_license'
)
->
value
(
'file_url'
);
//如果是非大陆的供应商,那么商业登记证的优先级大于营业执照
...
...
@@ -927,4 +926,20 @@ class SupplierService
return
true
;
}
//获取供应商编码给xm-select使用
public
static
function
getSupplierCodeListForXmSelect
()
{
$supplierList
=
SupplierChannelModel
::
where
(
'status'
,
'!='
,
SupplierChannelModel
::
STATUS_DISABLE
)
->
select
([
'supplier_code'
,
'supplier_name'
,
'supplier_id'
])
->
get
()
->
toArray
();
$data
=
[];
foreach
(
$supplierList
as
$supplier
)
{
$data
[]
=
[
'name'
=>
"
{
$supplier
[
'supplier_name'
]
}
(
{
$supplier
[
'supplier_code'
]
}
)"
,
'value'
=>
$supplier
[
'supplier_code'
],
];
}
return
$data
;
}
}
app/Http/Services/SyncSupplierService.php
View file @
a3f73892
...
...
@@ -291,6 +291,14 @@ class SyncSupplierService
}
foreach
(
$suppliers
as
$supplier
)
{
//判断是否是同名多供应商,如果是的话,如果是之前已经禁用的,则直接跳过
if
(
count
(
$suppliers
)
>
1
)
{
if
(
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
)
{
Log
::
warning
(
"检测到同名供应商并且属于禁用状态,跳过,供应商id为 : "
.
$supplier
[
'supplier_id'
]);
continue
;
}
}
$originIsEntity
=
$supplier
[
'is_entity'
];
//$supplier = $supplier->toArray();
$supplierId
=
$supplier
[
'supplier_id'
];
...
...
app/Presenters/MultiSelectorPresenter.php
View file @
a3f73892
...
...
@@ -11,6 +11,7 @@ class MultiSelectorPresenter
$data
=
$data
?:
[[
'name'
=>
'启用'
,
'value'
=>
1
],
[
'name'
=>
'禁用'
,
'value'
=>
-
1
]];
$isRequired
=
array_get
(
$option
,
'required'
,
false
);
$width
=
array_get
(
$option
,
'width'
,
'157px'
);
$radio
=
array_get
(
$option
,
'radio'
,
'false'
);
$requiredHtml
=
$isRequired
?
'<span style="color: red">*</span>'
:
""
;
$elemId
=
$name
.
"Selector"
;
$data
=
json_encode
(
$data
);
...
...
@@ -19,7 +20,7 @@ class MultiSelectorPresenter
$requiredHtml
$text</label>
<div class="layui-input-inline" style="margin-top: 0">
<div id="$elemId" class="layui-input-inline" value="$value" style="width: $width;">
<div id="$elemId" class="layui-input-inline" value="$value" style="width: $width;">
</div>
<input type="hidden" name="$name" id="$name" value="$value">
</div>
...
...
@@ -37,6 +38,7 @@ class MultiSelectorPresenter
name: 'name',
value: 'value'
},
radio: $radio,
size: 'mini',
direction: 'down',
data : $data,
...
...
@@ -61,4 +63,4 @@ class MultiSelectorPresenter
EOF;
return
$html
;
}
}
\ No newline at end of file
}
resources/views/script/SupplierDetailScript.blade.php
View file @
a3f73892
...
...
@@ -46,7 +46,7 @@
title
:
'输入要修改的供应商名称'
,
btn
:
[
'保存'
,
'取消'
],
},
function
(
supplierName
,
index
)
{
layer
.
msg
(
'sdasdas'
,
{
icon
:
6
});
//
layer.msg('sdasdas', {icon: 6});
let
res
=
ajax
(
'/api/supplier/changeSupplierName'
,
{
supplier_id
:
supplierId
,
supplier_name
:
supplierName
...
...
resources/views/web/BatchUpdateGoodsLabel.blade.php
View file @
a3f73892
...
...
@@ -47,9 +47,11 @@
<div
class=
"layui-form-item"
id=
"supplier_select_div"
style=
"display: none"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_code','供应商选择 : ',null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('supplier_code','供应商选择 : ',null,--}}
{{-- $supplierCodes,['required'=>true,'width'=>'400px']) !!}--}}
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('supplier_code','供应商选择','',$supplierData,['required'=>true,'radio'=>'true','width'=>'400px']) !!}
</div>
</div>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
a3f73892
...
...
@@ -93,11 +93,17 @@
{{
--
class=
"layui-btn layui-btn"
>
取消拉黑--}}
{{--
</button>
--}}
@endif
{{--
如果是驳回,则可以修改名称--}}
{{--
如果是驳回,则可以修改名称--}}
@if($supplier['is_entity'] == \App\Model\SupplierChannelModel::IS_ENTITY_REJECT
&&
empty($supplier['group_code']))
<button
id=
"change_supplier_name"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
修改名称
</button>
<button
id=
"change_supplier_name"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
修改名称
</button>
@endif
{{--如果是待提审/未通过并且集团编码为空,则可以修改名称--}}
@if(($supplier['status'] == \App\Model\SupplierChannelModel::STATUS_PENDING || $supplier['status'] == \App\Model\SupplierChannelModel::STATUS_REJECT)
&&
empty($supplier['group_code']))
<button
id=
"change_supplier_name"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
修改名称
</button>
@endif
@endif
@if (checkPerm('PrintSupplier'))
...
...
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