|
|
@@ -8,192 +8,99 @@
|
|
|
<div class="container-fluid" id="list">
|
|
|
<div class="card col-md visible-on">
|
|
|
<div class="card-body p-0">
|
|
|
- <table class="table table-striped table-bordered text-nowrap" v-if="userDutyCheckNows&&userDutyCheckNows.length>=1">
|
|
|
- <thead class="thead-light" >
|
|
|
- <tr>
|
|
|
- <th class="visible-md">日期</th>
|
|
|
- <td>序号</td>
|
|
|
- <td>姓名</td>
|
|
|
- @can('人事管理-打卡审核')<td>操作</td>@endcan
|
|
|
- <td v-if="workgroupSign">组长审核</td>
|
|
|
- <td >打卡时间</td>
|
|
|
- <td>打卡类型</td>
|
|
|
- <td>手机号</td>
|
|
|
- <td>劳务所</td>
|
|
|
- <td>工作组</td>
|
|
|
- <td>异常</td>
|
|
|
- <td>合计工时</td>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr v-for="(userDutyCheck,i) in userDutyCheckNows">
|
|
|
- <td v-if="userDutyCheck.checked_at" class="text-center font-weight-bold">@{{ userDutyCheck.checked_at.substring(0,10) }}</td>
|
|
|
- <td>@{{ i+1 }}</td>
|
|
|
- <td ><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.full_name }}</span></td>
|
|
|
- @can('人事管理-打卡审核')<td>
|
|
|
- <b v-if="userDutyCheck.verify_user_id" class="text-success">已审核</b>
|
|
|
- <button v-else @click="storeClockAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">审核</button>
|
|
|
- </td>@endcan
|
|
|
- <td v-if="workgroupSign">
|
|
|
- <b v-if="userDutyCheck.group_user_id" class="text-success">已审核</b>
|
|
|
- <button v-else @click="storeGroupAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">组长审核</button>
|
|
|
- </td>
|
|
|
- <td>@{{ userDutyCheck.checked_at.substring(11,16) }}</td>
|
|
|
- <td>
|
|
|
- <div v-if="userDutyCheck.verify_user_id" class="text-center">@{{ userDutyCheck.type }}</div>
|
|
|
- <select v-else v-model="userDutyCheck.type" @change="isException(userDutyCheck.id,userDutyCheck.user_id,userDutyCheck.checked_at,userDutyCheck.type)" class="form-control" style="width: 100px">
|
|
|
- <option value="登入">登入</option>
|
|
|
- <option value="登出">登出</option>
|
|
|
- </select>
|
|
|
- </td>
|
|
|
- <td class="text-muted"><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.mobile_phone }}</span></td>
|
|
|
- <td ><span v-if="userDutyCheck.user_labor">@{{ userDutyCheck.user_labor.labor_company.name }}</span></td>
|
|
|
- <td class="font-weight-bold"><span v-if="userDutyCheck.user_workgroup">
|
|
|
+ <div >
|
|
|
+ <table class="table table-striped table-bordered text-nowrap" v-for="day in date">
|
|
|
+ <thead class="thead-light" >
|
|
|
+ <tr class="text-center">
|
|
|
+ <th v-if="day==0" colspan="11">@{{ day | toDate}}</th>
|
|
|
+ <th v-if="day==-1" colspan="11">@{{ day | toDate}}</th>
|
|
|
+ <th v-if="day==-2" colspan="11">@{{ day | toDate}}</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>序号</td>
|
|
|
+ <td>姓名</td>
|
|
|
+ @can('人事管理-打卡审核')<td>操作</td>@endcan
|
|
|
+ <td v-if="workgroupSign">组长审核</td>
|
|
|
+ <td >打卡时间</td>
|
|
|
+ <td>打卡类型</td>
|
|
|
+ <td>手机号</td>
|
|
|
+ <td>劳务所</td>
|
|
|
+ <td>工作组</td>
|
|
|
+ <td>异常</td>
|
|
|
+ <td>合计工时</td>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="(userDutyCheck,i) in userDutyChecks" v-if="whichDay(userDutyCheck.checked_at)==day">
|
|
|
+ <td>@{{ i+1 }}</td>
|
|
|
+ <td ><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.full_name }}</span></td>
|
|
|
+ @can('人事管理-打卡审核')<td>
|
|
|
+ <b v-if="userDutyCheck.verify_user_id" class="text-success">已审核</b>
|
|
|
+ <button v-else @click="storeClockAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">审核</button>
|
|
|
+ </td>@endcan
|
|
|
+ <td v-if="workgroupSign">
|
|
|
+ <b v-if="userDutyCheck.group_user_id" class="text-success">已审核</b>
|
|
|
+ <button v-else @click="storeGroupAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">组长审核</button>
|
|
|
+ </td>
|
|
|
+ <td>@{{ userDutyCheck.checked_at.substring(11,16) }}</td>
|
|
|
+ <td>
|
|
|
+ <div v-if="userDutyCheck.verify_user_id" class="text-center">@{{ userDutyCheck.type }}</div>
|
|
|
+ <select v-else v-model="userDutyCheck.type" @change="isException(userDutyCheck.id,userDutyCheck.user_id,userDutyCheck.checked_at,userDutyCheck.type)" class="form-control" style="width: 100px">
|
|
|
+ <option value="登入">登入</option>
|
|
|
+ <option value="登出">登出</option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <td class="text-muted"><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.mobile_phone }}</span></td>
|
|
|
+ <td ><span v-if="userDutyCheck.user_labor">@{{ userDutyCheck.user_labor.labor_company.name }}</span></td>
|
|
|
+ <td class="font-weight-bold"><span v-if="userDutyCheck.user_workgroup">
|
|
|
@{{ userDutyCheck.user_workgroup.name }}</span></td>
|
|
|
- <td>@{{ userDutyCheck.exception }}</td>
|
|
|
- <td>@{{ userDutyCheck.duration_man_hour }}</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table class="table table-striped table-bordered text-nowrap" v-if="userDutyCheckYesterdays&&userDutyCheckYesterdays.length>=1">
|
|
|
- <thead class="thead-light" style="color: #17a2b8" >
|
|
|
- <tr>
|
|
|
- <th>日期</th>
|
|
|
- <td>序号</td>
|
|
|
- <td>姓名</td>
|
|
|
- @can('人事管理-打卡审核')<td>操作</td>@endcan
|
|
|
- <td v-if="workgroupSign">组长审核</td>
|
|
|
- <td >打卡时间</td>
|
|
|
- <td>打卡类型</td>
|
|
|
- <td>手机号</td>
|
|
|
- <td>劳务所</td>
|
|
|
- <td>工作组</td>
|
|
|
- <td>异常</td>
|
|
|
- <td>合计工时</td>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr v-for="(userDutyCheck,i) in userDutyCheckYesterdays">
|
|
|
- <td v-if="userDutyCheck.checked_at" class="text-center font-weight-bold">@{{ userDutyCheck.checked_at.substring(0,10) }}</td>
|
|
|
- <td>@{{ i+1 }}</td>
|
|
|
- <td ><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.full_name }}</span></td>
|
|
|
- @can('人事管理-打卡审核')<td>
|
|
|
- <b v-if="userDutyCheck.verify_user_id" class="text-success">已审核</b>
|
|
|
- <button v-else @click="storeClockAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">审核</button>
|
|
|
- </td>@endcan
|
|
|
- <td v-if="workgroupSign">
|
|
|
- <b v-if="userDutyCheck.group_user_id" class="text-success">已审核</b>
|
|
|
- <button v-else @click="storeGroupAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">组长审核</button>
|
|
|
- </td>
|
|
|
- <td>@{{ userDutyCheck.checked_at.substring(11,16) }}</td>
|
|
|
- <td>
|
|
|
- <div v-if="userDutyCheck.verify_user_id" class="text-center">@{{ userDutyCheck.type }}</div>
|
|
|
- <select v-else v-model="userDutyCheck.type" @change="isException(userDutyCheck.id,userDutyCheck.user_id,userDutyCheck.checked_at,userDutyCheck.type)" class="form-control" style="width: 100px">
|
|
|
- <option value="登入">登入</option>
|
|
|
- <option value="登出">登出</option>
|
|
|
- </select>
|
|
|
- </td>
|
|
|
- <td class="text-muted"><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.mobile_phone }}</span></td>
|
|
|
- <td ><span v-if="userDutyCheck.user_labor">@{{ userDutyCheck.user_labor.labor_company.name }}</span></td>
|
|
|
- <td class="font-weight-bold"><span v-if="userDutyCheck.user_workgroup">
|
|
|
- @{{ userDutyCheck.user_workgroup.name }}</span></td>
|
|
|
- <td>@{{ userDutyCheck.exception }}</td>
|
|
|
- <td>@{{ userDutyCheck.duration_man_hour }}</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table class="table table-striped table-bordered text-nowrap" v-if="userDutyCheckBefores&&userDutyCheckBefores.length>=1">
|
|
|
- <thead class="thead-light" style="color:rosybrown">
|
|
|
- <tr >
|
|
|
- <th>日期</th>
|
|
|
- <td>序号</td>
|
|
|
- <td>姓名</td>
|
|
|
- @can('人事管理-打卡审核')<td>操作</td>@endcan
|
|
|
- <td v-if="workgroupSign">组长审核</td>
|
|
|
- <td >打卡时间</td>
|
|
|
- <td>打卡类型</td>
|
|
|
- <td>手机号</td>
|
|
|
- <td>劳务所</td>
|
|
|
- <td>工作组</td>
|
|
|
- <td>异常</td>
|
|
|
- <td>合计工时</td>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr v-for="(userDutyCheck,i) in userDutyCheckBefores">
|
|
|
- <td v-if="userDutyCheck.checked_at" class="text-center font-weight-bold">@{{ userDutyCheck.checked_at.substring(0,10) }}</td>
|
|
|
- <td>@{{ i+1 }}</td>
|
|
|
- <td ><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.full_name }}</span></td>
|
|
|
- @can('人事管理-打卡审核')<td>
|
|
|
- <b v-if="userDutyCheck.verify_user_id" class="text-success">已审核</b>
|
|
|
- <button v-else @click="storeClockAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">审核</button>
|
|
|
- </td>@endcan
|
|
|
- <td v-if="workgroupSign">
|
|
|
- <b v-if="userDutyCheck.group_user_id" class="text-success">已审核</b>
|
|
|
- <button v-else @click="storeGroupAudit(userDutyCheck.id,userDutyCheck.type)" class="btn btn-primary w-80">组长审核</button>
|
|
|
- </td>
|
|
|
- <td>@{{ userDutyCheck.checked_at.substring(11,16) }}</td>
|
|
|
- <td>
|
|
|
- <div v-if="userDutyCheck.verify_user_id" class="text-center">@{{ userDutyCheck.type }}</div>
|
|
|
- <select v-else v-model="userDutyCheck.type" @change="isException(userDutyCheck.id,userDutyCheck.user_id,userDutyCheck.checked_at,userDutyCheck.type)" class="form-control" style="width: 100px">
|
|
|
- <option value="登入">登入</option>
|
|
|
- <option value="登出">登出</option>
|
|
|
- </select>
|
|
|
- </td>
|
|
|
- <td class="text-muted"><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.mobile_phone }}</span></td>
|
|
|
- <td ><span v-if="userDutyCheck.user_labor">@{{ userDutyCheck.user_labor.labor_company.name }}</span></td>
|
|
|
- <td class="font-weight-bold"><span v-if="userDutyCheck.user_workgroup">
|
|
|
- @{{ userDutyCheck.user_workgroup.name }}</span></td>
|
|
|
- <td>@{{ userDutyCheck.exception }}</td>
|
|
|
- <td>@{{ userDutyCheck.duration_man_hour }}</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ <td>@{{ userDutyCheck.exception }}</td>
|
|
|
+ <td>@{{ userDutyCheck.duration_man_hour }}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
@endsection
|
|
|
|
|
|
@section('lastScript')
|
|
|
<script>
|
|
|
+
|
|
|
new Vue({
|
|
|
el:"#list",
|
|
|
data:{
|
|
|
- userDutyCheckYesterdays:[
|
|
|
- @foreach($userDutyCheckYesterdays as $userDutyCheck)
|
|
|
- {id:'{{$userDutyCheck->id}}',user_id:'{{$userDutyCheck->user_id}}',
|
|
|
- checked_at:'{{$userDutyCheck->checked_at}}',
|
|
|
- type:'{{$userDutyCheck->type}}',verify_user_id:'{{$userDutyCheck->verify_user_id}}',group_user_id:'{{$userDutyCheck->group_user_id}}',
|
|
|
- exception:'',duration_man_hour:'',@if($userDutyCheck->userWorkgroup)user_workgroup:{!! $userDutyCheck->userWorkgroup !!} @endif,
|
|
|
- @if($userDutyCheck->userDetail)user_detail:{!! $userDutyCheck->userDetail !!} @endif,
|
|
|
- @if($userDutyCheck->userLabor)user_labor:{!! $userDutyCheck->userLabor !!} @endif},
|
|
|
- @endforeach
|
|
|
- ],
|
|
|
- userDutyCheckNows:[
|
|
|
- @foreach($userDutyCheckNows as $userDutyCheck)
|
|
|
- {id:'{{$userDutyCheck->id}}',user_id:'{{$userDutyCheck->user_id}}',
|
|
|
- checked_at:'{{$userDutyCheck->checked_at}}',
|
|
|
- type:'{{$userDutyCheck->type}}',verify_user_id:'{{$userDutyCheck->verify_user_id}}',group_user_id:'{{$userDutyCheck->group_user_id}}',
|
|
|
- exception:'',duration_man_hour:'',@if($userDutyCheck->userWorkgroup)user_workgroup:{!! $userDutyCheck->userWorkgroup !!} @endif,
|
|
|
- @if($userDutyCheck->userDetail)user_detail:{!! $userDutyCheck->userDetail !!} @endif,
|
|
|
- @if($userDutyCheck->userLabor)user_labor:{!! $userDutyCheck->userLabor !!} @endif},
|
|
|
- @endforeach
|
|
|
- ],
|
|
|
- userDutyCheckBefores:[
|
|
|
- @foreach($userDutyCheckBefores as $userDutyCheck)
|
|
|
+ date:[0,-1,-2],
|
|
|
+ dateStr:'',
|
|
|
+ userDutyChecks:[
|
|
|
+ @foreach($userDutyChecks as $userDutyCheck)
|
|
|
{id:'{{$userDutyCheck->id}}',user_id:'{{$userDutyCheck->user_id}}',
|
|
|
checked_at:'{{$userDutyCheck->checked_at}}',
|
|
|
type:'{{$userDutyCheck->type}}',verify_user_id:'{{$userDutyCheck->verify_user_id}}',group_user_id:'{{$userDutyCheck->group_user_id}}',
|
|
|
- exception:'',duration_man_hour:'',@if($userDutyCheck->userWorkgroup)user_workgroup:{!! $userDutyCheck->userWorkgroup !!} @endif,
|
|
|
- @if($userDutyCheck->userDetail)user_detail:{!! $userDutyCheck->userDetail !!} @endif,
|
|
|
- @if($userDutyCheck->userLabor)user_labor:{!! $userDutyCheck->userLabor !!} @endif},
|
|
|
+ exception:'',duration_man_hour:'',@if($userDutyCheck->userWorkgroup)user_workgroup:{!! $userDutyCheck->userWorkgroup !!}, @endif
|
|
|
+ @if($userDutyCheck->userDetail)user_detail:{!! $userDutyCheck->userDetail !!}, @endif
|
|
|
+ @if($userDutyCheck->userLabor)user_labor:{!! $userDutyCheck->userLabor !!}, @endif},
|
|
|
@endforeach
|
|
|
],
|
|
|
workgroupSign:'{{$workgroupSign}}',
|
|
|
},
|
|
|
methods:{
|
|
|
+ whichDay(dateStr){
|
|
|
+ let nowDate=new Date();
|
|
|
+ let targetDate=new Date(dateStr);
|
|
|
+ if(nowDate.getMonth()!=targetDate.getMonth()){
|
|
|
+ if (new Date(targetDate.setDate(targetDate.getDate()+1))==nowDate){
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ if (new Date(targetDate.setDate(targetDate.getDate()+2))==nowDate){
|
|
|
+ return -2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let diffOfDays=targetDate.getDate()-nowDate.getDate();
|
|
|
+ return diffOfDays;
|
|
|
+ },
|
|
|
store(id,type,url){
|
|
|
|
|
|
},
|
|
|
@@ -207,25 +114,7 @@
|
|
|
tempTip.show(response.data.data);
|
|
|
return;
|
|
|
}
|
|
|
- _this.userDutyCheckNows.every(function (userDutyCheck) {
|
|
|
- if (userDutyCheck.id==id){
|
|
|
- userDutyCheck.verify_user_id=response.data.data;
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.showSuccess('审核通过!');
|
|
|
- return false
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- _this.userDutyCheckBefores.every(function (userDutyCheck) {
|
|
|
- if (userDutyCheck.id==id){
|
|
|
- userDutyCheck.verify_user_id=response.data.data;
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.showSuccess('审核通过!');
|
|
|
- return false
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- _this.userDutyCheckYesterdays.every(function (userDutyCheck) {
|
|
|
+ _this.userDutyChecks.every(function (userDutyCheck) {
|
|
|
if (userDutyCheck.id==id){
|
|
|
userDutyCheck.verify_user_id=response.data.data;
|
|
|
tempTip.setDuration(3000);
|
|
|
@@ -249,25 +138,7 @@
|
|
|
tempTip.show(response.data.data);
|
|
|
return;
|
|
|
}
|
|
|
- _this.userDutyCheckNows.every(function (userDutyCheck) {
|
|
|
- if (userDutyCheck.id==id){
|
|
|
- userDutyCheck.group_user_id=response.data.data;
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.showSuccess('审核通过!');
|
|
|
- return false
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- _this.userDutyCheckBefores.every(function (userDutyCheck) {
|
|
|
- if (userDutyCheck.id==id){
|
|
|
- userDutyCheck.group_user_id=response.data.data;
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.showSuccess('审核通过!');
|
|
|
- return false
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- _this.userDutyCheckYesterdays.every(function (userDutyCheck) {
|
|
|
+ _this.userDutyChecks.every(function (userDutyCheck) {
|
|
|
if (userDutyCheck.id==id){
|
|
|
userDutyCheck.group_user_id=response.data.data;
|
|
|
tempTip.setDuration(3000);
|
|
|
@@ -285,23 +156,7 @@
|
|
|
let _this=this;
|
|
|
axios.post('{{url("personnel/checking-in/isException")}}',{id:id,user_id:user_id,checked_at:checked_at,type:type})
|
|
|
.then(function (response) {
|
|
|
- _this.userDutyCheckYesterdays.every(function (userDutyCheck) {
|
|
|
- if (userDutyCheck.id==id){
|
|
|
- userDutyCheck.exception=response.data.exception;
|
|
|
- userDutyCheck.duration_man_hour=response.data.duration_man_hour;
|
|
|
- return false
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- _this.userDutyCheckBefores.every(function (userDutyCheck) {
|
|
|
- if (userDutyCheck.id==id){
|
|
|
- userDutyCheck.exception=response.data.exception;
|
|
|
- userDutyCheck.duration_man_hour=response.data.duration_man_hour;
|
|
|
- return false
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- _this.userDutyCheckNows.every(function (userDutyCheck) {
|
|
|
+ _this.userDutyChecks.every(function (userDutyCheck) {
|
|
|
if (userDutyCheck.id==id){
|
|
|
userDutyCheck.exception=response.data.exception;
|
|
|
userDutyCheck.duration_man_hour=response.data.duration_man_hour;
|
|
|
@@ -315,6 +170,16 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ filters:{
|
|
|
+ toDate:function(val){
|
|
|
+ let dd = new Date();
|
|
|
+ dd.setDate(dd.getDate()+val);//获取AddDayCount天后的日期
|
|
|
+ let y = dd.getFullYear();
|
|
|
+ let m = dd.getMonth()+1;//获取当前月份的日期
|
|
|
+ let d = dd.getDate();
|
|
|
+ return y+'-'+(m<10?'0'+m:m)+'-'+d;
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
@endsection
|