Commit c9ee2511 by 朱继来

重新调整审核调价功能

parent f97f26df
......@@ -742,6 +742,15 @@ Class OrderController extends Controller
// return array('errcode'=>-10010,'errmsg'=>'没有权限进行二次调价');
// }
if (!$request->input('pay_time_limit')) {
$payTime = $request->input('payTime', '');
$payTimeOther = $request->input('payTimeOther', '');
$pay_time_limit = $payTime == 'other' ? $payTimeOther : $payTime;
} else {
$pay_time_limit = $request->input('pay_time_limit');
}
$url = Config('website.api_domain').'order/changeOrder';
$check['k1'] = time();
......@@ -757,22 +766,39 @@ Class OrderController extends Controller
"order_amount" => $request->input('order_amount', ''),
"extra_fee" => $request->input('extra_fee', ''),
"change_info" => $request->input('change_info', ''),
"payTime" => $request->input('payTime', ''),
"payTimeOther" => $request->input('payTimeOther', ''),
"pay_time_limit" => $pay_time_limit,
"check_failed" => $request->input('check_failed', ''),
"order_id" => $order_id,
"pf" => 1,
"k1" => $check['k1'],
"k2" => $check['k2']
"k2" => $check['k2'],
];
echo '<pre>';
print_r(curlApi($url, $resData, "POST"));die;
$temp = json_decode(curlApi($url, $resData, "POST"), true);
return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
}
}
// 驳回调价信息
public function ajaxRejected(Request $request)
{
if ($request->isMethod('post')) {
$order_id = $request->input('order_id');
$order = DB::connection('order')
->table('lie_order')
->where(['order_id' => $order_id])
->update(['order_temp_info' => '']);
if (!$order) {
return array('errcode'=>-1, 'errmsg'=>'驳回失败');
}
return array('errcode'=>0,'errmsg'=>'驳回成功');
}
}
// 推送业务员
public function sendSales(Request $request, $id='')
{
......
......@@ -38,7 +38,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/details/{id}', 'OrderController@details');
Route::get('/change/{id}', 'OrderController@changeOrder');
Route::match(['get', 'post'], '/sendSales/{id?}', 'OrderController@sendSales');
Route::match(['get', 'post'], '/sendSales/{id?}', 'OrderController@sendSales');
Route::post('/ajaxdeletegoods', 'OrderController@ajaxdeletegoods');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::get('/check/{id}', 'OrderController@check');
......@@ -61,6 +61,8 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/amount', 'OrderCountController@amount');
Route::match('post', '/ajaxDelayTime', 'OrderController@ajaxDelayTime');
Route::match('post', '/ajaxRejected', 'OrderController@ajaxRejected');
});
......
......@@ -23,7 +23,4 @@ return [
// 竞调账户配置显示时间
'vp_time_set' => '2018-04-01',
// 订单审核时默认选中 ---经理ID
'manager_id' => 1406, // 郑家锋
];
......@@ -1250,6 +1250,14 @@
});
return false;
}
var sale_id = $('input[name=sale_id]').val();
if (sale_id == 0) {
layer.alert('请先将订单推送给业务员', function(){
location.href = '/sendSales/'+$('input[name=order_id]').val();
});
return false;
}
if (payTime == '') {
......@@ -1317,7 +1325,9 @@
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
layer.alert(resp.errmsg || '网络异常', function(){
location.reload();
});
}
},
......@@ -1329,6 +1339,69 @@
});
})
// 弹出已调价的订单信息
$('.checkAdjusted').click(function(){
var adjusted_info = $('.adjusted_order').html();
var layer_btn;
if (is_manager) {
layer_btn = ['驳回', '确认调价'];
} else {
layer_btn = [];
}
// 弹出提示
layer.open({
title: '调价后的订单信息',
content: adjusted_info,
area: ['700px', '400px'],
btn: layer_btn,
yes: function(index, layero){
$.ajax({
url : '/ajaxRejected',
type: 'post',
data: $('#adjustedOrderForm').serialize()+'&order_status=1',
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function (res) {
console.log(res);
}
})
},
btn2: function(index, layero){
$.ajax({
url : '/ajaxSaveChange',
type: 'post',
data: $('#adjustedOrderForm').serialize()+'&order_status=2',
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function (res) {
console.log(res);
}
})
}
});
})
},
}
......
......@@ -5,6 +5,7 @@
<form id="checkOrderForm" class="form-horizontal">
<input type="hidden" name="order_sn" value="{{$order_info['order_sn']}}">
<input type="hidden" name="order_id" value="{{$order_info['order_id']}}">
<input type="hidden" name="sale_id" value="{{$order_info['sale_id']}}">
<input type="hidden" name="goods_amount" value="{{$order_price_info['goods_price']}}">
<input type="hidden" name="order_amount" value="{{$order_info['order_amount']}}">
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}">
......@@ -60,7 +61,10 @@
<tbody>
@foreach ($order_items_info as $v)
<tr>
<td><p>{{$v['goods_name']}}</p></td>
<td>
<input type="hidden" name="change_info[{{$v['rec_id']}}][goods_name]" value="{{$v['goods_name']}}">
<p>{{$v['goods_name']}}</p>
</td>
<td>
<input class="only_positive_nubme num" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
</td>
......@@ -143,8 +147,12 @@
</td>
</tr>
</table>
<a class="btn btn-primary checkOrder">提交</a>
@if ($order_info['status'] == 1 && $order_info['order_temp_info'])
<a class="btn btn-primary checkAdjusted">查看调价信息</a>
@else
<a class="btn btn-primary checkOrder">提交</a>
@endif
</form>
@endif
......@@ -204,7 +212,77 @@
</div>
</div>
@if ($order_info['status'] == 1 && $order_info['order_temp_info'])
<div class="tabs-box adjusted_order" style="display: none;">
<div class="order-change-main">
<form id="adjustedOrderForm" class="form-horizontal">
<input type="hidden" name="order_id" value="{{$order_info['order_id']}}">
<input type="hidden" name="sale_id" value="{{$order_info['sale_id']}}">
<input type="hidden" name="extra_fee" value="{{$order_info['order_temp_info']['extra_fee']}}">
<input type="hidden" name="goods_amount" value="{{$order_info['order_temp_info']['goods_amount']}}">
<input type="hidden" name="deposit_amount" value="{{$order_info['order_temp_info']['deposit_amount']}}">
<input type="hidden" name="order_pay_type" value="{{$order_info['order_temp_info']['order_pay_type']}}">
<input type="hidden" name="pay_time_limit" value="{{$order_info['order_temp_info']['pay_time_limit']}}">
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>型号</th>
<th>调整数量</th>
<th>调整单价</th>
</tr>
</thead>
<tbody>
@foreach ($order_info['order_temp_info']['change_info'] as $k => $v)
<tr>
<td>
<input type="hidden" name="change_info[{{$k}}][goods_name]" value="{{$v['goods_name']}}">
<p>{{$v['goods_name']}}</p>
</td>
<td>
<input type="hidden" name="change_info[{{$k}}][goods_number]" value="{{$v['goods_number']}}">
<p>{{$v['goods_number']}}</p>
</td>
<td>
<input type="hidden" name="change_info[{{$k}}][goods_price]" value="{{$v['goods_price']}}">
<p>{{$v['goods_price']}}</p>
</td>
</tr>
@endforeach
</tbody>
</table>
<hr>
<table class="table table-bordered table-hover">
<tr>
<th>商品总额:</th>
<td>{{$order_info['order_temp_info']['goods_amount']}}</td>
</tr>
<tr>
<th>附加费:</th>
<td>{{$order_info['order_temp_info']['extra_fee']}}</td>
</tr>
<tr>
<th>订单总额:</th>
<td>{{$order_info['order_temp_info']['goods_amount'] + $order_info['order_temp_info']['extra_fee']}}</td>
</tr>
<tr>
<th>付款时间:</th>
<td>{{$order_info['order_temp_info']['pay_time_limit'].'天'}}</td>
</tr>
</table>
</form>
</div>
</div>
@endif
<script>
var is_manager = "{{ $role == 1 || $role == 2 ? true : false }}";
var order_amount = "{{$order_info['order_amount']}}";
var currency = "{{$order_info['currency']}}";
var order_pay_type = "{{$order_info['order_pay_type']}}";
......
......@@ -430,7 +430,7 @@
<!-- 查看ERP订单详情时去掉操作按钮 -->
@if (!isset($_REQUEST['tags']))
<!-- 人工审单时去掉操作按钮 -->
@if ($action_name != 'changeOrder')
@if ($action_name != 'sendSales' && $action_name != 'changeOrder')
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
<!-- 判断操作权限 -->
......
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