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
3f40a276
authored
Jun 24, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
类型切换
parent
126ca0c6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
56 deletions
app/Http/Services/CompanyService.php
app/Http/Validators/SupplierValidator.php
app/Presenters/SingleSelectPresenter.php
config/website.php
public/plugins/assets/js/common.js
resources/views/script/AddSupplierScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/script/supplier/SupplierFileScript.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Services/CompanyService.php
View file @
3f40a276
...
...
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\DB;
class
CompanyService
{
public
function
getCompanyInfo
(
$supplierName
,
$taxNumber
,
$regionType
=
1
)
public
function
getCompanyInfo
(
$supplierName
,
$taxNumber
,
$regionType
=
1
)
{
$params
=
[
'keyword'
=>
$supplierName
?:
$taxNumber
,
...
...
@@ -24,14 +24,17 @@ class CompanyService
$result
=
json_decode
(
$result
,
true
);
$company
=
[];
if
(
array_get
(
$result
,
'code'
)
===
0
)
{
$companyInfo
=
array_get
(
$result
[
'data'
],
0
);
$company
=
[
'supplier_name'
=>
$companyInfo
[
'com_name'
],
'registered_capital'
=>
(
int
)
$companyInfo
[
'registered_capital'
],
'supplier_address'
=>
$companyInfo
[
'com_address'
],
'tax_number'
=>
$companyInfo
[
'tyc_info'
][
'tax_number'
],
'phone'
=>
$companyInfo
[
'tyc_info'
][
'phone_number'
],
];
$companyInfo
=
array_get
(
array_get
(
$result
[
'data'
],
'company_info_list'
),
0
);
if
(
!
empty
(
$companyInfo
))
{
$company
=
[
'supplier_name'
=>
$companyInfo
[
'com_name'
],
'registered_capital'
=>
(
int
)
$companyInfo
[
'registered_capital'
],
'supplier_address'
=>
$companyInfo
[
'com_address'
],
'tax_number'
=>
$companyInfo
[
'tyc_info'
][
'tax_number'
],
'phone'
=>
$companyInfo
[
'tyc_info'
][
'phone_number'
],
];
}
}
return
$company
;
}
...
...
app/Http/Validators/SupplierValidator.php
View file @
3f40a276
...
...
@@ -17,6 +17,7 @@ class SupplierValidator
//因为控制器那边已经被之前的人魔改的难用的一比,而且控制器那边还接收了一大堆统一变量
public
function
checkSave
(
$validateData
,
$isAudit
)
{
dd
(
$validateData
[
'tax_number'
]);
//整理下请求数据
$validateData
=
$this
->
transformRequestData
(
$validateData
);
//这个supplierId是用来判断是新增还是修改的
...
...
app/Presenters/SingleSelectPresenter.php
View file @
3f40a276
...
...
@@ -32,7 +32,7 @@ EOF;
if
(
$value
!==
null
)
{
$checked
=
(
$v
==
$value
)
?
"checked"
:
''
;
}
$itemsHtml
=
$itemsHtml
.
"<input type='radio' lay-filter='${name}' name='${name}' value='${v}' title='${item}'
$checked
$disabled
>"
;
$itemsHtml
=
$itemsHtml
.
"<input type='radio' lay-filter='${name}' name='${name}'
id='${name}'
value='${v}' title='${item}'
$checked
$disabled
>"
;
}
return
$itemsHtml
;
}
...
...
config/website.php
View file @
3f40a276
...
...
@@ -21,7 +21,7 @@ return [
'UploadUrl'
=>
env
(
'API_DOMAIN'
)
.
'/oss/upload'
,
'UploadKey'
=>
'fh6y5t4rr351d2c3bryi'
,
'QueueDomain'
=>
'http://192.168.1.252:16590/mq/push'
,
'InternalApiDomain'
=>
'http://192.168.1.
19
2:8200'
,
'InternalApiDomain'
=>
'http://192.168.1.
25
2:8200'
,
'WarningRobot'
=>
'https://oapi.dingtalk.com/robot/send?access_token=7ff88e1ee208e3a637c17bc51c1c879bccbf101fef5885d22ad70d21ea2f966a'
,
'CSWarningRobot'
=>
'https://oapi.dingtalk.com/robot/send?access_token=92917a6e090a8a39832c4843a579d6c6f9dfecc46fa275f8753ddee2b4399045'
,
...
...
public/plugins/assets/js/common.js
View file @
3f40a276
...
...
@@ -85,3 +85,44 @@ function inArray(needle, haystack) {
}
return
false
;
}
function
attachmentsUploadedChangeSupplierType
(
supplierType
,
supplierGroup
,
fieldName
)
{
let
msg
=
''
;
let
radioObj
=
$
(
'input[name="supplier_type"]'
);
//已经上传品质保证协议(代理商则提示为“已经上传代理证”),是否切换为正式供应商?
if
(
supplierType
===
'2'
)
{
//如果已经上传品质保证协议,并且供应商性质不是代理商(代理商要代理证)
if
(
'quality_assurance_agreement'
===
fieldName
&&
supplierGroup
!==
'1'
)
{
msg
=
'已经上传品质保证协议,是否切换为正式供应商?'
layer
.
confirm
(
msg
,
function
(
index
)
{
radioObj
.
get
(
0
).
checked
=
true
;
radioObj
.
get
(
1
).
checked
=
false
;
});
}
if
(
'proxy_certificate'
===
fieldName
&&
supplierGroup
===
'1'
)
{
msg
=
'该供应商为代理供应商,已经上传代理证,是否切换为正式供应商?'
layer
.
confirm
(
msg
,
function
(
index
)
{
radioObj
.
get
(
0
).
checked
=
true
;
radioObj
.
get
(
1
).
checked
=
false
;
});
}
}
else
{
if
(
'quality_assurance_agreement'
===
fieldName
&&
supplierGroup
!==
'1'
)
{
msg
=
'未上传品质保证协议,是否切换为临时供应商?'
layer
.
confirm
(
msg
,
function
(
index
)
{
radioObj
.
get
(
0
).
checked
=
false
;
radioObj
.
get
(
1
).
checked
=
true
;
});
}
if
(
'proxy_certificate'
===
fieldName
&&
supplierGroup
===
'1'
)
{
msg
=
'该供应商为代理供应商,但是未上传代理证,是否切换为临时供应商?'
layer
.
confirm
(
msg
,
function
(
index
)
{
radioObj
.
get
(
0
).
checked
=
false
;
radioObj
.
get
(
1
).
checked
=
true
;
});
}
}
layui
.
form
.
render
(
'radio'
);
return
msg
;
}
resources/views/script/AddSupplierScript.blade.php
View file @
3f40a276
...
...
@@ -182,27 +182,5 @@
}
}
}
function
attachmentsUploadedTips
(){
let
msg
=
''
;
//已经上传品质保证协议(代理商则提示为“已经上传代理证”),是否切换为正式供应商?
if
(
data
.
field
.
supplier_type
===
2
)
{
//如果已经上传品质保证协议,并且供应商性质不是代理商(代理商要代理证)
if
(
inArray
(
'quality_assurance_agreement'
,
data
.
field
.
field_name
)
&&
data
.
field
.
supplier_group
!==
1
)
{
msg
=
'已经上传品质保证协议,是否切换为正式供应商?'
}
if
(
inArray
(
'proxy_certificate'
,
data
.
field
.
field_name
)
&&
data
.
field
.
supplier_group
===
1
)
{
msg
=
'该供应商为代理供应商,已经上传代理证,是否切换为正式供应商?'
}
}
else
{
if
(
inArray
(
'quality_assurance_agreement'
,
data
.
field
.
field_name
)
&&
data
.
field
.
supplier_group
!==
1
)
{
msg
=
'未上传品质保证协议,是否切换为临时供应商?'
}
if
(
inArray
(
'proxy_certificate'
,
data
.
field
.
field_name
)
&&
data
.
field
.
supplier_group
===
1
)
{
msg
=
'该供应商为代理供应商,但是未上传代理证,是否切换为临时供应商?'
}
}
}
});
</script>
\ No newline at end of file
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
3f40a276
...
...
@@ -37,13 +37,13 @@
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
$
(
this
).
after
(
"
<
div
id
=
'supplier_check_tip'
style
=
'margin-top: 5px'
>
" +
"
<
p
style
=
'color: red;'
>
" + res.err_msg + "
<
/p></
div
>
");
$('#supplier_name').prop('
disabled
', false);
$('#supplier_name').prop('
readonly
', false);
}
} else {
layer.msg(res.err_msg, {icon: 5});
$(this).after("
<
div
id
=
'supplier_check_tip'
style
=
'margin-top: 5px'
>
" +
"
<
p
style
=
'color: red;'
>
" + res.err_msg + "
<
/p></
div
>
");
$('#supplier_name').prop('
disabled
', false);
$('#supplier_name').prop('
readonly
', false);
}
} else if (res.err_code === 0) {
//如果供应商没有问题,就要去自动填补部分资料
...
...
@@ -71,14 +71,14 @@
let supplierNameObj = $('#supplier_name');
let taxNumberObj = $('#tax_number');
if (data.value) {
supplierNameObj.attr('
disabled
', false);
supplierNameObj.attr('
readonly
', false);
supplierNameObj.removeClass('layui-disabled');
taxNumberObj.attr('
disabled
', false);
taxNumberObj.attr('
readonly
', false);
taxNumberObj.removeClass('layui-disabled');
} else {
supplierNameObj.attr('
disabled
', true);
supplierNameObj.attr('
readonly
', true);
supplierNameObj.addClass('layui-disabled');
taxNumberObj.attr('
disabled
', true);
taxNumberObj.attr('
readonly
', true);
taxNumberObj.addClass('layui-disabled');
}
if (data.value === '2') {
...
...
@@ -94,10 +94,10 @@
$('#supplier_name').change(function () {
let taxNumberObj = $('#tax_number');
if ($(this).val()) {
taxNumberObj.attr('
disabled
', true);
taxNumberObj.attr('
readonly
', true);
taxNumberObj.addClass('layui-disabled');
} else {
taxNumberObj.attr('
disabled
', false);
taxNumberObj.attr('
readonly
', false);
taxNumberObj.removeClass('layui-disabled');
}
...
...
@@ -105,10 +105,10 @@
$('#tax_number').change(function () {
let supplierNameObj = $('#supplier_name');
if ($(this).val()) {
supplierNameObj.attr('
disabled
', true);
supplierNameObj.attr('
readonly
', true);
supplierNameObj.addClass('layui-disabled');
} else {
supplierNameObj.attr('
disabled
', false);
supplierNameObj.attr('
readonly
', false);
supplierNameObj.removeClass('layui-disabled');
}
});
...
...
@@ -121,10 +121,8 @@
let supplier_type = data.value;
if (supplier_type === '1') {
$('#attachment_required_span').show();
// $('#apply_audit_button').show();
} else {
$('#attachment_required_span').hide();
// $('#apply_audit_button').hide();
}
});
...
...
@@ -231,8 +229,6 @@
$('#recheck_company_info').click(function () {
let supplierName = $('#supplier_name').val();
let taxNumber = $('#tax_number').val();
console.log(supplierName);
console.log(taxNumber);
admin.btnLoading('#recheck_company_info', '正在查验公司信息,请稍后');
if (!supplierName && !taxNumber) {
layer.msg('请填写供应商名称或者税号后再进行查验', {icon: 5});
...
...
@@ -249,11 +245,12 @@
if (res.err_code === 0) {
admin.btnLoading('#recheck_company_info', false);
let companyInfo = res.data;
$('#supplier_name').val(companyInfo.supplier_name);
$('#tax_number').val(companyInfo.tax_number);
$('#phone').val(companyInfo.phone);
$('#supplier_address').val(companyInfo.supplier_address);
$('#registered_capital').val(companyInfo.registered_capital);
$('#supplier_name').attr('value', companyInfo.supplier_name);
$('#tax_number').attr('value', companyInfo.tax_number);
$('#phone').attr('value', companyInfo.phone);
$('#supplier_address').attr('value', companyInfo.supplier_address);
$('#registered_capital').attr('value', companyInfo.registered_capital);
form.render();
layer.msg('校验公司信息通过,自动补全相关数据', {icon: 6})
} else {
admin.btnLoading('#recheck_company_info', false);
...
...
resources/views/script/supplier/SupplierFileScript.blade.php
View file @
3f40a276
...
...
@@ -61,6 +61,7 @@
loadIndex
=
layer
.
load
(
1
);
},
done
:
function
(
res
,
index
,
upload
)
{
let
fieldName
=
''
;
fileName
=
this
.
files
[
index
]
.
name
;
if
(
res
.
code
===
200
)
{
//动态添加js
...
...
@@ -72,7 +73,8 @@
fileTemplateObj
.
find
(
'#file_name'
)
.
val
(
fileName
);
fileTemplateObj
.
find
(
'#file_url'
)
.
val
(
res
.
data
[
0
]);
fileTemplateObj
.
find
(
'#field_name'
)
.
val
(
$
(
'#file_type_select'
)
.
val
());
fieldName
=
$
(
'#file_type_select'
)
.
val
();
fileTemplateObj
.
find
(
'#field_name'
)
.
val
(
fieldName
);
fileTemplateObj
.
find
(
'#validity_period'
)
.
addClass
(
'layui-input validity_period layui-disabled'
);
fileTemplateObj
.
find
(
'#validity_period'
)
.
prop
(
'disabled'
,
true
);
...
...
@@ -95,7 +97,9 @@
});
});
delete
this
.
files
[
index
];
let
supplierType
=
$
(
'input[name="supplier_type"]:checked'
)
.
val
();
layer
.
close
(
loadIndex
);
attachmentsUploadedChangeSupplierType
(
supplierType
,
$
(
'#supplier_group'
)
.
val
(),
fieldName
)
},
});
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
3f40a276
...
...
@@ -58,7 +58,7 @@
layui-disabled
@endif"
value=
"{{$supplier['supplier_name'] or ''}}"
@
if
($
supplier
['
sync_united_status
']==
1
)
disabled
@
endif
>
@
if
($
supplier
['
sync_united_status
']==
1
)
readonly
@
endif
>
</div>
</div>
<div
class=
"layui-col-md5"
>
...
...
@@ -66,7 +66,7 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
公司税号
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"请输入公司税号,选择所在区域才允许输入"
class=
"layui-input layui-disabled"
disabled
value=
"{{$supplier['tax_number'] or ''}}"
>
class=
"layui-input layui-disabled"
readonly
value=
"{{$supplier['tax_number'] or ''}}"
>
</div>
</div>
</div>
...
...
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