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
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
39 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
...
@@ -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字符串的供应商名称的数据
//默认过滤带有-1字符串的供应商名称的数据
$query
->
whereRaw
(
'supplier_name NOT LIKE "%-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
;
return
$query
;
}
}
...
@@ -305,18 +306,11 @@ class SupplierFilter
...
@@ -305,18 +306,11 @@ class SupplierFilter
break
;
break
;
//附件里面缺少品质协议的,而且是现货类型供应商
//附件里面缺少品质协议的,而且是现货类型供应商
case
"no_quality_assurance_agreement"
:
case
"no_quality_assurance_agreement"
:
// $query->leftjoin('supplier_attachments', 'supplier_channel.supplier_id', '=',
$query
->
whereDoesntHave
(
'attachment'
,
function
(
$query
)
{
// 'supplier_attachments.supplier_id')
$query
->
whereNotIn
(
'status'
,
// ->selectRaw('lie_supplier_channel.*,
[
SupplierChannelModel
::
STATUS_DISABLE
,
SupplierChannelModel
::
STATUS_BLOCK
])
// lie_supplier_attachments.quality_assurance_agreement,lie_supplier_attachments.supplier_id as supplier_attachment_supplier_id')
->
where
(
'field_name'
,
'quality_assurance_agreement'
);
// ->where(function ($q) {
})
->
where
(
'supplier_group'
,
2
);
// $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);
break
;
break
;
//联系人待完善
//联系人待完善
case
"contact_no_complete"
:
case
"contact_no_complete"
:
...
@@ -368,7 +362,7 @@ class SupplierFilter
...
@@ -368,7 +362,7 @@ class SupplierFilter
$query
->
where
(
'stockup_type'
,
'NOT LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
);
$query
->
where
(
'stockup_type'
,
'NOT LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
);
break
;
break
;
case
"not_yunxin_and_has_no_sku"
:
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
;
break
;
case
"yunxin"
:
case
"yunxin"
:
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
);
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
);
...
@@ -380,7 +374,7 @@ class SupplierFilter
...
@@ -380,7 +374,7 @@ class SupplierFilter
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
);
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
);
break
;
break
;
case
"yunxin_and_has_no_sku"
:
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
;
break
;
case
"yunxin_expired_at_days"
:
case
"yunxin_expired_at_days"
:
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_expired_in_days'
,
'!='
,
0
);
$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
...
@@ -1161,7 +1161,7 @@ class DataService
echo
json_encode
(
$supplierList
);
echo
json_encode
(
$supplierList
);
}
}
//获取上传了平台合作协议的供应商
//获取上传了平台
平台
合作协议的供应商
public
function
exportHasCooperationAgreementSupplierList
()
public
function
exportHasCooperationAgreementSupplierList
()
{
{
$header
=
[
$header
=
[
...
@@ -1191,7 +1191,7 @@ class DataService
...
@@ -1191,7 +1191,7 @@ class DataService
];
];
}
}
array_unshift
(
$excelData
,
$header
);
array_unshift
(
$excelData
,
$header
);
Excel
::
create
(
'上传了“平台合作协议”的供应商'
,
function
(
$excel
)
use
(
$excelData
)
{
Excel
::
create
(
'上传了“平台
平台
合作协议”的供应商'
,
function
(
$excel
)
use
(
$excelData
)
{
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
$sheet
->
fromArray
(
$excelData
);
});
});
...
...
app/Http/Services/SupplierStatisticsService.php
View file @
796c7fee
...
@@ -58,7 +58,7 @@ class SupplierStatisticsService
...
@@ -58,7 +58,7 @@ class SupplierStatisticsService
$payTypeTerm
=
$this
->
getStatisticsCount
(
'pay_type_term'
);
$payTypeTerm
=
$this
->
getStatisticsCount
(
'pay_type_term'
);
//账期供应商
//账期供应商
$levelA
=
$this
->
getStatisticsCount
(
'level_a'
);
$levelA
=
$this
->
getStatisticsCount
(
'level_a'
);
//缺少合作协议(线上)
//缺少
平台
合作协议(线上)
//缺少品质协议(线上)
//缺少品质协议(线上)
$result
=
[
$result
=
[
'total'
=>
$total
,
'total'
=>
$total
,
...
@@ -105,7 +105,7 @@ class SupplierStatisticsService
...
@@ -105,7 +105,7 @@ class SupplierStatisticsService
'yunxin_expired'
=>
null
,
'yunxin_expired'
=>
null
,
//已过期(非云芯)供应商
//已过期(非云芯)供应商
'not_yunxin_expired'
=>
null
,
'not_yunxin_expired'
=>
null
,
//缺少合作协议(线上)
//缺少
平台
合作协议(线上)
'no_cooperation_agreement'
=>
null
,
'no_cooperation_agreement'
=>
null
,
];
];
$result
=
array_map
(
function
(
$value
)
{
$result
=
array_map
(
function
(
$value
)
{
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
796c7fee
...
@@ -53,7 +53,8 @@ class SupplierTransformer
...
@@ -53,7 +53,8 @@ class SupplierTransformer
$supplier
[
'has_sku'
]
=
$supplier
[
'sku_num'
]
?
'是'
:
'否'
;
$supplier
[
'has_sku'
]
=
$supplier
[
'sku_num'
]
?
'是'
:
'否'
;
$supplier
[
'is_business_abnormal_name'
]
=
$supplier
[
'is_business_abnormal'
]
==
1
?
'是'
:
'否'
;
$supplier
[
'is_business_abnormal_name'
]
=
$supplier
[
'is_business_abnormal'
]
==
1
?
'是'
:
'否'
;
if
(
isset
(
$supplier
[
'attachment'
]))
{
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
{
}
else
{
$supplier
[
'has_quality_assurance_agreement'
]
=
'无'
;
$supplier
[
'has_quality_assurance_agreement'
]
=
'无'
;
}
}
...
@@ -112,13 +113,14 @@ class SupplierTransformer
...
@@ -112,13 +113,14 @@ class SupplierTransformer
return
$suppliers
;
return
$suppliers
;
}
}
public
function
checkHasQualityAssuranceAgreement
(
$attachment
)
//判断是否有特定的协议
public
function
checkHasSpecificAttachment
(
$specificAttacmentName
,
$attachments
)
{
{
if
(
!
$attachment
)
{
if
(
!
$attachment
s
)
{
return
false
;
return
false
;
}
}
foreach
(
$attachment
as
$key
=>
$value
)
{
foreach
(
$attachment
s
as
$key
=>
$value
)
{
if
(
$value
[
'field_name'
]
==
'quality_assurance_agreement'
)
{
if
(
$value
[
'field_name'
]
==
$specificAttacmentName
)
{
return
true
;
return
true
;
}
}
}
}
...
...
config/fixed.php
View file @
796c7fee
...
@@ -207,7 +207,7 @@ return [
...
@@ -207,7 +207,7 @@ return [
'quality_assurance_agreement'
=>
'品质保证协议'
,
'quality_assurance_agreement'
=>
'品质保证协议'
,
'legal_ID_card'
=>
'法人身份证'
,
'legal_ID_card'
=>
'法人身份证'
,
'registration_certificate'
=>
'商业登记证'
,
'registration_certificate'
=>
'商业登记证'
,
'cooperation_agreement'
=>
'合作协议'
,
'cooperation_agreement'
=>
'
平台
合作协议'
,
'proxy_certificate'
=>
'代理证'
,
'proxy_certificate'
=>
'代理证'
,
'incorporation_certificate'
=>
'公司注册证'
,
'incorporation_certificate'
=>
'公司注册证'
,
'certification_notice'
=>
'认证通知书'
,
'certification_notice'
=>
'认证通知书'
,
...
@@ -251,7 +251,7 @@ return [
...
@@ -251,7 +251,7 @@ return [
'not_yunxin_expired_at_days'
=>
'3天内到期(非云芯)供应商'
,
'not_yunxin_expired_at_days'
=>
'3天内到期(非云芯)供应商'
,
'yunxin_expired'
=>
'已过期(云芯)供应商'
,
'yunxin_expired'
=>
'已过期(云芯)供应商'
,
'not_yunxin_expired'
=>
'已过期(非云芯)供应商'
,
'not_yunxin_expired'
=>
'已过期(非云芯)供应商'
,
'no_cooperation_agreement'
=>
'缺少合作协议(线上)'
,
'no_cooperation_agreement'
=>
'缺少
平台
合作协议(线上)'
,
],
],
//Sku列表的罗盘对应菜单id
//Sku列表的罗盘对应菜单id
'SkuListCompassMenuMap'
=>
[
'SkuListCompassMenuMap'
=>
[
...
...
resources/views/script/SupplierListScript.blade.php
View file @
796c7fee
...
@@ -127,6 +127,12 @@
...
@@ -127,6 +127,12 @@
width
:
80
,
width
:
80
,
},
},
{
{
field
:
'has_cooperation_agreement'
,
title
:
'平台合作协议'
,
align
:
'center'
,
width
:
80
,
},
{
field
:
'contact_num'
,
title
:
'联系人'
,
align
:
'center'
,
width
:
70
,
templet
:
function
(
data
)
{
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 +
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>
"
"'
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 @@
...
@@ -134,8 +134,8 @@
</a>
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
class=
"main_filter"
title=
"缺少合作协议(线上)"
id=
"no_cooperation_agreement"
>
<a
class=
"main_filter"
title=
"缺少
平台
合作协议(线上)"
id=
"no_cooperation_agreement"
>
缺少合作协议(线上)
缺少
平台
合作协议(线上)
</a>
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
...
@@ -214,6 +214,8 @@
...
@@ -214,6 +214,8 @@
<?php
<?php
$routerName
=
explode
(
'/'
,
request
()
->
path
())[
1
];
$routerName
=
explode
(
'/'
,
request
()
->
path
())[
1
];
?>
?>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['supplier_group'=>'供应商性质','company_nature'=>'公司实际性质'],
{!! $multiTransformableSelectPresenter->render(['supplier_group'=>'供应商性质','company_nature'=>'公司实际性质'],
...
@@ -235,6 +237,8 @@
...
@@ -235,6 +237,8 @@
@inject('transformableSelectPresenter','App\Presenters\Filter\TransformableSelectPresenter')
@inject('transformableSelectPresenter','App\Presenters\Filter\TransformableSelectPresenter')
{!! $transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes) !!}
{!! $transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes) !!}
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
@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采购员'],
{!! $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 @@
...
@@ -248,10 +252,19 @@
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('level','等级','',$levelData) !!}
{!! $multiSelectorPresenter->render('level','等级','',$levelData) !!}
</div>
</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"
>
<div
class=
"layui-inline"
style=
"width: 600px"
>
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'创建时间']) !!}
{!! $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'创建时间']) !!}
</div>
</div>
</div>
<div
class=
"layui-row"
style=
"margin-top:10px;margin-bottom: 10px;margin-left: 20px;"
>
<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=
""
<button
class=
"layui-btn layui-btn-sm layui-btn load"
id=
"getSupplierListButton"
lay-submit=
""
lay-filter=
"load"
>
查询
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