consultant_list.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {!! $gird !!}
  2. <script>
  3. $(function () {
  4. $(document).on('click','#consultant_reset_list',function () {
  5. var id_array=new Array();
  6. $('input[class="grid-row-checkbox"]:checked').each(function(){
  7. id_array.push($(this).attr('data-id'));
  8. });
  9. var idstr=id_array.join(',');
  10. if( idstr=='' || idstr==null ){
  11. swal('请勾选需要重置的会员', '', 'error');
  12. }else{
  13. $.ajax({
  14. type: "post",
  15. url: "{{route('consultant.reset')}}",
  16. data: {
  17. id:idstr,
  18. _token:LA.token,
  19. },
  20. dataType: "json",
  21. success: function(result){
  22. if(result.code==0){
  23. swal(result.info, '', 'error');
  24. return false;
  25. }else{
  26. swal(result.info, '', 'success');
  27. }
  28. setTimeout(function () {
  29. window.location.reload();
  30. }, 2000);
  31. }
  32. });
  33. }
  34. })
  35. $(document).on('click','.consultant_reset',function () {
  36. var id = $(this).attr('ls');
  37. if(id){
  38. $.ajax({
  39. type: "post",
  40. url: "{{route('consultant.reset')}}",
  41. data: {
  42. id:id,
  43. _token:LA.token,
  44. },
  45. dataType: "json",
  46. success: function(result){
  47. if(result.code==0){
  48. swal(result.info, '', 'error');
  49. return false;
  50. }else{
  51. swal(result.info, '', 'success');
  52. }
  53. setTimeout(function () {
  54. window.location.reload();
  55. }, 2000);
  56. }
  57. });
  58. }
  59. })
  60. })
  61. </script>