recycle.blade.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @extends('layouts.app')
  2. @section('title')回收站-临时工报表-人事管理@endsection
  3. @section('content')
  4. <div id="page" class="d-none container-fluid">
  5. <div class="card">
  6. <div id="form_div"></div>
  7. <span ><button class="btn btn-sm btn-outline-danger ml-2" @click="recover()">恢复</button></span>
  8. <div class="card-body">
  9. <table class="table table-hover table-striped text-nowrap table-bordered">
  10. <tr>
  11. <th>
  12. <label for="all">
  13. <input id="all" type="checkbox" @click="checkAll($event)">全选
  14. </label>
  15. </th>
  16. <th>序号</th>
  17. <th>进场编号</th>
  18. <th>小组</th>
  19. <th>临时工</th>
  20. <th>电话</th>
  21. <th>身份证号</th>
  22. <th>劳务所</th>
  23. <th>进场时间</th>
  24. <th>进组时间</th>
  25. <th>退组时间</th>
  26. <th>退场时间</th>
  27. <th>审核时间</th>
  28. <th>审核人</th>
  29. <th>晚饭打卡</th>
  30. <th>在线时长</th>
  31. <th>本次工作时长</th>
  32. <th>备注</th>
  33. </tr>
  34. <tr v-for="(laborReport,i) in laborReports">
  35. <td v-if="laborReport.id">
  36. <input class="checkItem" type="checkbox" :value="laborReport.id" v-model="checkData">
  37. </td>
  38. <td>@{{ i+1 }}</td>
  39. <td class="text-muted">@{{laborReport.enter_number}}</td>
  40. <td>@{{laborReport.userWorkGroupName}}</td>
  41. <td >@{{laborReport.name}}</td>
  42. <td class="text-muted">@{{laborReport.mobile_phone}}</td>
  43. <td class="text-muted">@{{laborReport.identity_number}}</td>
  44. <td class="text-muted">@{{laborReport.labor_company}}</td>
  45. <td class="text-muted">@{{laborReport.enter_at}}</td>
  46. <td>@{{laborReport.checkInAt}}</td>
  47. <td class="text-muted">@{{laborReport.checkOutAt}}</td>
  48. <td >
  49. @{{ laborReport.exit_at }}
  50. <span v-if="laborReport.exit_at" class="text-danger">(参考)</span>
  51. </td>
  52. <td class="text-muted">@{{laborReport.verifyAt}}</td>
  53. <td class="text-muted"><span v-if="laborReport.verifyPerson">@{{laborReport.verifyPerson}}</span></td>
  54. <td class="text-muted"><span v-if="laborReport.relax_time">@{{laborReport.relax_time}}</span></td>
  55. <td class="text-muted"><span v-if="laborReport.thisRecordOnlineTime">@{{laborReport.thisRecordOnlineTime}}</span></td>
  56. <td><span v-if="laborReport.thisRecordWorkingTime">@{{laborReport.thisRecordWorkingTime}}</span></td>
  57. <td><span v-if="laborReport.remark">@{{laborReport.remark}}</span></td>
  58. </tr>
  59. </table>
  60. <div class="text-info h5 btn btn">{{$laborReports->count()}}/@{{ sum }}</div>
  61. <div>{{$laborReports->appends($paginateParams)->links()}}</div>
  62. </div>
  63. </div>
  64. </div>
  65. @stop
  66. @section('lastScript')
  67. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  68. <script>
  69. new Vue({
  70. el:"#page",
  71. data:{
  72. laborReports:[
  73. @foreach($laborReports as $laborReport)
  74. {id:'{{$laborReport->id}}',enter_number:'{{$laborReport->enter_number}}'
  75. ,@if($laborReport->userWorkgroup)user_workgroup_id:'{{$laborReport->userWorkgroup->id}}',
  76. userWorkgroupNeedRemark:'{{$laborReport->userWorkgroup->isNeedRemark}}',
  77. userWorkGroupName:'{{$laborReport->userWorkgroup->name}}',@endif
  78. userId:'{{$laborReport->user_id}}',name:'{{$laborReport->name}}'
  79. ,mobile_phone:'{{$laborReport->mobile_phone}}',identity_number:'{{$laborReport->identity_number}}',
  80. @if($laborReport->laborCompany)
  81. labor_company:'{{$laborReport->laborCompany->name}}',labor_company_id:'{{$laborReport->laborCompany->id}}',@endif
  82. checkInAt:'{{$laborReport->check_in_at}}', relax_time:'{{$laborReport->relax_time}}',
  83. is_exportGroup:'{{$laborReport->is_exportGroup}}',is_export:'{{$laborReport->is_export}}',
  84. verifyAt:'{{$laborReport->verify_at}}',groupUserId:'{{$laborReport->group_user_id}}',verifyPerson:'{{$laborReport->user['name']}}',
  85. checkOutAt:'{{$laborReport->check_out_at}}',onlineDuration:'{{$laborReport->online_duration}}',
  86. workingDuration:'{{$laborReport->working_duration}}', created_at:'{{$laborReport->created_at}}',
  87. @if($laborReport->userDutyCheck)
  88. enter_at:'{{$laborReport->userDutyCheck->checked_at}}',@endif
  89. exit_at:'{{$laborReport->exit_at}}', checks:'{{$laborReport->checks}}',
  90. thisRecordOnlineTime:'{{$laborReport->thisRecordOnlineTime}}',
  91. thisRecordWorkingTime:'{{$laborReport->thisRecordWorkingTime}}',isAdult:'{{$laborReport->isAdult}}',
  92. sequence:'{{$laborReport->sequence}}',amountOfJoined:'{{$laborReport->amountOfJoined}}',remark:'{{$laborReport->remark}}',
  93. @if($laborReport->userDutyCheck)user_duty_check_id:'{{$laborReport->userDutyCheck->id}}', userDutyCheckVerifyUserId:'{{$laborReport->userDutyCheck->verify_user_id}}'
  94. ,userDutyCheckType:'{{$laborReport->userDutyCheck->type}}',userDutyCheckAt:'{{$laborReport->userDutyCheck->checked_at}}',@endif},
  95. @endforeach
  96. ],
  97. paginate:50,
  98. checkData:[],
  99. sum:{!! $laborReports->total() !!},
  100. },
  101. mounted(){
  102. $("#page").removeClass('d-none');
  103. let data = [
  104. [
  105. {name:'name',type:'input',tip:'用户名:可在两侧添加百分号(%)进行模糊搜索',placeholder:'临时工名称'},
  106. ]
  107. ];
  108. this.form = new query({
  109. el: '#form_div',
  110. condition: data,
  111. });
  112. this.form.init();
  113. },
  114. methods:{
  115. //全选事件
  116. checkAll(e){
  117. if (e.target.checked){
  118. this.laborReports.forEach((el,i)=>{
  119. if (this.checkData.indexOf(el.id) == '-1'){
  120. this.checkData.push(el.id);
  121. }
  122. });
  123. }else {
  124. this.checkData = [];
  125. }
  126. },
  127. recover(){
  128. tempTip.setDuration(3000);
  129. if (this.checkData.length<1){
  130. tempTip.showSuccess('尚未未选择需要恢复单!');
  131. return;
  132. }
  133. let checkData=this.checkData;
  134. let _this=this;
  135. let delArr=[];
  136. if (!confirm('确定要恢复所选内容吗?'))return;
  137. axios.post('{{url('personnel/laborReport/recover')}}',{checkData:checkData})
  138. .then(function (response) {
  139. if (response.data.success){
  140. checkData.forEach(function (data) {
  141. _this.laborReports.every(function (laborReport,i) {
  142. if (data===laborReport.id){
  143. delArr.unshift(i);return false;
  144. }
  145. return true;
  146. });
  147. });
  148. delArr.forEach(function (item) {
  149. _this.$delete(_this.laborReports,item);
  150. });
  151. tempTip.showSuccess('恢复成功!');
  152. return;
  153. }
  154. tempTip.show('恢复失败,未知错误!');
  155. }).catch(function (err) {
  156. tempTip.show('恢复失败,网络错误:'+err);
  157. });
  158. }
  159. },
  160. });
  161. </script>
  162. @stop