Commit e63de1c2 by 杨树贤

修复冲突

parents 40300e2f d0465329
...@@ -31,6 +31,6 @@ class SetSupplierFollowUp extends Command ...@@ -31,6 +31,6 @@ class SetSupplierFollowUp extends Command
public function handle() public function handle()
{ {
$service = new DataService(); $service = new DataService();
$service->importMainBrandData(); $service->importSupplierLevel();
} }
} }
...@@ -32,7 +32,11 @@ class SupplierShareApplyApiController extends Controller ...@@ -32,7 +32,11 @@ class SupplierShareApplyApiController extends Controller
$this->response(-1, '供应商名称不能为空'); $this->response(-1, '供应商名称不能为空');
} }
$supplierModel = new SupplierChannelModel(); $supplierModel = new SupplierChannelModel();
$supplier = $supplierModel->where('supplier_name', $supplierName)->first(); //下面的处理是为了兼容有问题的数据
if (!empty($supplier = $supplierModel->where('supplier_name', $supplierName)->first())) {
$supplier = $supplierModel->where('supplier_name', 'like', "%$supplierName%")->whereNotIn('status',
[SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_REJECT])->first();
}
if (empty($supplier)) { if (empty($supplier)) {
$this->response(-1, '该供应商名称不存在,请输入正确供应商名称'); $this->response(-1, '该供应商名称不存在,请输入正确供应商名称');
} }
......
...@@ -29,6 +29,25 @@ class LogService ...@@ -29,6 +29,25 @@ class LogService
$model->insert($data); $model->insert($data);
} }
//添加日志
public function AddAdminLog($supplierId, $type, $action, $content, $remark = '')
{
$adminId = 1000;
$adminName = 'admin';
$data = [
'supplier_id' => $supplierId,
'type' => $type,
'action' => $action,
'content' => $content,
'remark' => $remark,
'admin_id' => $adminId,
'admin_name' => $adminName,
'add_time' => time(),
];
$model = new LogModel();
$model->insert($data);
}
public function getLogs($supplierId, $type = '', $limit = 100) public function getLogs($supplierId, $type = '', $limit = 100)
{ {
$model = new LogModel(); $model = new LogModel();
......
...@@ -14,6 +14,7 @@ class SupplierContactTransformer ...@@ -14,6 +14,7 @@ class SupplierContactTransformer
foreach ($list as &$item) { foreach ($list as &$item) {
$user = $service->getAdminUserInfoByCodeId($item['can_check_uids']); $user = $service->getAdminUserInfoByCodeId($item['can_check_uids']);
$item['channel_name'] = array_get($user, 'name'); $item['channel_name'] = array_get($user, 'name');
$item['working_status'] = $service->checkIsResignedByCodeId($item['can_check_uids']) ? '离职' : '在职';
} }
unset($item); unset($item);
......
...@@ -195,6 +195,8 @@ class SupplierTransformer ...@@ -195,6 +195,8 @@ class SupplierTransformer
//转换表单数据 //转换表单数据
public function transformPostData($channel) public function transformPostData($channel)
{ {
$channel['supplier_name'] = trim($channel['supplier_name']);
if (!empty($channel['stockup_type'])) { if (!empty($channel['stockup_type'])) {
$stockupType = array_keys($channel['stockup_type']); $stockupType = array_keys($channel['stockup_type']);
$stockupType = !empty($stockupType) ? implode(",", $stockupType) : ''; $stockupType = !empty($stockupType) ? implode(",", $stockupType) : '';
......
...@@ -23,6 +23,7 @@ class SupplierValidator ...@@ -23,6 +23,7 @@ class SupplierValidator
'legal_representative' => 'required', 'legal_representative' => 'required',
'stockup_type' => 'required', 'stockup_type' => 'required',
'main_brands' => 'required', 'main_brands' => 'required',
'currency' => 'required',
'main_customers' => 'max:100', 'main_customers' => 'max:100',
'ticket_time' => 'max:20', 'ticket_time' => 'max:20',
'region' => 'required', 'region' => 'required',
...@@ -159,6 +160,7 @@ class SupplierValidator ...@@ -159,6 +160,7 @@ class SupplierValidator
return [ return [
'supplier_type.required' => '供应商类别不能为空', 'supplier_type.required' => '供应商类别不能为空',
'supplier_name.required' => '供应商名称不能为空', 'supplier_name.required' => '供应商名称不能为空',
'currency.required' => '结算币种不能为空',
'legal_representative.required' => '法人代表不能为空', 'legal_representative.required' => '法人代表不能为空',
'stockup_type.required' => '合作类型不能为空', 'stockup_type.required' => '合作类型不能为空',
'register_company_name.required' => '注册公司名不能为空', 'register_company_name.required' => '注册公司名不能为空',
......
...@@ -56,7 +56,7 @@ class IntracodeModel extends Model ...@@ -56,7 +56,7 @@ class IntracodeModel extends Model
} }
} }
$redis->set('EncodedList_all_supplier', json_encode($codeList)); $redis->set('EncodedList_all_supplier', json_encode($codeList));
$redis->expire('EncodedList_all_supplier', 60 * 10);//缓存10分钟 $redis->expire('EncodedList_all_supplier', 60);//缓存10分钟
} }
} }
return $codeList; return $codeList;
......
No preview for this file type
No preview for this file type
[ZoneTransfer]
ZoneId=3
HostUrl=about:internet
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
form.on('radio(receipt_type)', function (data) { form.on('radio(receipt_type)', function (data) {
if (data.value == 1) { if (data.value == 1) {
$('#swift_code_div').hide(); $('#swift_code_div').hide();
}else{ } else {
$('#swift_code_div').show(); $('#swift_code_div').show();
} }
}); });
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
k2: k2, k2: k2,
source: 1 source: 1
} }
, accept: 'file'
, exts: 'jpg|png|bmp|jpeg|zip|pdf'
, before: function (obj) { , before: function (obj) {
layer.msg('加载中', { layer.msg('加载中', {
icon: 16 icon: 16
...@@ -52,7 +54,11 @@ ...@@ -52,7 +54,11 @@
let item = this.item; let item = this.item;
//预读本地文件示例,不支持ie8 //预读本地文件示例,不支持ie8
obj.preview(function (index, file, result) { obj.preview(function (index, file, result) {
$('#' + item.attr('preview')).attr('src', result); //图片链接(base64) // if (file.type.indexOf('image') !== -1){
// $('#' + item.attr('preview')).attr('src', result); //图片链接(base64)
// }else{
// $('#' + item.attr('preview')).attr('src', '/images/file.png');
// }
}); });
} }
, done: function (res) { , done: function (res) {
...@@ -60,6 +66,7 @@ ...@@ -60,6 +66,7 @@
layer.msg('上传成功', {icon: 6}); layer.msg('上传成功', {icon: 6});
let item = this.item; let item = this.item;
$('#' + item.attr('data-obj')).val(res.data[0]); $('#' + item.attr('data-obj')).val(res.data[0]);
$('#certificate_url').text(res.data[0]);
return false; return false;
} else { } else {
layer.msg('上传失败', {icon: 5}); layer.msg('上传失败', {icon: 5});
......
...@@ -28,10 +28,11 @@ ...@@ -28,10 +28,11 @@
{field: 'supplier_position', title: '职位', align: 'center',width: 100}, {field: 'supplier_position', title: '职位', align: 'center',width: 100},
{field: 'supplier_email', title: '邮箱', align: 'center',width: 200}, {field: 'supplier_email', title: '邮箱', align: 'center',width: 200},
{field: 'supplier_mobile', title: '手机号', align: 'center',width: 150}, {field: 'supplier_mobile', title: '手机号', align: 'center',width: 150},
{field: 'supplier_telephone', title: '座机', align: 'center',width: 180}, {field: 'supplier_telephone', title: '座机', align: 'center',width: 150},
{field: 'supplier_qq', title: 'QQ', align: 'center',width: 120}, {field: 'supplier_qq', title: 'QQ', align: 'center',width: 120},
{field: 'supplier_fax', title: '传真', align: 'center',width: 140}, {field: 'supplier_fax', title: '传真', align: 'center',width: 140},
{field: 'channel_name', title: '采购员', align: 'center',width: 170}, {field: 'channel_name', title: '采购员', align: 'center',width: 110},
{field: 'working_status', title: '采购员状态', align: 'center',width: 120},
]], ]],
id: 'contactList', id: 'contactList',
page: {}, page: {},
......
...@@ -33,11 +33,10 @@ ...@@ -33,11 +33,10 @@
{field: 'bank_adderss', title: '开户行', align: 'center', width: 150}, {field: 'bank_adderss', title: '开户行', align: 'center', width: 150},
{field: 'account_no', title: '银行账号', align: 'center', width: 130}, {field: 'account_no', title: '银行账号', align: 'center', width: 130},
{field: 'account_name', title: '账户名称', align: 'center', width: 150}, {field: 'account_name', title: '账户名称', align: 'center', width: 150},
{field: 'swift_code', title: '电汇号码', align: 'center', width: 150}, {field: 'swift_code', title: '电汇号码', align: 'center', width: 130},
{ {
field: 'certificate', title: '信息凭证', width: 150, align: 'center', templet: function (data) { field: 'certificate', title: '信息凭证', width: 200, align: 'center', templet: function (data) {
return "<a href='" + data.certificate + "' target='_blank'>" + return "<a href='" + data.certificate + "' target='_blank'>" + data.certificate + "</a>";
"<img class='certificate_img' style='width: 70px;height: 60px' src='" + data.certificate + "'></a>";
} }
}, },
{field: 'remark', title: '备注', align: 'center', width: 200}, {field: 'remark', title: '备注', align: 'center', width: 200},
......
...@@ -82,10 +82,11 @@ ...@@ -82,10 +82,11 @@
value="{{$receipt['certificate'] or ''}}"> value="{{$receipt['certificate'] or ''}}">
<button type="button" class="layui-btn upload-img" preview="preview" data-obj="certificate"> <button type="button" class="layui-btn upload-img" preview="preview" data-obj="certificate">
<i class="layui-icon">&#xe67c;</i>上传图片 <i class="layui-icon">&#xe67c;</i>上传文件
</button> </button>
<img @if(!empty($receipt['certificate'])) src="{{$receipt['certificate'] or ''}}" <a target="_blank" id="certificate_url" href="{{$receipt['certificate'] or ''}}">{{$receipt['certificate'] or ''}}</a>
@endif class="layui-upload-img" width="50px" height="50px" id="preview"> {{-- <img @if(!empty($receipt['certificate'])) src="{{$receipt['certificate'] or ''}}"--}}
{{-- @endif class="layui-upload-img" width="50px" height="50px" id="preview">--}}
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md2"> <div class="layui-col-md2">
结算币种 :{{$supplier['currency_name']}} <span class="required_field">*</span> 结算币种 :{{$supplier['currency_name']}}
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
@if ($supplier['currency']==1) @if ($supplier['currency']==1)
......
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
<div class="layui-inline"> <div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('currency','结算币种', {!! $statusPresenter->render('currency','结算币种',
isset($supplier)?$supplier['currency']:'',config('fixed.Currency'),['required'=>false]) !!} isset($supplier)?$supplier['currency']:'',config('fixed.Currency'),['required'=>true]) !!}
</div> </div>
<div class="layui-inline" id="tax_number_div" <div class="layui-inline" id="tax_number_div"
@if(empty($supplier) || (!empty($supplier)&&$supplier['currency']!=1)) @if(empty($supplier) || (!empty($supplier)&&$supplier['currency']!=1))
......
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