missionAudit.blade.php 8.6 KB

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