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
08897255
authored
Jun 30, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善逻辑
parent
5bde83ae
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
8 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/DataService.php
resources/views/script/AddSupplierScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/web/AddSupplier.blade.php
resources/views/web/SupplierList.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
08897255
...
...
@@ -322,7 +322,7 @@ class SupplierApiController extends Controller
}
$regionType
=
$region
==
2
?
1
:
2
;
//还要去请求天眼查获取资料
$company
=
(
new
CompanyService
())
->
getCompanyInfo
(
$supplierName
,
$taxNumber
,
$regionType
);
$company
=
(
new
CompanyService
())
->
getCompanyInfo
(
$supplierName
,
$taxNumber
,
$regionType
);
if
(
!
$company
)
{
$this
->
response
(
-
2
,
'公司未进行工商注册,请修改后重新提交'
);
}
...
...
@@ -440,6 +440,37 @@ class SupplierApiController extends Controller
$this
->
response
(
0
,
'已发送同步请求'
);
}
//发送一体化同步请求
public
function
SyncToUnited
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
if
(
in_array
(
$supplier
[
'supplier_name'
],
config
(
'field.SkipChangeSupplierTypeNames'
)))
{
$service
=
new
SyncSupplierService
();
$service
->
syncSupplierToUnited
(
$supplierId
);
$this
->
response
(
0
,
'属于代购供应商,直接发送同步'
);
}
//去调取天眼查数据,有数据的话,更新
$regionType
=
$supplier
[
'region'
]
==
2
?
1
:
2
;
$companyInfo
=
(
new
CompanyService
())
->
getCompanyInfo
(
$supplier
[
'supplier_name'
],
''
,
$regionType
);
//先判断是否是标准添加,如果标准添加,国内地区,但是没有税号的,不允许同步
if
(
$supplier
[
'is_standard_add'
]
==
1
&&
$supplier
[
'region'
]
==
2
&&
!
$supplier
[
'tax_number'
])
{
$this
->
response
(
-
1
,
'该供应商属于国内,但是没有税号,不允许同步'
);
}
if
(
$supplier
[
'is_standard_add'
]
==
1
&&
$supplier
[
'region'
]
!=
2
)
{
if
(
empty
(
$companyInfo
))
{
$this
->
response
(
-
1
,
'该供应商属于海外,但是无法查询公司信息,不允许同步'
);
}
}
$service
=
new
SyncSupplierService
();
$service
->
syncSupplierToUnited
(
$supplierId
);
$this
->
response
(
0
,
'已发送同步请求'
);
}
//设置云芯账号
public
function
SetYunxinChannelUid
(
$request
)
{
...
...
app/Http/Services/DataService.php
View file @
08897255
...
...
@@ -543,5 +543,15 @@ class DataService
echo
json_encode
(
$exportJson
);
}
//禁用(没有集团编码)供应商
public
function
disableNoUnitedSupplier
()
{
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'group_code'
,
''
)
->
update
([
'is_type'
=>
2
,
'update_time'
=>
time
(),
]);
}
}
resources/views/script/AddSupplierScript.blade.php
View file @
08897255
...
...
@@ -152,7 +152,7 @@
obj2Checked
=
false
;
}
}
else
{
if
(
!
inArray
(
'quality_assurance_agreement'
,
fieldNameList
)
&&
supplierGroup
!==
'1'
)
{
if
(
!
inArray
(
'quality_assurance_agreement'
,
fieldNameList
)
&&
!
inArray
(
supplierGroup
,
[
'1'
,
'4'
])
)
{
msg
=
'未上传品质保证协议,是否切换为临时供应商?'
obj1Checked
=
false
;
obj2Checked
=
true
;
...
...
resources/views/script/SupplierListScript.blade.php
View file @
08897255
...
...
@@ -296,6 +296,29 @@
}
});
//同步一体化的手动操作
$
(
"#sync_supplier_to_united"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'list'
);
let
data
=
checkStatus
.
data
;
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的供应商'
,
{
icon
:
5
})
}
else
{
if
(
data
.
length
>
1
)
{
layer
.
msg
(
'该操作不支持多选'
,
{
icon
:
5
})
return
;
}
let
supplierId
=
data
[
0
].
supplier_id
;
let
res
=
ajax
(
'/api/supplier/SyncToUnited'
,
{
supplier_id
:
supplierId
})
if
(
res
.
err_code
===
0
)
{
table
.
reload
(
'list'
)
layer
.
closeAll
();
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
})
}
}
});
//审批供应商弹窗
$
(
"#audit_supplier"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'list'
);
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
08897255
...
...
@@ -60,7 +60,7 @@
obj2Checked
=
false
;
}
}
else
{
if
(
!
inArray
(
'quality_assurance_agreement'
,
fieldNameList
)
&&
supplierGroup
!==
'1'
)
{
if
(
!
inArray
(
'quality_assurance_agreement'
,
fieldNameList
)
&&
!
inArray
(
supplierGroup
,
[
'1'
,
'4'
])
)
{
msg
=
'未上传品质保证协议,是否切换为临时供应商?'
obj1Checked
=
false
;
obj2Checked
=
true
;
...
...
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
08897255
...
...
@@ -116,6 +116,7 @@
//监听所在区域变化,中国才显示省市选择
//而且有值+新增供应商操作 才能修改供应商名字和税号
//如果区域是海外(非中国),就去掉税号的必填星号
form
.
on
(
'select(region)'
,
function
(
data
)
{
@
if
(
empty
(
$supplier
))
let
supplierNameObj
=
$
(
'#supplier_name'
);
...
...
@@ -133,8 +134,10 @@
}
@
endif
if
(
data
.
value
===
'2'
)
{
$
(
'#tax_number_required_span'
).
show
();
$
(
'.city-div'
).
show
();
}
else
{
$
(
'#tax_number_required_span'
).
hide
();
$
(
'.city-div'
).
hide
();
}
});
...
...
resources/views/web/AddSupplier.blade.php
View file @
08897255
...
...
@@ -66,9 +66,9 @@
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-block"
id=
"tax_number_div"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
公司税号
</label>
<label
class=
"layui-form-label"
><span
id=
"tax_number_required_span"
class=
"require"
>
*
</span>
公司税号
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"选择所在区域才允许输入公司税号"
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"选择所在区域才允许输入公司税号
,海外供应商没有税号可以不填
"
class=
"layui-input layui-disabled"
disabled
value=
""
>
</div>
</div>
...
...
resources/views/web/SupplierList.blade.php
View file @
08897255
...
...
@@ -38,6 +38,9 @@
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" title="
该操作可以将供应商同步到供应商
" id="
sync_supplier_to_erp
">
金蝶同步
</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" title="
该操作可以将供应商同步到一体化
" id="
sync_supplier_to_united
">
一体化同步
</button>
@endif
@if(checkPerm('ApplySupplierShare'))
{{-- @if(checkPerm('BlockSupplier'))--}}
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
08897255
...
...
@@ -54,7 +54,7 @@
<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)
placeholder=
"
选择所在区域才允许
输入供应商名称"
class=
"layui-input @if ($supplier)
layui-disabled
@endif"
value=
"{{$supplier['supplier_name'] or ''}}"
...
...
@@ -66,9 +66,9 @@
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-block"
id=
"tax_number_div"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
公司税号
</label>
<label
class=
"layui-form-label"
><span
id=
"tax_number_required_span"
class=
"require"
>
*
</span>
公司税号
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"
请输入公司税号,选择所在区域才允许输入
"
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"
选择所在区域才允许输入公司税号,海外供应商没有税号可以不填
"
class=
"layui-input layui-disabled"
disabled
value=
"{{$supplier['tax_number'] or ''}}"
>
</div>
<div
id=
'supplier_check_tip'
style=
'margin-top: 5px'
>
...
...
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