Commit ebba17c0 by 朱继来

Merge branch 'zjl_action_log_20180521'

parents e3194631 2b782186
......@@ -146,3 +146,40 @@
return $token;
}
/**
* 获取客户端IP地址
* @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字
* @param boolean $adv 是否进行高级模式获取(有可能被伪装)
* @return mixed
*/
function get_client_ip($type = 0, $adv = false)
{
$type = $type ? 1 : 0;
static $ip = null;
if (null !== $ip) {
return $ip[$type];
}
if ($adv) {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$pos = array_search('unknown', $arr);
if (false !== $pos) {
unset($arr[$pos]);
}
$ip = trim($arr[0]);
} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (isset($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
}
} elseif (isset($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
}
// IP地址合法验证
$long = sprintf("%u", ip2long($ip));
$ip = $long ? array($ip, $long) : array('0.0.0.0', 0);
return $ip[$type];
}
......@@ -72,6 +72,8 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/express_set', 'OrderController@expressSet');
Route::post('/ajaxDownloadContract', 'OrderController@ajaxDownloadContract');
});
// 不需要登陆态
......
......@@ -149,6 +149,29 @@
}
})
// 下载合同
$('.download-contract').click(function(){
var order_id = $(this).data('id');
$.ajax({
url: '/ajaxDownloadContract',
type: 'post',
data: {order_id:order_id},
dataType: 'json',
success: function(resp) {
if (resp.errcode != 0) {
layer.msg(resp.msg);
return false;
}
location.href = resp.data;
},
error: function(err) {
console.log(err)
}
})
})
// 切换类型时,清空输入框内容
$('.dropdown-menu>li').click(function(){
var val = $(this).data('val'); // 当前值
......@@ -1049,16 +1072,20 @@
// 设置默认值false
$('input[name=check_failed]').val(0);
var check_failed_info = '';
// 检查商品单价
$('.order-change-table').find('tbody tr').each(function(){
var origin_price = parseFloat($(this).find('.price').data('origin'));
var price = parseFloat($(this).find('.price').val()) || 0;
var goods_name = $(this).children('td').eq(0).children('p').html();
origin_price = (origin_price * 0.8).toFixed(4);
limit_price = (origin_price * 0.8).toFixed(4);
// 若商品单价降价幅度小于或等于20%则赋值
if (price <= origin_price) {
if (price <= limit_price) {
check_failed_info += '型号:'+goods_name+',单价:'+origin_price+' -> '+price+' | ';
$('input[name=check_failed]').val(1);
$('input[name=check_failed_info]').val(check_failed_info);
}
});
}
......
......@@ -18,7 +18,6 @@
order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default'),
listUrl = '/self_order';
listUrl += '?order_type=' + order_type;
......@@ -63,15 +62,11 @@
listUrl += '&order_source_adtag=' + order_source_adtag;
}
if (erp_order_id) {
listUrl += '&erp_order_id=' + erp_order_id;
}
if (test_order.is(':checked')) {
listUrl += '&test_order=' + 1;
}
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id && !test_order.is(':checked')) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !test_order.is(':checked')) {
listUrl = '/self_order';
}
......@@ -90,16 +85,15 @@
order_payment_mode = $('#order_payment_mode').data('default'),
order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default');
test_order = $('input[name=test_order]');
if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id && !test_order.is(':checked')) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !test_order.is(':checked')) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
} else {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
......@@ -119,7 +113,7 @@
test_order = '';
}
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_payment_mode='+order_payment_mode+'&order_status='+order_status+'&order_invoice_status='+order_invoice_status+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&erp_order_id='+erp_order_id+'&test_order='+test_order+'&order_goods_type='+2;
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_payment_mode='+order_payment_mode+'&order_status='+order_status+'&order_invoice_status='+order_invoice_status+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&test_order='+test_order+'&order_goods_type='+2;
})
// 选择查看测试订单
......
......@@ -11,6 +11,7 @@
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}">
<input type="hidden" name="user_mobile" value="{{$user_mobile}}">
<input type="hidden" name="check_failed" value="">
<input type="hidden" name="check_failed_info" value="">
<!-- 审核 -->
<p>审核</p>
......
......@@ -236,11 +236,11 @@
发票信息
<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
@if (!isset($_REQUEST['tags']))
@if ($order_info['status'] < 10 && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms))
@if($order_info['status'] < 10 && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms))
<a href="/changeInvoice/{{$order_info['order_id']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self')
@if ($order_info['status'] < 10 && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms))
@if($order_info['status'] < 10 && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms))
<a href="/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'erp')
......@@ -384,6 +384,7 @@
</tr>
</thead>
<tbody>
@if (!empty($order_items_info))
@foreach ($order_items_info as $v)
<tr>
<td>{{$v['goods_name']}}</td>
......@@ -405,7 +406,7 @@
@endif
</tr>
@endforeach
@endif
</tbody>
<tfoot>
......@@ -418,6 +419,11 @@
<div class="tabs-box order-total">
<div>
<table>
<tr>
<td>商品总额:</td>
<td>{{$currency}}<span id="order-total" class="amount">{{$order_price_info['goods_price']}}</span></td>
</tr>
@if (isset($order_price_info['ext_price']))
<tr>
<td>附加款:</td>
......@@ -427,11 +433,6 @@
</tr>
@endif
<tr>
<td>商品总额:</td>
<td>{{$currency}}<span id="order-total" class="amount">{{$order_price_info['goods_price']}}</span></td>
</tr>
@if ($order_price_info['shipping_price'] != 0)
<tr>
<td>快递费用:</td>
......@@ -503,7 +504,7 @@
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
<!-- 判断操作权限 -->
@if (($role == 1 || $role ==2) && $order_info['status'] == 1 && in_array('check_order', $userPerms))
@if ($order_info['status'] == 1 && in_array('check_order', $userPerms))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">人工审单</a>
@endif
......@@ -524,7 +525,8 @@
<!-- <a href="{{URL('send', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">订单发货</a> -->
@endif
@if ($order_info['status'] == 10 && in_array('send_invoice', $userPerms))
<!-- 已发货之后的状态 -->
@if ($order_info['status'] > 4)
<a href="{{URL('invShipping', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">寄送发票</a>
@endif
......@@ -544,9 +546,9 @@
@if (in_array($order_info['status'], [4, 8]) && in_array('self_order_invoice_express', $userPerms))
<a class="btn btn-default self_invoice_express" data-id="{{$order_info['order_id']}}" href="javascript:;" class="btn btn-default">填写发票快递</a>
@endif
</div>
<!-- 快递公司 -->
@if ($shippings)
<script>
var shippings = '{!! json_encode($shippings) !!}';
......@@ -554,13 +556,35 @@
var shippings_info = eval('('+shippings+')');
</script>
@endif
@endif
@if (!empty($order_shipping_inside))
<p>物流信息</p>
<div class="tabs-box">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>物流时间</th>
<th>物流信息</th>
</tr>
</thead>
<tbody>
@foreach ($order_shipping_inside as $v)
<tr>
<td width="15%">{{date('Y-m-d H:i:s', $v['create_time'])}}</td>
<td>{{$v['info']}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
<!-- 二期处理 -->
<!-- <p>操作记录</p>
@if (!empty($actionLog))
<p>操作记录</p>
<div class="tabs-box">
<table class="table table-bordered table-hover log">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>操作时间</th>
......@@ -569,21 +593,17 @@
</tr>
</thead>
<tbody>
<php>$logs = json_decode($detail['operate_log'], true)</php>
<empty name="logs">
<tr><td colspan="20">没有操作记录</td></tr>
<else/>
<foreach name="logs" item="v">
@foreach ($actionLog as $v)
<tr>
<td><p class="time">{$v.time|date="Y-m-d H:i:s", ###}</p></td>
<td><p class="uname">{$v.user}</p></td>
<td><p class="log">{$v.extra}</p></td>
<td width="15%">{{date('Y-m-d H:i:s', $v->create_time)}}</td>
<td width="8%">{{App\Http\Controllers\getOperatorName($v->operator_id, $v->operator_type)}}</td>
<td>{{$v->event}}</td>
</tr>
</foreach>
</empty>
@endforeach
</tbody>
</table>
</div> -->
</div>
@endif
</div>
<script>
......
......@@ -259,7 +259,7 @@
if (in_array($v['status'], [-1, 1, 2])) {
echo '不需同步';
} else {
echo $v['erp_order_id'] != '' || $v['erp_order_id'] != '-' ? '<span class="list-text-success"><b>已同步</b></span>' : '<span class="list-text-checking"><b>未同步</b></span>';
echo $v['erp_order_id'] != '' && $v['erp_order_id'] != '-' ? '<span class="list-text-success"><b>已同步</b></span>' : '<span class="list-text-checking"><b>未同步</b></span>';
}
?>
</td>
......@@ -278,14 +278,11 @@
@endif
<?php
$apiUrl = Config('website.api_domain');
$k1 = time();
$k2 = md5(md5($k1).'fh6y5t4rr351d2c3bryi');
$downLoadUrl = $apiUrl.'contract/pdfinfo?id='.$v['order_id'].'&k1='.$k1.'&k2='.$k2;
?>
@if (in_array('download_contract', $userPerms))
<a class="btn btn-info" href="{{$downLoadUrl}}">下载合同</a>
<a class="btn btn-info download-contract" data-id="{{$v['order_id']}}" href="javascript:;">下载合同</a>
@endif
</div>
</td>
......
......@@ -104,17 +104,7 @@
<input type="text" name="order_source_adtag" value="{{$condition['order_source_adtag']}}" placeholder="请输入内容">
</dd>
</dl>
<dl>
<dt>同步状态:</dt>
<dd>
<div class="droplist" data-default="{{$condition['erp_order_id']}}" id="erp_order_id" name="erp_order_id">
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">已同步</li>
</ul>
</div>
</dd>
</dl>
@if (in_array('self_check_test_order', $userPerms))
<dl>
<dt></dt>
......
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