Commit 150d6a2a by 杨树贤

完全需求

parent bdc3ba69
......@@ -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)
......
......@@ -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'])) {
......
......@@ -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' => '注册资金至少50万',
'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);
......
......@@ -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>
......
......@@ -83,6 +83,7 @@ return [
'confidentiality_agreement',
'cooperation_agreement',
'other_attachment',
'legal_ID_card'
],
//-2是复审不通过,-1是初审不通过,0是待审核,1是待复审,2是复审通过
......
......@@ -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' => '代理证',
......
......@@ -74,6 +74,13 @@
placeholder="请输入供应商英文名称" class="layui-input" value="">
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label">注册资金 : </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-md9">
<div class="layui-col-md5">
<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">
......
......@@ -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>
......
......@@ -57,11 +57,20 @@
</div>
<div class="layui-form-item">
<label class="layui-form-label">英文名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input"
value="{{$supplier['supplier_name_en'] or ''}}">
<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"
placeholder="请输入供应商英文名称" class="layui-input"
value="{{$supplier['supplier_name_en'] or ''}}">
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label">注册资金 : </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">
......@@ -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-md9">
<div class="layui-col-md5">
<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 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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment