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
752f5a71
authored
Jun 17, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-供应商新增字段-20220616'
parents
c5ddd870
2d3f292b
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
95 additions
and
40 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/SupplierController.php
app/Http/Transformers/SupplierTransformer.php
app/Http/Validators/SupplierValidator.php
app/Presenters/MultiSelectorPresenter.php
app/Presenters/StatusPresenter.php
config/field.php
config/fixed.php
resources/views/web/AddSupplier.blade.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/supplier/SupplierBase.blade.php
resources/views/web/supplier/SupplierListCommon.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
752f5a71
...
...
@@ -83,6 +83,10 @@ class SupplierApiController extends Controller
'pay_type_value'
,
'pay_type_extra'
,
'supplier_type'
,
'registered_capital'
,
'is_business_abnormal'
,
'has_legal_ID_card'
,
];
public
function
Entrance
(
Request
$request
,
$id
)
...
...
app/Http/Controllers/Filter/SupplierFilter.php
View file @
752f5a71
...
...
@@ -58,7 +58,7 @@ class SupplierFilter
$query
->
where
(
'create_uid'
,
$adminId
);
}
if
((
isset
(
$map
[
'status'
])
&&
$map
[
'status'
]
===
"0"
)
||
!
empty
(
$map
[
'status'
]))
{
$query
->
where
(
'status'
,
$map
[
'status'
]
);
$query
->
where
In
(
'status'
,
explode
(
','
,
$map
[
'status'
])
);
}
if
(
!
empty
(
$map
[
'is_type'
]))
{
...
...
app/Http/Controllers/SupplierController.php
View file @
752f5a71
...
...
@@ -66,6 +66,14 @@ class SupplierController extends Controller
$applyService
=
new
SupplierShareApplyService
();
$applyData
=
$applyService
->
getAuditSupplierShareApplyList
(
$request
->
user
->
userId
);
$this
->
data
[
'shareApplyCount'
]
=
$applyData
[
'total'
];
$statusData
=
[];
foreach
(
config
(
'fixed.SupplierStatus'
)
as
$key
=>
$value
)
{
$statusData
[]
=
[
'name'
=>
$value
,
'value'
=>
$key
,
];
}
$this
->
data
[
'statusData'
]
=
$statusData
;
return
$this
->
view
(
'供应商列表'
);
}
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
752f5a71
...
...
@@ -120,6 +120,8 @@ class SupplierTransformer
$supplier
[
'region_name'
]
=
array_get
(
config
(
'fixed.Region'
),
$supplier
[
'region'
]);
$supplier
[
'currency_name'
]
=
array_get
(
config
(
'fixed.Currency'
),
$supplier
[
'currency'
]);
$supplier
[
'supplier_group_name'
]
=
array_get
(
config
(
'fixed.SupplierGroup'
),
$supplier
[
'supplier_group'
]);
$supplier
[
'is_business_abnormal_name'
]
=
$supplier
[
'is_business_abnormal'
]
==
1
?
'是'
:
'否'
;
$supplier
[
'has_legal_ID_card_name'
]
=
$supplier
[
'has_legal_ID_card'
]
==
1
?
'是'
:
'否'
;
$supplier
[
'pay_type_name'
]
=
array_get
(
config
(
'fixed.SupplierPayType'
),
$supplier
[
'pay_type'
]);
$supplier
[
'trading_method_name'
]
=
array_get
(
config
(
'fixed.TradingMethod'
),
$supplier
[
'trading_method'
]);
if
(
isset
(
$supplier
[
'settlement_type'
]))
{
...
...
app/Http/Validators/SupplierValidator.php
View file @
752f5a71
...
...
@@ -55,6 +55,7 @@ class SupplierValidator
'currency'
=>
'required'
,
'supplier_group'
=>
'required'
,
'main_customers'
=>
'max:100'
,
'registered_capital'
=>
'required|numeric|min:50'
,
'ticket_time'
=>
'max:20'
,
'region'
=>
'required'
,
'cn_delivery_time'
=>
'regex:/^\d+\-\d$/'
,
...
...
@@ -66,6 +67,7 @@ class SupplierValidator
'return_phone'
=>
'max:50'
,
'cn_ratio'
=>
'min:1'
,
'us_ratio'
=>
'min:1'
,
'is_business_abnormal'
=>
'required'
,
];
$contactRuler
=
[
'supplier_consignee'
=>
'required|max:50'
,
...
...
@@ -111,6 +113,13 @@ class SupplierValidator
}
}
//如果选择有法人身份证,那么附件上传必须要要有法人身份证
if
(
$validateData
[
'has_legal_ID_card'
]
==
1
)
{
if
(
!
in_array
(
'legal_ID_card'
,
$attachmentFields
))
{
$errorMessageList
[]
=
'请上传法人身份证'
;
}
}
if
(
!
$supplierId
)
{
//附件信息校验
foreach
(
$validateData
[
'validity_type'
]
as
$key
=>
$type
)
{
...
...
@@ -168,14 +177,6 @@ class SupplierValidator
if
(
!
$contactCount
)
{
$errorMessageList
[]
=
"供应商至少要有一个联系人,请补全"
;
}
// $contacts = SupplierContactModel::where('supplier_id', $supplierId)->get()->toArray();
// foreach ($contacts as $contact) {
// $contactValidator = new SupplierContactValidator();
// $contactValidateResult = $contactValidator->checkSave($contact);
// if ($contactValidateResult) {
// $errorMessageList[] = $contactValidateResult;
// }
// }
}
//币种为人民币的话需要验证税号
if
(
$validateData
[
'currency'
]
==
1
)
{
...
...
@@ -241,8 +242,7 @@ class SupplierValidator
return
implode
(
'|'
,
$errorMessageList
);
}
private
function
messages
()
private
function
messages
()
{
return
[
'supplier_type.required'
=>
'供应商类别 不能为空'
,
...
...
@@ -284,13 +284,15 @@ class SupplierValidator
'ticket_time.max'
=>
'到票时间不能超过20个字符'
,
'billing_period_detail.required'
=>
'账期详情 不能为空'
,
'billing_period_detail.max'
=>
'账期详情不能超过100个字符'
,
'registered_capital.required'
=>
'注册资金 不能为空'
,
'registered_capital.min'
=>
'注册资金至少50万'
,
'registered_capital.numeric'
=>
'注册资金填纯数字即可,默认单位是万'
,
'is_business_abnormal.required'
=>
'是否历史经营异常必选,请补充选择'
];
}
public
function
transformRequestData
(
$validateData
)
{
public
function
transformRequestData
(
$validateData
)
{
foreach
(
$validateData
as
&
$item
)
{
if
(
!
is_array
(
$item
))
{
$item
=
trim
(
$item
);
...
...
app/Presenters/MultiSelectorPresenter.php
View file @
752f5a71
...
...
@@ -17,18 +17,14 @@ class MultiSelectorPresenter
<label class="layui-form-label">
$requiredHtml
$text</label>
<div class="layui-input-inline
">
<div id="$elemId" class="layui-input-inline" value="$value" style="width:
300px;">
<div class="layui-input-inline" style="margin-top: 0
">
<div id="$elemId" class="layui-input-inline" value="$value" style="width:
155px;">
</div>
<input type="hidden" name="$name" id="$name" value="$value">
</div>
<script>
window.onload = function(){
layui.config({
base: '/js/web/layui/exts/xmSelect/'
}).extend({
xmSelect: 'xm-select'
}).use(['xmSelect', 'element'], function () {
layui.use(['xmSelect', 'element'], function () {
let xmSelect = layui.xmSelect;
//渲染多选
let selector = xmSelect.render({
...
...
@@ -41,6 +37,7 @@ class MultiSelectorPresenter
name: 'name',
value: 'value'
},
size: 'mini',
direction: 'down',
data : $data,
height: "1300px",
...
...
app/Presenters/StatusPresenter.php
View file @
752f5a71
...
...
@@ -13,9 +13,10 @@ class StatusPresenter
$width
=
array_get
(
$option
,
'width'
,
'auto'
);
$noName
=
array_get
(
$option
,
'noName'
);
$name
=
$noName
?
''
:
$name
;
$labelWidth
=
array_get
(
$option
,
'label_width'
);
$requiredHtml
=
$isRequired
?
'<span class="require">*</span>'
:
""
;
$html
=
<<<EOF
<label class="layui-form-label">
<label class="layui-form-label"
style="width: $labelWidth"
>
$requiredHtml
$text
</label>
...
...
config/field.php
View file @
752f5a71
...
...
@@ -83,6 +83,7 @@ return [
'confidentiality_agreement'
,
'cooperation_agreement'
,
'other_attachment'
,
'legal_ID_card'
],
//-2是复审不通过,-1是初审不通过,0是待审核,1是待复审,2是复审通过
...
...
config/fixed.php
View file @
752f5a71
...
...
@@ -4,18 +4,9 @@ return [
//网页不用验证授权方法
'NotAuth'
=>
[
'ChoiceSupplierList'
,
'HoldItems'
,
'ObtainSkuList'
,
'SupplierLog'
],
//api不用授权方法
'ApiNotAuth'
=>
[
'ApiSpecialList'
,
'ApiSpeciaModulelList'
,
'ApiModuleConfigList'
,
'ApiLogList'
,
'ApiInitSupplier'
,
'ApiChoiceSupplier'
],
'MenuSign'
=>
'/web/'
,
//菜单去除掉标记,生成菜单时用
...
...
@@ -24,6 +15,7 @@ return [
'MD5KEY'
=>
'LX@ichunt.com82560956-0755'
,
//接口加密密钥
'WMSKEY'
=>
'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp'
,
//WMS加密密钥
//1代理商,2现货商,3财务供应商,4原厂,5代工厂,6黑名单
'SupplierGroup'
=>
[
0
=>
'其它'
,
...
...
@@ -211,6 +203,7 @@ return [
'business_license'
=>
'营业执照'
,
'billing_information'
=>
'开票资料'
,
'quality_assurance_agreement'
=>
'品质保证协议'
,
'legal_ID_card'
=>
'法人身份证'
,
'registration_certificate'
=>
'商业登记证'
,
'cooperation_agreement'
=>
'合作协议'
,
'proxy_certificate'
=>
'代理证'
,
...
...
resources/views/web/AddSupplier.blade.php
View file @
752f5a71
...
...
@@ -74,6 +74,13 @@
placeholder=
"请输入供应商英文名称"
class=
"layui-input"
value=
""
>
</div>
</div>
<div
class=
"layui-col-md5"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
注册资金 :
</label>
<div
class=
"layui-input-block"
style=
"width: 230px"
>
<input
type=
"text"
name=
"registered_capital"
id=
"registered_capital"
placeholder=
"请输入注册资金(万),至少需要50万"
class=
"layui-input"
value=
""
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-row"
>
...
...
@@ -82,12 +89,17 @@
{!! $statusPresenter->render('region','所在区域 : ','',
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
</div>
<div
class=
"layui-col-md
9
"
>
<div
class=
"layui-col-md
5
"
>
<div
class=
"city-div"
style=
"display: none"
>
<label
class=
"layui-form-label"
>
选择省市 :
</label>
<div
class=
"city-selector"
id=
"city-selector"
></div>
</div>
</div>
<div
class=
"layui-col-md3"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('is_business_abnormal','是否历史经营异常 : ','',
[-1=>'否',1=>'是'],['required'=>true,'label_width'=>'120px']) !!}
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
@@ -125,7 +137,11 @@
value=
""
>
</div>
</div>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-col-md3"
>
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',-1,[1=>'有',-1=>'无']) !!}
</div>
<div
class=
"layui-col-md3"
>
<label
class=
"layui-form-label"
style=
"width: 80px"
>
成立时间 :
</label>
<div
class=
"layui-input-block"
style=
"width: 150px"
>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
752f5a71
...
...
@@ -134,6 +134,13 @@
供应商英文名称 :{{$supplier['supplier_name_en']}}
</div>
<div
class=
"layui-row"
>
<span
class=
"required_field"
>
*
</span>
注册资金 :{{$supplier['registered_capital']?:'未设置'}}
</div>
<div
class=
"layui-row"
>
<span
class=
"is_business_abnormal"
>
*
</span>
是否历史经营异常
:{{$supplier['is_business_abnormal_name']}}
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md2"
>
<span
class=
"required_field"
>
*
</span>
所在区域 :{{$supplier['region_name']}}
</div>
...
...
@@ -153,6 +160,10 @@
<span
class=
"required_field"
>
*
</span>
法人代表 :{{$supplier['legal_representative']}}
</div>
<div
class=
"layui-col-md3"
>
法人身份证 :
:{{$supplier['has_legal_ID_card_name']}}
</div>
<div
class=
"layui-col-md3"
>
成立时间 :{{$supplier['established_time']}}
</div>
</div>
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
752f5a71
...
...
@@ -57,6 +57,7 @@
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md5"
>
<label
class=
"layui-form-label"
>
英文名称 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"supplier_name_en"
id=
"supplier_name_en"
...
...
@@ -64,6 +65,14 @@
value=
"{{$supplier['supplier_name_en'] or ''}}"
>
</div>
</div>
<div
class=
"layui-col-md5"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
注册资金 :
</label>
<div
class=
"layui-input-block"
style=
"width: 230px"
>
<input
type=
"text"
name=
"registered_capital"
id=
"registered_capital"
placeholder=
"请输入注册资金(万),至少需要50万"
class=
"layui-input"
value=
"{{$supplier['registered_capital']}}"
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md3"
>
...
...
@@ -71,12 +80,17 @@
{!! $statusPresenter->render('region','所在区域',!empty($supplier)?array_get($supplier,'region',''):'',
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
</div>
<div
class=
"layui-col-md
9
"
>
<div
class=
"layui-col-md
5
"
>
<div
class=
"city-div"
style=
"display: none"
>
<label
class=
"layui-form-label"
>
选择省市 :
</label>
<div
class=
"city-selector"
id=
"city-selector"
></div>
</div>
</div>
<div
class=
"layui-col-md3"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('is_business_abnormal','是否历史经营异常 : ',$supplier['is_business_abnormal'],
[-1=>'否',1=>'是'],['required'=>true,'label_width'=>'120px']) !!}
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md5"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
注册地址 :
...
...
@@ -116,7 +130,11 @@
value=
"{{$supplier['legal_representative'] or ''}}"
>
</div>
</div>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-col-md3"
>
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',$supplier['has_legal_ID_card'],[1=>'有',-1=>'无']) !!}
</div>
<div
class=
"layui-col-md3"
>
<label
class=
"layui-form-label"
style=
"width: 80px"
>
成立时间 :
</label>
<div
class=
"layui-input-block"
style=
"width: 150px"
>
...
...
@@ -171,8 +189,8 @@
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
合作类型
</label>
<div
class=
"layui-input-block"
>
{{--
<input
type=
"hidden"
name=
"stockup_type"
--
}}
{{
--
value=
"{{$supplier['stockup_type'] or ''}}"
>
--}}
{{--
<input
type=
"hidden"
name=
"stockup_type"
--
}}
{{
--
value=
"{{$supplier['stockup_type'] or ''}}"
>
--}}
@foreach(config('fixed.StockupType') as $k=>$type)
<input
type=
"checkbox"
name=
"stockup_type[{{$k}}]"
lay-skin=
"primary"
...
...
resources/views/web/supplier/SupplierListCommon.blade.php
View file @
752f5a71
...
...
@@ -152,8 +152,10 @@
{!! $transformableInputPresenter->render(['supplier_name'=>'供应商名称','supplier_code'=>'供应商编码','supplier_id'=>'供应商ID']) !!}
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('status','供应商状态','',config('fixed.SupplierStatus')) !!}
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('status','供应商状态','',config('fixed.SupplierStatus')) !!}--}}
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('status','供应商状态','',$statusData) !!}
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
...
...
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