Commit 6c5c6b47 by 朱继来

调整自营列表筛选、导出JS

parent 5b353495
...@@ -248,11 +248,15 @@ class OrderModel extends Model ...@@ -248,11 +248,15 @@ class OrderModel extends Model
$cellData = $this->exportList($list); $cellData = $this->exportList($list);
// 标题 // 标题
if ($map['order_goods_type'] == 1) {
$headerCell = ['订单ID', '订单编号', '会员账号', '是否为新订单', '收货人', '下单日期', '下单时间', '客户名称', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注']; $headerCell = ['订单ID', '订单编号', '会员账号', '是否为新订单', '收货人', '下单日期', '下单时间', '客户名称', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注'];
} else {
$headerCell = ['订单ID', '订单编号', '会员账号', '收货人', '下单日期', '下单时间', '客户名称', '商品型号', '制造商', '供应商', '数量', '单价', '均摊后单价', '商品小计', '币种', $sale_name, '商品总额', '运费', '附加费', '优惠券', '订单总额', '订单类型', '订单状态', '发货状态', '收货地址', '发票类型', '发票状态', '发票抬头', '公司注册地址', '公司电话', 'adtags来源', '新用户来源', '取消原因', '推送备注'];
}
array_unshift($cellData, $headerCell); array_unshift($cellData, $headerCell);
$fileName = '订单导出'.date('_YmdHis'); $fileName = $map['order_goods_type'] == 1 ? '联营订单导出'.date('_YmdHis') : '自营订单导出'.date('_YmdHis');
Excel::create($fileName, function($excel) use ($cellData){ Excel::create($fileName, function($excel) use ($cellData){
$excel->sheet('订单导出', function($sheet) use ($cellData){ $excel->sheet('订单导出', function($sheet) use ($cellData){
...@@ -332,7 +336,11 @@ class OrderModel extends Model ...@@ -332,7 +336,11 @@ class OrderModel extends Model
$tmp[$i]['order_sn'] = "\t".$order[$i]['order_sn']."\t"; $tmp[$i]['order_sn'] = "\t".$order[$i]['order_sn']."\t";
$tmp[$i]['user_account'] = $order[$i]['mobile'] ? $order[$i]['mobile'] : $order[$i]['email']; $tmp[$i]['user_account'] = $order[$i]['mobile'] ? $order[$i]['mobile'] : $order[$i]['email'];
// $tmp[$i]['is_new'] = $order[$i]['is_new'] == 1 ? '是' : '否'; // 是否为新用户 // $tmp[$i]['is_new'] = $order[$i]['is_new'] == 1 ? '是' : '否'; // 是否为新用户
if ($order[$i]['order_goods_type'] == 1) {
$tmp[$i]['is_new_order'] = $order[$i]['is_new_order'] == 1 ? '是' : '否'; // 是否为新订单 $tmp[$i]['is_new_order'] = $order[$i]['is_new_order'] == 1 ? '是' : '否'; // 是否为新订单
}
$tmp[$i]['consignee'] = isset($order[$i]['consignee']) ? $order[$i]['consignee'] : ''; $tmp[$i]['consignee'] = isset($order[$i]['consignee']) ? $order[$i]['consignee'] : '';
$tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]['create_time']); $tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]['create_time']);
$tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]['create_time']); $tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]['create_time']);
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
} }
// 搜索、导出条件 // 搜索、导出条件
function orderListCommon(url) { function orderListCommon(url, type) { // type-订单类型
var order_type = $('#order_type').data('default'), var order_type = $('#order_type').data('default'),
order_contain = $('input[name=order_contain]').val(), order_contain = $('input[name=order_contain]').val(),
time_start = $('input[name="time_start"]').val(), time_start = $('input[name="time_start"]').val(),
...@@ -75,9 +75,11 @@ ...@@ -75,9 +75,11 @@
// order_type_a = $('#order_type_a').data('default'), // order_type_a = $('#order_type_a').data('default'),
order_pay_type = $('#order_pay_type').val() ? $('#order_pay_type').val() : '', order_pay_type = $('#order_pay_type').val() ? $('#order_pay_type').val() : '',
order_status = $('#order_status').val() ? $('#order_status').val() : '', order_status = $('#order_status').val() ? $('#order_status').val() : '',
sale_type = $('#sale_type').val() ? $('#sale_type').val() : '',
shipping_name = $('#shipping_name').val() ? $('#shipping_name').val() : '', shipping_name = $('#shipping_name').val() ? $('#shipping_name').val() : '',
order_send = $('#order_send').val(), order_send = $('#order_send').val(),
order_source_pf = $('#order_source_pf').val() ? $('#order_source_pf').val() : '', order_source_pf = $('#order_source_pf').val() ? $('#order_source_pf').val() : '',
order_invoice_status = $('#order_invoice_status').val() ? $('#order_invoice_status').val() : '',
order_source_adtag = $('input[name="order_source_adtag"]').val(), order_source_adtag = $('input[name="order_source_adtag"]').val(),
order_source_ptag = $('input[name="order_source_ptag"]').val(), order_source_ptag = $('input[name="order_source_ptag"]').val(),
erp_order_id = $('#erp_order_id').val() ? $('#erp_order_id').val() : '', erp_order_id = $('#erp_order_id').val() ? $('#erp_order_id').val() : '',
...@@ -87,8 +89,9 @@ ...@@ -87,8 +89,9 @@
is_new_order = $('#is_new_order').val() ? $('#is_new_order').val() : ''; is_new_order = $('#is_new_order').val() ? $('#is_new_order').val() : '';
if (url == '/export') { if (url == '/export') {
if (type == 1) { // 联营
if (test_order.length) { if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && ! order_source_ptag && !erp_order_id && !is_new && !is_new_order && !order_payment_mode && !test_order.is(':checked')) { if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !order_source_ptag && !erp_order_id && !is_new && !is_new_order && !order_payment_mode && !test_order.is(':checked')) {
layer.msg('请选择筛选条件,再导出!'); layer.msg('请选择筛选条件,再导出!');
return false; return false;
} }
...@@ -98,6 +101,19 @@ ...@@ -98,6 +101,19 @@
return false; return false;
} }
} }
} else { // 自营
if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !sale_type && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag && !is_new && !test_order.is(':checked')) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
} else {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !sale_type && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag && !is_new) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
}
}
} }
var listUrl = url; var listUrl = url;
...@@ -132,6 +148,10 @@ ...@@ -132,6 +148,10 @@
listUrl += '&order_status=' + order_status; listUrl += '&order_status=' + order_status;
} }
if (sale_type) {
listUrl += '&sale_type=' + sale_type;
}
if (shipping_name) { if (shipping_name) {
listUrl += '&shipping_name=' + shipping_name; listUrl += '&shipping_name=' + shipping_name;
} }
...@@ -144,6 +164,10 @@ ...@@ -144,6 +164,10 @@
listUrl += '&order_source_pf=' + order_source_pf; listUrl += '&order_source_pf=' + order_source_pf;
} }
if (order_invoice_status) {
listUrl += '&order_invoice_status=' + order_invoice_status;
}
if (order_source_adtag) { if (order_source_adtag) {
listUrl += '&order_source_adtag=' + order_source_adtag; listUrl += '&order_source_adtag=' + order_source_adtag;
} }
...@@ -172,24 +196,31 @@ ...@@ -172,24 +196,31 @@
listUrl += '&test_order=' + 1; listUrl += '&test_order=' + 1;
} }
if (!order_contain && !time_start && !time_end && !order_pay_type && !order_status && !shipping_name && !order_send && !order_source_pf && !order_source_adtag && !order_source_ptag && !erp_order_id && (is_new === '') && !is_new_order && !order_payment_mode && !test_order.is(':checked')) {
listUrl = '/list';
}
if (url == '/export') { if (url == '/export') {
listUrl += '&order_goods_type='+1; listUrl += '&order_goods_type='+type;
} }
location.href = listUrl; location.href = listUrl;
} }
// 联营搜索
$('.searchOrder').click(function(){ $('.searchOrder').click(function(){
orderListCommon('/list'); orderListCommon('/list', 1);
}) })
// 导出订单 // 联营导出订单
$('.exportExcel').click(function() { $('.exportExcel').click(function() {
orderListCommon('/export'); orderListCommon('/export', 1);
})
// 自营搜索
$('.search_self_order').click(function(){
orderListCommon('/self_order', 2);
})
// 自营导出订单
$('.self_export').click(function() {
orderListCommon('/export', 2);
}) })
// 选择查看测试订单 // 选择查看测试订单
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<title>订单管理后台 | 订单列表</title> <title>订单管理后台 | 订单列表</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script> <script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('selfOrder.css') @include('orderlist.css')
@include('selfOrder.js') @include('orderlist.js')
</head> </head>
<body class=""> <body class="">
......
...@@ -390,6 +390,5 @@ ...@@ -390,6 +390,5 @@
$('.order_pay_type').selectpicker('val', order_pay_type.split(',')).trigger("change"); $('.order_pay_type').selectpicker('val', order_pay_type.split(',')).trigger("change");
$('.is_new').selectpicker('val', is_new.split(',')).trigger("change"); $('.is_new').selectpicker('val', is_new.split(',')).trigger("change");
$.lie.self.index(); $.lie.order.index();
$.lie.order.cancelorder();
</script> </script>
\ No newline at end of file
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/bootstrap-select.min.css" rel="stylesheet">
<link href="/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link href="/layer/skin/layer.css" rel="stylesheet">
<link href="/css/order.css" rel="stylesheet">
<link href="/css/detail.css" rel="stylesheet">
\ No newline at end of file
<script src="/js/jquery-2.2.1.js"></script>
<script src="/js/jquery.form.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/bootstrap-select.min.js"></script>
<script src="/layer/layer.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/inspinia.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/order.js"></script>
<script src="/js/self_order.js"></script>
<script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.js"></script>
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