Commit 4671ad0b by allen

后台添加订单

parent 315afce2
......@@ -72,6 +72,13 @@ Class AddOrderController extends Controller
$info['crm_account'] = $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'];
}
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'cart/getDJKConfg';
$info['api_dgk_url'] = ($url.'?k1='.$data['k1']."&".'k2='.$data['k2']);
return view('addOrder', $info);
}
......
......@@ -270,10 +270,22 @@
dataType: 'json',
success: function (resp) { console.log(resp)
if (resp.errcode != 0) {
console.log(resp.data)
layer.msg(resp.errmsg);
return false;
}
// 检查是否有dgk的商品 如果有就弹出提示框
// console.log(data.supplier_id)
if(resp.data.supplier_id ==7){
//包含digikey的商品
window.is_dgk = 1
}else{
window.is_dgk = 0
}
$('.sku-info').show();
var data = resp.data;
......@@ -650,6 +662,13 @@
// 提交订单
// $('.submit-order').on('click', function() {
$('.submit-order').off().on('click', function() {
//检查有没有digikey的商品 有的话弹出框
if(window.is_dgk == 1){
alert(11);
return false;
}
var self = $(this);
var address_id = $('input[name=address_id]').val();
var type = self.data('type'); // 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务
......@@ -984,6 +1003,74 @@
},
}
});
setTimeout( function(){
$.get(window.api_dgk_url_text,function(data){
window.data = data.data.data
console.log(window.data)
//循环第一级
// console.log(Object.keys(window.data).length)
product_len = Object.keys(window.data).length
for(let key in window.data){
// console.log(key)
// console.log(window.data[key])
$('.product_one').append('<option class="product_one_select" >'+key+' </option>')
}
},'json')
}, 10 )
$(document).on('change','.product_one',function(data){
var select_key = $('.product_one option:selected').val()
// console.log(select_key)
$('.product_two').html('')
for(let key in window.data){
if(key == select_key){
console.log('找到')
console.log(window.data[key])
console.log(window.data[key].length)
for(i=0 ; i<window.data[key].length ;i++){
$('.product_two').append('<option class="" >'+window.data[key][i]+' </option>')
}
// for(let key_two in window.data[key]){
// $('.product_two').append('<option class="" >'+key_two+' </option>')
// }
}
// $('.product_one').append('<option class="product_one_select" >'+key+' </option>')
}
})
// $('')
})(jQuery)
//获取url中的参数
......
......@@ -227,6 +227,50 @@
</div>
</div>
</div>
<div class="delivery-info">
<span> 终端名称 </span> <input type="text" class="search-sku" name="client_name" value="" placeholder="">
<!-- <span> 终端名称 </span> <input type="text" class="search-sku" name="client_name" value="" placeholder=""> -->
&nbsp;&nbsp;&nbsp;&nbsp;
<span> 客户类型 </span>:
<select class="layui-select">
<option>请选择</option>
<option value="1">终端</option>
<option value="2">贸易商</option>
<option value="3">大学</option>
<option value="4">个人</option>
</select>
</div>
<br/>
<div class="delivery-info">
<span> 终端名称</span> <input type="text" class="search-sku" name="client_name" value="" placeholder="">
<!-- <span> 终端名称 </span> <input type="text" class="search-sku" name="client_name" value="" placeholder=""> -->
&nbsp;&nbsp;&nbsp;&nbsp;
<span> 产品用途 </span>:
<select class="layui-select product_one">
<option>请选择</option>
</select>
<select class="layui-select product_two">
</select>
</div>
</div>
</div>
......@@ -404,6 +448,8 @@
var sale_id = "{{$sale_id}}";
var URL_api = "{{Config('website.api_domain')}}";
var role = "{{ $role }}";
window.api_dgk_url_text ="<?php echo $api_dgk_url;?>"
$.lie.add_order.lyorder();
</script>
\ No newline at end of file
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