Commit ebba17c0 by 朱继来

Merge branch 'zjl_action_log_20180521'

parents e3194631 2b782186
...@@ -146,3 +146,40 @@ ...@@ -146,3 +146,40 @@
return $token; 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 () { ...@@ -72,6 +72,8 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/express_set', 'OrderController@expressSet'); Route::match(['get', 'post'], '/express_set', 'OrderController@expressSet');
Route::post('/ajaxDownloadContract', 'OrderController@ajaxDownloadContract');
}); });
// 不需要登陆态 // 不需要登陆态
......
...@@ -149,6 +149,29 @@ ...@@ -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(){ $('.dropdown-menu>li').click(function(){
var val = $(this).data('val'); // 当前值 var val = $(this).data('val'); // 当前值
...@@ -1049,16 +1072,20 @@ ...@@ -1049,16 +1072,20 @@
// 设置默认值false // 设置默认值false
$('input[name=check_failed]').val(0); $('input[name=check_failed]').val(0);
var check_failed_info = '';
// 检查商品单价 // 检查商品单价
$('.order-change-table').find('tbody tr').each(function(){ $('.order-change-table').find('tbody tr').each(function(){
var origin_price = parseFloat($(this).find('.price').data('origin')); var origin_price = parseFloat($(this).find('.price').data('origin'));
var price = parseFloat($(this).find('.price').val()) || 0; 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%则赋值 // 若商品单价降价幅度小于或等于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]').val(1);
$('input[name=check_failed_info]').val(check_failed_info);
} }
}); });
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
order_invoice_status = $('#order_invoice_status').data('default'), order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(), order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'), test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default'),
listUrl = '/self_order'; listUrl = '/self_order';
listUrl += '?order_type=' + order_type; listUrl += '?order_type=' + order_type;
...@@ -63,15 +62,11 @@ ...@@ -63,15 +62,11 @@
listUrl += '&order_source_adtag=' + order_source_adtag; listUrl += '&order_source_adtag=' + order_source_adtag;
} }
if (erp_order_id) {
listUrl += '&erp_order_id=' + erp_order_id;
}
if (test_order.is(':checked')) { if (test_order.is(':checked')) {
listUrl += '&test_order=' + 1; 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'; listUrl = '/self_order';
} }
...@@ -90,16 +85,15 @@ ...@@ -90,16 +85,15 @@
order_payment_mode = $('#order_payment_mode').data('default'), order_payment_mode = $('#order_payment_mode').data('default'),
order_invoice_status = $('#order_invoice_status').data('default'), order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(), order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'), test_order = $('input[name=test_order]');
erp_order_id = $('#erp_order_id').data('default');
if (test_order.length) { 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('请选择筛选条件,再导出!'); layer.msg('请选择筛选条件,再导出!');
return false; return false;
} }
} else { } 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('请选择筛选条件,再导出!'); layer.msg('请选择筛选条件,再导出!');
return false; return false;
} }
...@@ -119,7 +113,7 @@ ...@@ -119,7 +113,7 @@
test_order = ''; 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 @@ ...@@ -11,6 +11,7 @@
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}"> <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="user_mobile" value="{{$user_mobile}}">
<input type="hidden" name="check_failed" value=""> <input type="hidden" name="check_failed" value="">
<input type="hidden" name="check_failed_info" value="">
<!-- 审核 --> <!-- 审核 -->
<p>审核</p> <p>审核</p>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
if (in_array($v['status'], [-1, 1, 2])) { if (in_array($v['status'], [-1, 1, 2])) {
echo '不需同步'; echo '不需同步';
} else { } 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> </td>
...@@ -278,14 +278,11 @@ ...@@ -278,14 +278,11 @@
@endif @endif
<?php <?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)) @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 @endif
</div> </div>
</td> </td>
......
...@@ -104,17 +104,7 @@ ...@@ -104,17 +104,7 @@
<input type="text" name="order_source_adtag" value="{{$condition['order_source_adtag']}}" placeholder="请输入内容"> <input type="text" name="order_source_adtag" value="{{$condition['order_source_adtag']}}" placeholder="请输入内容">
</dd> </dd>
</dl> </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)) @if (in_array('self_check_test_order', $userPerms))
<dl> <dl>
<dt></dt> <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