Commit 796c7fee by 杨树贤

合作协议筛选

parent c317403e
......@@ -147,20 +147,21 @@ class SupplierFilter
}
}
//获取没有平台合作协议的数据
if (!empty($map['has_cooperation_agreement'])) {
if ($map['has_cooperation_agreement'] == 1) {
$query->whereHas('attachment', function ($query) {
$query->where('field_name', 'cooperation_agreement');
})->where('uploaded_sku', '>', 0);
}else{
$query->whereDoesntHave('attachment', function ($query) {
$query->where('field_name', 'cooperation_agreement');
})->where('uploaded_sku', '>', 0);
}
}
//默认过滤带有-1字符串的供应商名称的数据
$query->whereRaw('supplier_name NOT LIKE "%-1"');
// if (config('website.domain') == 'liexin.net' && !in_array(request()->user->userId, [
// 1611,
// 1499,
// 1354,
// 1613,
// 1000,
// 1619,
// 1629
// ])) {
// $query->where('supplier_channel.supplier_id', '>', 12211);
// }
return $query;
}
......@@ -305,18 +306,11 @@ class SupplierFilter
break;
//附件里面缺少品质协议的,而且是现货类型供应商
case "no_quality_assurance_agreement":
// $query->leftjoin('supplier_attachments', 'supplier_channel.supplier_id', '=',
// 'supplier_attachments.supplier_id')
// ->selectRaw('lie_supplier_channel.*,
// lie_supplier_attachments.quality_assurance_agreement,lie_supplier_attachments.supplier_id as supplier_attachment_supplier_id')
// ->where(function ($q) {
// $q->where('supplier_attachments.quality_assurance_agreement', '')
// ->orWhereNull('supplier_attachment.supplier_id');
// });
// $query->whereNotIn('status',
// [SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK]);
// //而且还是现货商类型的供应商
// $query->where('supplier_group', 2);
$query->whereDoesntHave('attachment', function ($query) {
$query->whereNotIn('status',
[SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK])
->where('field_name', 'quality_assurance_agreement');
})->where('supplier_group', 2);
break;
//联系人待完善
case "contact_no_complete":
......@@ -368,7 +362,7 @@ class SupplierFilter
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', 0);
break;
case "not_yunxin_and_has_no_sku":
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', 0)->where('uploaded_sku',1);
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', 0)->where('uploaded_sku', 1);
break;
case "yunxin":
$query->where('stockup_type', 'LIKE', '%5%');
......@@ -380,7 +374,7 @@ class SupplierFilter
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', 0);
break;
case "yunxin_and_has_no_sku":
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', 0)->where('uploaded_sku',1);
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', 0)->where('uploaded_sku', 1);
break;
case "yunxin_expired_at_days":
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_expired_in_days', '!=', 0);
......
......@@ -1161,7 +1161,7 @@ class DataService
echo json_encode($supplierList);
}
//获取上传了平台合作协议的供应商
//获取上传了平台平台合作协议的供应商
public function exportHasCooperationAgreementSupplierList()
{
$header = [
......@@ -1191,7 +1191,7 @@ class DataService
];
}
array_unshift($excelData, $header);
Excel::create('上传了“平台合作协议”的供应商', function ($excel) use ($excelData) {
Excel::create('上传了“平台平台合作协议”的供应商', function ($excel) use ($excelData) {
$excel->sheet('sheet1', function ($sheet) use ($excelData) {
$sheet->fromArray($excelData);
});
......
......@@ -58,7 +58,7 @@ class SupplierStatisticsService
$payTypeTerm = $this->getStatisticsCount('pay_type_term');
//账期供应商
$levelA = $this->getStatisticsCount('level_a');
//缺少合作协议(线上)
//缺少平台合作协议(线上)
//缺少品质协议(线上)
$result = [
'total' => $total,
......@@ -105,7 +105,7 @@ class SupplierStatisticsService
'yunxin_expired' => null,
//已过期(非云芯)供应商
'not_yunxin_expired' => null,
//缺少合作协议(线上)
//缺少平台合作协议(线上)
'no_cooperation_agreement' => null,
];
$result = array_map(function ($value) {
......
......@@ -53,7 +53,8 @@ class SupplierTransformer
$supplier['has_sku'] = $supplier['sku_num'] ? '是' : '否';
$supplier['is_business_abnormal_name'] = $supplier['is_business_abnormal'] == 1 ? '是' : '否';
if (isset($supplier['attachment'])) {
$supplier['has_quality_assurance_agreement'] = $this->checkHasQualityAssuranceAgreement($supplier['attachment']) ? '有' : '无';
$supplier['has_quality_assurance_agreement'] = $this->checkHasSpecificAttachment('quality_assurance_agreement', $supplier['attachment']) ? '有' : '无';
$supplier['has_cooperation_agreement'] = $this->checkHasSpecificAttachment('cooperation_agreement', $supplier['attachment']) ? '有' : '无';
} else {
$supplier['has_quality_assurance_agreement'] = '无';
}
......@@ -112,13 +113,14 @@ class SupplierTransformer
return $suppliers;
}
public function checkHasQualityAssuranceAgreement($attachment)
//判断是否有特定的协议
public function checkHasSpecificAttachment($specificAttacmentName, $attachments)
{
if (!$attachment) {
if (!$attachments) {
return false;
}
foreach ($attachment as $key => $value) {
if ($value['field_name'] == 'quality_assurance_agreement') {
foreach ($attachments as $key => $value) {
if ($value['field_name'] == $specificAttacmentName) {
return true;
}
}
......
......@@ -207,7 +207,7 @@ return [
'quality_assurance_agreement' => '品质保证协议',
'legal_ID_card' => '法人身份证',
'registration_certificate' => '商业登记证',
'cooperation_agreement' => '合作协议',
'cooperation_agreement' => '平台合作协议',
'proxy_certificate' => '代理证',
'incorporation_certificate' => '公司注册证',
'certification_notice' => '认证通知书',
......@@ -251,7 +251,7 @@ return [
'not_yunxin_expired_at_days' => '3天内到期(非云芯)供应商',
'yunxin_expired' => '已过期(云芯)供应商',
'not_yunxin_expired' => '已过期(非云芯)供应商',
'no_cooperation_agreement' => '缺少合作协议(线上)',
'no_cooperation_agreement' => '缺少平台合作协议(线上)',
],
//Sku列表的罗盘对应菜单id
'SkuListCompassMenuMap' => [
......
......@@ -127,6 +127,12 @@
width: 80,
},
{
field: 'has_cooperation_agreement',
title: '平台合作协议',
align: 'center',
width: 80,
},
{
field: 'contact_num', title: '联系人', align: 'center', width: 70, templet: function (data) {
return "<a ew-href='/supplier/SupplierDetail?view=iframe&tab=contact&supplier_id=" + data.supplier_id +
"' class='list-href' ew-title='供应商详情 - " + data.supplier_code + "' title='点击跳转查看联系人列表'>" + data.contact_num + "</a>"
......
......@@ -134,8 +134,8 @@
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="缺少合作协议(线上)" id="no_cooperation_agreement">
缺少合作协议(线上)
<a class="main_filter" title="缺少平台合作协议(线上)" id="no_cooperation_agreement">
缺少平台合作协议(线上)
</a>
</div>
<div class="layui-row">
......@@ -214,6 +214,8 @@
<?php
$routerName = explode('/', request()->path())[1];
?>
<div class="layui-row">
<div class="layui-inline">
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['supplier_group'=>'供应商性质','company_nature'=>'公司实际性质'],
......@@ -235,6 +237,8 @@
@inject('transformableSelectPresenter','App\Presenters\Filter\TransformableSelectPresenter')
{!! $transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes) !!}
</div>
</div>
<div class="layui-row">
<div class="layui-inline">
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['has_sku'=>'SKU上传','sku_tag'=>'SKU标准','sku_mode'=>'SKU模式','uploaded_sku' => '历史SKU合作','outside_contact_type' => 'SKU上传方式','yunxin_channel_uid' => 'SKU采购员'],
......@@ -248,10 +252,19 @@
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('level','等级','',$levelData) !!}
</div>
<div class="layui-inline">
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['has_cooperation_agreement'=>'平台合作协议'],
['has_cooperation_agreement'=>[1=>'是',-1=>'否']]) !!}
</div>
</div>
<div class="layui-row">
<div class="layui-inline" style="width: 600px">
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'创建时间']) !!}
</div>
</div>
<div class="layui-row" style="margin-top:10px;margin-bottom: 10px;margin-left: 20px;">
<button class="layui-btn layui-btn-sm layui-btn load" id="getSupplierListButton" lay-submit=""
lay-filter="load">查询
......
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