Commit 0d0c70a1 by 朱继来

联营设置线下转账

parent 4ae2a1f0
......@@ -1532,16 +1532,41 @@ Class OrderController extends Controller
if (!$update) {
errorLog(Error::E_UPDATE_FAILED, '延长失败');
return ['errcode'=>0, 'errmsg'=>'延长失败'];
return ['errcode'=>1, 'errmsg'=>'延长失败'];
}
// 操作记录
$OrderActionLogModel = new OrderActionLogModel();
$actionLog = $OrderActionLogModel->addLog($order_id, $request->user->userId, 3, '延长付款时间,截止到:'.date('Y-m-d H:i:s', $delay_time));
$actionLog = $OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '延长付款时间,截止到:'.date('Y-m-d H:i:s', $delay_time));
return ['errcode'=>0, 'errmsg'=>'延长成功'];
}
// 线下转账
public function offlinePaid(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', '');
$data['order_sn'] = $request->input('order_sn', '');
$data['operator_id'] = $request->user->userId;
if (empty($data['order_id']) && empty($data['order_sn'])) return ['errcode'=>Error::E_NOT_EXISTS, 'errmsg'=>'参数不存在'];
$url = Config('website.api_domain').'order/offlinePaid';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$temp = json_decode(curlApi($url, $data, "POST"), true); // 连接API
if ($temp['err_code'] != 0) {
return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
}
return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
}
}
public function tempCount(Request $request)
{
$current = strtotime(date('Y-m-d', time())); // 当天0点
......
......@@ -119,6 +119,8 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/refund_self_order', 'RefundController@selfRefundList');
Route::post('/ajax/cancelSelfRefund', 'RefundController@cancelSelfRefund');
Route::get('/refund_self_export', 'RefundController@refundSelfExport');
Route::post('/ajax/offlinePaid', 'OrderController@offlinePaid');
});
// 不需要登陆态
......
......@@ -770,6 +770,45 @@
$(this).parents('tbody').find('.click-down').show();
})
// 线下转账
$('.offline-paid').click(function() {
var order_id = $(this).data('id');
var order_sn = $(this).data('sn');
var content = '<div>确定要使用“线下转账”的付款方式吗?</div><div style="margin-top:5px; color:red;">选择“线下转账”,订单会立即同步至ERP,但必须由财务在“出库前”完成付款确认,否则无法出库。</div>';
layer.open({
title:'提示信息',
content: content,
btn:['确认', '取消'],
//提交事件
btn1:function(){
$.ajax({
url: '/ajax/offlinePaid',
data: {order_id: order_id, order_sn: order_sn},
type:'post',
dataType: 'json',
success:function(resp){
if(resp.errcode == 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
return false;
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error:function(){
layer.alert('网络异常');
}
});
},
btn2:function(index){
layer.close(index);
}
});
})
},
//物流信息
......
......@@ -668,11 +668,16 @@
<!-- 预付款 管理员完成首款对账后改变'对账'按钮 -->
@if (in_array($order_info['status'], [2, 3]) && in_array('check_account', $userPerms))
@if ($order_info['status'] == 3 && (!empty($order_pay_log) && $order_pay_log[0]['pay_type'] != ''))
<a href="javascript:;" data-id="{{$order_info['order_id']}}" class="btn btn-success last-check">对账</a>
<!-- <a href="javascript:;" data-id="{{$order_info['order_id']}}" class="btn btn-success last-check">对账</a> -->
@else
<a href="{{URL('checkPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-success">对账</a>
<!-- <a href="{{URL('checkPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-success">对账</a> -->
@endif
@endif
<!-- 线下转账 -->
@if (in_array($order_info['status'], [2, 3]) && in_array('offline_paid', $userPerms))
<a href="javascript:;" data-id="{{$order_info['order_id']}}" data-sn="{{$order_info['order_sn']}}" class="btn btn-success offline-paid">线下转账</a>
@endif
@if (in_array($order_info['status'], array(4, 7, 8, 10)) && in_array('order_send', $userPerms))
<!-- <a href="{{URL('send', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">订单发货</a> -->
......
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