Commit ad400db2 by 朱继来

调整订单列表其他信息展示

parent 3fea8ef7
......@@ -486,6 +486,27 @@ Class OrderController extends Controller
// 订单其他信息
public function orderOtherInfoLoading(Request $request)
{
$is_manager = $request->input('is_manager', 0);
if (!$is_manager) { // 非管理账户检查查询时间
$time_start = $request->input('time_start', '');
$time_end = $request->input('time_end', '');
if ($time_start && $time_end) {
$diff = $time_end - $time_start;
if ($diff >= 60*60*24*365) return ['err_code'=>1, 'err_msg'=>'查询时间不能超过一年'];
} else if ($time_end) {
return ['err_code'=>2, 'err_msg'=>'请选择开始时间'];
} else if ($time_start) {
$diff = time() - $time_start;
if ($diff >= 60*60*24*365) return ['err_code'=>1, 'err_msg'=>'查询时间不能超过一年'];
} else {
return ['err_code'=>3, 'err_msg'=>'请选择查询时间'];
}
}
// 判断页面
$tid = $request->input('pid', 1);
$info = $this->_search($request, $tid);
......
......@@ -329,76 +329,83 @@
location.href = listUrl;
})
// 指定账号加载信息
if (username == 'admin@ichunt.com') {
// 订单其他信息
var page_type = $('#page_type').val();
// 点击获取订单其他信息
$('.order-other-info').click(function(){
var page_type = $('#page_type').val(); // 区分页面 1-联营,2-自营,3-ERP
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 (manager == 1) {
var page_type = $('#page_type').val();
orderOtherInfo(page_type, 1);
}
// 订单其他信息:已付款, 下单用户数, 付款用户数, 金额
function orderOtherInfo(pid, is_manager=0) {
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_start){
time_start = Date.parse(time_start) / 1000;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
}
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() : '',
business_type : $('#business_type').val() ? $('#business_type').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 = '';
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() : '',
business_type : $('#business_type').val() ? $('#business_type').val() : '',
pid : pid,
is_manager : is_manager,
};
$.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>';
}
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>';
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>';
}
if (pid != 3 && data.noreason_count) {
html += '<span class="error">共有'+data.noreason_count+'单已取消订单未填写取消原因</span>';
}
$('.show-other-info').append(html);
},
})
}
$('.show-other-info').append(html);
$('.order-other-info').hide();
},
})
}
// 填写取消原因
......
......@@ -286,15 +286,16 @@
@endif
</table>
</div>
<div class="row-fluid pagination">
@if ($username == 'admin@ichunt.com')
<span class="show-list-info">
共{{$count ? $count : 0}}单
<div class="row-fluid pagination">
<div class="show-list-info">
<span>共{{$count ? $count : 0}}单</span>
<span class="show-other-info"></span>
@if (!in_array($username, ['vpadmin@ichunt.com', 'admin@ichunt.com']))
<a class="btn btn-xs btn-info order-other-info" style="margin-top: -3px;">查看其它信息</a>
@endif
</div>
<span class="show-other-info"></span>
</span>
@endif
<?php echo $page; ?>
</div>
</div>
......@@ -304,7 +305,7 @@
var order_status = "{{$condition['order_status']}}";
var order_source = "{{$condition['order_source_pf']}}";
var order_send = "{{$condition['order_send']}}";
var username = "{{$username}}";
var manager = "{{$role}}";
$(".order_status").selectpicker({
actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮
......
......@@ -455,14 +455,14 @@
</table>
</div>
<div class="row-fluid pagination">
@if ($username == 'admin@ichunt.com')
<span class="show-list-info">
共{{$count ? $count : 0}}单
<span class="show-other-info"></span>
</span>
@endif
<div class="row-fluid pagination">
<div class="show-list-info">
<span>共{{$count ? $count : 0}}单</span>
<span class="show-other-info"></span>
@if (!in_array($username, ['vpadmin@ichunt.com', 'admin@ichunt.com']))
<a class="btn btn-xs btn-info order-other-info" style="margin-top: -3px;">查看其它信息</a>
@endif
</div>
<?php echo $page; ?>
</div>
......@@ -480,7 +480,7 @@
var is_new = "{{$condition['is_new']}}";
var erp_order_id = "{{$condition['erp_order_id']}}";
var is_new_order = "{{$condition['is_new_order']}}";
var username = "{{$username}}";
var manager = "{{$role}}";
if (test_order) {
$('input[name=test_order]').attr('checked', true);
......
......@@ -348,14 +348,15 @@
@endif
</table>
</div>
<div class="row-fluid pagination">
@if ($username == 'admin@ichunt.com')
<span class="show-list-info">
共{{$count ? $count : 0}}单
<span class="show-other-info"></span>
</span>
@endif
<div class="row-fluid pagination">
<div class="show-list-info">
<span>共{{$count ? $count : 0}}单</span>
<span class="show-other-info"></span>
@if (!in_array($username, ['vpadmin@ichunt.com', 'admin@ichunt.com']))
<a class="btn btn-xs btn-info order-other-info" style="margin-top: -3px;">查看其它信息</a>
@endif
</div>
<?php echo $page; ?>
</div>
......@@ -373,7 +374,7 @@
var order_send = "{{$condition['order_send']}}";
var order_pay_type = "{{$condition['order_pay_type']}}";
var is_new = "{{$condition['is_new']}}";
var username = "{{$username}}";
var manager = "{{$role}}";
if (test_order) {
$('input[name=test_order]').attr('checked', true);
......
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