Commit f97f26df by 朱继来

调整审核(temp)

parent 1c848c9b
......@@ -759,16 +759,71 @@ Class OrderController extends Controller
"change_info" => $request->input('change_info', ''),
"payTime" => $request->input('payTime', ''),
"payTimeOther" => $request->input('payTimeOther', ''),
"check_failed" => $request->input('check_failed', ''),
"order_id" => $order_id,
"pf" => 1,
"k1" => $check['k1'],
"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 sendSales(Request $request, $id='')
{
if ($request->isMethod('post')) {
$order_id = $request->input('order_id', '');
$sale_id = $request->input('sale_id', '');
if (empty($order_id) || empty($sale_id))
return array('errcode'=>10003, 'errmsg'=>'参数不存在');
$url = Config('website.api_domain').'order/sendSales';
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$resData = array(
"order_id"=>$order_id,
"sale_id"=>$sale_id,
"pf"=>1,
"k1"=>$check['k1'],
"k2"=>$check['k2']
);
$temp = json_decode(curlApi($url, $resData, "POST"), true);
return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
// $update = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update(['sale_id' => $sale_id]);
// if (!$update) {
// return array('errcode'=>-1, 'errmsg'=>'推送失败');
// }
// return array('errcode'=>0, 'errmsg'=>'推送成功');
}
$info = $this->orderDetail($request, $id);
// 获取所有的业务员
$sale_list = $this->getSales('销售');
$perm = new PermController;
$manager = $perm->getRoleUsers($request, '经理');
$sale_list = $perm->getRoleUsers($request, '交易员');
$info['sale_list'] = $sale_list;
$info['manager'] = $manager;
return view('detail', $info);
}
// 人工审单后再次调价 --- 20180404
......
......@@ -38,6 +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::post('/ajaxdeletegoods', 'OrderController@ajaxdeletegoods');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::get('/check/{id}', 'OrderController@check');
......
......@@ -23,4 +23,7 @@ return [
// 竞调账户配置显示时间
'vp_time_set' => '2018-04-01',
// 订单审核时默认选中 ---经理ID
'manager_id' => 1406, // 郑家锋
];
......@@ -270,6 +270,9 @@
if(action_type=='account'){
self.account();
}
if(action_type=='sendSales'){
self.sendSales();
}
if(action_type=='changeOrder'){
self.changeOrder();
}
......@@ -904,6 +907,54 @@
});
})
},
// 推送业务员
sendSales: function() {
$('.send_sales').click(function(){
var sale_id = $('input[name=sale_id]:checked').val();
var sale_name = $('input[name=sale_id]:checked').next('span').text();
if (sale_id == null) {
layer.msg('请选择业务员!');
return false;
}
// 弹出提示
layer.open({
title: '提醒',
content: '<div>确定推送到 <i class="error">'+sale_name+'</i> 吗?</div>',
btn:['取消','确定'],
yes: function(index, layero){
layer.close(index);
},
btn2: function(index, layero){
$.ajax({
url : '/sendSales',
type: 'post',
data: $('#sendSalesForm').serialize(),
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);
}
})
}
});
return false;
})
},
//人工审单
changeOrder: function(){
$('.deletegoods').click(function(){
......@@ -1043,7 +1094,8 @@
$('.order-change-table input').on('blur', function(){
var table = $('.order-change-table');
var goods_total = 0;
$(table).find('tr').each(function(){
$(table).find('tbody tr').each(function(){
var num = parseInt($(this).find('.num').val()) || 0;
var price = parseFloat($(this).find('.price').val()) || 0;
goods_total += parseFloat(num * price);
......@@ -1149,18 +1201,12 @@
// 提交表单
$('.checkOrder').click(function(){
var sale_id = $('input[name=sale_id]:checked').val();
var order_status = $('input[name=order_status]:checked').val();
var reason = $('input[name=reason]:checked').val();
var payTime = $('.payTime').val();
var payTimeOther = $('.payTimeOther').val();
if (sale_id == null) {
layer.msg('请选择业务员!');
return false;
}
if (order_status == -1) {console.log(reason)
if (order_status == -1) {
if (reason == null) {
layer.msg('请选择不通过原因!');
return false;
......@@ -1234,6 +1280,22 @@
var order_amount = currencySign+$('input[name=order_amount]').val();
var extra_fee = $('input[name=extra_fee]').val() == '' ? '' : currencySign+$('input[name=extra_fee]').val();
// 设置默认值false
$('input[name=check_failed]').val(0);
// 检查商品单价
$('.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;
origin_price = (origin_price * 0.8).toFixed(4);
// 若商品单价降价幅度小于或等于20%则赋值
if (price <= origin_price) {
$('input[name=check_failed]').val(1);
}
});
// 弹出提示
layer.open({
title: '提醒',
......
......@@ -9,6 +9,8 @@
<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'] : ''}}">
<input type="hidden" name="user_mobile" value="{{$user_mobile}}">
<input type="hidden" name="check_failed" value="">
<!-- 审核 -->
<p>审核</p>
<table class="table table-bordered table-hover check-table" style="min-height:150px;">
......@@ -20,34 +22,6 @@
</td>
</tr>
<tr>
<td class="check-table-title" width="20%">业务员:</td>
<td>
@if (!empty($manager))
@foreach ($manager as $k => $v)
@if(($k + 1) % 8 == 1)
<ul>
@endif
<li><label><input type="radio" name="sale_id" value="{{$v->userId}}"/>{{$v->name}}</label></li>
@if(($k + 1) % 8 == 0 || $k + 1 == count($manager))
</ul>
@endif
@endforeach
<hr/>
@endif
@foreach ($sale_list as $key => $vo)
@if(($key + 1) % 8 == 1)
<ul>
@endif
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/>{{$vo->name}}</label></li>
@if(($key + 1) % 8 == 0 || $key + 1 == count($sale_list))
</ul>
@endif
@endforeach
</td>
</tr>
<tr>
<td class="check-table-title" width="20%">调价审核:</td>
<td class="check-select">
<label><input type="radio" name="order_status" value="2" checked>审核通过</label>
......@@ -91,7 +65,7 @@
<input class="only_positive_nubme num" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
</td>
<td>
<input class="price only_number" name="change_info[{{$v['rec_id']}}][goods_price]" value="{{$v['goods_price']}}">
<input class="price only_number" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['goods_price']}}" value="{{$v['goods_price']}}">
</td>
</tr>
@endforeach
......@@ -160,7 +134,7 @@
<option value="3">3天</option>
<option value="7">7天</option>
<option value="15">15天</option>
<option value="0">其他</option>
<option value="other">其他</option>
</select>
<div class="customArea">
......
......@@ -392,6 +392,11 @@
</div>
</div>
@if ($action_name == 'sendSales')
<!--推送业务员-->
@include('detail.sendSales')
@endif
@if ($action_name == 'checkPay')
<!--对账-->
@include('detail.checkPay')
......
<p style="padding-left: 5px;">推送业务员</p>
<div class="tabs-box">
<div class="order-change-main">
@if ($order_info['sale_id'])
<p class="error">订单已推送!</p>
@endif
<form id="sendSalesForm" class="form-horizontal">
<input type="hidden" name="order_id" value="{{$order_info['order_id']}}">
<table class="table table-bordered table-hover check-table" style="min-height:150px;">
<tr>
<td class="check-table-title" width="20%">业务员:</td>
<td>
@if (!empty($manager))
@foreach ($manager as $k => $v)
@if(($k + 1) % 8 == 1)
<ul>
@endif
@if ($v->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$v->userId}}" checked /><span>{{$v->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$v->userId}}"/><span>{{$v->name}}</span></label></li>
@endif
@if(($k + 1) % 8 == 0 || $k + 1 == count($manager))
</ul>
@endif
@endforeach
<hr/>
@endif
@foreach ($sale_list as $key => $vo)
@if(($key + 1) % 8 == 1)
<ul>
@endif
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/><span>{{$vo->name}}</span></label></li>
@endif
@if(($key + 1) % 8 == 0 || $key + 1 == count($sale_list))
</ul>
@endif
@endforeach
</td>
</tr>
</table>
<a class="btn btn-primary send_sales">提交</a>
</form>
</div>
</div>
......@@ -267,10 +267,15 @@
<td>
<div class="btn-group btn-group-xs">
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}" target="_blank">详情</a>
<!-- 管理员和经理显示 $role = 1 || 2 -->
@if (in_array('check_order', $userPerms))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@endif
<!-- 管理员和经理显示 && sale_id为空 && 订单状态为待审核 -->
@if (in_array($role, [1, 2]) && !$v['sale_id'] && $v['status'] == 1)
<a class="btn btn-info" href="{{URL('sendSales', ['order_id'=>$v['order_id']])}}" target="_blank">推送</a>
@endif
</div>
</td>
</tr>
......
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