Commit 0c0aa129 by 朱继来

审单添加终端信息

parent b0aca936
......@@ -854,6 +854,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);
}
......@@ -939,6 +948,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);
......@@ -1590,6 +1605,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);
......
......@@ -736,7 +736,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;
......
......@@ -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();
......
......@@ -1980,6 +1980,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(){
......
......@@ -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
......@@ -453,7 +453,7 @@
@endif
<!-- 终端客户信息 -->
@if ($order_extra)
@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;">
......
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