|
|
@@ -0,0 +1,268 @@
|
|
|
+
|
|
|
+@extends('layouts.app')
|
|
|
+@section('title')临时工报表@endsection
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ <div id="nav2">
|
|
|
+ @component('personnel.menu')@endcomponent
|
|
|
+ </div>
|
|
|
+ <div class="d-none" id="list">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="">
|
|
|
+ <div>
|
|
|
+ <form method="GET" action="{{url('personnel/laborReport/')}}" id="optionSubmit">
|
|
|
+ <table class="table table-sm table-bordered text-nowrap mb-0">
|
|
|
+ <tr v-if="isBeingFilterConditions">
|
|
|
+ <td colspan="10"><div class="col" style="padding:0">
|
|
|
+ <a href="{{url('personnel/laborReport')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
|
|
|
+ </div></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <span class="text-muted">每页显示记录:</span>
|
|
|
+ </td>
|
|
|
+ <td colspan="9">
|
|
|
+ <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control-sm" style="vertical-align: middle" @change="setPaginate">
|
|
|
+ <option value="50">50行</option>
|
|
|
+ <option value="100">100行</option>
|
|
|
+ <option value="200">200行</option>
|
|
|
+ <option value="500">500行</option>
|
|
|
+ <option value="1000">1000行</option>
|
|
|
+ </select></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td rowspan="2">
|
|
|
+ <span class="text-muted">根据条件过滤:</span>
|
|
|
+ </td>
|
|
|
+ <td >
|
|
|
+ <input style="width: 150px" name="created_at_start" type="date" v-model="filterData.created_at_start" :class="filterData.created_at_start?'bg-warning':''" class="form-control-sm tooltipTarget" title="选择显示指定日期的起始时间">
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="form-control-sm tooltipTarget" placeholder="小组"
|
|
|
+ style="width:70px" @input="owner_seek"
|
|
|
+ title="输入关键词快速定位下拉列表,回车确定">
|
|
|
+ <select name="user_workgroup_id" id="user_workgroup_id" :class="filterData.user_workgroup_id?'bg-warning':''" v-model="filterData.user_workgroup_id" @change="setUserWorkGroup"
|
|
|
+ class="form-control-sm tooltipTarget" title="选择要显示的工作组">
|
|
|
+ @foreach($userWorkGroups as $userWorkGroup)
|
|
|
+ <option value="{{$userWorkGroup->id}}">{{$userWorkGroup->name}}</option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ <input hidden type="submit" >
|
|
|
+ </td>
|
|
|
+
|
|
|
+ <td >
|
|
|
+ <input :class="filterData.enter_number?'bg-warning':''" type="text" title="支持15内模糊搜索与15天外精确搜索" name="enter_number" class="form-control-sm tooltipTarget" v-model="filterData.enter_number" style="vertical-align: middle" placeholder="进厂编号"></td>
|
|
|
+ <td >
|
|
|
+ <input :class="filterData.identity_number?'bg-warning':''" type="text" title="支持15内模糊搜索与15天外精确搜索" name="identity_number" class="form-control-sm tooltipTarget" v-model="filterData.identity_number" style="vertical-align: middle" placeholder="身份证号"></td>
|
|
|
+ <td colspan="5"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <input style="width: 150px" type="date" name="created_at_end" v-model="filterData.created_at_end" :class="filterData.created_at_end?'bg-warning':''" class="form-control-sm tooltipTarget" title="选择显示指定日期的结束时间">
|
|
|
+ </td>
|
|
|
+ <td >
|
|
|
+ <input type="text" title="支持15内模糊搜索与15天外精确搜索" name="mobile_phone" class="form-control-sm tooltipTarget" v-model="filterData.mobile_phone" :class="filterData.mobile_phone?'bg-warning':''" style="vertical-align: middle" placeholder="电话号"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <span class="text-muted">操作选定记录:</span>
|
|
|
+ </td>
|
|
|
+ <td colspan="9">
|
|
|
+ <span class="dropdown">
|
|
|
+ <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData>0?'btn-dark text-light':'']"
|
|
|
+ data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
|
|
|
+ 导出Excel
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu">
|
|
|
+ <a class="dropdown-item" @click="laborReportExport(1)" href="javascript:">导出勾选内容</a>
|
|
|
+ <a class="dropdown-item" @click="laborReportExport(2)" href="javascript:">导出所有页</a>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <input hidden type="submit" >
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div class="">
|
|
|
+ <table class="table table-striped table-sm text-nowrap table-hover">
|
|
|
+ <tr>
|
|
|
+ <th>
|
|
|
+ <label for="all">
|
|
|
+ <input id="all" type="checkbox" @click="checkAll($event)">全选
|
|
|
+ </label>
|
|
|
+ </th>
|
|
|
+ <th>ID</th>
|
|
|
+ <th>创建日期</th>
|
|
|
+ <th class="laborReport_1">进厂编号</th>
|
|
|
+ <th class="laborReport_1">小组</th>
|
|
|
+ <th class="laborReport_1">临时工</th>
|
|
|
+ <th class="laborReport_1">电话</th>
|
|
|
+ <th class="laborReport_1">身份证号</th>
|
|
|
+ <th class="laborReport_1">劳务所</th>
|
|
|
+ <th class="laborReport_2">打卡时间</th>
|
|
|
+ <th class="laborReport_2">审核时间</th>
|
|
|
+ <th class="laborReport_2">审核人</th>
|
|
|
+ <th class="laborReport_2">退场时间</th>
|
|
|
+ <th class="laborReport_2">午饭打卡</th>
|
|
|
+ <th class="laborReport_2">在线时长</th>
|
|
|
+ <th class="laborReport_2">本次工作时长</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(laborReport,i) in laborReports">
|
|
|
+ <td>
|
|
|
+ <input class="checkItem" type="checkbox" :value="laborReport.id" v-model="checkData">
|
|
|
+ </td>
|
|
|
+ <td>@{{ i+1 }}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.created_at}}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.id}}</td>
|
|
|
+ <td>@{{laborReport.enterNumber}}</td>
|
|
|
+ <td>@{{laborReport.userWorkGroupId}}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.name}}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.mobilePhone}}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.identityNumber}}</td>
|
|
|
+ <td>@{{laborReport.laborCompany}}</td>
|
|
|
+ <td>@{{laborReport.checkInAt}}</td>
|
|
|
+ <td>@{{laborReport.verifyAt}}</td>
|
|
|
+ <td> </td>
|
|
|
+ <td class="text-muted">@{{laborReport.checkOutAt}}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.onlineDuration}}</td>
|
|
|
+ <td class="text-muted">@{{laborReport.workingDuration}}</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+@endsection
|
|
|
+
|
|
|
+@section('lastScript')
|
|
|
+ <script>
|
|
|
+ @if(isset($request))
|
|
|
+ let request={!! json_encode($request) !!};
|
|
|
+ @endif
|
|
|
+ new Vue({
|
|
|
+ el:"#list",
|
|
|
+ data:{
|
|
|
+ laborReports:[
|
|
|
+ @foreach($laborReports as $laborReport)
|
|
|
+ {id:'{{$laborReport->id}}',enterNumber:'{{$laborReport->enter_number}}'
|
|
|
+ ,userWorkGroupId:'{{$laborReport->user_workgroup_id}}',userId:'{{$laborReport->user_id}}',name:'{{$laborReport->name}}'
|
|
|
+ ,mobilePhone:'{{$laborReport->mobile_phone}}',identityNumber:'{{$laborReport->identity_number}}',laborCompany:'{{$laborReport->labor_company}}'
|
|
|
+ ,checkInAt:'{{$laborReport->check_in_at}}',
|
|
|
+ verifyAt:'{{$laborReport->verify_at}}', checkOutAt:'{{$laborReport->check_out_at}}',onlineDuration:'{{$laborReport->online_duration}}',
|
|
|
+ workingDuration:'{{$laborReport->working_duration}}', created_at:'{{$laborReport->created_at}}',},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ i:0,
|
|
|
+ userWorkGroups:[
|
|
|
+ @foreach($userWorkGroups as $userWorkGroup)
|
|
|
+ {id:'{{$userWorkGroup->id}}',name:'{{$userWorkGroup->name}}'},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ filterData:
|
|
|
+ {paginate:'50',created_at_start:'',created_at_end:'',enter_number:'',identity_number:'',user_workgroup_id: '',mobile_phone:''},
|
|
|
+ checkData:[]
|
|
|
+ },
|
|
|
+ mounted:function(){
|
|
|
+ this.initInputs();
|
|
|
+ $(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
+ $('#list').removeClass('d-none');
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ checkData:{
|
|
|
+ handler(){
|
|
|
+ if (this.checkData.length === this.laborReports.length){
|
|
|
+ document.querySelector('#all').checked = true;
|
|
|
+ }else {
|
|
|
+ document.querySelector('#all').checked = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ isBeingFilterConditions:function(){
|
|
|
+
|
|
|
+ for(let key in this.filterData){
|
|
|
+ if(this.filterData[key]){
|
|
|
+ if(key==='paginate')continue;
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ initInputs:function(){
|
|
|
+ let data=this;
|
|
|
+ let uriParts =decodeURI(location.href).split("?");
|
|
|
+ if(uriParts.length>1){
|
|
|
+ let params = uriParts[1].split('&');
|
|
|
+ params.forEach(function(paramPair){
|
|
|
+ let pair=paramPair.split('=');
|
|
|
+ let key = pair[0], val = pair[1];
|
|
|
+ $('input[name="'+key+'"]').val(val);
|
|
|
+ $('select[name="'+key+'"]').val(val);
|
|
|
+ decodeURI(data.filterData[key]=val);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setPaginate:function(e){
|
|
|
+ this.filterData.paginate=e.target.value;
|
|
|
+ var form = document.getElementById("optionSubmit");
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ setUserWorkGroup:function (e){
|
|
|
+ this.filterData.user_workgroup_id=e.target.value;
|
|
|
+ var form = document.getElementById("optionSubmit");
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ checkAll(e){
|
|
|
+ if (e.target.checked){
|
|
|
+ this.laborReports.forEach((el,i)=>{
|
|
|
+ if (this.checkData.indexOf(el.id) == '-1'){
|
|
|
+ this.checkData.push(el.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.checkData = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {{--laborReportExport(e){--}}
|
|
|
+ {{-- let val=e;--}}
|
|
|
+ {{-- let data=this.filterData;--}}
|
|
|
+ {{-- if (val==1){--}}
|
|
|
+ {{-- if (this.checkData&&this.checkData.length<=0){--}}
|
|
|
+ {{-- tempTip.setDuration(4000);--}}
|
|
|
+ {{-- tempTip.showSuccess('没有勾选任何记录');--}}
|
|
|
+ {{-- }else{--}}
|
|
|
+ {{-- location.href="{{url('laborReport/export').'/'}}"+this.checkData;--}}
|
|
|
+ {{-- }--}}
|
|
|
+ {{-- } else {--}}
|
|
|
+ {{-- location.href="{{url('laborReport/export/-1?created_at_start=')}}"+--}}
|
|
|
+ {{-- data.created_at_start+"&created_at_end="+data.created_at_end+"&enter_number="+--}}
|
|
|
+ {{-- data.enter_number+"&identity_number="+data.identity_number+"&user_workgroup_id="+data.user_workgroup_id+--}}
|
|
|
+ {{-- "&mobile_phone="+data.mobile_phone;--}}
|
|
|
+ {{-- }--}}
|
|
|
+ {{--},--}}
|
|
|
+ owner_seek:function (e) {
|
|
|
+ let _this=this;
|
|
|
+ let $val=e.target.value;
|
|
|
+ if($val==='')_this.filterData.user_workgroup_id='';
|
|
|
+ else
|
|
|
+ _this.owners.forEach(function (userWorkGroup) {
|
|
|
+ if (userWorkGroup.name.includes($val)){
|
|
|
+ _this.filterData.user_workgroup_id=userWorkGroup.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@endsection
|
|
|
+<style>
|
|
|
+ .laborReport_1{background-color: #FFFF00}
|
|
|
+ .laborReport_2{background-color: #ffffff}
|
|
|
+</style>
|