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
cc223814
authored
Jun 28, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-供应商类型-20220614' into ysx-供应商新需求-20220627
parents
063befa4
b7a2d47c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
82 additions
and
28 deletions
app/Http/Controllers/Api/CommonApiController.php
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Services/SupplierAuditService.php
app/Http/Services/SupplierStatisticsService.php
app/Http/Services/SyncSupplierService.php
app/Http/routes.php
app/Presenters/BrandSelectorPresenter.php
config/fixed.php
public/plugins/assets/js/common.js
resources/views/script/BatchOffShelfScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/web/supplier/SupplierBase.blade.php
resources/views/web/supplier/SupplierListCommon.blade.php
resources/views/web/supplier/SupplierPayType.blade.php
app/Http/Controllers/Api/CommonApiController.php
View file @
cc223814
...
...
@@ -72,7 +72,9 @@ class CommonApiController extends Controller
//请求天眼查校验接口
$supplierName
=
$request
->
get
(
'supplier_name'
);
$taxNumber
=
$request
->
get
(
'tax_number'
);
$company
=
(
new
CompanyService
())
->
getCompanyInfo
(
$supplierName
,
$taxNumber
);
$region
=
$request
->
get
(
'region'
);
$regionType
=
$region
==
2
?
1
:
2
;
$company
=
(
new
CompanyService
())
->
getCompanyInfo
(
$supplierName
,
$taxNumber
,
$regionType
);
if
(
!
$company
)
{
$this
->
response
(
-
1
,
'获取不到公司'
);
}
...
...
app/Http/Controllers/Api/SupplierApiController.php
View file @
cc223814
...
...
@@ -142,6 +142,10 @@ class SupplierApiController extends Controller
]);
$channel
=
$request
->
only
(
$channelMap
);
//如果是有直接新增权限的(绕过天眼查等校验)
if
(
checkPerm
(
'IgnoreCompanyCheck'
))
{
$channel
[
'is_standard_add'
]
=
-
1
;
}
$service
=
new
SupplierService
();
$supplierId
=
$service
->
saveSupplier
(
$channel
);
if
(
!
$supplierId
)
{
...
...
app/Http/Controllers/Filter/SupplierFilter.php
View file @
cc223814
...
...
@@ -307,6 +307,9 @@ class SupplierFilter
break
;
case
"level_a"
:
$query
->
where
(
'level'
,
'A'
);
break
;
case
"pay_type_term"
:
$query
->
where
(
'pay_type'
,
1
);
}
return
$query
;
}
...
...
app/Http/Services/SupplierAuditService.php
View file @
cc223814
...
...
@@ -79,8 +79,10 @@ class SupplierAuditService
//发送队列消息同步到金蝶
$service
=
new
SyncSupplierService
();
$service
->
syncSupplierToErp
(
$supplierId
);
//同步给一体化系统
(
new
SyncSupplierService
())
->
syncSupplierToUnited
(
$supplierId
);
if
(
$status
==
SupplierChannelModel
::
STATUS_PASSED
)
{
//同步给一体化系统
(
new
SyncSupplierService
())
->
syncSupplierToUnited
(
$supplierId
);
}
}
return
$result
;
}
...
...
app/Http/Services/SupplierStatisticsService.php
View file @
cc223814
...
...
@@ -55,6 +55,8 @@ class SupplierStatisticsService
//历史检测异常
$historyAbnormal
=
$this
->
getStatisticsCount
(
'history_abnormal'
);
//战略供应商(等级为A)
$payTypeTerm
=
$this
->
getStatisticsCount
(
'pay_type_term'
);
//账期供应商
$levelA
=
$this
->
getStatisticsCount
(
'level_a'
);
$result
=
[
'total'
=>
$total
,
...
...
@@ -75,6 +77,7 @@ class SupplierStatisticsService
'has_supplier_tag'
=>
$hasTagSupplier
,
'contact_no_complete'
=>
$concatNoComplete
,
'history_abnormal'
=>
$historyAbnormal
,
'pay_type_term'
=>
$payTypeTerm
,
'level_a'
=>
$levelA
,
];
$result
=
array_map
(
function
(
$value
)
{
...
...
app/Http/Services/SyncSupplierService.php
View file @
cc223814
...
...
@@ -152,11 +152,21 @@ class SyncSupplierService
$groupCode
=
array_get
(
$syncResult
,
'group_code'
);
$sourceSn
=
array_get
(
$syncResult
,
'source_sn'
);
$supplierId
=
$sourceSn
;
return
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'sync_united_status'
=>
SupplierChannelModel
::
SYNC_UNITED_STATUS_OK
,
'group_code'
=>
$groupCode
,
'company_nature'
=>
$syncResult
[
'company_nature'
],
]);
if
(
$supplierId
)
{
return
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'sync_united_status'
=>
SupplierChannelModel
::
SYNC_UNITED_STATUS_OK
,
'group_code'
=>
$groupCode
,
'company_nature'
=>
$syncResult
[
'company_nature'
],
]);
}
else
{
return
SupplierChannelModel
::
where
(
'group_code'
,
$groupCode
)
->
update
([
'sync_united_status'
=>
SupplierChannelModel
::
SYNC_UNITED_STATUS_OK
,
'group_code'
=>
$groupCode
,
'company_nature'
=>
$syncResult
[
'company_nature'
],
]);
}
}
}
\ No newline at end of file
app/Http/routes.php
View file @
cc223814
...
...
@@ -60,5 +60,6 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\SyncSupplierService
())
->
syncSupplierToUnited
(
12421
);
$resut
=
json_decode
(
'{"group_code":"G000010","source_sn":0,"company_name":"深圳大事件科技有限公司","init_nature":"原厂","company_nature":"方案商","company_type":2}'
,
true
);
dd
((
new
\App\Http\Services\SyncSupplierService
())
->
syncSupplierToUnitedResult
(
$resut
));
});
app/Presenters/BrandSelectorPresenter.php
View file @
cc223814
...
...
@@ -49,7 +49,7 @@ class BrandSelectorPresenter
page: pageIndex
},
dataType: 'json',
timeout:
1
0000,
timeout:
2
0000,
success: function (res) {
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
if (res.code === 0) {
...
...
config/fixed.php
View file @
cc223814
...
...
@@ -236,6 +236,7 @@ return [
'has_supplier_tag'
=>
'客户指定供应商'
,
'history_abnormal'
=>
'历史检测异常'
,
'level_a'
=>
'战略供应商'
,
'pay_type_term'
=>
'账期供应商'
,
],
//Sku列表的罗盘对应菜单id
'SkuListCompassMenuMap'
=>
[
...
...
public/plugins/assets/js/common.js
View file @
cc223814
...
...
@@ -67,7 +67,7 @@ function ajax(url, data) {
data
:
data
,
async
:
false
,
dataType
:
'json'
,
timeout
:
1
0000
,
timeout
:
2
0000
,
success
:
function
(
resp
)
{
if
(
resp
)
{
result
=
resp
;
...
...
resources/views/script/BatchOffShelfScript.blade.php
View file @
cc223814
...
...
@@ -69,7 +69,7 @@
page
:
pageIndex
},
dataType
:
'json'
,
timeout
:
1
0000
,
timeout
:
2
0000
,
success
:
function
(
res
)
{
if
(
!
res
)
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
if
(
res
.
errcode
===
0
)
{
...
...
resources/views/script/SupplierListScript.blade.php
View file @
cc223814
...
...
@@ -27,7 +27,7 @@
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
timeout
:
1
0000
,
timeout
:
2
0000
,
success
:
function
(
res
)
{
if
(
res
.
err_code
===
0
)
{
$
.
each
(
res
.
data
,
function
(
index
,
value
)
{
...
...
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
cc223814
...
...
@@ -46,10 +46,8 @@
type
:
'GET'
,
async
:
true
,
dataType
:
'json'
,
timeout
:
1
0000
,
timeout
:
2
0000
,
success
:
function
(
res
)
{
console
.
log
(
supplier_name
);
console
.
log
(
tax_number
);
if
(
supplier_name
!==
''
||
tax_number
!==
''
)
{
if
(
res
.
err_code
!==
0
)
{
//当code=-2的时候,是公司信息校验有问题,但是如果有跳过检查权限,那么就什么都不处理
...
...
@@ -67,8 +65,11 @@
"
<
p
style
=
'color: red;'
>
" + res.err_msg + "
<
/p></
div
>
");
$('#supplier_name').prop('disabled', false);
}
//监听是不是供应商名称变化
resetCompanyInfo(self.attr('id') === 'supplier_name');
if (!ignoreCompanyCheck) {
//监听是不是供应商名称变化
resetCompanyInfo(self.attr('id') === 'supplier_name');
}
} else if (res.err_code === 0) {
//如果供应商没有问题,就要去自动填补部分资料
let companyInfo = res.data;
...
...
@@ -78,11 +79,14 @@
$('#supplier_address').val(companyInfo.supplier_address);
$('#registered_capital').val(companyInfo.registered_capital);
layer.msg('校验公司信息通过,自动补全相关数据', {icon: 6})
if (self.attr('id') === 'supplier_name') {
$('#tax_number').attr('disabled', true);
} else {
$('#supplier_name').attr('disabled', true);
if (!ignoreCompanyCheck) {
if (self.attr('id') === 'supplier_name') {
$('#tax_number').attr('disabled', true);
} else {
$('#supplier_name').attr('disabled', true);
}
}
}
}
...
...
@@ -278,6 +282,7 @@
$('#recheck_company_info').click(function () {
let supplierName = $('#supplier_name').val();
let taxNumber = $('#tax_number').val();
let region = $('#region').val();
admin.btnLoading('#recheck_company_info', '正在查验公司信息,请稍等...');
if (!supplierName && !taxNumber) {
layer.msg('请填写供应商名称或者税号后再进行查验', {icon: 5});
...
...
@@ -285,13 +290,13 @@
return false;
}
$('#supplier_check_tip').remove();
let url = '/api/common/checkCompanyInfo?supplier_name=' + supplierName + '&tax_number=' + taxNumber;
let url = '/api/common/checkCompanyInfo?supplier_name=' + supplierName + '&tax_number=' + taxNumber
+ '®ion=' + region
;
$.ajax({
url: url,
type: 'GET',
async: true,
dataType: 'json',
timeout:
1
0000,
timeout:
2
0000,
success: function (res) {
admin.btnLoading('#recheck_company_info', false);
if (res.err_code === 0) {
...
...
@@ -306,7 +311,7 @@
layer.msg('验证成功,校验公司信息通过,自动补全相关数据', {icon: 6})
} else {
if (ignoreCompanyCheck) {
layer.msg('公司未进行工商注册', {icon: 5})
} else {
$('#supplier_name').after("
<
div
id
=
'supplier_check_tip'
style
=
'margin-top: 5px'
>
" +
"
<
p
style
=
'color: red;'
>
公司未进行工商注册,请修改后重新提交
<
/p></
div
>
"
);
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
cc223814
...
...
@@ -54,11 +54,11 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商名称 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"supplier_name"
id=
"supplier_name"
placeholder=
"请输入供应商名称"
class=
"layui-input @if ($supplier
['sync_united_status']==1
)
placeholder=
"请输入供应商名称"
class=
"layui-input @if ($supplier)
layui-disabled
@endif"
value=
"{{$supplier['supplier_name'] or ''}}"
@
if
($
supplier
['
sync_united_status
']==
1
)
disabled
@
endif
>
@
if
($
supplier
)
disabled
@
endif
>
</div>
</div>
<div
class=
"layui-col-md5"
>
...
...
resources/views/web/supplier/SupplierListCommon.blade.php
View file @
cc223814
...
...
@@ -126,6 +126,10 @@
<a
class=
"main_filter"
title=
"战略供应商"
id=
"level_a"
>
</a>
</div>
<div
class=
"layui-row"
>
<a
class=
"main_filter"
title=
"账期供应商"
id=
"pay_type_term"
>
</a>
</div>
</div>
<div
class=
"split-item"
id=
"s7"
style=
"text-align: center"
>
...
...
resources/views/web/supplier/SupplierPayType.blade.php
View file @
cc223814
...
...
@@ -26,11 +26,26 @@
value=
"{{$supplier['pay_type_value'] or ''}}"
>
<select
lay-filter=
"pay_type_month"
>
<option
value=
""
>
请选择
</option>
<option
value=
"7"
@
if
($
supplier
['
pay_type_value
']==
7
)
selected=
'selected'
@
endif
>
7
</option>
<option
value=
"15"
@
if
($
supplier
['
pay_type_value
']==
15
)
selected=
'selected'
@
endif
>
15
</option>
<option
value=
"30"
@
if
($
supplier
['
pay_type_value
']==
30
)
selected=
'selected'
@
endif
>
30
</option>
<option
value=
"45"
@
if
($
supplier
['
pay_type_value
']==
45
)
selected=
'selected'
@
endif
>
45
</option>
<option
value=
"60"
@
if
($
supplier
['
pay_type_value
']==
60
)
selected=
'selected'
...
...
@@ -55,7 +70,10 @@
<input
class=
"layui-input valueInput"
type=
"hidden"
name=
"pay_type_value"
>
<select
lay-filter=
"pay_type_month"
>
<option
value=
""
>
请选择
</option>
<option
value=
"30"
>
7
</option>
<option
value=
"30"
>
15
</option>
<option
value=
"30"
>
30
</option>
<option
value=
"30"
>
45
</option>
<option
value=
"60"
>
60
</option>
<option
value=
"90"
>
90
</option>
</select>
...
...
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