Commit 808e5569 by 朱继来

Merge branch 'zjl_cancel_order_20190213' into development

parents c48c4012 ff3064c3
......@@ -381,42 +381,39 @@ Class OrderController extends Controller
return view('orderlist', $info);
}
// 获取页面及订单信息 tid为订单类型:1.联营 2. 自营
public function getOrderInfo($request, $tid)
// 订单搜索参数
public function _search(Request $request, $tid)
{
$info = $this->getPageInfo($request);
$map = array();
// 页面参数
if ($request->isMethod('get')) {
$map['order_type'] = $request->input('order_type', '');
$map['order_contain'] = $request->input('order_contain', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['order_status'] = $request->input('order_status', '');
$map['sale_type'] = $request->input('sale_type', '');
$map['shipping_name'] = $request->input('shipping_name', '');
$map['order_send'] = $request->input('order_send', '');
$map['test_order'] = $request->input('test_order', '');
$map['order_pay_type'] = $request->input('order_pay_type', '');
$map['order_type_a'] = $request->input('order_type_a', '');
$map['order_source'] = $request->input('order_source', '');
$map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_source_ptag'] = $request->input('order_source_ptag', '');
$map['erp_order_id'] = $request->input('erp_order_id', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['order_invoice_status']= $request->input('order_invoice_status', '');
$map['is_new'] = $request->input('is_new', '');
$map['is_new_order'] = $request->input('is_new_order', '');
}
$map['order_type'] = $request->input('order_type', '');
$map['order_contain'] = $request->input('order_contain', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['order_status'] = $request->input('order_status', '');
$map['sale_type'] = $request->input('sale_type', '');
$map['shipping_name'] = $request->input('shipping_name', '');
$map['order_send'] = $request->input('order_send', '');
$map['test_order'] = $request->input('test_order', '');
$map['order_pay_type'] = $request->input('order_pay_type', '');
$map['order_type_a'] = $request->input('order_type_a', '');
$map['order_source'] = $request->input('order_source', '');
$map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_source_ptag'] = $request->input('order_source_ptag', '');
$map['erp_order_id'] = $request->input('erp_order_id', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['order_invoice_status']= $request->input('order_invoice_status', '');
$map['is_new'] = $request->input('is_new', '');
$map['is_new_order'] = $request->input('is_new_order', '');
// 订单查看权限---交易员、客服、测试
if (in_array($info['role'], [3, 4])) {
// 筛选自己的订单
$data['sale_id'] = $request->user->userId;
$map['sale_id'] = $request->user->userId;
}
// 自营客服权限
......@@ -444,15 +441,25 @@ Class OrderController extends Controller
$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;
if ($tid == 1 || $tid == 3) {
$manager = $perm->getRoleUsers($request, '经理');
$test = $perm->getRoleUsers($request, '测试');
$sales = $perm->getRoleUsers($request, '交易员');
$kefu = $perm->getRoleUsers($request, '客服');
$manager = $perm->getRoleUsers($request, '经理');
$test = $perm->getRoleUsers($request, '测试');
$sales = $perm->getRoleUsers($request, '交易员');
$kefu = $perm->getRoleUsers($request, '客服');
$sale_list = array_merge($manager, $sales, $test, $kefu);
} else {
$sale_list = $perm->getRoleUsers($request, '客服');
......@@ -461,33 +468,46 @@ Class OrderController extends Controller
//获取订单列表
$url = Config('website.api_domain').'order/getAllOrder';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码
$data['size'] = $size; // 当前页条数
$data['map'] = $map;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码
$data['size'] = $info['size']; // 当前页条数
$data['map'] = $info['map'];
$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%');
$show = $page->show();
$info['condition'] = $map;
$info['condition'] = $info['map'];
$info['sale_list'] = $sale_list;
$info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_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;
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订单
public function erpOrder(Request $request)
{
......
......@@ -87,11 +87,11 @@ Class OrderCountController extends Controller
$time_today_start = strtotime(date('Y-m-d'));
$time_today_end = strtotime(date('Y-m-d',time()+3600*24))-1;
$map['time_start'] = $time_start = !empty($time_start) ? $time_start : $time_today_start;
$map['time_end'] = $time_end = !empty($time_end) ? $time_end : $time_today_end;
$map['checkTime'] = $checkTime = $request->input('checkTime', '1'); // 默认选择订单付款时间
$map['checkStatus'] = $checkStatus = $request->input('checkStatus', '1'); // 默认选择查询全部
$map['time_start'] = $time_start = !empty($time_start) ? $time_start : $time_today_start;
$map['time_end'] = $time_end = !empty($time_end) ? $time_end : $time_today_end;
$map['checkTime'] = $checkTime = $request->input('checkTime', '1'); // 默认选择订单付款时间
$map['checkStatus'] = $checkStatus = $request->input('checkStatus', '1'); // 默认选择查询全部
$map['order_goods_type'] = $type;
// 竞调账号
......@@ -114,8 +114,6 @@ Class OrderCountController extends Controller
if ($response['err_code'] == 0) {
$count = $response['data']['count'];
$pay_count = $response['data']['pay_count'];
if($count > 0){
$pageSize = 10;
$page = new Page($count, $pageSize);
......@@ -125,13 +123,12 @@ Class OrderCountController extends Controller
}
$info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_count'];
}
$info['checkTime'] = $checkTime;
$info['checkStatus'] = $checkStatus;
$info['time_start'] = $time_start;
$info['time_end'] = $time_end;
$info['checkTime'] = $checkTime;
$info['checkStatus'] = $checkStatus;
$info['time_start'] = $time_start;
$info['time_end'] = $time_end;
return view($view, $info);
}
......@@ -147,4 +144,33 @@ Class OrderCountController extends Controller
{
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]+');
Route::group(['middleware' => 'web'], function () {
Route::get('/', 'OrderController@orderList');
Route::get('/list', 'OrderController@orderList');
Route::post('/ajax/orderOtherInfoLoading', 'OrderController@orderOtherInfoLoading');
Route::get('/erp_order', 'OrderController@erpOrder');
Route::get('/export', 'OrderController@export');
......@@ -62,6 +63,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/self_count', 'OrderCountController@selfCount');
Route::get('/amount', 'OrderCountController@amount');
Route::get('/self_amount', 'OrderCountController@selfAmount');
Route::post('/ajax/orderAmountInfoLoading', 'OrderCountController@orderAmountInfoLoading');
Route::match('post', '/ajaxDelayTime', 'OrderController@ajaxDelayTime');
......
......@@ -280,6 +280,7 @@
}
})
// ERP订单列表
$('.searchErpOrder').click(function(){
var order_type = $('#order_type').data('default'),
order_contain = $('input[name=order_contain]').val(),
......@@ -323,6 +324,75 @@
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();
},
......
......@@ -8,6 +8,7 @@
self.bind();
},
bind:function(){
// 订单列表
$('.order-amount-search').click(function(){
var type = $('input[name=type]').val(),
checkTime = $('#checkTime').val(),
......@@ -28,6 +29,64 @@
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);
},
})
}
}
}
......
......@@ -23,8 +23,7 @@
<option value="2">已完成</option>
<option value="3">未完成</option>
</select>
<input type="hidden" name="type" value="{{ $type }}">
<button class="btn btn-primary order-amount-search">搜索</button>
</div>
</div>
......@@ -114,23 +113,13 @@
@endforeach
@endif
</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">
<span class="show-list-info">
@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>
<span class="show-list-info"></span>
<?php echo isset($page) ? $page : ''; ?>
</div>
......
......@@ -5,7 +5,8 @@
<!-- <ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">ERP订单</a></li>
</ul> -->
<input type="hidden" name="page_type" id="page_type" value="3">
<div class="tabs-box">
<div class="row-fluid search-box">
<div class="span12">
......@@ -289,9 +290,8 @@
@if ($username != 'vpadmin@ichunt.com')
<span class="show-list-info">
共{{$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}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
<span class="show-other-info"></span>
</span>
@endif
......
......@@ -5,7 +5,8 @@
<!-- <ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">平台订单</a></li>
</ul> -->
<input type="hidden" name="page_type" id="page_type" value="1">
<div class="tabs-box">
<div class="row-fluid search-box">
<div class="span12">
......@@ -458,16 +459,9 @@
@if ($username != 'vpadmin@ichunt.com')
<span class="show-list-info">
共{{$count ? $count : 0}}单,
{{$paid_order_count}}单已付款(包含预付款),
下单用户数为{{$user_count}}人,
付款用户数为{{$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 class="show-other-info"></span>
</span>
@endif
<?php echo $page; ?>
......
......@@ -5,7 +5,8 @@
<!-- <ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">自营订单</a></li>
</ul> -->
<input type="hidden" name="page_type" id="page_type" value="2">
<div class="tabs-box">
<div class="row-fluid search-box">
<div class="span12">
......@@ -338,12 +339,8 @@
@if ($username != 'vpadmin@ichunt.com')
<span class="show-list-info">
共{{$count ? $count : 0}}单,
{{$paid_order_count}}单已付款(包含预付款),
下单用户数为{{$user_count}}人,
付款用户数为{{$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 class="show-other-info"></span>
</span>
@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