Commit 5f41b9fe by 朱继来

Merge branch 'zjl_digikey_20200424'

parents 37713d1e 32fdcefe
......@@ -856,6 +856,15 @@ Class OrderController extends Controller
return redirect('/prompt')->with(['message'=>"该订单不符合人工审单条件~【status:{$info['order_info']['status']}】",'url' =>$redirect, 'jumpTime'=>3,'status'=>false]);
}
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'cart/getDJKConfg';
$res = json_decode(curlApi($url, $data, "POST"), true);
$info['api_dgk_config'] = $res['data']['data'];
$info['api_dgk_config_one'] = array_keys($res['data']['data']); // 一级分类
return view('detail', $info);
}
......@@ -941,6 +950,12 @@ Class OrderController extends Controller
"change_extend_fee" => $request->input('change_extend_fee', ''),
"kefu_remark" => $request->input('kefu_remark', ''), // 客服备注
"freight_fee" => $request->input('freight_fee', ''), // 运费
"customer_id" => $request->input('customer_id', ''), // 终端客户信息 ID
"customer_cn" => $request->input('customer_cn', ''), // 终端客户信息 中文
"customer_en" => $request->input('customer_en', ''), // 终端客户信息 英文
"customer_type" => $request->input('customer_type', ''), // 终端客户信息 客户类型
"product_use_classone_sn" => $request->input('product_use_classone_sn', ''), // 终端客户信息 一级分类
"product_use_classtwo_sn" => $request->input('product_use_classtwo_sn', ''), // 终端客户信息 二级分类
];
// dd(curlApi($url, $resData, "POST"));
$temp = json_decode(curlApi($url, $resData, "POST"), true);
......@@ -1588,6 +1603,7 @@ Class OrderController extends Controller
'erpPayLog' => $erpPayLog,
'order_refund_info' => $temp['data']['order_refund_info'],
'order_refund_items' => $temp['data']['order_refund_items'],
'order_extra' => $temp['data']['order_extra'],
];
// 获取收款信息
......@@ -1598,6 +1614,18 @@ Class OrderController extends Controller
$response = array_merge($response, $info);
$is_dgk_exists = false; // 检查明细中是否存在digikey商品
foreach ($response['order_items_info'] as $v) {
if ($v['supplier_id'] == 7 || strtolower($v['supplier_name']) == 'digikey') {
$is_dgk_exists = true;
}
continue;
}
$response['is_dgk_exists'] = $is_dgk_exists;
// 获取数组中的采购人id的名字
$this->getBuyerName($response);
......
......@@ -97,5 +97,13 @@
'end_time' => '2019-10-31 23:59:59',
],
// 终端客户信息--类型
'end_user_type' => [
1 => '终端',
2 => '贸易商',
3 => '大学',
4 => '个人',
],
];
\ No newline at end of file
......@@ -459,6 +459,7 @@
// 调整商品数量
$('.shop-table').delegate('.goods_num', 'blur', function() {
var self = $(this);
var origin_num = self.data('origin_num'); // 原始数量
var num = self.val();
var min_buy = Number(self.parents('tr').attr('min_buy'));
var cart_id = self.parents('tr').data('cid');
......@@ -466,6 +467,8 @@
var user_id = 0;
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
if (origin_num == num) return; // 未修改数量,则return
if (internal_uid) {
user_id = internal_uid;
} else {
......@@ -534,6 +537,8 @@
return false;
},
})
layer.msg('商品删除中...', {icon: 16, time: 0, shade: 0.3});
},
btn2: function (index) {
layer.close(index);
......@@ -643,6 +648,8 @@
layer.alert(resp.errmsg);
},
})
layer.msg('批量导入中...', {icon: 16, time: 0, shade: 0.3});
})
form.find('input[type="file"]').trigger('click');
......@@ -736,7 +743,7 @@
return false;
}
var en_reg = /^[a-zA-Z0-9\.\s\,]+$/;
var en_reg = /^[a-zA-Z0-9\.\s\,\(\)]+$/;
if(!en_reg.test(customer_en)){
layer.msg('请填写全英文名称');
return false;
......@@ -868,11 +875,11 @@
if (len > 0) {
var buyer = '';
// list = list.reverse();
// 购物车列表
for (var i = 0; i < len; i++) {
for (var i = len - 1 ; i >= 0; i--) {
html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'">'+
'<td>'+(i+1)+'</td>'+
'<td>'+(len - i)+'</td>'+
'<td class="goods_id">'+list[i].goods_id+'</td>'+
'<td>'+list[i].goods_name+'</td>'+
'<td>'+list[i].brand_name+'</td>';
......@@ -881,7 +888,7 @@
html += '<td><span class="goods_mpl">'+list[i].mpl+'</span></td>';
}
html += '<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'"></td>'+
html += '<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'" data-origin_num="'+list[i].goods_number+'"></td>'+
'<td class="goods_price">'+list[i].goods_price+'</td>'+
'<td class="goods_amount">'+list[i].goods_amount_format+'</td>'+
'<td>'+list[i].delivery_time+'</td>';
......
......@@ -91,9 +91,9 @@
var val = $(this).val();
if (val.toLowerCase() == 'digikey') {
layer.tips('暂不能添加digikey商品', $(this)); // 临时添加
$(this).val('');
return false;
// layer.tips('暂不能添加digikey商品', $(this)); // 临时添加
// $(this).val('');
// return false;
$('.skuid-info').css('display', 'block');
$('.layui-layer-iframe .layui-layer-btn, .layui-layer-page .layui-layer-btn').css('padding-top', '50px');
......@@ -248,11 +248,11 @@
var status_val = '';
// 临时添加,限制新增digikey商品
if (data.supplier_id == 7) {
layer.msg('暂不能添加digikey商品');
$('.search-sku').val('');
return false;
}
// if (data.supplier_id == 7) {
// layer.msg('暂不能添加digikey商品');
// $('.search-sku').val('');
// return false;
// }
$('.sku-info').show();
......
......@@ -2086,6 +2086,41 @@
var order_id = $('input[name=order_id]').val();
var business_type = $('input[name=business_type]').val();
// 若存在digikey商品,终端客户信息必填 2020-4-26
if (is_dgk_exists) {
var customer_cn = $('.customer_cn').val();
var customer_en = $('.customer_en').val();
var customer_type = $('.customer_type').val();
var product_use_classone_sn = $('.product_use_classone_sn').val();
var product_use_classtwo_sn = $('.product_use_classtwo_sn').val();
if (!customer_cn) {
layer.msg('请填写终端中文名称');
return false;
}
if (!customer_en) {
layer.msg('请填写终端英文名称');
return false;
}
var en_reg = /^[a-zA-Z0-9\.\s\,\(\)]+$/;
if(!en_reg.test(customer_en)){
layer.msg('请填写全英文名称');
return false;
}
if (customer_type == '') {
layer.msg('请选择客户类型');
return false;
}
if (product_use_classone_sn == '') {
layer.msg('请选择产品用途一级分类');
return false;
}
}
// 联营订单需要先指派业务员
if (order_goods_type == 1 && sale_id == 0) {
layer.alert('请先将订单推送给客服', function(){
......
......@@ -244,10 +244,11 @@
<span><i class="text-danger">*</i> 客户类型:</span>
<select class="layui-select customer_type" name="customer_type">
<option value="">请选择</option>
<option value="1">终端</option>
<option value="2">贸易商</option>
<option value="3">大学</option>
<option value="4">个人</option>
@if (Config('params.end_user_type'))
@foreach (Config('params.end_user_type') as $k => $v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
......
......@@ -50,6 +50,71 @@
</table>
@endif
<!-- 存在digikey商品的时候展示 -->
@if ($is_dgk_exists)
<style>
#checkOrderForm .row { margin-left: 0px !important; margin-right: 0px !important; }
#checkOrderForm .form-group { margin-left: 0px !important; }
.change-order-end-client input { width: 300px; }
.change-order-end-client select { width: 200px; }
</style>
<div class="change-order-end-client">
<h4>终端客户信息 <span class="title-tips"><i class="fa fa-info-circle"></i>digikey渠道商品必填,其他渠道可不填写</span></h4>
<input type="hidden" class="customer_id" name="customer_id" value="{{ $order_extra ? $order_extra['id'] : '' }}">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span><i class="text-danger">*</i> 终端中文名称:</span>
<input type="text" class="customer_cn" name="customer_cn" value="{{ $order_extra ? $order_extra['customer_cn'] : '' }}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span><i class="text-danger">*</i> 客户类型:</span>
<select class="layui-select customer_type" name="customer_type">
<option value="">请选择</option>
@if (Config('params.end_user_type'))
@foreach (Config('params.end_user_type') as $k => $v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span><i class="text-danger">*</i> 终端英文名称:</span>
<input type="text" class="customer_en" name="customer_en" value="{{ $order_extra ? $order_extra['customer_en'] : '' }}">
<a href="https://translate.google.cn/" target="_blank">谷歌翻译</a>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span><i class="text-danger">*</i> 产品用途:</span>
<select class="layui-select product_use_classone_sn" name="product_use_classone_sn">
<option value="">请选择</option>
@if ($api_dgk_config_one)
@foreach ($api_dgk_config_one as $k=>$v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
<select class="layui-select product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
</div>
</div>
</div>
</div>
<hr/>
@endif
<!-- 审核 -->
@if ($order_info['order_goods_type'] == 1)
<p>审核</p>
......@@ -75,7 +140,6 @@
</tr>
</table>
<hr/>
@else
<table class="table table-bordered table-hover check-table">
<tr>
......@@ -624,4 +688,39 @@
}
});
})
// dgk 终端客户信息
var is_dgk_exists = "{{ $is_dgk_exists }}";
if (is_dgk_exists) {
var api_dgk_config = eval('('+'{!! isset($api_dgk_config) ? json_encode($api_dgk_config) : '' !!}'+')');
var customer_type = "{{ $order_extra ? $order_extra['customer_type'] : 0 }}";
var product_use_classone_sn = "{{ $order_extra ? $order_extra['product_use_classone_sn'] : '' }}";
var product_use_classtwo_sn = "{{ $order_extra ? $order_extra['product_use_classtwo_sn'] : '' }}";
$('.order-change-main').delegate('.product_use_classone_sn', 'change', function(data){
var select_key = $('.product_use_classone_sn').find('option:selected').text();
$('.product_use_classtwo_sn').html('');
for(let key in api_dgk_config){
if(key == select_key){
for(var i = 0; i < api_dgk_config[key].length; i++){
$('.product_use_classtwo_sn').append('<option value="'+i+'">'+api_dgk_config[key][i]+'</option>')
}
}
}
})
// select 赋值
if (customer_type) {
$('select[name=customer_type]').val(customer_type);
}
if (product_use_classone_sn) {
$('select[name=product_use_classone_sn]').val(product_use_classone_sn);
$('select[name=product_use_classone_sn]').change(); // 添加change事件
$('select[name=product_use_classtwo_sn]').val(product_use_classtwo_sn);
}
}
</script>
\ No newline at end of file
......@@ -451,6 +451,29 @@
@endif
</table>
@endif
<!-- 终端客户信息 -->
@if ($order_extra && $action_name == 'details')
<table class="table table-bordered table-hover">
<tr class="caption">
<th colspan="4" style="text-align: center; background: #f9f9f9;">
终端客户信息
</th>
</tr>
<tr>
<th>客户名称(中文)</th>
<th>客户名称(英文)</th>
<th>客户类型</th>
<th>产品用途</th>
</tr>
<tr>
<td>{{ $order_extra['customer_cn'] }}</td>
<td>{{ $order_extra['customer_en'] }}</td>
<td>{{ Config('params.end_user_type')[$order_extra['customer_type']] }}</td>
<td>{{ $order_extra['product_use'] }}</td>
</tr>
</table>
@endif
</div>
<div class="tabs-box goods-price table-responsive list-item-table">
......
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