Commit e96bebd4 by 杨树贤

修复冲突

parents 1e394010 bed61d3a
......@@ -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)
......
......@@ -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->whereIn('status', explode(',',$map['status']));
}
if (!empty($map['is_type'])) {
......
......@@ -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('供应商列表');
}
......
......@@ -30,6 +30,9 @@ class SupplierAttachmentService
$attachment['type_name'] = array_get(config('fixed.FileNameMapping'), $attachment['field_name']);
unset($attachment['validity_period']);
$attachmentId = $attachment['attachment_id'];
if (empty($attachment['description'])) {
unset($attachment['description']);
}
$attachmentModel = new SupplierAttachmentsModel();
if (empty($attachmentId)) {
$attachment['create_uid'] = request()->user->userId;
......
......@@ -100,8 +100,8 @@ class SupplierAuditService
'supplier_type',
'settlement_type',
];
foreach ($supplier as $key=>&$value) {
if (in_array($key,$needChangeField) && empty($value)) {
foreach ($supplier as $key => &$value) {
if (in_array($key, $needChangeField) && empty($value)) {
$value = '';
}
}
......@@ -141,7 +141,8 @@ class SupplierAuditService
$departmentService = new DepartmentService();
$subordinateUserIds = $departmentService->getSubordinateUserIds($auditUserId);
if (in_array($lastUpdateUserId, $subordinateUserIds)) {
if (in_array($lastUpdateUserId, $subordinateUserIds) || in_array($supplier['create_uid'],
$subordinateUserIds)) {
return true;
}
return false;
......
......@@ -268,13 +268,14 @@ class SupplierService
$logContent = '确认新增供应商';
}
//过滤掉没有修改的操作,不需要记录日志
//过滤掉没有修改的操作,但是需要记录一条更新记录(用于判断是否可以审核)
if (!empty($oldSupplier) && !empty($newSupplier)) {
$oldSupplier = $oldSupplier->toArray();
$newSupplier = $newSupplier->toArray();
unset($oldSupplier['update_time']);
unset($newSupplier['update_time']);
if ($oldSupplier == $newSupplier) {
$logService->AddLog($this->newSupplierId, LogModel::UPDATE_OPERATE, '修改供应商基本资料', '没有内容变化');
return $supplierId;
}
}
......@@ -435,7 +436,7 @@ class SupplierService
'update_time' => time(),
'channel_uid' => $preChannelUid,
]);
}else{
} else {
$result = $model->where('supplier_id', $supplierId)->update([
'channel_uid' => $preChannelUid,
]);
......@@ -540,6 +541,8 @@ class SupplierService
if (!$result) {
return $result;
}
//新增一条申请审核的日志
// (new LogService())->AddLog($data['supplier_id'], LogModel::UPDATE_OPERATE, '申请审核', '申请审核供应商');
}
return true;
}
......
......@@ -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',
......@@ -125,6 +127,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) {
......@@ -182,14 +191,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) {
......@@ -255,8 +256,7 @@ class SupplierValidator
return implode('|', $errorMessageList);
}
private
function messages()
private function messages()
{
return [
'supplier_type.required' => '供应商类别 不能为空',
......@@ -298,13 +298,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);
......
......@@ -56,5 +56,4 @@ Route::group(['middleware' => ['external'],'namespace' => 'Api'], function () {
Route::match(['get', 'post'], '/test', function () {
$departmentService = new DepartmentService();
$subordinateUserIds = $departmentService->getSubordinateUserIds(1368);
dd($subordinateUserIds);
});
......@@ -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">
<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",
......
......@@ -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' => '代理证',
......
......@@ -55,5 +55,6 @@ return [
'main_customers' => '3-5家客户',
'ticket_time' => '到票时间',
'billing_period_detail' => '账期详情',
'registered_capital' => '注册资金(万)',
]
];
\ No newline at end of file
......@@ -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-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>
......
......@@ -59,11 +59,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"><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">
......@@ -73,12 +82,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','是否历史经营异常 : ',$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>注册地址 :
......@@ -118,7 +132,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">
......@@ -173,8 +191,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"
......
......@@ -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')
......
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