Commit d200a3da by 朱继来

申请主管审核

parent 1d3e4453
......@@ -898,7 +898,8 @@ Class OrderController extends Controller
$order_goods_type = $request->input('order_goods_type', 1);
if ($order_goods_type == 1) {
$resData['status'] = $auditor_role == 3 ? 1 : 2; // 角色为‘查看自己’时,状态为待审核,否则为待付款
// $resData['status'] = $auditor_role == 3 ? 1 : 2; // 角色为‘查看自己’时,状态为待审核,否则为待付款
$resData['is_manager'] = $auditor_role == 3 ? 0 : 1; // 角色为‘查看自己’时,is_manager = 0
}
$url = Config('website.api_domain').'order/changeOrder';
......@@ -910,6 +911,23 @@ Class OrderController extends Controller
}
}
// 申请主管审核
public function ajaxApplyManagerAudit(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/applyManagerAudit';
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
// 主管审核
public function ajaxAuditPass(Request $request)
{
......
......@@ -43,6 +43,7 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/sendSales/{id?}', 'OrderController@sendSales');
Route::post('/ajaxdeletegoods', 'OrderController@ajaxdeletegoods');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::post('/ajaxApplyManagerAudit', 'OrderController@ajaxApplyManagerAudit');
Route::post('/ajaxAuditPass', 'OrderController@ajaxAuditPass');
Route::post('/ajaxReAudit', 'OrderController@ajaxReAudit');
Route::get('/check/{id}', 'OrderController@check');
......
......@@ -4,6 +4,48 @@
$.extend($.lie, {
audit: {
index:function() {
// 申请主管审核
$('.apply-manager-audit').click(function() {
var order_id = $(this).data('id');
// 弹出提示
layer.open({
area: ['360px'],
title: '提示信息',
content: '确定申请主管审核吗?',
btn:['确定', '取消'],
yes: function(index, layero){
$.ajax({
url : '/ajaxApplyManagerAudit',
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);
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);
}
});
})
// 主管审核
$('.manager-audit').click(function() {
var order_id = $(this).data('id');
......
......@@ -157,13 +157,18 @@
@endif
@if (in_array('check_order', $userPerms) && $order_info['sale_id'])
@if ($order_info['status'] == 1)
@if (in_array($order_info['status'], [1, 2]))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" target="_blank">人工审单</a>
@elseif ($order_info['status'] == 2 && in_array($role, [1, 2]))
@elseif ($order_info['status'] == 2 && $order_temp_info['is_manager_audit'] == 3 && in_array($role, [1, 2]))
<a class="btn btn-success re-audit" data-id="{{$order_info['order_id']}}">反审</a>
@endif
@endif
<!-- 申请主管审核 -->
@if (isset($order_temp_info['is_manager_audit']) && $order_temp_info['is_manager_audit'] == 1)
<a class="btn btn-info apply-manager-audit" data-id="{{$order_info['order_id']}}">申请主管审核</a>
@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>
......
......@@ -30,12 +30,12 @@
<th>发货状态</th>
<th>物流单号</th>
<th>京东订单编号</th>
<th width="8%">自动确认收货时间</th>
<th>自动确认收货时间</th>
</tr>
<tr>
<td>{{ $order_info['order_sn'] }}</td>
<td>{{ $order_temp_info['is_manager_audit'] ? '待主管审核' : Config('params.order_status')[$order_info['status']] }}</td>
<td>{{ Config('params.order_status')[$order_info['status']] }}</td>
<td>{{ $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'] }}</td>
<td>
<?php
......
......@@ -12,7 +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_audit.js?v=<?= time() ?>"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/order_send_email.js"></script>
......
......@@ -250,6 +250,7 @@
<th class="pl30">ERP单号</th>
<th class="pl30">应付金额</th>
<th class="pl30">订单状态</th>
<th class="pl30">主管审核</th>
<th class="pl30">付款类型</th>
<th class="pl30">支付方式</th>
<th class="pl30">业务员</th>
......@@ -288,24 +289,36 @@
?>
</td>
<td class="show-list">
<?php
if (!empty($order_extend->is_manager_audit) && $v['status'] == 1) {
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;
}
}
<?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;
}
?>
</td>
<td class="show-list">
<?php
if ($v['status'] >= 1 && $v['status'] < 4 && isset($order_extend->is_manager_audit)) {
switch ($order_extend->is_manager_audit) {
case 1:
echo '<span class="list-text-checking"><b>未申请</b></span>';break;
case 2:
echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 3:
echo '<span class="list-text-success"><b>已审核</b></span>';break;
default:
echo ''; break;
}
}
?>
</td>
<td class="show-list"> {{ Config('params.order_pay_type')[$v['order_pay_type']] }} </td>
<td class="show-list"><?php print_r(App\Http\Controllers\getPayName($v['order_id'])); ?></td>
......@@ -331,15 +344,20 @@
<td>
<div class="btn-group btn-group-xs" style="min-width: 200px;">
@if (in_array('check_order', $userPerms) && $v['sale_id'])
@if ($v['status'] == 1)
@if (in_array($v['status'], [1, 2]))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@elseif ($v['status'] == 2 && in_array($role, [1, 2]))
@elseif ($v['status'] == 2 && $order_extend->is_manager_audit == 3 && in_array($role, [1, 2]))
<a class="btn btn-success re-audit" data-id="{{$v['order_id']}}">反审</a>
@endif
@endif
<!-- 申请主管审核 -->
@if (isset($order_extend->is_manager_audit) && $order_extend->is_manager_audit == 1)
<a class="btn btn-info apply-manager-audit" data-id="{{$v['order_id']}}">申请主管审核</a>
@endif
<!-- 主管审核 -->
@if (isset($order_extend->is_manager_audit) && in_array($role, [1, 2]) && $v['status'] == 1)
@if (in_array($v['status'], [2, 3, 4]) && isset($order_extend->is_manager_audit) && in_array($order_extend->is_manager_audit, [1, 2]) && in_array($role, [1, 2]))
<a class="btn btn-danger manager-audit" data-id="{{$v['order_id']}}">主管审核</a>
@endif
......
......@@ -11,7 +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_audit.js?v=<?= time() ?>"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/order_send_email.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