Commit 6a4d28bb by 杨树贤

罗盘新增选项

parent 3485bffb
...@@ -278,6 +278,9 @@ class SupplierFilter ...@@ -278,6 +278,9 @@ class SupplierFilter
break; break;
case "history_abnormal": case "history_abnormal":
$query->where('system_tags', 'like', '%历史检测异常%'); $query->where('system_tags', 'like', '%历史检测异常%');
break;
case "level_a":
$query->where('level', 'A');
} }
return $query; return $query;
} }
......
...@@ -54,6 +54,8 @@ class SupplierStatisticsService ...@@ -54,6 +54,8 @@ class SupplierStatisticsService
$concatNoComplete = $this->getStatisticsCount('contact_no_complete'); $concatNoComplete = $this->getStatisticsCount('contact_no_complete');
//历史检测异常 //历史检测异常
$historyAbnormal = $this->getStatisticsCount('history_abnormal'); $historyAbnormal = $this->getStatisticsCount('history_abnormal');
//战略供应商(等级为A)
$levelA = $this->getStatisticsCount('level_a');
$result = [ $result = [
'total' => $total, 'total' => $total,
'need_review' => $needReview, 'need_review' => $needReview,
...@@ -72,6 +74,8 @@ class SupplierStatisticsService ...@@ -72,6 +74,8 @@ class SupplierStatisticsService
'no_quality_assurance_agreement' => $noQualityAssuranceAgreement, 'no_quality_assurance_agreement' => $noQualityAssuranceAgreement,
'has_supplier_tag' => $hasTagSupplier, 'has_supplier_tag' => $hasTagSupplier,
'contact_no_complete' => $concatNoComplete, 'contact_no_complete' => $concatNoComplete,
'history_abnormal' => $historyAbnormal,
'level_a' => $levelA,
]; ];
$result = array_map(function ($value) { $result = array_map(function ($value) {
if ($value > 999) { if ($value > 999) {
...@@ -91,10 +95,7 @@ class SupplierStatisticsService ...@@ -91,10 +95,7 @@ class SupplierStatisticsService
$filter = new SupplierFilter(); $filter = new SupplierFilter();
$model = $model->where('supplier_code', '!=', ''); $model = $model->where('supplier_code', '!=', '');
if ($type=='contact_no_complete') { if ($type=='contact_no_complete') {
// dd($filter->defaultFilter($model, $type)->count(DB::raw("distinct(lie_supplier_channel.supplier_id)")));
$subQuery = $filter->defaultFilter($model, $type); $subQuery = $filter->defaultFilter($model, $type);
// dd($subQuery->toSql());
// return DB::connection('web')->table(DB::raw("({$subQuery->toSql()}) as sub"))->count();
return $subQuery->get()->count(); return $subQuery->get()->count();
} }
return $filter->defaultFilter($model, $type)->count(); return $filter->defaultFilter($model, $type)->count();
......
...@@ -17,20 +17,15 @@ class SupplierValidator ...@@ -17,20 +17,15 @@ class SupplierValidator
{ {
//整理下请求数据 //整理下请求数据
$validateData = $this->transformRequestData($validateData); $validateData = $this->transformRequestData($validateData);
$supplierId = $validateData['supplier_id']; $supplierId = $validateData['supplier_id'];
//如果是修改直接提交,不是点申请审核的,只需要校验供应商名称是否存在即可
//如果是直接提交,不是点申请审核的,只需要校验供应商名称是否存在即可 if (!$isAudit && !empty($supplierId)) {
if (!$isAudit) {
if (empty($validateData['supplier_name'])) { if (empty($validateData['supplier_name'])) {
return '供应商名称不能为空'; return '供应商名称不能为空';
} }
if (empty($supplierId)) {
$count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name'])->count();
} else {
$count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name']) $count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name'])
->where('supplier_id', '!=', $supplierId)->count(); ->where('supplier_id', '!=', $supplierId)->count();
}
if ($count) { if ($count) {
return "该供应商名称已经存在,请核验后再提交"; return "该供应商名称已经存在,请核验后再提交";
} }
...@@ -69,16 +64,23 @@ class SupplierValidator ...@@ -69,16 +64,23 @@ class SupplierValidator
//只有在提交供应商是正式的时候,才会去校验附件 //只有在提交供应商是正式的时候,才会去校验附件
if ($validateData['supplier_type'] == 1) { if ($validateData['supplier_type'] == 1) {
if ($isAudit) {
//产品要把表单校验改成审核的时候才去校验,这个时候附件就要单独去取值了,要不然这个时候提交上来的肯定没有附件信息 //产品要把表单校验改成审核的时候才去校验,这个时候附件就要单独去取值了,要不然这个时候提交上来的肯定没有附件信息
$attachments = SupplierAttachmentModel::where('supplier_id', $supplierId)->first(); $attachments = SupplierAttachmentModel::where('supplier_id', $supplierId)->first();
$attachments = !empty($attachments) ? $attachments->toArray() : []; $attachments = !empty($attachments) ? $attachments->toArray() : [];
$validateData = array_merge($validateData, $attachments); $validateData = array_merge($validateData, $attachments);
}
//校验附件,只要营业执照、商业登记证、公司注册证至少其中一个上传了附件,就判定已经上传了附件 //校验附件,只要营业执照、商业登记证、公司注册证至少其中一个上传了附件,就判定已经上传了附件
$attachmentValidateFields = [ $attachmentValidateFields = [
'business_license', 'business_license',
'registration_certificate', 'registration_certificate',
'incorporation_certificate' 'incorporation_certificate'
]; ];
if (!$validateData['billing_information']) {
return '附件 : 请上传开票资料!';
}
$attachmentValidateFieldsExist = false; $attachmentValidateFieldsExist = false;
foreach ($attachmentValidateFields as $field) { foreach ($attachmentValidateFields as $field) {
if (array_get($validateData, $field)) { if (array_get($validateData, $field)) {
......
...@@ -237,8 +237,9 @@ return [ ...@@ -237,8 +237,9 @@ return [
'to_follow_up' => '待跟进', 'to_follow_up' => '待跟进',
'no_sku' => '无sku', 'no_sku' => '无sku',
'no_quality_assurance_agreement' => '无品质协议', 'no_quality_assurance_agreement' => '无品质协议',
'history_abnormal' => '历史检测异常',
'has_supplier_tag' => '客户指定供应商', 'has_supplier_tag' => '客户指定供应商',
'history_abnormal' => '历史检测异常',
'level_a' => '战略供应商',
], ],
//Sku列表的罗盘对应菜单id //Sku列表的罗盘对应菜单id
'SkuListCompassMenuMap' => [ 'SkuListCompassMenuMap' => [
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
<div class="split-group" style="height: 130px;"> <div class="split-group" style="height: 130px;">
<div class="split-item" id="s1"> <div class="split-item" id="s1">
<div class="layui-row"> <div class="layui-row">
{{-- <a class="main_filter layui-badge layui-bg-green" id="all">全部({{$statistics['total']}})</a>--}}
<a class="main_filter layui-badge layui-bg-green" id="total"></a> <a class="main_filter layui-badge layui-bg-green" id="total"></a>
</div> </div>
</div> </div>
...@@ -98,6 +97,14 @@ ...@@ -98,6 +97,14 @@
<a title="公司性质为现货商性质的供应商没有上传品质协议" class="main_filter" id="no_quality_assurance_agreement"> <a title="公司性质为现货商性质的供应商没有上传品质协议" class="main_filter" id="no_quality_assurance_agreement">
</a> </a>
</div> </div>
<div class="layui-row">
<a class="main_filter" title="系统标签中贴有客户指定的供应商" id="has_supplier_tag">
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="历史检测异常" id="history_abnormal">
</a>
</div>
</div> </div>
<div class="split-item" id="s5" style="text-align: center"> <div class="split-item" id="s5" style="text-align: center">
@if(checkPerm('SupplierBlockList')) @if(checkPerm('SupplierBlockList'))
...@@ -112,13 +119,8 @@ ...@@ -112,13 +119,8 @@
</a> </a>
</div> </div>
@endif @endif
<div class="layui-row"> <div class="layui-row">
<a class="main_filter" title="系统标签中贴有客户指定的供应商" id="has_supplier_tag"> <a class="main_filter" title="战略供应商" id="level_a">
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="历史检测异常" id="history_abnormal">
</a> </a>
</div> </div>
</div> </div>
......
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