Commit 6a4d28bb by 杨树贤

罗盘新增选项

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