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
d065baa4
authored
Jul 27, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
等级和认证
parent
1baeece6
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
5 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierTagService.php
app/Http/Transformers/SupplierTransformer.php
config/fixed.php
config/validate.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
d065baa4
...
...
@@ -70,6 +70,9 @@ class SupplierApiController extends Controller
'system_tags'
,
'customer_tags'
,
'level'
,
'has_certification'
,
];
public
function
Entrance
(
Request
$request
,
$id
)
...
...
app/Http/Controllers/SupplierController.php
View file @
d065baa4
...
...
@@ -5,10 +5,8 @@ namespace App\Http\Controllers;
use
App\Http\Services\LogService
;
use
App\Http\Services\RegionService
;
use
App\Http\Services\SupplierAttachmentService
;
use
App\Http\Services\SupplierAuditService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierStatisticsService
;
use
App\Http\Services\SupplierTagService
;
use
App\Http\Transformers\LogTransformer
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Model\IntracodeModel
;
...
...
app/Http/Services/SupplierTagService.php
View file @
d065baa4
...
...
@@ -49,6 +49,9 @@ class SupplierTagService
//新增/修改标签和供应商id对应关系到标签系统
public
function
saveTags
(
$supplierId
,
$tagUse
,
$newTags
,
$oldTags
)
{
if
((
!
$newTags
)
&&
(
!
$oldTags
))
{
return
true
;
}
$newTags
=
explode
(
','
,
$newTags
);
$oldTags
=
explode
(
','
,
$oldTags
);
//先区分哪些需要删除,哪些需要修改
...
...
@@ -94,6 +97,10 @@ class SupplierTagService
]
];
}
//没有参数就直接跳过吧
if
(
empty
(
$params
))
{
return
true
;
}
$response
=
$this
->
client
->
post
(
'/update'
,
[
RequestOptions
::
JSON
=>
$params
,
]);
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
d065baa4
...
...
@@ -36,7 +36,7 @@ class SupplierTransformer
$supplier
[
'channel_username'
]
=
$this
->
getChannelUserNames
(
$supplier
[
'channel_uid'
]);
$supplier
[
'purchase_username'
]
=
array_get
(
$users
,
$supplier
[
'purchase_uid'
]);
$supplier
[
'status_name'
]
=
array_get
(
config
(
'fixed.SupplierStatus'
),
$supplier
[
'status'
]);
$supplier
[
'region_name'
]
=
array_get
(
config
(
'fixed.Region'
),
$supplier
[
'region'
],
'暂无'
);
$supplier
[
'region_name'
]
=
array_get
(
config
(
'fixed.Region'
),
$supplier
[
'region'
],
'暂无'
);
$supplier
[
'contact_num'
]
=
$this
->
getContactNum
(
$supplier
[
'supplier_id'
]);
$supplier
[
'has_sku'
]
=
$supplier
[
'sku_num'
]
?
'是'
:
'否'
;
$supplier
[
'is_own'
]
=
$supplier
[
'create_uid'
]
==
request
()
->
user
->
userId
?
"创建"
:
"指派"
;
...
...
@@ -125,6 +125,8 @@ class SupplierTransformer
$supplier
[
'last_update_name'
]
=
$log
[
'admin_name'
]
?:
'无'
;
$supplier
[
'last_update_time'
]
=
empty
(
$supplier
[
'last_update_time'
])
?
date
(
'Y-m-d H:i:s'
,
$log
[
'add_time'
])
:
'无'
;
$supplier
[
'has_certification'
]
=
array_get
(
config
(
'fixed.CertificationStatus'
),
$supplier
[
'has_certification'
],
''
);
return
$supplier
;
}
...
...
@@ -235,7 +237,7 @@ class SupplierTransformer
$attachment
=
[];
$attachmentFields
=
config
(
'field.AttachmentFields'
);
foreach
(
$channel
as
$key
=>
$field
)
{
foreach
(
$channel
as
$key
=>
$field
)
{
if
(
in_array
(
$key
,
$attachmentFields
))
{
$attachment
[
$key
]
=
$field
;
unset
(
$channel
[
$key
]);
...
...
config/fixed.php
View file @
d065baa4
...
...
@@ -229,4 +229,9 @@ return [
'expire'
=>
'七天后过期'
,
'off_shelf'
=>
'下架'
,
],
'CertificationStatus'
=>
[
-
1
=>
'非认证'
,
1
=>
'认证'
,
]
];
config/validate.php
View file @
d065baa4
...
...
@@ -46,5 +46,7 @@ return [
'return_consignee'
=>
'退货收货人'
,
'system_tags'
=>
'系统标签'
,
'customer_tags'
=>
'自定义标签'
,
'level'
=>
'等级'
,
'has_certification'
=>
'认证'
,
]
];
\ No newline at end of file
resources/views/web/SupplierDetail.blade.php
View file @
d065baa4
...
...
@@ -155,7 +155,8 @@
<div
class=
"layui-col-md12"
>
{{array_get(config('fixed.FileNameMapping'),$key)}} :
@foreach($item as $k=>$v)
<a
href=
"{{$v['url']}}"
style=
"color: dodgerblue"
target=
"_blank"
>
{{$v['file_name']}}
</a>
|
<a
href=
"{{$v['url']}}"
style=
"color: dodgerblue"
target=
"_blank"
>
{{$v['file_name']}}
</a>
|
@endforeach
</div>
@endif
...
...
@@ -188,6 +189,15 @@
<b>
供应商标签
</b>
</blockquote>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md2"
>
等级 :{{$supplier['level']}}
</div>
<div
class=
"layui-col-md3"
>
认证 :{{$supplier['has_certification']}}
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md6"
></div>
<div
class=
"layui-col-md12"
>
系统标签 :
@foreach (explode(',',$supplier['system_tags']) as $tag)
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
d065baa4
...
...
@@ -161,6 +161,18 @@
<b>
供应商标签 :
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md3"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('level','等级',!empty($supplier)?$supplier['level']:'',['A'=>'A','B'=>'B','C'=>'C','D'=>'D','E'=>'E'],['width'=>'150px']) !!}
</div>
<div
class=
"layui-col-md3"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('has_certification','认证',!empty($supplier)?$supplier['has_certification']:'',[1=>'认证',-1=>'非认证'],['width'=>'150px']) !!}
</div>
<div
class=
"layui-col-md6"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
系统标签 :
</label>
<div
class=
"layui-input-block"
style=
"margin-top: 15px"
>
...
...
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