Commit 587b7126 by 朱继来

1. 主管审核接口;

2. 反审接口;
parent bf049b01
......@@ -898,6 +898,40 @@ Class OrderController extends Controller
}
}
// 主管审核
public function ajaxAuditPass(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', '');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'order/managerAudit';
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
// 反审
public function ajaxReAudit(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', '');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'order/reAudit';
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
// 驳回调价信息
public function ajaxRejected(Request $request)
{
......
......@@ -42,7 +42,9 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/change/{id}', 'OrderController@changeOrder');
Route::match(['get', 'post'], '/sendSales/{id?}', 'OrderController@sendSales');
Route::post('/ajaxdeletegoods', 'OrderController@ajaxdeletegoods');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::post('/ajaxAuditPass', 'OrderController@ajaxAuditPass');
Route::post('/ajaxReAudit', 'OrderController@ajaxReAudit');
Route::get('/check/{id}', 'OrderController@check');
Route::match(['get', 'post'], '/applyAdjust/{id}', 'OrderController@applyAdjust');
Route::match(['get', 'post'], '/send/{id}', 'OrderController@send');
......
......@@ -680,7 +680,7 @@
var supplier_id = $(this).data('sup_id');
var supplier_name = $(this).data('sup_name');
if (supplier_id == '7' || supplier_name.toLowerCase() == 'digikey') {
if (supplier_id == '7' || supplier_name.toString().toLowerCase() == 'digikey') {
is_dgk = true;
}
})
......
......@@ -35,7 +35,7 @@
self.parents('tr').find('.change_status').val(-1); // 调整状态
self.parents('tr').find('.change_status_val').html('<i class="error">已取消</i>'); // 调整状态
self.parents('tr').find('.del_reason').val(reason); // 删除原因
self.parents('tr').find('input').attr('disabled', true); // 禁用当前行input
self.parents('tr').find('input').attr('readonly', 'readonly'); // 设置当前行input只读
calculate(self);
......@@ -583,7 +583,7 @@
}
})
layer.msg('审核提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
// layer.msg('审核提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2: function(index, layero){
layer.close(index);
......@@ -672,6 +672,9 @@
var new_str = ''; // 新增商品数据
var curr_no = 1; // 标记当前行序号
// 明细取消禁用
$('.deletegoods').attr('disabled', false).css('pointer-events', 'auto');
for (var i in items) {
if (!items[i].is_add) {
$('.change_item_'+i).find('.change_goods_price').val(items[i].goods_price);
......
......@@ -1264,6 +1264,7 @@
}
});
})
}
......
......@@ -86,6 +86,10 @@
goods_len++
})
if (goods_len == 1) {
$('.deletegoods').attr('disabled', false).css('pointer-events', 'auto');
}
var curr_no = goods_len + 1; // 当前添加行序号
var data = eval('('+resp.data+')');
var order_item = data.item; // 当前新增商品信息
......
......@@ -544,6 +544,7 @@
},
})
}
},
}
......
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
audit: {
index:function() {
// 主管审核
$('.manager-audit').click(function() {
var order_id = $(this).data('id');
// 弹出提示
layer.open({
area: ['360px'],
title: '提示信息',
content: '确定审核通过该订单吗?',
btn:['确定', '取消'],
yes: function(index, layero){
$.ajax({
url : '/ajaxAuditPass',
type: 'post',
data: {order_id: order_id},
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常', function() {
location.reload();
});
}
},
error: function (res) {
console.log(res);
}
})
layer.msg('提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2: function(index, layero){
layer.close(index);
}
});
})
// 反审
$('.re-audit').click(function() {
var order_id = $(this).data('id');
// 弹出提示
layer.open({
area: ['360px'],
title: '提示信息',
content: '确定再次审核该订单吗?',
btn:['确定', '取消'],
yes: function(index, layero){
$.ajax({
url : '/ajaxReAudit',
type: 'post',
data: {order_id: order_id},
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
window.open('/change/' + order_id, '_blank')
return false;
}
layer.alert(resp.errmsg || '网络异常');
return false;
},
error: function (res) {
console.log(res);
}
})
layer.msg('提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2: function(index, layero){
layer.close(index);
}
});
})
},
}
})
})(jQuery)
\ No newline at end of file
......@@ -171,10 +171,7 @@
@endif
<td>状态</td>
@if (count($order_items_info) > 1)
<th width="5%">操作</th>
@endif
<th width="5%">操作</th>
</thead>
<tbody>
......@@ -191,10 +188,10 @@
<p>{{$v['goods_name']}}</p>
</td>
<td>
<input class="only_number num change_goods_number" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
<input class="only_number num change_goods_number" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>>
</td>
<td>
<input class="price only_number change_goods_price" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" data-price="{{$v['goods_price']}}" value="{{$v['goods_price']}}">
<input class="price only_number change_goods_price" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" data-price="{{$v['goods_price']}}" value="{{$v['goods_price']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>>
</td>
<!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2)
......@@ -214,14 +211,15 @@
<td>
<input class="change_status" type="hidden" name="change_info[{{$v['rec_id']}}][status]" value="{{$v['status']}}">
<span class="change_status_val">{{ $v['status'] == 1 ? '正常' : '<i class="error">已取消</i>' }}</span>
<span class="change_status_val"><?= $v['status'] == 1 ? '正常' : '<i class="error">已取消</i>' ?></span>
</td>
@if (count($order_items_info) > 1 && in_array($order_info['status'], [1, 2]))
@if (in_array($order_info['status'], [1, 2]) && $v['status'] == 1)
<td><a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="<?= $v['rec_id'] ?>" data-type="{{ $order_info['order_goods_type'] }}">删除</a></td>
<input type="hidden" class="del_reason" name="change_info[{{$v['rec_id']}}][del_reason]">
@else
<td></td>
@endif
<input type="hidden" class="del_reason" name="change_info[{{$v['rec_id']}}][del_reason]">
</tr>
@endforeach
</tbody>
......@@ -499,6 +497,13 @@
var pay_preferential = "{{ $order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0 }}"; // 支付优惠(钱包)
var new_client_price = "{{ $order_price_info['new_client_price'] }}";
// 明细数目
var item_count = "{{ count($order_items_info) }}";
if (item_count == 1) {
$('.deletegoods').attr('disabled', true).css('pointer-events', 'none');
}
var rest_time = "{{$order_info['pay_time'] ? $order_info['pay_time'] - time() : NULL}}";
if (rest_time) {
......
......@@ -43,7 +43,7 @@
<td>{{$v['goods_number']}}</td>
<td>{{$v['goods_price']}}</td>
<td>
{{ $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' }}
<?= $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' ?>
@if (isset($v['is_add']))
<i style="color: green;">(新增)</i>
......
......@@ -145,13 +145,20 @@
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$order_info['order_id']}}" data-type="2">取消订单</a>
@endif
<!-- 判断操作权限 -->
@if (in_array($order_info['status'], [1, 2]) && in_array('check_order', $userPerms) && $order_info['sale_id'])
<a class="btn btn-info" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" target="_blank">人工审单</a>
@if (in_array('check_order', $userPerms) && $order_info['sale_id'])
@if ($order_info['status'] == 1)
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" target="_blank">人工审单</a>
@elseif ($order_info['status'] == 2)
<a class="btn btn-success re-audit" data-id="{{$order_info['order_id']}}">反审</a>
@endif
@endif
<!-- 主管审核 -->
@if ($order_temp_info['is_manager_audit'] && in_array($role, [1, 2]) && $order_info['status'] == 1)
<a class="btn btn-danger manager-audit" data-id="{{$order_info['order_id']}}">主管审核</a>
@endif
<!-- 判断邮件发送时机 -->
<!-- 判断邮件发送时机 -->
@if (!empty($order_temp_info['erp_sn']) )
<a class="btn btn-primary send_mail" >发送邮件</a>
@endif
......@@ -352,6 +359,7 @@
$.lie.order.details();
$.lie.track.orderTrack();
$.lie.audit.index();
// 发送邮件
$(document).on('click','.send_mail',function(data){
......
......@@ -50,7 +50,7 @@
{{$currency.number_format($order_info['order_amount'] - $order_info['advance_amount'], 2, '.', '')}}
</td>
@endif
<td>{{ Config('params.order_status')[$order_info['status']] }}</td>
<td>{{ $order_temp_info['is_manager_audit'] ? '待主管审核' : Config('params.order_status')[$order_info['status']] }}</td>
<td>
<?php
......
......@@ -12,6 +12,7 @@
<script src="/js/md5.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/details.js?v=<?= time() ?>"></script>
<script src="/js/order_audit.js"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/refund.js?v=<?= time() ?>"></script>
......
......@@ -289,17 +289,21 @@
</td>
<td class="show-list">
<?php
switch ($v['status']) {
case -2: echo '<span class="list-text-no-check"><b>审核未通过</b></span>';break;
case -1: echo '<span class="list-text-cancel"><b>已取消</b></span>';break;
case 1: echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 2: echo '<span class="list-text-pay"><b>待付款</b></span>';break;
case 3: echo '<span class="list-text-last-pay"><b>待付尾款</b></span>';break;
case 4: echo '<span class="list-text-send"><b>待发货</b></span>';break;
case 7: echo '<span class="list-text-send"><b>部分发货</b></span>';break;
case 8: echo '<span class="list-text-confirm"><b>待收货</b></span>';break;
case 10: echo '<span class="list-text-success"><b>交易成功</b></span>';break;
}
if ($order_extend->is_manager_audit) {
echo '<span class="list-text-checking"><b>待主管审核</b></span>';
} else {
switch ($v['status']) {
case -2: echo '<span class="list-text-no-check"><b>审核未通过</b></span>';break;
case -1: echo '<span class="list-text-cancel"><b>已取消</b></span>';break;
case 1: echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 2: echo '<span class="list-text-pay"><b>待付款</b></span>';break;
case 3: echo '<span class="list-text-last-pay"><b>待付尾款</b></span>';break;
case 4: echo '<span class="list-text-send"><b>待发货</b></span>';break;
case 7: echo '<span class="list-text-send"><b>部分发货</b></span>';break;
case 8: echo '<span class="list-text-confirm"><b>待收货</b></span>';break;
case 10: echo '<span class="list-text-success"><b>交易成功</b></span>';break;
}
}
?>
</td>
<td class="show-list"> {{ Config('params.order_pay_type')[$v['order_pay_type']] }} </td>
......@@ -327,9 +331,18 @@
<td>
<div class="btn-group btn-group-xs" style="width: 240px;">
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}" target="_blank">详情</a>
@if (in_array('check_order', $userPerms) && in_array($v['status'], [1, 2, 3]) && $v['sale_id'])
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@if (in_array('check_order', $userPerms) && $v['sale_id'])
@if ($v['status'] == 1)
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@elseif ($v['status'] == 2)
<a class="btn btn-success re-audit" data-id="{{$v['order_id']}}">反审</a>
@endif
@endif
<!-- 主管审核 -->
@if ($order_extend->is_manager_audit && in_array($role, [1, 2]) && $v['status'] == 1)
<a class="btn btn-danger manager-audit" data-id="{{$v['order_id']}}">主管审核</a>
@endif
<!-- 管理员和经理或有推送权限显示 -->
......@@ -438,6 +451,7 @@
$.lie.order.index();
$.lie.track.orderTrack();
$.lie.cancel.cancelorder();
$.lie.audit.index();
// 展开菜单
$('#side-menu').children('li').eq(1).addClass('active');
......
......@@ -11,6 +11,7 @@
<script src="/js/common.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/list.js?v=<?= time() ?>"></script>
<script src="/js/order_audit.js"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
......
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