Browse Source

加粉时间不得更改,不能选今天以后

sunhao 5 years ago
parent
commit
859ae7d3ae

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

603
             $customers['receiverDistrict'] = $order['receiverDistrict'];
603
             $customers['receiverDistrict'] = $order['receiverDistrict'];
604
             $customers['receiverStreet'] = $order['receiverStreet'];
604
             $customers['receiverStreet'] = $order['receiverStreet'];
605
             $customers['receiverAddress'] = $order['receiverAddress'];
605
             $customers['receiverAddress'] = $order['receiverAddress'];
606
-            $customers['fanTime'] = $request->input('fanTime');
607
 
606
 
608
             $if_e = DB::table('customers')->select('id')->where('phone', $order['receiverMobile'])->first();
607
             $if_e = DB::table('customers')->select('id')->where('phone', $order['receiverMobile'])->first();
609
             if(isset($if_e->id)){               
608
             if(isset($if_e->id)){               
613
             }else{
612
             }else{
614
                 $customers['phone'] = $order['receiverMobile'];                
613
                 $customers['phone'] = $order['receiverMobile'];                
615
                 $customers['is_fugou'] = 0;
614
                 $customers['is_fugou'] = 0;
615
+                $customers['fanTime'] = $request->input('fanTime');
616
                 $in_c = DB::table('customers')->insert($customers);
616
                 $in_c = DB::table('customers')->insert($customers);
617
             }
617
             }
618
 
618
 

+ 11 - 6
resources/views/order/ordercreate.blade.php

469
                             //$("input[name=receiverStreet]").val(data.receiverStreet);
469
                             //$("input[name=receiverStreet]").val(data.receiverStreet);
470
                             $("input[name=receiverAddress]").val(data.receiverAddress);
470
                             $("input[name=receiverAddress]").val(data.receiverAddress);
471
                             $("input[name=fanTime]").val(data.fanTime);
471
                             $("input[name=fanTime]").val(data.fanTime);
472
+                            $("input[name=fanTime]").attr('disabled', 'true');
473
+                        }
474
+                        else{
475
+                            $("input[name=fanTime]").removeAttr('disabled');
472
                         }
476
                         }
473
                     }
477
                     }
474
                 })
478
                 })
554
                         document.getElementById('good_sku').innerHTML = str;
558
                         document.getElementById('good_sku').innerHTML = str;
555
                         document.getElementById('good_sku').style.display='block'
559
                         document.getElementById('good_sku').style.display='block'
556
                        
560
                        
557
-                        // layer.open({
558
-                        //   type: 1,
559
-                        //   area: ['600px', '360px'],
560
-                        //   shadeClose: true, //点击遮罩关闭
561
-                        //   content: str
562
-                        // });
563
                     }
561
                     }
564
                 }
562
                 }
565
             })
563
             })
624
             layer.msg('加粉时间不能为空!',{icon:2,time:1500});
622
             layer.msg('加粉时间不能为空!',{icon:2,time:1500});
625
             return false;
623
             return false;
626
         }
624
         }
625
+
626
+        var tdate = today_date();
627
+        if(fanTime>tdate){
628
+            layer.msg('加粉时间不能超过今天!',{icon:2,time:1500});
629
+            return false;
630
+        }
631
+
627
         var receiverState = $("input[name=receiverState]").val();
632
         var receiverState = $("input[name=receiverState]").val();
628
         if(!receiverState){
633
         if(!receiverState){
629
             layer.msg('省份不能为空!',{icon:2,time:1500});
634
             layer.msg('省份不能为空!',{icon:2,time:1500});