missionAudit.blade.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. @extends('layouts.app')
  2. @section('content')
  3. <div id="nav2">
  4. @component('process.menu')@endcomponent
  5. @component('process.checking-in.menuChecking-in')@endcomponent
  6. </div>
  7. <div class="container-fluid card" id="list">
  8. <div class="card-header">
  9. <form method="GET" action="{{url('process/checking-in/missionAudit')}}" id="form">
  10. <table class="table-sm text-nowrap table-bordered" style="width: 100%">
  11. <tbody>
  12. <tr v-if="isBeingFilterConditions">
  13. <td colspan="4">
  14. <div class="col" style="padding:0">
  15. <a href="{{url('process/checking-in/missionAudit')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
  16. </div></td>
  17. <td></td>
  18. </tr>
  19. <tr>
  20. <td>
  21. <span class="text-muted">每页显示记录:</span>
  22. </td>
  23. <td colspan="3">
  24. <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control-sm" style="vertical-align: middle" @change="submit">
  25. <option value="50">50行</option>
  26. <option value="100">100行</option>
  27. <option value="200">200行</option>
  28. <option value="500">500行</option>
  29. <option value="1000">1000行</option>
  30. </select></td>
  31. <td></td>
  32. </tr>
  33. <tr>
  34. <td style="width: 200px">
  35. <span class="text-muted">根据条件过滤:</span>
  36. </td>
  37. <td class="col" style="width: 300px">
  38. <div class="col p-0">
  39. <label class="form-check-label col-2 pull-left p-0">日期:</label>
  40. <input v-model="filterData.start_date" name="start_date" type="date" class="form-control-sm m-0 col-7" style="width: 130px">
  41. </div>
  42. <input v-model="filterData.end_date" name="end_date" type="date" class="form-control-sm col-7 offset-md-2 mt-2" style="width: 130px">
  43. </td>
  44. <td style="width: 300px">
  45. <label class="form-check-label">姓名</label>
  46. <input v-model="filterData.full_name" name="full_name" class="form-control-sm" type="text">
  47. </td>
  48. <td style="width: 300px">
  49. <label class="form-check-label">电话</label>
  50. <input v-model="filterData.mobile_phone" name="mobile_phone" class="form-control-sm" type="text">
  51. </td>
  52. <td><input hidden type="submit"></td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. </form>
  57. </div>
  58. <div class="card-body">
  59. <table class="table table-striped">
  60. <thead class="thead-light">
  61. <tr>
  62. <td>序号</td>
  63. <td>日期</td>
  64. <td>姓名</td>
  65. <td>电话</td>
  66. <td>劳务所</td>
  67. <td>登记工时</td>
  68. <td>打卡工时</td>
  69. <td>工时差</td>
  70. <td>计费工时</td>
  71. <td>计件数量</td>
  72. <td>查看</td>
  73. <td>审核</td>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <tr v-for="(processDailyParticipant,i) in processDailyParticipants">
  78. <td>@{{ i+1 }}</td>
  79. <td><p v-if="processDailyParticipant.process_daily">
  80. @{{ processDailyParticipant.process_daily.date }}</p></td>
  81. <td><p v-if="processDailyParticipant.user_detail">
  82. @{{ processDailyParticipant.user_detail.full_name }}</p></td>
  83. <td><p v-if="processDailyParticipant.user_detail">
  84. @{{ processDailyParticipant.user_detail.mobile_phone }}</p></td>
  85. <td><p v-if="processDailyParticipant.user_detail">
  86. @{{ processDailyParticipant.user_detail.user_labor_company }}</p></td>
  87. <td>@{{ processDailyParticipant.hour_count }}</td>
  88. <td class="text-danger">@{{ processDailyParticipant.hour }}</td>
  89. <td class="text-danger">@{{ processDailyParticipant.diff }}</td>
  90. <td class="text-danger">@{{ processDailyParticipant.billingHour }}</td>
  91. <td>@{{ processDailyParticipant.unit_count }}</td>
  92. <td><button v-if="processDailyParticipant.user_detail" @click="showUserDetail(processDailyParticipant.user_id)" class="btn btn-info">查看</button></td>
  93. <td><b v-if="processDailyParticipant.status=='已审核'" class="text-success">已审核</b>
  94. <button v-else class="btn btn-primary" @click="storeMissionAudit(processDailyParticipant.id)">审核</button>
  95. </td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. {{$processDailyParticipants->appends($request)->links()}}
  100. </div>
  101. </div>
  102. @endsection
  103. @section('lastScript')
  104. <script>
  105. new Vue({
  106. el:"#list",
  107. data:{
  108. processDailyParticipants:[
  109. @foreach($processDailyParticipants as $processDailyParticipant)
  110. {!! $processDailyParticipant !!},
  111. @endforeach
  112. ],
  113. filterData:{paginate:50,start_date:'',end_date:'',full_name:'',mobile_phone:''}
  114. },
  115. mounted:function () {
  116. this.initInputs();
  117. },
  118. computed:{
  119. isBeingFilterConditions:function(){
  120. for(let key in this.filterData){
  121. if(this.filterData[key]){
  122. if(key==='paginate')continue;
  123. return true
  124. }
  125. }
  126. return false;
  127. },
  128. },
  129. methods:{
  130. //回显条件参数
  131. initInputs:function(){
  132. let data=this;
  133. let uriParts =decodeURI(location.href).split("?");
  134. if(uriParts.length>1){
  135. let params = uriParts[1].split('&');
  136. params.forEach(function(paramPair){
  137. let pair=paramPair.split('=');
  138. let key = pair[0], val = pair[1];
  139. $('input[name="'+key+'"]').val(val);
  140. $('select[name="'+key+'"]').val(val);
  141. decodeURI(data.filterData[key]=val);
  142. });
  143. }
  144. },
  145. //提交表单
  146. submit:function(){
  147. let form = $("#form");
  148. form.submit();
  149. },
  150. //提交审核
  151. storeMissionAudit(id){
  152. let _this=this;
  153. axios.post('{{url("process/storeMissionAudit")}}',{id:id})
  154. .then(function (response) {
  155. if (response.data.error){
  156. tempTip.setDuration(3000);
  157. tempTip.show('审核失败:'+response.data.error);
  158. return;
  159. }
  160. _this.processDailyParticipants.every(function (processDailyParticipant) {
  161. if (processDailyParticipant.id==id){
  162. processDailyParticipant.status="已审核";
  163. tempTip.setDuration(3000);
  164. tempTip.showSuccess('审核通过!');
  165. return false;
  166. }
  167. return true;
  168. });
  169. }).catch(function (err) {
  170. tempTip.setDuration(3000);
  171. tempTip.show('审核失败!网络错误:' + err);
  172. });
  173. },
  174. showUserDetail(user_id){
  175. window.open("{{url('maintenance/userLabor')}}/"+user_id);
  176. }
  177. },
  178. });
  179. </script>
  180. @endsection