Commit 4d30f0fc by 朱继来

1. 订单后台交互微调;

2. 调整取消原因弹框;
parent 1ad91e2c
......@@ -846,30 +846,6 @@ Class OrderController extends Controller
}
}
// 填写订单取消原因
public function ajaxInputCancelReason(Request $request)
{
if ($request->isMethod('post')) {
$order_id = $request->input('order_id');
$cancel_reason = $request->input('cancel_reason');
$update = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update(['cancel_reason' => $cancel_reason]);
if (!$update) return ['errcode' => -1, 'errmsg' => '填写订单取消原因失败'];
// 操作记录
$log['order_id'] = $order_id;
$log['operator_id'] = $request->user->userId;
$log['operator_type'] = 2;
$log['event'] = '填写订单取消原因:'.$cancel_reason;
$log['ip'] = get_client_ip();
$log['create_time'] = time();
DB::connection('order')->table('lie_order_action_log')->insert($log);
return ['errcode' => 0, 'errmsg' => '填写订单取消原因成功'];
}
}
// 申请再次调价
public function applyAdjust(Request $request, $id)
{
......@@ -980,42 +956,6 @@ Class OrderController extends Controller
}
}
// 联营取消订单
public function cancelPay(Request $request, $id)
{
if($request->isMethod('post')){
$order_id = $request->input('order_id');
$cancel_reason = $request->input('cancel_reason');
$operator_id = $request->user->userId;
if (!$order_id) {
errorLog(Error::E_NOT_EXISTS, '订单不存在');
return array('errcode'=>Error::E_NOT_EXISTS,'errmsg'=>'订单不存在~');
}
if (!$cancel_reason) {
errorLog(Error::E_NOT_EXISTS, '取消订单的原因不可为空');
return array('errcode'=>Error::E_NOT_EXISTS,'errmsg'=>'取消订单的原因不可为空~');
}
$url = Config('website.api_domain').'order/cancel';
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$resData = array("pf"=>1, "k1"=>$check['k1'], "k2"=>$check['k2'], "order_id"=>$order_id, "cancel_reason"=>$cancel_reason, 'operator_id'=>$operator_id, 'type' => 2);
$temp = json_decode(curlApi($url,$resData,"POST"), true);
return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
}
$info = $this->orderDetail($request, $id);
$this->pageHeader($request, $info, '取消订单', ["title" => '取消订单', "href" => '#']);
return view('detail', $info);
}
// 对账
public function checkPay(Request $request, $id)
{
......@@ -1313,24 +1253,23 @@ Class OrderController extends Controller
return $response;
}
// 自营取消订单
public function ajaxSelfCancel(Request $request)
// 取消订单
public function ajaxCancel(Request $request)
{
if ($request->isMethod('post')) {
$order_id = $request->input('order_id');
$cancel_reason = $request->input('reason');
$operator_id = $request->user->userId;
$data['order_id'] = $request->input('order_id', 0);
$data['cancel_reason'] = $request->input('cancel_reason', '');
$data['type'] = $request->input('type', 2); // 2.取消订单,3.审核不通过,4-填写取消原因
$data['operator_id'] = $request->user->userId;
$url = Config('website.api_domain').'order/cancel';
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$resData = array("pf"=>1, "k1"=>$check['k1'], "k2"=>$check['k2'], "order_id"=>$order_id, "cancel_reason"=>$cancel_reason, 'operator_id'=>$operator_id, 'type' => 2);
$temp = json_decode(curlApi($url, $resData, "POST"), true);
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
......
......@@ -47,7 +47,7 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/send/{id}', 'OrderController@send');
Route::post('/ajaxCheck', 'OrderController@ajaxCheck');
Route::match(['get', 'post'], '/adjustPrice/{id}', 'OrderController@adjustPrice');
Route::match(['get', 'post'], '/cancelPay/{id}', 'OrderController@cancelPay');
// Route::match(['get', 'post'], '/cancelPay/{id}', 'OrderController@cancelPay');
Route::match(['get', 'post'], '/checkPay/{id}', 'OrderController@checkPay');
Route::match(['get', 'post'], '/invShipping/{id}', 'OrderController@invShipping');
......@@ -64,7 +64,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/self_amount', 'OrderCountController@selfAmount');
Route::get('/self_order', 'OrderController@selfOrder');
Route::post('/ajaxSelfCancel', 'OrderController@ajaxSelfCancel');
Route::post('/ajaxCancel', 'OrderController@ajaxCancel');
Route::post('/ajaxSelfExpress', 'OrderController@ajaxSelfExpress');
Route::match(['get', 'post'], '/self_check_pay/{id}', 'OrderController@selfCheckPay');
......@@ -76,7 +76,7 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/tempcount', 'OrderController@tempCount');
Route::post('/ajaxDownloadContract', 'OrderController@ajaxDownloadContract');
Route::post('/ajaxInputCancelReason', 'OrderController@ajaxInputCancelReason');
// Route::post('/ajaxInputCancelReason', 'OrderController@ajaxInputCancelReason');
Route::post('/ajax/shipping', 'OrderController@shipping');
Route::get('/add_order', 'AddOrderController@addOrder');
......
......@@ -98,7 +98,7 @@ li {
.search-user, .search-sku {
width: 240px !important;
}
.label-prompt {
.create-order .label-prompt {
padding: 6px 6px;
}
.get-user, .get-sku {
......
......@@ -407,6 +407,7 @@
var cart_id = self.parents('tr').data('cid');
var type = self.parents('tr').data('type');
var user_id = 0;
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
if (is_online) {
user_id = $('.user_id').val();
......@@ -414,6 +415,10 @@
user_id = internal_uid ? internal_uid : user_id;
if (goods_type == 1) { // 联营需要选择交货地
delivery_place = $('input[name=delivery_place]:checked').val();
}
$.ajax({
type: "POST",
url: '/ajax/changeNum',
......@@ -421,7 +426,7 @@
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
loading.lists(user_id, goods_type, is_online); // 加载购物车列表
loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
}
layer.msg(resp.errmsg);
......@@ -434,6 +439,7 @@
var self = $(this);
var cart_id = self.parents('tr').data('cid');
var user_id = 0;
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
if (is_online) {
user_id = $('.user_id').val();
......@@ -441,6 +447,10 @@
user_id = internal_uid ? internal_uid : user_id;
if (goods_type == 1) { // 联营需要选择交货地
delivery_place = $('input[name=delivery_place]:checked').val();
}
layer.open({
title: '删除提示',
content: '确定删除该商品吗?',
......@@ -454,7 +464,7 @@
success: function(resp){
layer.msg(resp.errmsg);
// self.parents('tr').remove();
loading.lists(user_id, goods_type, is_online); // 加载购物车列表
loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
return false;
},
})
......@@ -559,7 +569,7 @@
success: function(resp){
if (resp.errcode == 0) {
layer.msg(resp.errmsg);
loading.lists(user_id, goods_type, is_online); // 加载购物车列表
loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
return false;
}
......
......@@ -3,7 +3,7 @@
<h3>客户信息</h3>
</div>
<div class="ibox-content">
<div class="ibox-content create-order">
<div class="account-info">
<h4>账户信息 <span class="title-tips"><i class="fa fa-info-circle"></i> 此账号为内部下单账号,前台不可登录。</span></h4>
......
......@@ -3,7 +3,7 @@
<h3>客户信息</h3>
</div>
<div class="ibox-content">
<div class="ibox-content create-order">
<div class="row" style="margin-bottom: 30px;">
<div class="col-sm-12">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入会员账号">
......
......@@ -3,7 +3,7 @@
<h3>客户信息</h3>
</div>
<div class="ibox-content">
<div class="ibox-content create-order">
<div class="row" style="margin-bottom: 30px;">
<div class="col-sm-12">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入会员账号">
......
......@@ -61,12 +61,22 @@
<td class="check-table-title" width="20%">调价审核:</td>
<td class="check-select">
<label><input type="radio" name="order_status" value="2" checked>审核通过</label>
<label><input type="radio" name="order_status" value="-1" id="faild">审核不通过</label>
<label><input type="radio" name="order_status" class="input-cancel-reason" value="-1" data-oid="{{$order_info['order_id']}}" data-type="3">审核不通过</label>
</td>
</tr>
<tr class="cancle_reason" style="display: none;">
<!-- <tr class="cancle_reason" style="display: none;">
<td class="check-table-title">审核不通过原因:</td>
<td>
<div class="form-group">
<label>常见原因:</label>
<div class="input-radio">
<label class="radio-inline"><input type="radio" name="cancel_reason" value="测试订单">测试订单</label>
<label class="radio-inline"><input type="radio" name="cancel_reason" value="客户没需求">客户没需求</label>
<label class="radio-inline"><input type="radio" name="cancel_reason" value="审核太久">审核太久</label>
<label class="radio-inline"><input type="radio" name="cancel_reason" value="订单信息填错">订单信息填错</label>
<label class="radio-inline"><input type="radio" name="cancel_reason" value="需用优惠券">需用优惠券</label>
</div>
</div>
<div class="multi-reason">
<label><input type="radio" name="reason" value="客户不接受调价">客户不接受调价</label>
<label><input type="radio" name="reason" value="无现货">无现货</label>
......@@ -79,7 +89,7 @@
<textarea name="reason" id="input-reason" placeholder="请填写其他原因"></textarea>
</div>
</td>
</tr>
</tr> -->
</table>
<hr/>
......
......@@ -575,15 +575,16 @@
@if (!isset($_REQUEST['tags']) && $action_name != 'changeOrder' && $action_name != 'sendSales')
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
@if (in_array($order_info['status'], [1, 2]) && in_array('cancel_order', $userPerms))
<!-- <a href="{{URL('cancelPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-danger">取消订单</a> -->
<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))
<a class="btn btn-info" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}">人工审单</a>
@endif
@if ($order_info['status'] == 2 && in_array('cancel_order', $userPerms))
<a href="{{URL('cancelPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-danger">取消订单</a>
@endif
<!-- 预付款 管理员完成首款对账后改变'对账'按钮 -->
@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'] != ''))
......@@ -607,7 +608,8 @@
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
@if (in_array($order_info['status'], [1, 2, 3, 4]) && in_array('self_order_cancel', $userPerms))
<a class="btn btn-danger self_cancel" href="javascript:;" data-id="{{$order_info['order_id']}}">取消订单</a>
<!-- <a class="btn btn-danger self_cancel" href="javascript:;" data-id="{{$order_info['order_id']}}">取消订单</a> -->
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$order_info['order_id']}}" data-type="2">取消订单</a>
@endif
<!-- 判断状态和权限 $extend-自营线下订单 -->
......
......@@ -325,7 +325,7 @@
@endif
@if ($v['status'] == -1 && !$v['cancel_reason'])
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}">填写取消原因</a>
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-type="4">填写取消原因</a>
@endif
</div>
</td>
......@@ -345,7 +345,7 @@
<?php
$is_new_order = App\Http\Controllers\getOrderExtend($v['order_id'], 'is_new');
echo $is_new_order->is_new ? '是' : '否';
echo $is_new_order && $is_new_order->is_new ? '是' : '否';
?>
</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