Explorar o código

人事功能修改

haozi %!s(int64=5) %!d(string=hai) anos
pai
achega
032b33965b

+ 16 - 2
app/Http/Controllers/PersonnelController.php

@@ -90,8 +90,20 @@ class PersonnelController extends Controller
         $checkInDate=Carbon::parse($userDutyCheck->checked_at)->format('Y-m-d');
         $laborReport=LaborReport::where('user_id',$userDutyCheck->user_id)->where('user_workgroup_id',$workgroup->id)->where('created_at','like',$checkInDate."%")->first();
         if (!$laborReport){
-            LaborReport::createLaborReportData($userDutyCheck->user_id,$userDutyCheck->workgroup_id,$userDutyCheck);
+            $laborReportNew=LaborReport::createLaborReportData($userDutyCheck->user_id,$userDutyCheck->workgroup_id,$userDutyCheck);
             $this->log(__METHOD__,"提交临时工报表记录__".__FUNCTION__,json_encode([$userDutyCheck->user_id,$userDutyCheck->workgroup_id,$userDutyCheck]));
+            //验证五分钟之内重新换组情况
+            $checkInDateNow=Carbon::parse($laborReportNew->created_at)->format('Y-m-d H');
+            $laborReports=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$checkInDateNow."%")->orderBy('created_at','DESC')->limit(2)->get();
+            if (count($laborReports)>1){
+                $laborReportLast=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$checkInDateNow."%")->orderBy('created_at','ASC')->limit(2)->first();
+                $lastDate=Carbon::parse($laborReportLast->created_at);
+                $thisDate=Carbon::parse($laborReportNew->created_at);
+                $diffDate=$thisDate->diffInMinutes($lastDate);
+                if ($diffDate<=5){
+                    $laborReportLast->delete();
+                }
+            }
         }else if ($laborReport){
             LaborReport::updateLaborReportVerify($laborReport,$userDutyCheck);
             $this->log(__METHOD__,"打卡组长审核".__FUNCTION__,json_encode($userDutyCheck),Auth::user()['id']);
@@ -157,7 +169,8 @@ class PersonnelController extends Controller
         $dateNow=Carbon::now()->addDays(1)->format('Y-m-d');
         $beforeYesterdayDate=Carbon::now()->addDays(-2)->format('Y-m-d');
         $userDutyChecks=UserDutyCheck::with(['userWorkgroup','userLabor.laborCompany','userDetail'])->whereIn("user_id",$user_ids)
-            ->whereBetween('checked_at',[$beforeYesterdayDate,$dateNow])->where('type','登入')->orderBy('checked_at','DESC')->get();
+            ->whereBetween('checked_at',[$beforeYesterdayDate,$dateNow])->orderBy('checked_at','DESC')->get();
+//        where('type','登入')->
         $laravelEchoPrefix = config('database.redis.options.prefix');
         return view('personnel/checking-in/clockAudit',['userDutyChecks'=>$userDutyChecks,'laravelEchoPrefix'=>$laravelEchoPrefix,'workgroupSign'=>$result['workgroupSign']]);
     }
@@ -178,6 +191,7 @@ class PersonnelController extends Controller
             'source'=>'补入',
             'workgroup_id'=>$userWorkgroupID
         ]);
+        if ($type=='登出')$userDutyCheck->verify_user_id=0;
         $userDutyCheck->save();
         if ($userDutyCheck&&$userDutyCheck->type=='登入'){
             event(new ClockinEvent($userDutyCheck));

+ 10 - 20
app/Http/Controllers/UserDutyCheckController.php

@@ -46,10 +46,6 @@ class UserDutyCheckController extends Controller
             }
             //正常情况
             $laborReport=LaborReport::where('user_workgroup_id',$userWorkgroupID)->where('created_at','like',Carbon::now()->format('Y-m-d')."%")->where('user_id',$userDetail->user_id)->first();
-//            if(!isset($laborReport)&&$userDutyCheck->type=='登入'){
-//                LaborReport::createLaborReportData($userDetail->user_id,$userWorkgroupID,$userDutyCheck);
-//                $this->log(__METHOD__,"提交临时工报表记录__".__FUNCTION__,json_encode($laborReport));
-//            }else
             if ($laborReport&&$userDutyCheck->type=='登出'){
                 LaborReport::updateLaborReportData($laborReport,$userDutyCheck);
                 $this->log(__METHOD__,"更新临时工报表记录__".__FUNCTION__,json_encode($laborReport));
@@ -91,10 +87,6 @@ class UserDutyCheckController extends Controller
         }
         //正常情况
         $laborReport=LaborReport::where('user_workgroup_id',$userWorkgroupID)->where('created_at','like',$dateNow."%")->where('user_id',$userDetail->user_id)->first();
-//        if(!$laborReport&&$userDutyCheck->type=='登入'){
-//            LaborReport::createLaborReportData($userDetail->user_id,$userWorkgroupID,$userDutyCheck);
-//            $this->log(__METHOD__,"提交临时工报表记录__".__FUNCTION__,json_encode([$userDetail->user_id,$userWorkgroupID,$userDutyCheck]));
-//        }else
             if ($laborReport&&$userDutyCheck->type=='登出'){
             LaborReport::updateLaborReportData($laborReport,$userDutyCheck);
             $this->log(__METHOD__,"更新临时工报表记录__".__FUNCTION__,json_encode([$laborReport,$userDutyCheck]));
@@ -136,9 +128,6 @@ class UserDutyCheckController extends Controller
         if ($userDutyCheck&&$userDutyCheck->type=='登入'){
             event(new ClockinEvent($userDutyCheck));
         }
-//        //添加临时工报表数据
-//        LaborReport::createLaborReportData($userDetail->user_id,$userWorkgroupID,$userDutyCheck);
-//        $this->log(__METHOD__,"提交临时工报表记录__".__FUNCTION__,json_encode([$userDetail->user_id,$userWorkgroupID,$userDutyCheck]));
         if ($userDutyCheck&&$userDutyCheck->error==true)return "<h1 style='color: darkred;text-align:center'>重复打卡!</h1>";
         if (!$userDutyCheck)return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
         $user=User::find($userDetail->user_id);
@@ -180,13 +169,10 @@ class UserDutyCheckController extends Controller
         if ($userDutyCheck&&$userDutyCheck->type=='登入'){
             event(new ClockinEvent($userDutyCheck));
         }
-//        LaborReport::createLaborReportData($user->id,$userWorkgroupID,$userDutyCheck);
-//        $this->log(__METHOD__,"提交临时工报表记录__".__FUNCTION__,json_encode([$user->id,$userWorkgroupID,$userDutyCheck]));
         if ($userDutyCheck&&$userDutyCheck->error==true)return "<h1 style='color: darkred;text-align:center'>重复打卡!</h1>";
         if (!$userDutyCheck)return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
         $userLaborToken=$user->token(config('users.token_check_in_expire_minutes'));
         $this->log(__METHOD__,"录入临时工,用户,对应工作组,打卡记录".__FUNCTION__,json_encode($request->all()));
-//        $group_name=$userDetail->user->userWorkgroups->first()['name'];
         $group_name=$userDutyCheck->userWorkgroup->first()['name'];
         $laravelEchoPrefix = config('database.redis.options.prefix');
         return response()->view('personnel/checking-in/success',['group_name'=>$group_name??'','full_name'=>$userDetail->full_name,'checked_at'=>$userDutyCheck->checked_at,'type'=>$userDutyCheck->type,'laravelEchoPrefix'=>$laravelEchoPrefix])
@@ -217,12 +203,12 @@ class UserDutyCheckController extends Controller
         $lastDate=Carbon::parse($userDutyCheckOld->checked_at);
         $thisDate=Carbon::parse($date);
         $diffDate=$thisDate->diffInMinutes($lastDate);
-        if ($userDutyCheckOld->type=="登出"&&$diffDate<7*1440){
-            $userDutyCheck->type="登入";
-            $userDutyCheck->verify_user_id=0;
-            $userDutyCheck->save();
-            return $userDutyCheck;
-        }
+//        if ($userDutyCheckOld->type=="登出"&&$diffDate<7*1440){
+//            $userDutyCheck->type="登入";
+//            $userDutyCheck->verify_user_id=0;
+//            $userDutyCheck->save();
+//            return $userDutyCheck;
+//        }
         if($diffDate<=5){
             $userDutyCheck->error=true;//重复打卡
             if($userWorkgroupID!=$userDutyCheckOld['workgroup_id']&&$userDutyCheckOld->type=='登入'){
@@ -230,7 +216,9 @@ class UserDutyCheckController extends Controller
                     $userDutyCheck->error=false;
                 }
                 $userDutyCheckOld->checked_at=$date;
+                $userDutyCheckOld->verify_user_id=null;
                 $userDutyCheckOld->workgroup_id=$userWorkgroupID;
+                $userDutyCheckOld->group_user_id=null;
                 $userDutyCheckOld->update();
                 return $userDutyCheckOld;
             }
@@ -246,12 +234,14 @@ class UserDutyCheckController extends Controller
                     break;
                 default:
                     $userDutyCheck->type="登出";
+                    $userDutyCheck->verify_user_id=0;
             }
         }
         if ($userDutyCheckOld->type=="登出"){
             switch ($diffDate){
                 case $diffDate<=20:
                     $userDutyCheck->type="登出";
+                    $userDutyCheck->verify_user_id=0;
                     break;
                 default:
                     $userDutyCheck->type="登入";

+ 3 - 1
app/Http/Controllers/UserLaborController.php

@@ -43,7 +43,9 @@ class UserLaborController extends Controller
         if (!$user_id) return ['error'=>'传递空值!'];
         $token=Cache::pull('tokenUser_'.$user_id);
         if ($token)Cache::pull('tokenStr_'.$token);
-        return ['success'=>true];
+        $userLabor=UserLabor::find($user_id);
+        $userLabor->is_relieve_facility=$userLabor->getIsRelieveFacilityAttribute();
+        return ['success'=>true,'userLabor'=>$userLabor];
     }
 
     /**

+ 3 - 3
app/LaborReport.php

@@ -53,13 +53,13 @@ class LaborReport extends Model
         $enter_number=$userWorkgroupID.date ("ymd").str_pad($number_id>99999?$number_id%99999:$number_id,4,"0",STR_PAD_LEFT);
         $laborReport->enter_number=$enter_number;
         $laborReport->update();
-        return;
+        return $laborReport;
     }
     //修改临时工报表数据
     static function updateLaborReportData($laborReport,$userDutyCheck){
             //正常打卡情况
             if($userDutyCheck->type=='登出'){
-//                $laborReport->check_out_at=$userDutyCheck->checked_at;
+                $laborReport->check_out_at=$userDutyCheck->checked_at;
                 $checkInDate=Carbon::parse($laborReport['check_in_at']);
                 $checkOutDate=Carbon::parse($userDutyCheck->checked_at);
                 $hour=($checkOutDate->diffInSeconds($checkInDate))/3600; //在线时长
@@ -86,7 +86,7 @@ class LaborReport extends Model
             $laborReport->update();
         }
         if ($userDutyCheck->type=='登出'&&$userDutyCheckOld->checked_at<$userDutyCheck->checked_at){
-//            $laborReport->check_out_at=$userDutyCheck->checked_at;
+            $laborReport->check_out_at=$userDutyCheck->checked_at;
             $checkInDate=Carbon::parse($laborReport['check_in_at']);
             $checkOutDate=Carbon::parse($userDutyCheck->checked_at);
             $hour=($checkOutDate->diffInSeconds($checkInDate))/3600; //在线时长

+ 12 - 0
app/UserLabor.php

@@ -4,6 +4,7 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
+use Illuminate\Support\Facades\Cache;
 
 class UserLabor extends Model
 {
@@ -15,6 +16,9 @@ class UserLabor extends Model
     protected $fillable=[
         'user_id','default_hour_price','labor_company_id'
     ];
+    protected $appends = [
+        'is_relieve_facility',
+    ];
 
     public function userDetail(){
         return $this->belongsTo('App\UserDetail','user_id','user_id');
@@ -22,5 +26,13 @@ class UserLabor extends Model
     public  function laborCompany(){
         return $this->belongsTo('App\LaborCompany');
     }
+    public function getIsRelieveFacilityAttribute(){
+        $user_id=$this['user_id'];
+        $token=Cache::get('tokenUser_'.$user_id);
+        if (Cache::has('tokenStr_'.$token)){
+            return true;
+        }
+        return false;
+    }
 
 }

+ 135 - 82
composer.lock

@@ -789,16 +789,16 @@
         },
         {
             "name": "endroid/qr-code",
-            "version": "3.8.1",
+            "version": "3.8.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/endroid/qr-code.git",
-                "reference": "a7e07d26fad46d7032b39a076f6c85e07757028d"
+                "reference": "1616778c697238b16e1b7592ea824bafcf7d108c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/endroid/qr-code/zipball/a7e07d26fad46d7032b39a076f6c85e07757028d",
-                "reference": "a7e07d26fad46d7032b39a076f6c85e07757028d",
+                "url": "https://api.github.com/repos/endroid/qr-code/zipball/1616778c697238b16e1b7592ea824bafcf7d108c",
+                "reference": "1616778c697238b16e1b7592ea824bafcf7d108c",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -860,7 +860,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2020-06-02T20:10:27+00:00"
+            "time": "2020-06-19T08:57:37+00:00"
         },
         {
             "name": "facade/flare-client-php",
@@ -1051,16 +1051,16 @@
         },
         {
             "name": "fideloper/proxy",
-            "version": "4.3.0",
+            "version": "4.4.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/fideloper/TrustedProxy.git",
-                "reference": "ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a"
+                "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a",
-                "reference": "ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a",
+                "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8",
+                "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1107,7 +1107,7 @@
                 "proxy",
                 "trusted proxy"
             ],
-            "time": "2020-02-22T01:51:47+00:00"
+            "time": "2020-06-23T01:36:47+00:00"
         },
         {
             "name": "filp/whoops",
@@ -1569,16 +1569,16 @@
         },
         {
             "name": "laravel/framework",
-            "version": "v7.16.1",
+            "version": "v7.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/framework.git",
-                "reference": "dc9cd8338d222dec2d9962553639e08c4585fa5b"
+                "reference": "6633c4017b311d3aaae842edabd567c637afc39c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/laravel/framework/zipball/dc9cd8338d222dec2d9962553639e08c4585fa5b",
-                "reference": "dc9cd8338d222dec2d9962553639e08c4585fa5b",
+                "url": "https://api.github.com/repos/laravel/framework/zipball/6633c4017b311d3aaae842edabd567c637afc39c",
+                "reference": "6633c4017b311d3aaae842edabd567c637afc39c",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1728,7 +1728,7 @@
                 "framework",
                 "laravel"
             ],
-            "time": "2020-06-16T14:31:25+00:00"
+            "time": "2020-06-23T15:22:07+00:00"
         },
         {
             "name": "laravel/tinker",
@@ -1863,16 +1863,16 @@
         },
         {
             "name": "league/commonmark",
-            "version": "1.4.3",
+            "version": "1.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/thephpleague/commonmark.git",
-                "reference": "412639f7cfbc0b31ad2455b2fe965095f66ae505"
+                "reference": "fc33ca12575e98e57cdce7d5f38b2ca5335714b3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/412639f7cfbc0b31ad2455b2fe965095f66ae505",
-                "reference": "412639f7cfbc0b31ad2455b2fe965095f66ae505",
+                "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/fc33ca12575e98e57cdce7d5f38b2ca5335714b3",
+                "reference": "fc33ca12575e98e57cdce7d5f38b2ca5335714b3",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1883,7 +1883,7 @@
             },
             "require": {
                 "ext-mbstring": "*",
-                "php": "^7.1"
+                "php": "^7.1 || ^8.0"
             },
             "conflict": {
                 "scrutinizer/ocular": "1.7.*"
@@ -1905,11 +1905,6 @@
                 "bin/commonmark"
             ],
             "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.4-dev"
-                }
-            },
             "autoload": {
                 "psr-4": {
                     "League\\CommonMark\\": "src"
@@ -1939,7 +1934,33 @@
                 "md",
                 "parser"
             ],
-            "time": "2020-05-04T22:15:21+00:00"
+            "funding": [
+                {
+                    "url": "https://enjoy.gitstore.app/repositories/thephpleague/commonmark",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://www.colinodell.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://www.paypal.me/colinpodell/10.00",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/colinodell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/colinodell",
+                    "type": "patreon"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/league/commonmark",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-06-21T20:50:13+00:00"
         },
         {
             "name": "league/flysystem",
@@ -4963,16 +4984,16 @@
         },
         {
             "name": "symfony/polyfill-ctype",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-ctype.git",
-                "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9"
+                "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
-                "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d",
+                "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -4991,6 +5012,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5037,20 +5062,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:14:59+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/polyfill-iconv",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-iconv.git",
-                "reference": "c4de7601eefbf25f9d47190abe07f79fe0a27424"
+                "reference": "ba6c9c18db36235b859cc29b8372d1c01298c035"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/c4de7601eefbf25f9d47190abe07f79fe0a27424",
-                "reference": "c4de7601eefbf25f9d47190abe07f79fe0a27424",
+                "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/ba6c9c18db36235b859cc29b8372d1c01298c035",
+                "reference": "ba6c9c18db36235b859cc29b8372d1c01298c035",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5069,6 +5094,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5116,20 +5145,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:47:27+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/polyfill-intl-grapheme",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
-                "reference": "e094b0770f7833fdf257e6ba4775be4e258230b2"
+                "reference": "6e4dbcf5e81eba86e36731f94fe56b1726835846"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e094b0770f7833fdf257e6ba4775be4e258230b2",
-                "reference": "e094b0770f7833fdf257e6ba4775be4e258230b2",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/6e4dbcf5e81eba86e36731f94fe56b1726835846",
+                "reference": "6e4dbcf5e81eba86e36731f94fe56b1726835846",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5148,6 +5177,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5196,20 +5229,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:47:27+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/polyfill-intl-idn",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-intl-idn.git",
-                "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a"
+                "reference": "a57f8161502549a742a63c09f0a604997bf47027"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a",
-                "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a57f8161502549a742a63c09f0a604997bf47027",
+                "reference": "a57f8161502549a742a63c09f0a604997bf47027",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5230,6 +5263,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5278,20 +5315,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:47:27+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/polyfill-intl-normalizer",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
-                "reference": "1357b1d168eb7f68ad6a134838e46b0b159444a9"
+                "reference": "40309d1700e8f72447bb9e7b54af756eeea35620"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/1357b1d168eb7f68ad6a134838e46b0b159444a9",
-                "reference": "1357b1d168eb7f68ad6a134838e46b0b159444a9",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/40309d1700e8f72447bb9e7b54af756eeea35620",
+                "reference": "40309d1700e8f72447bb9e7b54af756eeea35620",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5310,6 +5347,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5361,20 +5402,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:14:59+00:00"
+            "time": "2020-06-14T14:40:37+00:00"
         },
         {
             "name": "symfony/polyfill-mbstring",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
-                "reference": "fa79b11539418b02fc5e1897267673ba2c19419c"
+                "reference": "7110338d81ce1cbc3e273136e4574663627037a7"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c",
-                "reference": "fa79b11539418b02fc5e1897267673ba2c19419c",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7",
+                "reference": "7110338d81ce1cbc3e273136e4574663627037a7",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5393,6 +5434,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5440,7 +5485,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:47:27+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/polyfill-php72",
@@ -5519,16 +5564,16 @@
         },
         {
             "name": "symfony/polyfill-php73",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-php73.git",
-                "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc"
+                "reference": "fa0837fe02d617d31fbb25f990655861bb27bd1a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc",
-                "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc",
+                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fa0837fe02d617d31fbb25f990655861bb27bd1a",
+                "reference": "fa0837fe02d617d31fbb25f990655861bb27bd1a",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5544,6 +5589,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5593,20 +5642,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:47:27+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/polyfill-php80",
-            "version": "v1.17.0",
+            "version": "v1.17.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-php80.git",
-                "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd"
+                "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd",
-                "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4a5b6bba3259902e386eb80dd1956181ee90b5b2",
+                "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5622,6 +5671,10 @@
             "extra": {
                 "branch-alias": {
                     "dev-master": "1.17-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
                 }
             },
             "autoload": {
@@ -5675,7 +5728,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-12T16:47:27+00:00"
+            "time": "2020-06-06T08:46:27+00:00"
         },
         {
             "name": "symfony/process",
@@ -6473,16 +6526,16 @@
         },
         {
             "name": "te7a-houdini/laravel-trix",
-            "version": "2.0.1",
+            "version": "2.0.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Te7a-Houdini/laravel-trix.git",
-                "reference": "495c4637eafc549a3933f9d9d11f4703e9b75967"
+                "reference": "cba876b2b0ed5ceaa1e2fba73ac1a4240eef9900"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Te7a-Houdini/laravel-trix/zipball/495c4637eafc549a3933f9d9d11f4703e9b75967",
-                "reference": "495c4637eafc549a3933f9d9d11f4703e9b75967",
+                "url": "https://api.github.com/repos/Te7a-Houdini/laravel-trix/zipball/cba876b2b0ed5ceaa1e2fba73ac1a4240eef9900",
+                "reference": "cba876b2b0ed5ceaa1e2fba73ac1a4240eef9900",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -6528,7 +6581,7 @@
                 "laravel-trix",
                 "te7a-houdini"
             ],
-            "time": "2020-03-06T15:33:35+00:00"
+            "time": "2020-06-04T12:31:59+00:00"
         },
         {
             "name": "tightenco/collect",
@@ -7738,16 +7791,16 @@
         },
         {
             "name": "phpdocumentor/type-resolver",
-            "version": "1.1.0",
+            "version": "1.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpDocumentor/TypeResolver.git",
-                "reference": "7462d5f123dfc080dfdf26897032a6513644fc95"
+                "reference": "30441f2752e493c639526b215ed81d54f369d693"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95",
-                "reference": "7462d5f123dfc080dfdf26897032a6513644fc95",
+                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30441f2752e493c639526b215ed81d54f369d693",
+                "reference": "30441f2752e493c639526b215ed81d54f369d693",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -7767,7 +7820,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.x-dev"
+                    "dev-1.x": "1.x-dev"
                 }
             },
             "autoload": {
@@ -7786,7 +7839,7 @@
                 }
             ],
             "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
-            "time": "2020-02-18T18:59:58+00:00"
+            "time": "2020-06-19T20:22:09+00:00"
         },
         {
             "name": "phpspec/prophecy",
@@ -8141,16 +8194,16 @@
         },
         {
             "name": "phpunit/phpunit",
-            "version": "8.5.6",
+            "version": "8.5.8",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "3f9c4079d1407cd84c51c02c6ad1df6ec2ed1348"
+                "reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3f9c4079d1407cd84c51c02c6ad1df6ec2ed1348",
-                "reference": "3f9c4079d1407cd84c51c02c6ad1df6ec2ed1348",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/34c18baa6a44f1d1fbf0338907139e9dce95b997",
+                "reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -8236,7 +8289,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2020-06-15T10:45:47+00:00"
+            "time": "2020-06-22T07:06:58+00:00"
         },
         {
             "name": "sebastian/code-unit-reverse-lookup",

BIN=BIN
public/images/QRCodeIMG/10.png


BIN=BIN
public/images/QRCodeIMG/4.png


BIN=BIN
public/images/QRCodeIMG/5.png


+ 15 - 2
resources/views/maintenance/userLabor/index.blade.php

@@ -102,7 +102,9 @@
                     </td>
                     <td>
                         @can('临时工')
-                            <button class="btn btn-sm btn-outline-warning" @click="relieve(userLabor.user_id,userLabor.user_detail.full_name)">解</button>
+                            <span v-if="userLabor.is_relieve_facility">
+                            <button class="btn btn-sm btn-outline-secondary" @click="relieve(userLabor.user_id,userLabor.user_detail.full_name)">解</button>
+                            </span>
                         @endcan
                     </td>
                 </tr>
@@ -119,7 +121,10 @@
             data:{
                 userLabors:[
                     @foreach( $userLabors as $userLabor )
-                    {!! $userLabor !!},
+{{--                    {!! $userLabor !!},--}}
+                    {user_id:'{{$userLabor->user_id}}',@if($userLabor->userDetail)user_detail:{!! $userLabor->userDetail !!}, @endif
+                        is_relieve_facility:'{{$userLabor->is_relieve_facility}}',
+                    },
                     @endforeach
                 ],
                 processDailyParticipants:[],
@@ -192,6 +197,7 @@
                         });
                 },
                 relieve(user_id,full_name){
+                    let _this=this;
                     axios.post('{{url('maintenance/userLabor/relieve')}}',{user_id:user_id})
                         .then((response)=>{
                             if (response.data.error){
@@ -200,6 +206,13 @@
                                 return;
                             }
                             if (response.data.success){
+                                _this.userLabors.every(function (userLabor) {
+                                      if (userLabor.user_id==response.data.userLabor.user_id){
+                                            userLabor.is_relieve_facility=response.data.userLabor.is_relieve_facility;
+                                          return false;
+                                      }
+                                      return true;
+                                });
                                 tempTip.setDuration(3000);
                                 tempTip.showSuccess('已解除“'+full_name+'”的绑定设备!');
                                 return;

+ 4 - 0
resources/views/personnel/checking-in/clockAudit.blade.php

@@ -35,12 +35,16 @@
                             <td>@{{ i+1 }}</td>
                             <td ><span v-if="userDutyCheck.user_detail">@{{ userDutyCheck.user_detail.full_name }}</span></td>
                             @can('人事管理-打卡审核')<td>
+                                <span v-if="userDutyCheck.type=='登入'">
                                 <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>
+                                </span>
                             </td>@endcan
                             <td v-if="workgroupSign">
+                                <span v-if="userDutyCheck.type=='登入'">
                                 <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>
+                                </span>
                             </td>
                             <td>@{{ userDutyCheck.checked_at.substring(11,16) }}</td>
                             <td>