Commit 16956301 by 朱继来

下单添加销售组织

parent f94825ee
......@@ -78,6 +78,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/getDJKConfg';
$info['api_dgk_url'] = ($url.'?k1='.$data['k1']."&".'k2='.$data['k2']);
$info['company'] = (new CmsModel())->getCompany(); // 获取公司组织
return view('addOrder', $info);
}
......@@ -552,6 +553,8 @@ Class AddOrderController extends Controller
$data['cart_id'] = implode(',', $request->input('cart_ids'));
$data['type'] = $request->input('type');
$data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', '');
if ($data['type'] == 3) { // 自营线下订单
$data['address_name'] = $request->input('address_name');
......
......@@ -43,9 +43,15 @@ class CmsModel extends Model
/*
批量查询用户姓名
*/
public function getBatchUserName($user_ids){
public function getBatchUserName($user_ids)
{
return $this->whereIn('userId',$user_ids)->select('userId','name','email')->get()->toArray();
}
// 获取后台公司组织
public function getCompany()
{
return $this->from('lie_organization')->where('status', 1)->select('com_name', 'com_currency', 'id')->get()->keyBy('id')->toArray();
}
}
\ No newline at end of file
......@@ -481,14 +481,43 @@
})
})
// 切换交货地
$('.delivery_place').click(function() {
// 选择销售组织
$('.com_id').change(function() {
var val = $(this).val();
if (!val) return false;
var currency = $(this).find("option:selected").data('currency');
var currency_sign = '';
var delivery_place = 0;
if (currency == 1) {
currency_sign = 'RMB';
delivery_place = 1;
} else {
currency_sign = 'USD';
delivery_place = 2;
}
// $('input[name=delivery_place][value='+delivery_place+']').attr('checked', true);
$('input[name=delivery_place][value='+delivery_place+']').trigger('click');
$('.currency-sign').text(currency_sign);
$('.currency-section').show();
var user_id = $('.user_id').val();
var delivery_place = $(this).val();
loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
})
// 切换交货地
// $('.delivery_place').click(function() {
// var user_id = $('.user_id').val();
// var delivery_place = $(this).val();
// loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
// })
// 调整商品数量
$('.shop-table').delegate('.goods_num', 'blur', function() {
var self = $(this);
......@@ -818,6 +847,17 @@
datax.customer_website = customer_website;
}
var com_id = $('.com_id').val(); // 公司ID
var com_name = $('.com_id').find("option:selected").text(); // 公司名称
if (!com_id) {
layer.msg('请选择销售组织');
return false;
}
datax.com_id = com_id;
datax.com_name = com_name;
datax.tax_id = tax_id;
datax.user_coupon_id = user_coupon_id;
datax.zy_delivery_type = zy_delivery_type;
......
......@@ -241,6 +241,22 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>销售组织:</span>
<select name="com_id" class="com_id">
<option value="">请选择</option>
@if ($company)
@foreach ($company as $k=>$v)
<option value="{{ $k }}" data-currency="{{ $v['com_currency'] }}">{{ $v['com_name'] }}</option>
@endforeach
@endif
</select>
<span class="currency-section hide"> 币别:<span class="currency-sign"></span></span>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span>交货地址:</span>
<label class="radio-inline">
<input type="radio" name="delivery_place" class="delivery_place" value="1" checked="checked"> 大陆
......
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