Commit 808e5569 by 朱继来

Merge branch 'zjl_cancel_order_20190213' into development

parents c48c4012 ff3064c3
...@@ -381,15 +381,14 @@ Class OrderController extends Controller ...@@ -381,15 +381,14 @@ Class OrderController extends Controller
return view('orderlist', $info); return view('orderlist', $info);
} }
// 获取页面及订单信息 tid为订单类型:1.联营 2. 自营 // 订单搜索参数
public function getOrderInfo($request, $tid) public function _search(Request $request, $tid)
{ {
$info = $this->getPageInfo($request); $info = $this->getPageInfo($request);
$map = array(); $map = array();
// 页面参数 // 页面参数
if ($request->isMethod('get')) {
$map['order_type'] = $request->input('order_type', ''); $map['order_type'] = $request->input('order_type', '');
$map['order_contain'] = $request->input('order_contain', ''); $map['order_contain'] = $request->input('order_contain', '');
$map['time_start'] = $request->input('time_start', ''); $map['time_start'] = $request->input('time_start', '');
...@@ -406,17 +405,15 @@ Class OrderController extends Controller ...@@ -406,17 +405,15 @@ Class OrderController extends Controller
$map['order_source_adtag'] = $request->input('order_source_adtag', ''); $map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_source_ptag'] = $request->input('order_source_ptag', ''); $map['order_source_ptag'] = $request->input('order_source_ptag', '');
$map['erp_order_id'] = $request->input('erp_order_id', ''); $map['erp_order_id'] = $request->input('erp_order_id', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', ''); $map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['order_invoice_status']= $request->input('order_invoice_status', ''); $map['order_invoice_status']= $request->input('order_invoice_status', '');
$map['is_new'] = $request->input('is_new', ''); $map['is_new'] = $request->input('is_new', '');
$map['is_new_order'] = $request->input('is_new_order', ''); $map['is_new_order'] = $request->input('is_new_order', '');
}
// 订单查看权限---交易员、客服、测试 // 订单查看权限---交易员、客服、测试
if (in_array($info['role'], [3, 4])) { if (in_array($info['role'], [3, 4])) {
// 筛选自己的订单 // 筛选自己的订单
$data['sale_id'] = $request->user->userId; $map['sale_id'] = $request->user->userId;
} }
// 自营客服权限 // 自营客服权限
...@@ -444,6 +441,17 @@ Class OrderController extends Controller ...@@ -444,6 +441,17 @@ Class OrderController extends Controller
$map['order_type_filter'] = [2, 3]; // 2-ERP, 3-JD $map['order_type_filter'] = [2, 3]; // 2-ERP, 3-JD
} }
$info['size'] = $size;
$info['map'] = $map;
return $info;
}
// 获取页面及订单信息 tid为订单类型:1.联营, 2. 自营, 3. ERP
public function getOrderInfo($request, $tid=1)
{
$info = $this->_search($request, $tid);
// 获取所有的业务员 (包括经理、交易员、客服、测试) // 获取所有的业务员 (包括经理、交易员、客服、测试)
$perm = new PermController; $perm = new PermController;
...@@ -452,7 +460,6 @@ Class OrderController extends Controller ...@@ -452,7 +460,6 @@ Class OrderController extends Controller
$test = $perm->getRoleUsers($request, '测试'); $test = $perm->getRoleUsers($request, '测试');
$sales = $perm->getRoleUsers($request, '交易员'); $sales = $perm->getRoleUsers($request, '交易员');
$kefu = $perm->getRoleUsers($request, '客服'); $kefu = $perm->getRoleUsers($request, '客服');
$sale_list = array_merge($manager, $sales, $test, $kefu); $sale_list = array_merge($manager, $sales, $test, $kefu);
} else { } else {
$sale_list = $perm->getRoleUsers($request, '客服'); $sale_list = $perm->getRoleUsers($request, '客服');
...@@ -464,30 +471,43 @@ Class OrderController extends Controller ...@@ -464,30 +471,43 @@ Class OrderController extends Controller
$data['k1'] = time(); $data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码 $data['p'] = $request->input('p', 1); // 当前页码
$data['size'] = $size; // 当前页条数 $data['size'] = $info['size']; // 当前页条数
$data['map'] = $map; $data['map'] = $info['map'];
$response = json_decode(curlApi($url, $data), true); $response = json_decode(curlApi($url, $data), true);
// 分页 // 分页
$page = new Page($response['data']['count'], $size); $page = new Page($response['data']['count'], $info['size']);
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%'); $page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show = $page->show(); $show = $page->show();
$info['condition'] = $map; $info['condition'] = $info['map'];
$info['sale_list'] = $sale_list; $info['sale_list'] = $sale_list;
$info['list'] = $response['data']['data']; $info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_count'];
$info['count'] = $response['data']['count']; $info['count'] = $response['data']['count'];
$info['user_count'] = $response['data']['user_count'];
$info['paid_user_count'] = $response['data']['paid_user_count'];
$info['paid_order_count'] = $response['data']['paid_order_count'];
$info['noreason_count'] = $response['data']['noreason_count'];
$info['page'] = $show; $info['page'] = $show;
return $info; return $info;
} }
// 订单其他信息
public function orderOtherInfoLoading(Request $request)
{
// 判断页面
$tid = $request->input('pid', 1);
$info = $this->_search($request, $tid);
$url = Config('website.api_domain').'order/getOrderOtherInfo';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['map'] = $info['map'];
$response = json_decode(curlApi($url, $data), true);
return $response;
}
// erp订单 // erp订单
public function erpOrder(Request $request) public function erpOrder(Request $request)
{ {
......
...@@ -114,8 +114,6 @@ Class OrderCountController extends Controller ...@@ -114,8 +114,6 @@ Class OrderCountController extends Controller
if ($response['err_code'] == 0) { if ($response['err_code'] == 0) {
$count = $response['data']['count']; $count = $response['data']['count'];
$pay_count = $response['data']['pay_count'];
if($count > 0){ if($count > 0){
$pageSize = 10; $pageSize = 10;
$page = new Page($count, $pageSize); $page = new Page($count, $pageSize);
...@@ -125,7 +123,6 @@ Class OrderCountController extends Controller ...@@ -125,7 +123,6 @@ Class OrderCountController extends Controller
} }
$info['list'] = $response['data']['data']; $info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_count'];
} }
$info['checkTime'] = $checkTime; $info['checkTime'] = $checkTime;
...@@ -147,4 +144,33 @@ Class OrderCountController extends Controller ...@@ -147,4 +144,33 @@ Class OrderCountController extends Controller
{ {
return $this->amount($request, 2, 'amount'); return $this->amount($request, 2, 'amount');
} }
// 金额统计
public function orderAmountInfoLoading(REQUEST $request)
{
$time_start = $request->input('time_start', ''); // 开始时间
$time_end = $request->input('time_end', ''); // 结束时间
// 今日开始、结束时间
$time_today_start = strtotime(date('Y-m-d'));
$time_today_end = strtotime(date('Y-m-d',time()+3600*24))-1;
$map['time_start'] = !empty($time_start) ? $time_start : $time_today_start;
$map['time_end'] = !empty($time_end) ? $time_end : $time_today_end;
$map['checkTime'] = $request->input('checkTime', '1'); // 默认选择订单付款时间
$map['checkStatus'] = $request->input('checkStatus', '1'); // 默认选择查询全部
$map['order_goods_type'] = $request->input('type', '1');
$url = Config('website.api_domain').'order/getOrderAmount';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['map'] = $map;
$response = json_decode(curlApi($url, $data), true);
return $response;
}
} }
\ No newline at end of file
...@@ -33,6 +33,7 @@ Route::pattern('roleId', '[0-9]+'); ...@@ -33,6 +33,7 @@ Route::pattern('roleId', '[0-9]+');
Route::group(['middleware' => 'web'], function () { Route::group(['middleware' => 'web'], function () {
Route::get('/', 'OrderController@orderList'); Route::get('/', 'OrderController@orderList');
Route::get('/list', 'OrderController@orderList'); Route::get('/list', 'OrderController@orderList');
Route::post('/ajax/orderOtherInfoLoading', 'OrderController@orderOtherInfoLoading');
Route::get('/erp_order', 'OrderController@erpOrder'); Route::get('/erp_order', 'OrderController@erpOrder');
Route::get('/export', 'OrderController@export'); Route::get('/export', 'OrderController@export');
...@@ -62,6 +63,7 @@ Route::group(['middleware' => 'web'], function () { ...@@ -62,6 +63,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/self_count', 'OrderCountController@selfCount'); Route::get('/self_count', 'OrderCountController@selfCount');
Route::get('/amount', 'OrderCountController@amount'); Route::get('/amount', 'OrderCountController@amount');
Route::get('/self_amount', 'OrderCountController@selfAmount'); Route::get('/self_amount', 'OrderCountController@selfAmount');
Route::post('/ajax/orderAmountInfoLoading', 'OrderCountController@orderAmountInfoLoading');
Route::match('post', '/ajaxDelayTime', 'OrderController@ajaxDelayTime'); Route::match('post', '/ajaxDelayTime', 'OrderController@ajaxDelayTime');
......
...@@ -280,6 +280,7 @@ ...@@ -280,6 +280,7 @@
} }
}) })
// ERP订单列表
$('.searchErpOrder').click(function(){ $('.searchErpOrder').click(function(){
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(),
...@@ -323,6 +324,75 @@ ...@@ -323,6 +324,75 @@
location.href = listUrl; location.href = listUrl;
}) })
// 订单其他信息
var page_type = $('#page_type').val();
orderOtherInfo(page_type);
// 订单其他信息:已付款, 下单用户数, 付款用户数, 金额
function orderOtherInfo(pid) {
var order_contain = $('input[name=order_contain]').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val();
if(time_start){
time_start = Date.parse(time_start) / 1000;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
}
var datax = {
order_type : $('#order_type').data('default'),
order_contain : specialStr(order_contain),
time_start : time_start,
time_end : time_end,
order_pay_type : $('#order_pay_type').val() ? $('#order_pay_type').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() : '',
order_send : $('#order_send').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_ptag : $('input[name="order_source_ptag"]').val(),
erp_order_id : $('#erp_order_id').val() ? $('#erp_order_id').val() : '',
test_order : $('input[name=test_order]').is(':checked') ? 1 : 0,
is_new : $('#is_new').val() ? $('#is_new').val() : '',
order_payment_mode : $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '',
is_new_order : $('#is_new_order').val() ? $('#is_new_order').val() : '',
pid : pid,
};
$.ajax({
type: "POST",
url: '/ajax/orderOtherInfoLoading',
data: datax,
dataType: "json",
success: function(resp){
if (resp.err_code != 0) {
layer.msg(resp.err_msg);
return false;
}
var data = resp.data;
var html = '';
if (pid != 3) {
html += '<span class="paid_order_count">'+data.paid_order_count+'单已付款(包含预付款),</span><span class="user_count">下单用户数为'+data.user_count+'人,</span><span class="paid_user_count">付款用户数为'+data.paid_user_count+'人,</span>';
}
html += '<span class="rmb_count">应付金额 ¥'+data.pay_count.rmb_count+',</span><span class="usd_count">$'+data.pay_count.usd_count+',</span><span class="rmb_pay">实收金额 ¥'+data.pay_count.rmb_pay+',</span><span class="usd_pay">$'+data.pay_count.usd_pay+',</span>';
if (pid != 3 && data.noreason_count) {
html += '<span class="error">共有'+data.noreason_count+'单已取消订单未填写取消原因</span>';
}
$('.show-other-info').append(html);
},
})
}
// 填写取消原因
this.cancelorder(); this.cancelorder();
}, },
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
self.bind(); self.bind();
}, },
bind:function(){ bind:function(){
// 订单列表
$('.order-amount-search').click(function(){ $('.order-amount-search').click(function(){
var type = $('input[name=type]').val(), var type = $('input[name=type]').val(),
checkTime = $('#checkTime').val(), checkTime = $('#checkTime').val(),
...@@ -28,6 +29,64 @@ ...@@ -28,6 +29,64 @@
location.href = url; location.href = url;
}) })
// 订单金额信息
var status = $('#status').val();
var type = $('#type').val();
orderAmountInfo(status, type);
function orderAmountInfo(status, type) {
var type = $('input[name=type]').val(),
checkTime = $('#checkTime').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
checkStatus = $('#status').val();
if(time_start){
time_start = Date.parse(time_start) / 1000;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
}
var datax = {
type : type,
checkTime : checkTime,
time_start : time_start,
time_end : time_end,
checkStatus : checkStatus,
};
$.ajax({
type: "POST",
url: '/ajax/orderAmountInfoLoading',
data: datax,
dataType: "json",
success: function(resp){
if (resp.err_code != 0) {
layer.msg(resp.err_msg);
return false;
}
var data = resp.data;
var html = '';
html += '<span>实收金额:¥'+data.rmb_pay+',</span><span>$'+data.usd_pay+',</span>';
if (checkStatus == 1) {
html += '<span>已完成金额:¥'+data.rmb_pay_finish+',</span><span>$'+data.usd_pay_finish+',</span>'+
'<span>未完成金额:¥'+data.rmb_pay_unfinish+',</span><span>$'+data.usd_pay_unfinish+'</span>';
} else if (checkStatus == 2) {
html += '<span>已完成金额:¥'+data.rmb_pay_finish+',</span><span>$'+data.usd_pay_finish+'</span>';
} else {
html += '<span>未完成金额:¥'+data.rmb_pay_unfinish+',</span><span>$'+data.usd_pay_unfinish+'</span>';
}
$('.show-list-info').append(html);
},
})
}
} }
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<option value="3">未完成</option> <option value="3">未完成</option>
</select> </select>
<input type="hidden" name="type" value="{{ $type }}">
<button class="btn btn-primary order-amount-search">搜索</button> <button class="btn btn-primary order-amount-search">搜索</button>
</div> </div>
</div> </div>
...@@ -114,23 +113,13 @@ ...@@ -114,23 +113,13 @@
@endforeach @endforeach
@endif @endif
</table> </table>
</div>
<input type="hidden" name="status" id="status" value="{{$checkStatus}}">
<input type="hidden" name="type" id="type" value="{{$type}}">
</div>
<div class="row-fluid pagination"> <div class="row-fluid pagination">
<span class="show-list-info"> <span class="show-list-info"></span>
@if ($checkStatus == 1)
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
已完成金额:¥{{!empty($pay_count['rmb_pay_finish']) ? $pay_count['rmb_pay_finish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_finish']) ? $pay_count['usd_pay_finish'] : 0}}
未完成金额:¥{{!empty($pay_count['rmb_pay_unfinish']) ? $pay_count['rmb_pay_unfinish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_unfinish']) ? $pay_count['usd_pay_unfinish'] : 0}}
@elseif ($checkStatus == 2)
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
已完成金额:¥{{!empty($pay_count['rmb_pay_finish']) ? $pay_count['rmb_pay_finish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_finish']) ? $pay_count['usd_pay_finish'] : 0}}
@else
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
未完成金额:¥{{!empty($pay_count['rmb_pay_unfinish']) ? $pay_count['rmb_pay_unfinish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_unfinish']) ? $pay_count['usd_pay_unfinish'] : 0}}
@endif
</span>
<?php echo isset($page) ? $page : ''; ?> <?php echo isset($page) ? $page : ''; ?>
</div> </div>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<!-- <ul class="nav nav-tabs"> <!-- <ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">ERP订单</a></li> <li class="active"><a href="javascript:;">ERP订单</a></li>
</ul> --> </ul> -->
<input type="hidden" name="page_type" id="page_type" value="3">
<div class="tabs-box"> <div class="tabs-box">
<div class="row-fluid search-box"> <div class="row-fluid search-box">
...@@ -289,9 +290,8 @@ ...@@ -289,9 +290,8 @@
@if ($username != 'vpadmin@ichunt.com') @if ($username != 'vpadmin@ichunt.com')
<span class="show-list-info"> <span class="show-list-info">
共{{$count ? $count : 0}}单, 共{{$count ? $count : 0}}单,
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}}, <span class="show-other-info"></span>
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
</span> </span>
@endif @endif
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<!-- <ul class="nav nav-tabs"> <!-- <ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">平台订单</a></li> <li class="active"><a href="javascript:;">平台订单</a></li>
</ul> --> </ul> -->
<input type="hidden" name="page_type" id="page_type" value="1">
<div class="tabs-box"> <div class="tabs-box">
<div class="row-fluid search-box"> <div class="row-fluid search-box">
...@@ -458,15 +459,8 @@ ...@@ -458,15 +459,8 @@
@if ($username != 'vpadmin@ichunt.com') @if ($username != 'vpadmin@ichunt.com')
<span class="show-list-info"> <span class="show-list-info">
共{{$count ? $count : 0}}单, 共{{$count ? $count : 0}}单,
{{$paid_order_count}}单已付款(包含预付款),
下单用户数为{{$user_count}}人, <span class="show-other-info"></span>
付款用户数为{{$paid_user_count}}人,
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}},
@if ($noreason_count)
<span class="error">共有{{$noreason_count}}单已取消订单未填写取消原因</span>
@endif
</span> </span>
@endif @endif
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<!-- <ul class="nav nav-tabs"> <!-- <ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">自营订单</a></li> <li class="active"><a href="javascript:;">自营订单</a></li>
</ul> --> </ul> -->
<input type="hidden" name="page_type" id="page_type" value="2">
<div class="tabs-box"> <div class="tabs-box">
<div class="row-fluid search-box"> <div class="row-fluid search-box">
...@@ -338,12 +339,8 @@ ...@@ -338,12 +339,8 @@
@if ($username != 'vpadmin@ichunt.com') @if ($username != 'vpadmin@ichunt.com')
<span class="show-list-info"> <span class="show-list-info">
共{{$count ? $count : 0}}单, 共{{$count ? $count : 0}}单,
{{$paid_order_count}}单已付款(包含预付款),
下单用户数为{{$user_count}}人, <span class="show-other-info"></span>
付款用户数为{{$paid_user_count}}人,
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
</span> </span>
@endif @endif
......
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