Commit 99cb6cda by 朱继来

Merge branch 'zjl_com_20210302'

parents 8678f987 44f4bed0
...@@ -78,6 +78,7 @@ Class AddOrderController extends Controller ...@@ -78,6 +78,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/getDJKConfg'; $url = Config('website.api_domain').'cart/getDJKConfg';
$info['api_dgk_url'] = ($url.'?k1='.$data['k1']."&".'k2='.$data['k2']); $info['api_dgk_url'] = ($url.'?k1='.$data['k1']."&".'k2='.$data['k2']);
$info['company'] = (new CmsModel())->getCompany(); // 获取公司组织
return view('addOrder', $info); return view('addOrder', $info);
} }
...@@ -552,6 +553,8 @@ Class AddOrderController extends Controller ...@@ -552,6 +553,8 @@ Class AddOrderController extends Controller
$data['cart_id'] = implode(',', $request->input('cart_ids')); $data['cart_id'] = implode(',', $request->input('cart_ids'));
$data['type'] = $request->input('type'); $data['type'] = $request->input('type');
$data['remark'] = $request->input('remark'); $data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', '');
if ($data['type'] == 3) { // 自营线下订单 if ($data['type'] == 3) { // 自营线下订单
$data['address_name'] = $request->input('address_name'); $data['address_name'] = $request->input('address_name');
......
<?php <?php
namespace App\Model; namespace App\Model;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Request; use Request;
use Excel; use Excel;
use DB; use DB;
class CmsModel extends Model class CmsModel extends Model
{ {
protected $table = 'user_info'; protected $table = 'user_info';
protected $primaryKey = 'userId'; protected $primaryKey = 'userId';
public $timestamps = false; public $timestamps = false;
// 获取用户名称 // 获取用户名称
public function getUserName($userId, $field='name') public function getUserName($userId, $field='name')
{ {
$user = $this->where(['userId' => $userId])->select($field)->first(); $user = $this->where(['userId' => $userId])->select($field)->first();
return $user ? $user->$field : ''; return $user ? $user->$field : '';
} }
// 获取用户ID // 获取用户ID
public function getSaleId($name='') public function getSaleId($name='')
{ {
if (!$name) return false; if (!$name) return false;
$name && $map['name'] = $name; $name && $map['name'] = $name;
$user = $this->where($map)->select('userId')->first(); $user = $this->where($map)->select('userId')->first();
return $user ? $user->userId : 0; return $user ? $user->userId : 0;
} }
/* /*
查询cms系统用户信息 查询cms系统用户信息
*/ */
public function getUserInfo($where){ public function getUserInfo($where){
return $this->where($where)->select('userId')->first(); return $this->where($where)->select('userId')->first();
} }
/* /*
批量查询用户姓名 批量查询用户姓名
*/ */
public function getBatchUserName($user_ids){ public function getBatchUserName($user_ids)
{
return $this->whereIn('userId',$user_ids)->select('userId','name','email')->get()->toArray(); 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
...@@ -427,7 +427,8 @@ ...@@ -427,7 +427,8 @@
} }
// if (goods_type == 1) { // 联营需要选择交货地 // if (goods_type == 1) { // 联营需要选择交货地
delivery_place = $('input[name=delivery_place]:checked').val(); // delivery_place = $('input[name=delivery_place]:checked').val();
delivery_place = $('.delivery_place').val();
if (delivery_place == null) { if (delivery_place == null) {
layer.msg('请选择交货地'); layer.msg('请选择交货地');
...@@ -481,14 +482,44 @@ ...@@ -481,14 +482,44 @@
}) })
}) })
// 切换交货地 // 选择销售组织
$('.delivery_place').click(function() { $('.com_id').change(function() {
var user_id = $('.user_id').val(); var val = $(this).val();
var delivery_place = $(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');
$('.delivery_place').val(delivery_place);
$('.currency-sign').text(currency_sign);
$('.currency-section').show();
var user_id = $('.user_id').val();
loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表 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() { $('.shop-table').delegate('.goods_num', 'blur', function() {
var self = $(this); var self = $(this);
...@@ -818,6 +849,17 @@ ...@@ -818,6 +849,17 @@
datax.customer_website = customer_website; 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.tax_id = tax_id;
datax.user_coupon_id = user_coupon_id; datax.user_coupon_id = user_coupon_id;
datax.zy_delivery_type = zy_delivery_type; datax.zy_delivery_type = zy_delivery_type;
......
...@@ -241,15 +241,40 @@ ...@@ -241,15 +241,40 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<span><i class="text-danger">*</i> 销售组织:</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 class="form-group">
<span>交货地址:</span>
<select name="delivery_place" class="delivery_place" disabled>
<option value="1">大陆</option>
<option value="2">香港</option>
</select>
</div>
</div>
<!-- <div class="col-sm-6">
<div class="form-group">
<span>交货地址:</span> <span>交货地址:</span>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="delivery_place" class="delivery_place" value="1" checked="checked"> 大陆 <input type="radio" name="delivery_place" class="delivery_place" value="1" checked="checked" disabled="disabled"> 大陆
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="delivery_place" class="delivery_place" value="2"> 香港 <input type="radio" name="delivery_place" class="delivery_place" value="2" disabled="disabled"> 香港
</label> </label>
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<!-- 目前仅支持联营商品退款 --> <!-- 目前仅支持联营商品退款 -->
<?php $goods_count = 0; ?> <?php $goods_count = 0; ?>
@foreach ($order_items_info as $k => $v) @foreach ($order_items_info as $k => $v)
@if ($v['order_goods_type'] == 1) @if ($v['order_goods_type'] == 1 && $v['status'] == 1)
<?php $goods_count++; ?> <?php $goods_count++; ?>
<tr> <tr>
<input type="hidden" name="service_item[{{ $v['rec_id'] }}][rec_id]" value="{{ $v['rec_id'] }}"> <input type="hidden" name="service_item[{{ $v['rec_id'] }}][rec_id]" value="{{ $v['rec_id'] }}">
......
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