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
796c7fee
authored
Jun 06, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
合作协议筛选
parent
c317403e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
74 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Services/DataService.php
app/Http/Services/SupplierStatisticsService.php
app/Http/Transformers/SupplierTransformer.php
config/fixed.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/supplier/SupplierListFilter.blade.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
796c7fee
...
...
@@ -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
);
...
...
app/Http/Services/DataService.php
View file @
796c7fee
...
...
@@ -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
);
});
...
...
app/Http/Services/SupplierStatisticsService.php
View file @
796c7fee
...
...
@@ -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
)
{
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
796c7fee
...
...
@@ -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
(
!
$attachment
s
)
{
return
false
;
}
foreach
(
$attachment
as
$key
=>
$value
)
{
if
(
$value
[
'field_name'
]
==
'quality_assurance_agreement'
)
{
foreach
(
$attachment
s
as
$key
=>
$value
)
{
if
(
$value
[
'field_name'
]
==
$specificAttacmentName
)
{
return
true
;
}
}
...
...
config/fixed.php
View file @
796c7fee
...
...
@@ -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'
=>
[
...
...
resources/views/script/SupplierListScript.blade.php
View file @
796c7fee
...
...
@@ -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>
"
...
...
resources/views/web/supplier/SupplierListFilter.blade.php
View file @
796c7fee
...
...
@@ -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,44 +214,57 @@
<?php
$routerName
=
explode
(
'/'
,
request
()
->
path
())[
1
];
?>
<div
class=
"layui-inline"
>
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['supplier_group'=>'供应商性质','company_nature'=>'公司实际性质'],
['supplier_group'=>config('fixed.SupplierGroup'),'company_nature'=>config('field.CompanyNature')]) !!}
</div>
<div
class=
"layui-inline"
>
@inject('transformableInputPresenter','App\Presenters\Filter\TransformableInputPresenter')
{!! $transformableInputPresenter->render(['supplier_name'=>'供应商名称','supplier_code'=>'供应商编码','group_code'=>'集团编码','supplier_id'=>'供应商ID']) !!}
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('status','供应商状态','',$statusData) !!}
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('stockup_type','合作类型','',$stockupTypeData) !!}
</div>
<div
class=
"layui-inline"
>
@inject('transformableSelectPresenter','App\Presenters\Filter\TransformableSelectPresenter')
{!! $transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes) !!}
</div>
<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采购员'],
['has_sku'=>[1=>'是',-1=>'否'], 'sku_tag'=>config('field.SkuTag'),'sku_mode'=>config('field.SkuMode'),'uploaded_sku'=>[1=>'是',-1=>'否'],'outside_contact_type'=>config('field.OutsideContactType'),'yunxin_channel_uid' => $userCodes]) !!}
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('supplier_type','供应商类型','',$supplierTypeData) !!}
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['supplier_group'=>'供应商性质','company_nature'=>'公司实际性质'],
['supplier_group'=>config('fixed.SupplierGroup'),'company_nature'=>config('field.CompanyNature')]) !!}
</div>
<div
class=
"layui-inline"
>
@inject('transformableInputPresenter','App\Presenters\Filter\TransformableInputPresenter')
{!! $transformableInputPresenter->render(['supplier_name'=>'供应商名称','supplier_code'=>'供应商编码','group_code'=>'集团编码','supplier_id'=>'供应商ID']) !!}
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('status','供应商状态','',$statusData) !!}
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('stockup_type','合作类型','',$stockupTypeData) !!}
</div>
<div
class=
"layui-inline"
>
@inject('transformableSelectPresenter','App\Presenters\Filter\TransformableSelectPresenter')
{!! $transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes) !!}
</div>
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('level','等级','',$levelData) !!}
<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采购员'],
['has_sku'=>[1=>'是',-1=>'否'], 'sku_tag'=>config('field.SkuTag'),'sku_mode'=>config('field.SkuMode'),'uploaded_sku'=>[1=>'是',-1=>'否'],'outside_contact_type'=>config('field.OutsideContactType'),'yunxin_channel_uid' => $userCodes]) !!}
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('supplier_type','供应商类型','',$supplierTypeData) !!}
</div>
<div
class=
"layui-inline"
>
@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-inline"
style=
"width: 600px"
>
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'创建时间']) !!}
<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"
>
查询
...
...
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