Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

view_reschedule-work-order.blade.php 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. @extends('customer-service.layout.master')
  2. @section('ptitle','Customer Service')
  3. @section('page_title', 'Dashboard')
  4. @section('subpage', 'Graph & Summary Report')
  5. @section('img_profile', asset($user->StaffDetail->user_pic))
  6. @section('login_name', $user->StaffDetail->name )
  7. @section('last_login', $user->last_login_at )
  8. @section('content')
  9. <style>
  10. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #EA5730 !important; }
  11. .ui-widget-content .bRed { color: #fff !important; }
  12. .ui-tabs .ui-tabs-nav li a { color: #636363 !important; }
  13. .ui-tabs .ui-tabs-nav li a:hover { color: #212121 !important; }
  14. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #2E6B9B !important; }
  15. .ui-widget-content a { color: #fff; }
  16. .dt-buttons { background: -webkit-linear-gradient(top, #F8F8F8 0%, #EFEFEF 100%); }
  17. .icos-download { padding-top: 0px; }
  18. .buttons-excel {
  19. padding: 7px 12px;
  20. display: block;
  21. color: #808080;
  22. font-size: 11px;
  23. }
  24. </style>
  25. <!-- Table work order -->
  26. <!-- 6 + 6 -->
  27. <div class="fluid">
  28. <form action="" class="main cussPayment">
  29. <fieldset>
  30. <div class="widget grid2 widgetH"></div>
  31. <div class="widget grid8">
  32. <div class="whead"><h6>Company's Name </h6></div>
  33. <div class="formRow">
  34. <div class="grid3"><label><b>Select company to assign work order : </b></label></div>
  35. <div class="grid9">
  36. <select class="styled" id="scid" name="scid" required>
  37. <option value=''>Please Choose Company</option>
  38. @foreach ($company as $c){
  39. <option value='{{$c->_id}}'>{{ $c->name }}</option>
  40. @endforeach
  41. </select>
  42. <b> * Any changes will automatically update, whether you drag or select</b>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="widget grid2 widgetH"></div>
  47. </fieldset>
  48. </form>
  49. </div>
  50. <div class="fluid">
  51. <!-- Calendar -->
  52. <div class="widget grid2 widgetH"></div>
  53. <div class="widget grid8 widgetBg">
  54. <div class="whead"><h6 id="title">Calendar for {{ $wo }}</h6></div>
  55. <div id="reschedule_calendar"></div>
  56. <div class="formRow calenderW">
  57. <div class="grid6"><button id="cancel" href="#" class="buttonM bCalender">Cancel Reschedule</button></div>
  58. <div class="grid6"><button id="confirm" href="#" class="buttonM bCalender">Confirm Reschedule</button></div>
  59. </div>
  60. </div>
  61. <div class="widget grid2 widgetH"></div>
  62. </div>
  63. @endsection
  64. @section('external_js')
  65. <script>
  66. $(document).ready(function(){
  67. var origin = window.location.origin;
  68. //===== Dynamic table toolbars =====//
  69. $('#dyn1 .tOptions').click(function () {
  70. $('#dyn .tablePars').slideToggle(200);
  71. });
  72. $('.tOptions').click(function () {
  73. $(this).toggleClass("act");
  74. });
  75. var today = "{{ $today }}";
  76. var company_selection = '';
  77. var wo = '{{ $wo }}';
  78. var subscriber_id = '';
  79. console.log(wo);
  80. /* View all schedule */
  81. $('#reschedule_calendar').fullCalendar({
  82. header: {
  83. left: 'prev,next,today',
  84. center: 'title',
  85. right: 'month,agendaWeek,agendaDay'
  86. },
  87. defaultView: 'agendaWeek',
  88. defaultDate: today,
  89. navLinks: true, // can click day/week names to navigate views
  90. firstDay: 1,
  91. eventLimit: true, // allow "more" link when too many events
  92. events: {
  93. url: "{{ url('/customer-service/get-all-calendar') }}",
  94. type: 'POST',
  95. data: function () { // a function that returns an object
  96. return {
  97. "company": $('#scid').val(),
  98. "status": '',
  99. "customer": '',
  100. "wk":wo,
  101. "_token": "{{ csrf_token() }}"
  102. };
  103. },
  104. error: function() {
  105. alert('there was an error while fetching events!');
  106. },
  107. },
  108. selectable:true,
  109. eventDurationEditable:false,
  110. select: function(start, end, allDay) {
  111. var start = $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss");
  112. var end = $.fullCalendar.formatDate(end, "Y-MM-DD HH:mm:ss");
  113. if(company_selection != '') {
  114. $.ajax({
  115. type: "POST",
  116. url: "{{ url('/customer-service/work-order/reschedule') }}",
  117. data: { "vendor": company_selection, "start": start, "end": end, "wo": wo , "_token": "{{ csrf_token() }}"},
  118. success:function(data){
  119. $('#reschedule_calendar').fullCalendar('refetchEvents');
  120. }
  121. });
  122. }else {
  123. alert("ERROR!! Please choose company !");
  124. window.location.reload();
  125. }
  126. },
  127. editable:false,
  128. });
  129. $('#scid').on('change',function(){
  130. company_selection = $('#scid').val();
  131. $('#reschedule_calendar').fullCalendar('refetchEvents');
  132. $.ajax({
  133. url: "{{ url('/customer-service/get-company-color') }}",
  134. type: 'POST',
  135. data: { "company": $('#scid').val(), "_token": "{{ csrf_token() }}" },
  136. }).done(function(company_label) {
  137. $('.fc-widget-header').css({"background":company_label[0].bg,"color":company_label[0].text});
  138. $('.fc-widget-header a[data-goto]').css({"background": company_label[0].bg,"color":company_label[0].text});
  139. document.getElementById("title").innerHTML = 'Calendar '+ company_label[0].name;
  140. });
  141. });
  142. /* Cancel add new schedule */
  143. $('#cancel').on('click',function(){
  144. window.location = "{{ url ('/customer-service/work-order/list')}}";
  145. });
  146. /* Confirm new schedule */
  147. $('#confirm').on('click',function(){
  148. $.ajax({
  149. type:"POST",
  150. url: "{{ url('/customer-service/work-order/update/reschedule') }}",
  151. data:{"wo": wo,"_token": "{{ csrf_token() }}"},
  152. success:function(response){
  153. if(response[0].result == "yes"){
  154. window.location = "{{ url ('/customer-service/work-order/list')}}";
  155. }else if(response[0].result == "no"){
  156. alert("ERROR!! Please choose datetime for current work order !");
  157. }
  158. }
  159. });
  160. });
  161. });
  162. </script>
  163. @endsection