Commit d065baa4 by mushishixian

等级和认证

parent 1baeece6
......@@ -70,6 +70,9 @@ class SupplierApiController extends Controller
'system_tags',
'customer_tags',
'level',
'has_certification',
];
public function Entrance(Request $request, $id)
......
......@@ -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;
......
......@@ -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,
]);
......
......@@ -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]);
......
......@@ -229,4 +229,9 @@ return [
'expire' => '七天后过期',
'off_shelf' => '下架',
],
'CertificationStatus' => [
-1 => '非认证',
1 => '认证',
]
];
......@@ -46,5 +46,7 @@ return [
'return_consignee' => '退货收货人',
'system_tags' => '系统标签',
'customer_tags' => '自定义标签',
'level' => '等级',
'has_certification' => '认证',
]
];
\ No newline at end of file
......@@ -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)
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment