Commit 6e9d3206 by 朱继来

Merge branch 'zjl_iteration_20190822' into development

parents ba3cd837 367b7f0f
......@@ -32,6 +32,16 @@ function getPayName($order_id)
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)
{
......@@ -112,6 +122,16 @@ class ReturnController extends Controller
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$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';
......@@ -144,6 +164,12 @@ class ReturnController extends Controller
$info['count'] = $response['data']['count'];
$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;
}
......
......@@ -259,7 +259,7 @@ class OrderModel extends Model
})
->where('it.status', '<>', -1)
->where('o.order_goods_type', '=', $map['order_goods_type'])
->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.single_pre_price', 'it.brand_name', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_type', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.sale_type', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.tax_title', 'i.inv_type', 'i.invoice_status', 'i.tax_title', 'i.company_address', 'i.company_phone', 'i.tax_no', 'i.bank_name', 'i.bank_account', 'a.consignee', 'a.address', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'u.is_new', 'u.is_test', 'c.com_name', 'oe.send_remark', 'oe.is_new as is_new_order', 'oe.business_type', 'oe.jd_order_id')
->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.single_pre_price', 'it.brand_name', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_type', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.sale_type', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.tax_title', 'i.inv_type', 'i.invoice_status', 'i.tax_title', 'i.company_address', 'i.company_phone', 'i.tax_no', 'i.bank_name', 'i.bank_account', 'a.consignee', 'a.address', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'u.is_new', 'u.is_test', 'c.com_name', 'oe.send_remark', 'oe.is_new as is_new_order', 'oe.business_type', 'oe.jd_order_id', 'oe.exchange_rate')
->groupBy('it.rec_id')
->orderBy('o.create_time', 'DESC')
->get()
......@@ -271,7 +271,7 @@ class OrderModel extends Model
// 标题
if ($map['order_goods_type'] == 1) {
$headerCell = ['订单ID', '订单编号', '京东订单编号', '会员账号', '收货人', '下单日期', '下单时间', '客户名称', '平台来源', 'SKUID', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', '客服', '商品总额', '运费', '附加费', '优惠券', '订单总额', '付款类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注', '是否为测试订单', '是否为新订单'];
$headerCell = ['订单ID', '订单编号', '京东订单编号', '会员账号', '收货人', '下单日期', '下单时间', '客户名称', '平台来源', 'SKUID', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', '客服', '商品总额', '运费', '附加费', '优惠券', '订单总额', '人民币总额', '付款类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注', '是否为测试订单', '是否为新订单'];
} else {
$headerCell = ['订单ID', '订单编号', '京东订单编号', '会员账号', '收货人', '下单日期', '下单时间', '客户名称', '平台来源', 'SKUID', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', '客服', '商品总额', '运费', '附加费', '优惠券', '订单总额', '付款类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注', '是否为测试订单', '销售类型', '业务类型'];
}
......@@ -367,12 +367,20 @@ class OrderModel extends Model
$tmp[$i]['extra_fee'] = '';
$tmp[$i]['coupon'] = '';
$tmp[$i]['order_amount'] = '';
if ($order[$i]['order_goods_type'] == 1) {
$tmp[$i]['rmb_amount'] = ''; // 人民币总额
}
} else {
$tmp[$i]['goods_sum'] = $this->getOrderPrice($order[$i]['order_id'], 1);
$tmp[$i]['shipping_fee'] = $this->getOrderPrice($order[$i]['order_id'], 3);
$tmp[$i]['extra_fee'] = $this->getOrderPrice($order[$i]['order_id'], 2);
$tmp[$i]['coupon'] = $this->getOrderPrice($order[$i]['order_id'], -4);
$tmp[$i]['order_amount'] = $order[$i]['order_amount'];
$tmp[$i]['order_amount'] = $order[$i]['order_amount'];
if ($order[$i]['order_goods_type'] == 1) {
$tmp[$i]['rmb_amount'] = $order[$i]['currency'] == 2 ? $order[$i]['order_amount'] * $order[$i]['exchange_rate'] : $order[$i]['order_amount']; // 人民币总额
}
}
$tmp[$i]['order_type'] = !empty($order[$i]['order_pay_type']) ? Config('params.order_pay_type')[$order[$i]['order_pay_type']] : '未知';
......
......@@ -66,7 +66,7 @@
order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '',
time_start = $('input[name="time_start"]').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 (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) {
......@@ -230,7 +230,8 @@
order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '',
time_start = $('input[name="time_start"]').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 (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) {
......@@ -271,6 +272,10 @@
listUrl += '&time_end='+time_end;
}
if (sale_id) {
listUrl += '&sale_id=' + sale_id;
}
listUrl += '&order_goods_type='+order_goods_type;
location.href = listUrl;
......
......@@ -49,6 +49,31 @@
</select>
</dd>
</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>
<dt>创建日期: </dt>
......@@ -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>
</tr>
......@@ -121,6 +147,7 @@
</td>
<?php $pay_name = App\Http\Controllers\getPayName($v['order_id']); ?>
<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>
<div class="btn-group btn-group-xs">
......@@ -150,11 +177,12 @@
</div>
<script>
var shippings = '{!! json_encode($shippings) !!}';
var shippings_info = eval('('+shippings+')');
var apply_status = "{{$condition['apply_status']}}";
var shippings = '{!! json_encode($shippings) !!}';
var shippings_info = eval('('+shippings+')');
var apply_status = "{{$condition['apply_status']}}";
var order_payment_mode = "{{$condition['order_payment_mode']}}";
var sale_id = "{{$condition['sale_id']}}";
$(".apply_status, .order_payment_mode").selectpicker({
actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮
......@@ -166,6 +194,7 @@
$('.apply_status').selectpicker('val', apply_status.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();
</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