Commit 9467fa3d by 朱继来

调整自营退货列表

parent 04bcbcc4
...@@ -32,6 +32,16 @@ function getPayName($order_id) ...@@ -32,6 +32,16 @@ function getPayName($order_id)
return false; return false;
} }
// 获取交易员名称
function getSalesName($sale_id)
{
if (!$sale_id) return false;
$user = DB::table('user_info')->where('userId', $sale_id)->select('name')->first();
return isset($user) ? $user->name : '';
}
// 获取物流名称 // 获取物流名称
function getShippingName($shipping_id) function getShippingName($shipping_id)
{ {
...@@ -112,6 +122,16 @@ class ReturnController extends Controller ...@@ -112,6 +122,16 @@ class ReturnController extends Controller
$map['time_start'] = $request->input('time_start', ''); $map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', ''); $map['time_end'] = $request->input('time_end', '');
$map['order_goods_type'] = $type; // 类型 $map['order_goods_type'] = $type; // 类型
$map['sale_id'] = $request->input('sale_id', '');
// 非管理员、经理、自营主管、自营主管助理,只能看到自己的退货单
if (!in_array($info['role'], [1, 2, 10, 11])) {
$map['create_uid'] = $request->user->userId;
}
if (!empty($map['sale_id'])) {
$map['create_uid'] = $map['sale_id'];
}
//获取订单列表 //获取订单列表
$url = Config('website.api_domain').'return/getReturnList'; $url = Config('website.api_domain').'return/getReturnList';
...@@ -144,6 +164,12 @@ class ReturnController extends Controller ...@@ -144,6 +164,12 @@ class ReturnController extends Controller
$info['count'] = $response['data']['count']; $info['count'] = $response['data']['count'];
$info['page'] = $show; $info['page'] = $show;
$perm = new PermController;
$joint_kefu = $perm->getRoleUsers($request, '客服');
$self_kefu = $perm->getRoleUsers($request, '自营客服');
$info['sale_list'] = array_merge($joint_kefu, $self_kefu);
return $info; return $info;
} }
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '', order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '',
time_start = $('input[name="time_start"]').val(), time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(), time_end = $('input[name="time_end"]').val(),
order_goods_type = $('input[name="order_goods_type"]').val(); order_goods_type = $('input[name="order_goods_type"]').val();
if (url == '/refund_export' || url == '/refund_self_export') { if (url == '/refund_export' || url == '/refund_self_export') {
if (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) { if (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) {
...@@ -230,7 +230,8 @@ ...@@ -230,7 +230,8 @@
order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '', order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '',
time_start = $('input[name="time_start"]').val(), time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(), time_end = $('input[name="time_end"]').val(),
order_goods_type = $('input[name="order_goods_type"]').val(); order_goods_type = $('input[name="order_goods_type"]').val(),
sale_id = $('#sale_id').val() ? $('#sale_id').val() : '';
if (url == '/return_export' || url == '/self_return_export') { if (url == '/return_export' || url == '/self_return_export') {
if (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) { if (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) {
...@@ -271,6 +272,10 @@ ...@@ -271,6 +272,10 @@
listUrl += '&time_end='+time_end; listUrl += '&time_end='+time_end;
} }
if (sale_id) {
listUrl += '&sale_id=' + sale_id;
}
listUrl += '&order_goods_type='+order_goods_type; listUrl += '&order_goods_type='+order_goods_type;
location.href = listUrl; location.href = listUrl;
......
...@@ -49,6 +49,31 @@ ...@@ -49,6 +49,31 @@
</select> </select>
</dd> </dd>
</dl> </dl>
@if (in_array($role, [1, 2, 10, 11]))
<dl>
<dt>客服:</dt>
<dd>
<select id="sale_id" name="sale_id" class="form-control sale_id selectpicker" title="全部" data-live-search="true" data-size="7" multiple>
<!-- <option value="">全部</option> -->
<optgroup label="在职">
@foreach ($sale_list as $v)
@if ($v->status != 4)
<option value="{{$v->userId}}">{{$v->name}}</option>
@endif
@endforeach
</optgroup>
<optgroup label="离职">
@foreach ($sale_list as $v)
@if ($v->status == 4)
<option value="{{$v->userId}}">{{$v->name}}</option>
@endif
@endforeach
</optgroup>
</select>
</dd>
</dl>
@endif
<dl> <dl>
<dt>创建日期: </dt> <dt>创建日期: </dt>
...@@ -85,6 +110,7 @@ ...@@ -85,6 +110,7 @@
<th class="pl30">退款金额</th> <th class="pl30">退款金额</th>
<th class="pl30">申请状态</th> <th class="pl30">申请状态</th>
<th class="pl30">支付方式</th> <th class="pl30">支付方式</th>
<th class="pl30">客服</th>
<th class="pl30">处理时间</th> <th class="pl30">处理时间</th>
<th class="pl30">操作</th> <th class="pl30">操作</th>
</tr> </tr>
...@@ -121,6 +147,7 @@ ...@@ -121,6 +147,7 @@
</td> </td>
<?php $pay_name = App\Http\Controllers\getPayName($v['order_id']); ?> <?php $pay_name = App\Http\Controllers\getPayName($v['order_id']); ?>
<td class="show-list"><?php print_r($pay_name); ?></td> <td class="show-list"><?php print_r($pay_name); ?></td>
<td>{{ App\Http\Controllers\getSalesName($v['create_uid']) }}</td>
<td class="show-list">{{$v['audit_time'] ? date('Y-m-d H:i:s', $v['audit_time']) : ''}}</td> <td class="show-list">{{$v['audit_time'] ? date('Y-m-d H:i:s', $v['audit_time']) : ''}}</td>
<td> <td>
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs">
...@@ -150,11 +177,12 @@ ...@@ -150,11 +177,12 @@
</div> </div>
<script> <script>
var shippings = '{!! json_encode($shippings) !!}'; var shippings = '{!! json_encode($shippings) !!}';
var shippings_info = eval('('+shippings+')'); var shippings_info = eval('('+shippings+')');
var apply_status = "{{$condition['apply_status']}}"; var apply_status = "{{$condition['apply_status']}}";
var order_payment_mode = "{{$condition['order_payment_mode']}}"; var order_payment_mode = "{{$condition['order_payment_mode']}}";
var sale_id = "{{$condition['sale_id']}}";
$(".apply_status, .order_payment_mode").selectpicker({ $(".apply_status, .order_payment_mode").selectpicker({
actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮 actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮
...@@ -166,6 +194,7 @@ ...@@ -166,6 +194,7 @@
$('.apply_status').selectpicker('val', apply_status.split(',')).trigger("change"); $('.apply_status').selectpicker('val', apply_status.split(',')).trigger("change");
$('.order_payment_mode').selectpicker('val', order_payment_mode.split(',')).trigger("change"); $('.order_payment_mode').selectpicker('val', order_payment_mode.split(',')).trigger("change");
$('#sale_id').selectpicker('val', sale_id.split(',')).trigger("change");
$.lie.refund.index_new(); $.lie.refund.index_new();
</script> </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