Browse Source

退方式

sunhao 5 years ago
parent
commit
7418b711e9

+ 16 - 1
app/Http/Controllers/Admin/OrderController.php

@@ -105,6 +105,7 @@ class OrderController extends Controller
105 105
             2 => '已审核',
106 106
             3 => '已发货',
107 107
         );
108
+
108 109
         foreach($result as $k=>&$v){
109 110
             /*
110 111
             //获取商品信息
@@ -126,7 +127,14 @@ class OrderController extends Controller
126 127
                 $v['enable_status'] = $this->getEnableStatus($v['status']);
127 128
             }
128 129
 
129
-            $v['status_name'] = $status_arr[$v['status']];            
130
+            $v['status_name'] = $status_arr[$v['status']];    
131
+            if($v['refund_type'] == 1){
132
+                $v['refund_type'] = '微信支付';
133
+            }elseif($v['refund_type'] == 2){
134
+                $v['refund_type'] = '付款码支付';
135
+            }else{
136
+                $v['refund_type'] = '';
137
+            }   
130 138
         }
131 139
 
132 140
         $yestoday = date('Y-m-d', strtotime('-1 day'));
@@ -1023,6 +1031,7 @@ class OrderController extends Controller
1023 1031
         $aftersale_time = $request->input('aftersale_time');
1024 1032
         $refund_time = $request->input('refund_time');
1025 1033
         $refund_price = $request->input('refund_price');
1034
+        $refund_type = $request->input('refund_type');
1026 1035
 
1027 1036
         $order = Order::where('id', $id)->first();
1028 1037
         $data = array();
@@ -1059,6 +1068,12 @@ class OrderController extends Controller
1059 1068
             }
1060 1069
             $data['refund_price'] = $refund_price;
1061 1070
         }
1071
+        if(isset($refund_type)){
1072
+            if(empty($refund_type)){
1073
+                $refund_type = null;                
1074
+            }
1075
+            $data['refund_type'] = (int)$refund_type;
1076
+        }
1062 1077
         if($id>0 && !empty($data)){
1063 1078
             $res = Order::where('id', $id)->update($data);
1064 1079
         }

+ 40 - 0
resources/views/order/orderlist.blade.php

@@ -76,6 +76,7 @@
76 76
                     <th width="2%">是否复购</th>                  
77 77
                     <th width="2%">是否退补单</th>                                                       
78 78
                     <th width="4%">应该退补差价</th> 
79
+                    <th width="4%">退补付款方式</th> 
79 80
                     <th width="5%">退补备注</th>                 
80 81
                     <th width="5%">退补时间</th>                 
81 82
                     <th width="4%">所属销售</th> 
@@ -146,6 +147,16 @@
146 147
                                 <input id="refund_price_2{{$a['id']}}" style="display: none" type='text' name='refund_price' value="{{$a['refund_price']}}" onblur="change_refund_price({{$a['id']}})" />
147 148
                                 <span class="sort_icon" hidden  onClick='change_refund_price_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
148 149
                             </td>
150
+
151
+                            <td class ="change_logistics_id"> 
152
+                                <p id="refund_type_1{{$a['id']}}">{{$a['refund_type']}}</p> 
153
+                                <select id="refund_type_2{{$a['id']}}" style="display: none" name='refund_type' value="{{$a['refund_type']}}" onchange="change_refund_type({{$a['id']}})">
154
+                                    <option value='0'>-请选择-</option>
155
+                                    <option value='1'>微信支付</option>
156
+                                    <option value='2'>付款码支付</option>
157
+                                </select>
158
+                                <span class="sort_icon" hidden  onClick='change_refund_type_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
159
+                            </td>
149 160
                                                     
150 161
                             <td class ="change_logistics_id"> 
151 162
                                 <p id="refund_note_1{{$a['id']}}">{{$a['refund_note']}}</p> 
@@ -597,6 +608,35 @@
597 608
             });
598 609
         }
599 610
 
611
+        function change_refund_type_click(id, refund_type){
612
+            $("#refund_type_1"+id).hide();
613
+            $("#refund_type_2"+id).show();
614
+            $("#refund_type_2"+id).focus();
615
+        }
616
+
617
+        function change_refund_type(id){
618
+            var refund_type = $("#refund_type_2"+id).val();
619
+            $.ajax({
620
+                url: '/admin/order/editLogisticsId?id='+id+'&refund_type='+refund_type,
621
+                type: 'get',
622
+                dateType: 'json',
623
+                success:function(msg){
624
+                    if(refund_type==1){
625
+                        refund_type = '微信支付';
626
+                    }
627
+                    if(refund_type==2){
628
+                        refund_type = '付款码支付';
629
+                    }
630
+                    if(refund_type==0){
631
+                        refund_type = '';
632
+                    }
633
+                    $("#refund_type_1"+id).html(refund_type);
634
+                    $("#refund_type_1"+id).show();
635
+                    $("#refund_type_2"+id).hide();
636
+                }
637
+            });
638
+        }
639
+
600 640
         function order_refund(id){
601 641
             $.ajax({
602 642
                 url: '/admin/order/setrefund/'+id,