Browse Source

审核后不能再点击修改备注

sunhao 5 years ago
parent
commit
90c6cb17d2

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

@@ -180,7 +180,9 @@ class OrderController extends Controller
180 180
         $delivery_type = (int)$request->input('delivery_type'); //发货状态 0到发货时间(未填物流信息) 2全部 
181 181
         $receiverName = trim($request->input('receiverName'));
182 182
         $receiverMobile = trim($request->input('receiverMobile'));
183
-
183
+        if($etime){
184
+            $etime = $etime. ' 23:59:59';
185
+        }
184 186
 
185 187
         //仓库管理员只能看到 918之后的数据
186 188
         $_start = '2019-09-18';
@@ -1062,6 +1064,10 @@ class OrderController extends Controller
1062 1064
         $receiverMobile = $request->input('receiverMobile');
1063 1065
         $delivery_type = (int)$request->input('delivery_type'); //发货状态 0到发货时间(未填物流信息) 2全部
1064 1066
 
1067
+        if($etime){
1068
+            $etime = $etime. ' 23:59:59';
1069
+        }
1070
+
1065 1071
         $_start = '2019-09-18';// 只看18号之后数据
1066 1072
         $today_date = date('Y-m-d');
1067 1073
         $result = Order::where(function($query) use($admin_id, $stime, $etime, $warehouse, $receiverMobile, $receiverName, $today_date, $delivery_type, $_start){

+ 68 - 2
resources/views/order/orderlist.blade.php

@@ -84,7 +84,8 @@
84 84
                             <td>{{$a['receiverState']}}{{$a['receiverCity']}}{{$a['receiverDistrict']}}{{$a['receiverStreet']}}{{$a['receiverAddress']}}</td>                            
85 85
                             <td>{{$a['goods_note']}}</td> 
86 86
                             <td>{{$a['delivery_date']}}</td> 
87
-                            @if($self_role =='销售' ) 
87
+
88
+                            @if($self_role =='销售' || ($self_role =='管理员' && $a['status']>0) ) 
88 89
                             <td>{{$a['logistics_id']}}</td>
89 90
                             @else                          
90 91
                             <td class ="change_logistics_id"> 
@@ -95,11 +96,15 @@
95 96
                             @endif
96 97
                             
97 98
                             @if($self_role !='销售' )
99
+                            @if($self_role =='管理员' && $a['status']>0)
100
+                                <td>{{$a['cost']}}</td>
101
+                            @else
98 102
                             <td class ="change_logistics_id"> 
99 103
                                 <p id="cost_1{{$a['id']}}">{{$a['cost']}}</p> 
100 104
                                 <input id="cost_2{{$a['id']}}" style="display: none" type='text' name='cost' value="{{$a['cost']}}" onblur="change_cost({{$a['id']}})" />
101 105
                                 <span class="sort_icon" hidden  onClick='change_cost_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
102 106
                             </td>  
107
+                            @endif
103 108
                             @endif                          
104 109
                             <td>@if($a['warehouse']==1) A仓库 @elseif($a['warehouse']==2) B仓库 @else @endif</td>                            
105 110
                             <td>{{$a['receivedAmount']}}</td>                            
@@ -108,11 +113,26 @@
108 113
                             <td>@if($a['is_fugou']==1) 是 @else 否 @endif</td>
109 114
                             <td>@if($a['is_refund']==1) 是 @else 否 @endif</td>
110 115
                             <td>{{$a['refund_price']}}</td>
116
+                            @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
111 117
                             <td>{{$a['refund_note']}}</td>
118
+                            @else
119
+                            <td class ="change_logistics_id"> 
120
+                                <p id="refund_note_1{{$a['id']}}">{{$a['refund_note']}}</p> 
121
+                                <textarea id="refund_note_2{{$a['id']}}" rows=4 style="display: none"  name='refund_note' onblur="change_refund_note({{$a['id']}})" >{{$a['refund_note']}}</textarea>
122
+                                <span class="sort_icon" hidden  onClick='change_refund_note_click("{{$a['id']}}","{{$a['refund_note']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
123
+                            </td>
124
+                            @endif
125
+
112 126
                             <td>{{$a['admin_name']}}</td>
113 127
                             <td id="order_verify{{$a['id']}}">{{$a['status_name']}}</td>
114 128
                             @if($self_role =='销售' ) <td>@if($a['status'] == 0)<font color='red'> {{$a['refuse_reason']}} </font> @endif</td> @endif
129
+                           
115 130
                             <td id="refund{{$a['id']}}">@if($a['order_status']==2) <span class="btn btn-danger radius">退款</span> @else 正常<br><span class="btn btn-primary radius" onclick="order_refund({{$a['id']}})">设为退款</span> @endif</td> 
131
+                            @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
132
+                            <td>{{$a['buyerMemo']}}</td> 
133
+                            <td>{{$a['sellerMemo']}}</td> 
134
+                            <td>{{$a['send_note']}}</td> 
135
+                            @else
116 136
                             <td class ="change_logistics_id"> 
117 137
                                 <p id="buyerMemo_1{{$a['id']}}">{{$a['buyerMemo']}}</p> 
118 138
                                 <input id="buyerMemo_2{{$a['id']}}" style="display: none" type='text' name='buyerMemo' value="{{$a['buyerMemo']}}" onblur="change_buyerMemo({{$a['id']}})" />
@@ -124,7 +144,13 @@
124 144
                                 <input id="sellerMemo_2{{$a['id']}}" style="display: none" type='text' name='sellerMemo' value="{{$a['sellerMemo']}}" onblur="change_sellerMemo({{$a['id']}})" />
125 145
                                 <span class="sort_icon" hidden  onClick='change_sellerMemo_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
126 146
                             </td> 
127
-                            <td>{{$a['send_note']}}</td>                                                                                                  
147
+                            
148
+                            <td class ="change_logistics_id"> 
149
+                                <p id="send_note_1{{$a['id']}}">{{$a['send_note']}}</p> 
150
+                                <textarea id="send_note_2{{$a['id']}}" rows=4 style="display: none"  name='send_note' onblur="change_send_note({{$a['id']}})" >{{$a['send_note']}}</textarea>
151
+                                <span class="sort_icon" hidden  onClick='change_send_note_click("{{$a['id']}}","{{$a['send_note']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
152
+                            </td>  
153
+                            @endif
128 154
                             <td>
129 155
                                 @if($a['enable_status'])
130 156
                                     @foreach($a['enable_status'] as $item)
@@ -319,6 +345,46 @@
319 345
             });
320 346
         }
321 347
 
348
+        function change_send_note_click(id, send_note){
349
+            $("#send_note_1"+id).hide();
350
+            $("#send_note_2"+id).show();
351
+            $("#send_note_2"+id).focus();
352
+        }
353
+
354
+        function change_send_note(id){
355
+            var send_note = $("#send_note_2"+id).val();
356
+            $.ajax({
357
+                url: '/admin/order/editLogisticsId?id='+id+'&send_note='+send_note,
358
+                type: 'get',
359
+                dateType: 'json',
360
+                success:function(msg){
361
+                    $("#send_note_1"+id).html(send_note);
362
+                    $("#send_note_1"+id).show();
363
+                    $("#send_note_2"+id).hide();
364
+                }
365
+            });
366
+        }
367
+
368
+        function change_refund_note_click(id, refund_note){
369
+            $("#refund_note_1"+id).hide();
370
+            $("#refund_note_2"+id).show();
371
+            $("#refund_note_2"+id).focus();
372
+        }
373
+
374
+        function change_refund_note(id){
375
+            var refund_note = $("#refund_note_2"+id).val();
376
+            $.ajax({
377
+                url: '/admin/order/editLogisticsId?id='+id+'&refund_note='+refund_note,
378
+                type: 'get',
379
+                dateType: 'json',
380
+                success:function(msg){
381
+                    $("#refund_note_1"+id).html(refund_note);
382
+                    $("#refund_note_1"+id).show();
383
+                    $("#refund_note_2"+id).hide();
384
+                }
385
+            });
386
+        }
387
+
322 388
         function order_refund(id){
323 389
             $.ajax({
324 390
                 url: '/admin/order/setrefund/'+id,

+ 70 - 4
resources/views/order/predictorderlist.blade.php

@@ -85,10 +85,11 @@
85 85
                             <td>{{$a['customerName']}}</td>                            
86 86
                             <td>{{$a['receiverName']}}</td>                            
87 87
                             <td>{{$a['receiverMobile']}}</td>                                                                                    
88
-                            <td>{{$a['receiverState']}}{{$a['receiverCity']}}{{$a['receiverDistrict']}}{{$a['receiverAddress']}}</td>                            
88
+                            <td>{{$a['receiverState']}}{{$a['receiverCity']}}{{$a['receiverDistrict']}}{{$a['receiverStreet']}}{{$a['receiverAddress']}}</td>                            
89 89
                             <td>{{$a['goods_note']}}</td> 
90 90
                             <td>{{$a['delivery_date']}}</td> 
91
-                            @if($self_role =='销售' ) 
91
+
92
+                            @if($self_role =='销售' || ($self_role =='管理员' && $a['status']>0) ) 
92 93
                             <td>{{$a['logistics_id']}}</td>
93 94
                             @else                          
94 95
                             <td class ="change_logistics_id"> 
@@ -99,11 +100,15 @@
99 100
                             @endif
100 101
                             
101 102
                             @if($self_role !='销售' )
103
+                            @if($self_role =='管理员' && $a['status']>0)
104
+                                <td>{{$a['cost']}}</td>
105
+                            @else
102 106
                             <td class ="change_logistics_id"> 
103 107
                                 <p id="cost_1{{$a['id']}}">{{$a['cost']}}</p> 
104 108
                                 <input id="cost_2{{$a['id']}}" style="display: none" type='text' name='cost' value="{{$a['cost']}}" onblur="change_cost({{$a['id']}})" />
105 109
                                 <span class="sort_icon" hidden  onClick='change_cost_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
106 110
                             </td>  
111
+                            @endif
107 112
                             @endif                          
108 113
                             <td>@if($a['warehouse']==1) A仓库 @elseif($a['warehouse']==2) B仓库 @else @endif</td>                            
109 114
                             <td>{{$a['receivedAmount']}}</td>                            
@@ -112,11 +117,26 @@
112 117
                             <td>@if($a['is_fugou']==1) 是 @else 否 @endif</td>
113 118
                             <td>@if($a['is_refund']==1) 是 @else 否 @endif</td>
114 119
                             <td>{{$a['refund_price']}}</td>
120
+                            @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
115 121
                             <td>{{$a['refund_note']}}</td>
122
+                            @else
123
+                            <td class ="change_logistics_id"> 
124
+                                <p id="refund_note_1{{$a['id']}}">{{$a['refund_note']}}</p> 
125
+                                <textarea id="refund_note_2{{$a['id']}}" rows=4 style="display: none"  name='refund_note' onblur="change_refund_note({{$a['id']}})" >{{$a['refund_note']}}</textarea>
126
+                                <span class="sort_icon" hidden  onClick='change_refund_note_click("{{$a['id']}}","{{$a['refund_note']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
127
+                            </td>
128
+                            @endif
129
+
116 130
                             <td>{{$a['admin_name']}}</td>
117 131
                             <td id="order_verify{{$a['id']}}">{{$a['status_name']}}</td>
118 132
                             @if($self_role =='销售' ) <td>@if($a['status'] == 0)<font color='red'> {{$a['refuse_reason']}} </font> @endif</td> @endif
133
+                           
119 134
                             <td id="refund{{$a['id']}}">@if($a['order_status']==2) <span class="btn btn-danger radius">退款</span> @else 正常<br><span class="btn btn-primary radius" onclick="order_refund({{$a['id']}})">设为退款</span> @endif</td> 
135
+                            @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
136
+                            <td>{{$a['buyerMemo']}}</td> 
137
+                            <td>{{$a['sellerMemo']}}</td> 
138
+                            <td>{{$a['send_note']}}</td> 
139
+                            @else
120 140
                             <td class ="change_logistics_id"> 
121 141
                                 <p id="buyerMemo_1{{$a['id']}}">{{$a['buyerMemo']}}</p> 
122 142
                                 <input id="buyerMemo_2{{$a['id']}}" style="display: none" type='text' name='buyerMemo' value="{{$a['buyerMemo']}}" onblur="change_buyerMemo({{$a['id']}})" />
@@ -128,7 +148,13 @@
128 148
                                 <input id="sellerMemo_2{{$a['id']}}" style="display: none" type='text' name='sellerMemo' value="{{$a['sellerMemo']}}" onblur="change_sellerMemo({{$a['id']}})" />
129 149
                                 <span class="sort_icon" hidden  onClick='change_sellerMemo_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
130 150
                             </td> 
131
-                            <td>{{$a['send_note']}}</td>                                                                                                  
151
+                            
152
+                            <td class ="change_logistics_id"> 
153
+                                <p id="send_note_1{{$a['id']}}">{{$a['send_note']}}</p> 
154
+                                <textarea id="send_note_2{{$a['id']}}" rows=4 style="display: none"  name='send_note' onblur="change_send_note({{$a['id']}})" >{{$a['send_note']}}</textarea>
155
+                                <span class="sort_icon" hidden  onClick='change_send_note_click("{{$a['id']}}","{{$a['send_note']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
156
+                            </td>  
157
+                            @endif                                                                                                  
132 158
                             <td>
133 159
                                 @if($a['enable_status'])
134 160
                                     @foreach($a['enable_status'] as $item)
@@ -140,7 +166,7 @@
140 166
                                     @endforeach
141 167
                                 @endif
142 168
 
143
-                                @if($self_role =='销售' && $a['status']>0)
169
+                                @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
144 170
 
145 171
                                 @else
146 172
                                 <a style="text-decoration:none" onClick='order_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>                                                           
@@ -322,6 +348,46 @@
322 348
             });
323 349
         }
324 350
 
351
+        function change_send_note_click(id, send_note){
352
+            $("#send_note_1"+id).hide();
353
+            $("#send_note_2"+id).show();
354
+            $("#send_note_2"+id).focus();
355
+        }
356
+
357
+        function change_send_note(id){
358
+            var send_note = $("#send_note_2"+id).val();
359
+            $.ajax({
360
+                url: '/admin/order/editLogisticsId?id='+id+'&send_note='+send_note,
361
+                type: 'get',
362
+                dateType: 'json',
363
+                success:function(msg){
364
+                    $("#send_note_1"+id).html(send_note);
365
+                    $("#send_note_1"+id).show();
366
+                    $("#send_note_2"+id).hide();
367
+                }
368
+            });
369
+        }
370
+
371
+        function change_refund_note_click(id, refund_note){
372
+            $("#refund_note_1"+id).hide();
373
+            $("#refund_note_2"+id).show();
374
+            $("#refund_note_2"+id).focus();
375
+        }
376
+
377
+        function change_refund_note(id){
378
+            var refund_note = $("#refund_note_2"+id).val();
379
+            $.ajax({
380
+                url: '/admin/order/editLogisticsId?id='+id+'&refund_note='+refund_note,
381
+                type: 'get',
382
+                dateType: 'json',
383
+                success:function(msg){
384
+                    $("#refund_note_1"+id).html(refund_note);
385
+                    $("#refund_note_1"+id).show();
386
+                    $("#refund_note_2"+id).hide();
387
+                }
388
+            });
389
+        }
390
+
325 391
         function order_refund(id){
326 392
             $.ajax({
327 393
                 url: '/admin/order/setrefund/'+id,

+ 2 - 2
resources/views/order/warehouselist.blade.php

@@ -10,9 +10,9 @@
10 10
         <div>
11 11
             <div>                      
12 12
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
13
-                <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
13
+                <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
14 14
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
15
-                <input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">
15
+                <input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">
16 16
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="收货人"/>
17 17
                 <input id="receiverName" type="text"  class="input-text" style="width:8%;text-align:center" name="receiverName" value="{{$receiverName?$receiverName:''}}">
18 18
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="收货人手机号"/>