Просмотр исходного кода

二次加工迁移文件,商品表改动,二次加工部分功能

Zhouzhendong 6 лет назад
Родитель
Сommit
128b908c02

+ 108 - 0
app/Http/Controllers/ProcessController.php

@@ -6,9 +6,13 @@ use App\Commodity;
 use App\Exports\WaybillExport;
 use App\Owner;
 use App\Process;
+use App\ProcessDaily;
+use App\User;
+use App\UserDutyCheck;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Gate;
 use Maatwebsite\Excel\Facades\Excel;
 
@@ -16,6 +20,7 @@ class ProcessController extends Controller
 {
 
     public function conditionQuery(Request $request,$processes){
+        if(!Gate::allows('二次加工管理-查询')){ return redirect(url('/'));  }
         $today=Carbon::now()->subDays(15);
         if ($request->input('commodity_barcode')){
             $barcode=$request->input('commodity_barcode');
@@ -46,6 +51,7 @@ class ProcessController extends Controller
      */
     public function index(Request $request)
     {
+        if(!Gate::allows('二次加工管理-查询')){ return redirect(url('/'));  }
         $processes=Process::with('tutorials')->orderBy('processes.id','DESC');
         if ($request->input('checkSign')){
             $excel=$this->isExport($request,$processes);
@@ -59,6 +65,7 @@ class ProcessController extends Controller
 
     //获取导出数据
     public function isExport(Request $request,$processes){
+        if(!Gate::allows('二次加工管理-查询')){ return redirect(url('/'));  }
         if ($request->input('checkSign')=="-1"){
             $processes=$this->conditionQuery($request,$processes);
             $excel=$this->export($processes);
@@ -69,6 +76,107 @@ class ProcessController extends Controller
         $excel=$this->export($processes);
         return $excel;
     }
+
+    //获取每日参与人
+    public function getDailyParticipant(Request $request){
+        if(!Gate::allows('二次加工管理-登记工时')){ return redirect(url('/'));  }
+        $id=$request->input('id');
+        $processDailies=ProcessDaily::with('processDailyParticipants')->orderBy('time','DESC')
+            ->where('process_id',$id)->get();
+        if ($processDailies){
+            $processDailies=$this->countManHour($processDailies);
+        }
+        return $processDailies;
+    }
+
+    //根据参与人查找打卡记录计算工时信息
+    public function countManHour($processDailies){
+        $today=Carbon::now()->format('Y-m-d');
+        $date=date("Y-m-d",strtotime('+'.strval(5)." day",strtotime($today)));
+        $processDailyOne=$processDailies[count($processDailies)-1];
+        $startDate=Carbon::parse($processDailyOne->time);
+        $diffDay=$startDate->diffInDays($today,true);
+        foreach ($processDailies as $processDaily){
+            $date=$processDaily->time;
+            foreach ($processDaily->processDailyParticipants as $processDailyParticipant){
+                $user=$processDailyParticipant->user_id;
+                $userDutyCheckStart=UserDutyCheck::select('id','checked_at')->where('user_id',$user)
+                    ->where('checked_at','like',$date.'%')->where('type','登入')->orderBy('id')->first();
+                $userDutyCheckEnd=UserDutyCheck::select('id','checked_at')->where('user_id',$user)
+                    ->where('checked_at','like',$date.'%')->where('type','登出')->orderBy('id','desc')->first();
+                //跨日情况寻找下一天
+                if (!$userDutyCheckEnd){
+                    $date=date("Y-m-d",strtotime("+1 day",strtotime($date)));
+                    $userDutyCheckEnd=UserDutyCheck::select('id','checked_at')->where('user_id',$user)
+                        ->where('checked_at','like',$date.'%')->where('type','登出')->orderBy('id','desc')->first();
+                }
+                if (!$userDutyCheckStart || !$userDutyCheckEnd){
+                    continue;
+                }
+                $dateStart=Carbon::parse($userDutyCheckStart->checked_at);
+                $dateEnd=Carbon::parse($userDutyCheckEnd->checked_at);
+                $hour=($dateEnd->diffInSeconds($dateStart))/3600; //打卡工时
+                if ($processDailyParticipant->dinner_duration)$hour=$hour-(($processDailyParticipant->dinner_duration)/60); //减晚饭时间
+                $hour=$this->isHour($userDutyCheckStart,$hour); //去除休息时间
+                $processDailyParticipant->hour=round($hour,2);
+                if ($hour&&$processDailyParticipant->hour_count){
+                    $diff=abs(round($processDailyParticipant->hour_count-$hour,2));
+                    $processDailyParticipant->diff=$diff;
+                }
+                //计件工
+                if ($processDailyParticipant->unit_price){
+                    continue;
+                }
+                if ($hour&&$hour>8){
+                    $processDailyParticipant->billingHour=8;
+                    continue;
+                }
+                if ($hour&&$hour<=8){
+                    $processDailyParticipant->billingHour=round($hour,2);
+                }
+            }
+        }
+        return $processDailies;
+    }
+
+    //打卡工时减休息时间
+    public function isHour($userDutyCheckStart,$hour){
+
+        $date=$userDutyCheckStart->checked_at;
+        $date=Carbon::parse($date)->format('H');
+        if ((int)$date<=11){
+            $hour=$hour-1;
+        }
+        return $hour;
+    }
+
+    //驳回二次加工单
+    public function reject($id){
+        if(!Gate::allows('二次加工管理-接单与驳回')){ return redirect(url('/'));  }
+        $process=Process::select('id','status')->find($id);
+        $process->status="驳回";
+        $process->update();
+        $this->log(__METHOD__,"驳回二次加工单_".__FUNCTION__,json_encode($process),Auth::user()['id']);
+        return $process;
+    }
+    //接单
+    public function receive($id){
+        if(!Gate::allows('二次加工管理-接单与驳回')){ return redirect(url('/'));  }
+        $process=Process::select('id','status')->find($id);
+        $process->status="接单";
+        $process->update();
+        $this->log(__METHOD__,"接单二次加工单_".__FUNCTION__,json_encode($process),Auth::user()['id']);
+        return $process;
+    }
+    //完成
+    public function accomplish($id){
+        if(!Gate::allows('二次加工管理-验收完成')){ return redirect(url('/'));  }
+        $process=Process::select('id','status')->find($id);
+        $process->status="已完成";
+        $process->update();
+        $this->log(__METHOD__,"完成二次加工单_".__FUNCTION__,json_encode($process),Auth::user()['id']);
+        return $process;
+    }
     /**
      * Show the form for creating a new resource.
      *

+ 24 - 2
app/Http/Controllers/TestController.php

@@ -15,11 +15,13 @@ use App\Logistic;
 use App\MeasuringMachine;
 use App\Order;
 use App\Package;
+use App\ProcessDaily;
 use App\Rejected;
 use App\RejectedBill;
 use App\RejectedBillItem;
 use App\Role;
 use App\User;
+use App\UserDutyCheck;
 use App\WMSReflectReceive;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Collection;
@@ -130,7 +132,27 @@ class TestController extends Controller
     }
 
     public function test1(){
-        $a=123;
-        dd(is_integer($a));
+  /*      $a=Package::orderBy('id')->first();
+
+        $date=date("Y-m-d",strtotime("+1 day",strtotime($a->created_at->format('Y-m-d'))));
+        dd($a->created_at->format('Y-m-d'));
+
+        $b=Package::orderBy('id','desc')->first();
+        $sf=$a->created_at->format('Y-m-d');dd((int)$sf);
+        $result=$sf->lte("11:00");
+
+        $c=Carbon::parse("9:10:05");
+        $d=Carbon::parse("18:01:20");
+        $x=($d->diffInSeconds($c))/3600;
+        dd($c,$d,round($x,2)-1);*/
+        $userDutyCheckStart=UserDutyCheck::select('id','checked_at')->where('user_id',1)
+            ->where('checked_at','like','2020-03-13%')->where('type','登入')->orderBy('id')->first();
+        $today=Carbon::now()->format('Y-m-d');
+        $date=date("Y-m-d",strtotime('+'.strval(5)." day",strtotime($today)));
+        $startDate=Carbon::parse("2020-03-31");
+        $diffDay=$startDate->diffInDays($today,true);
+
+        dd($diffDay);
+        $package=Package::orderBy('updated_at','DESC')->get();
     }
 }

+ 3 - 0
app/ProcessDaily.php

@@ -14,4 +14,7 @@ class ProcessDaily extends Model
     public function process(){
         return $this->belongsTo('App\Process','process_id','id');
     }
+    public function processDailyParticipants(){
+        return $this->hasMany('App\ProcessDailyParticipant','process_daily_id','process_id');
+    }
 }

+ 1 - 4
app/ProcessDailyParticipant.php

@@ -14,15 +14,12 @@ class ProcessDailyParticipant extends Model
         'user_name'
     ];
 
-    public function processDaily(){
-        return $this->belongsTo('App\ProcessDaily','process_daily_id','id');
-    }
     public function user(){
         return $this->belongsTo('App\User','user_id','id');
     }
 
 
-    public function getAttribute()
+    public function getUserNameAttribute()
     {
         return $this['user']?$this['user']['name']:null;
     }

+ 1 - 1
app/UserDutyCheck.php

@@ -17,7 +17,7 @@ class UserDutyCheck extends Model
         return $this->belongsTo('App\User','user_id','id');
     }
 
-    public function getAttribute()
+    public function getUserNameAttribute()
     {
         return $this['user']?$this['user']['name']:null;
     }

+ 1 - 1
database/migrations/2020_03_25_164242_create_process_dailies_table.php

@@ -18,7 +18,7 @@ class CreateProcessDailiesTable extends Migration
         Schema::create('process_dailies', function (Blueprint $table) {
             $table->bigIncrements('id');
             $table->bigInteger('process_id')->comment('外键二次加工单');
-            $table->timestamp('time')->index()->comment('日期');
+            $table->date('time')->index()->comment('日期');
             $table->integer('output')->comment('当日产量');
             $table->integer('remain')->comment('当日剩余');
             $table->timestamps();

+ 2 - 2
database/migrations/2020_03_25_164303_create_process_daily_participants_table.php

@@ -19,8 +19,8 @@ class CreateProcessDailyParticipantsTable extends Migration
             $table->bigIncrements('id');
             $table->bigInteger('process_daily_id')->index()->comment('外键每日记录');
             $table->bigInteger('user_id')->index()->comment('外键用户');
-            $table->timestamp('started_at')->nullable()->comment('开始时间');
-            $table->timestamp('ended_at')->nullable()->comment('开始时间');
+            $table->time('started_at')->nullable()->comment('开始时间');
+            $table->time('ended_at')->nullable()->comment('开始时间');
             $table->decimal('hour_price')->nullable()->comment('计时工资');
             $table->tinyInteger('hour_count')->nullable()->comment('计时工时');
             $table->decimal('unit_price')->nullable()->comment('计件工资');

+ 1 - 1
resources/views/maintenance/city/create.blade.php

@@ -31,7 +31,7 @@
                     <div class="form-group row">
                         <label for="province_id" class="col-2 col-form-label text-right">所属省份</label>
                         <div class="col-8">
-                            <select name="City[province_id]" class="form-control" style="width: 30%;height: 30px">
+                            <select name="City[province_id]" class="form-control" style="width: 30%;">
                                 @foreach($provinces as $province)
                                     <option value="{{$province->id}}">{{$province->name}}</option>
                                 @endforeach

+ 202 - 18
resources/views/process/index.blade.php

@@ -106,14 +106,14 @@
                         </label>
                     </th>
                     <th>序号</th>
-                    <th>操作</th>
+                    <th >操作</th>
                     <th>任务号</th>
                     <th>货主</th>
                     <th>单据类型</th>
                     <th>单据号</th>
                     <th>加工类型</th>
                     <th>预期数量</th>
-                    <th>教程</th>
+                    <th class="text-center">教程</th>
                     <th>单价</th>
                     <th>提交日期</th>
                     <th>商品编码</th>
@@ -121,12 +121,21 @@
                     <th>实际数量</th>
                     <th>状态</th>
                 </tr>
-                <tr v-for="(processOne,i) in processes">
+                <tr v-for="(processOne,i) in processes" :id="processOne.id">
                     <td>
                         <input class="checkItem" type="checkbox" :value="processOne.id" v-model="checkData">
                     </td>
                     <td class="text-muted">@{{ i+1 }}</td>
-                    <td>操作</td>
+                    <td >
+                        <p v-if="!processOne.openProcessHour && processOne.status=='驳回'" class="text-muted">已驳回</p>
+                        <p v-if="!processOne.openProcessHour && processOne.status=='已完成'" class="text-success">已完成</p>
+                        <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReject(processOne.id)" class="btn-sm btn-outline-dark pull-left">驳回</button>
+                        <button v-if="!processOne.openProcessHour && processOne.status=='待接单'"  @click="processReceive(processOne.id)" class="btn-sm btn-outline-primary pull-left">接单</button>
+                        <button v-if="(processOne.status=='加工中' || processOne.status=='待加工') && !processOne.openProcessHour"
+                                class="btn-sm btn-outline-info pull-left" @click="openProcessHour(processOne.id);processOne.openProcessHour=true;processOne.detailFolding=false">登记工时</button>
+                        <button v-if="processOne.openProcessHour" @click="closeProcessHour(processOne.id);processOne.openProcessHour=false" class="btn-sm btn-dark pull-left">收起登记工时</button>
+                        <button v-if="!processOne.openProcessHour && processOne.status=='待验收'" @click="processAccomplish(processOne.id)" class="btn-sm btn-outline-success pull-left">完成</button>
+                    </td>
                     <td class="text-muted">@{{ processOne.code }}</td>
                     <td class="text-muted">@{{ processOne.owner_name }}</td>
                     <td class="text-muted">@{{ processOne.bill_type }}</td>
@@ -135,31 +144,33 @@
                     <td>@{{ processOne.amount }}</td>
                     <td>
                         <div class="text-center">
-                            <div v-if="processOne.tutorials && processOne.tutorialCount>1">
-                            <a href="javascript:;" @click="processOne.detailFolding=true">@{{processOne.tutorialCount}}个货主,点击展开明细</a>
-                            <table class="table table-sm">
+                            <div v-if=" processOne.tutorials.length>1">
+                            <a href="javascript:;" @click="processOne.detailFolding=true;processOne.openProcessHour=false;closeProcessHour(processOne.id)" v-if="!processOne.detailFolding">@{{processOne.tutorials.length}}个教程,点击展开明细</a>
+                            <button class="btn-sm btn-outline-dark pull-left" href="javascript:;" @click="processOne.detailFolding=false" v-else>收起编辑</button>
+                            <table class="table table-sm" v-if="processOne.detailFolding">
                                 <tr>
                                     <th>标题</th>
                                     <th>货主</th>
                                     <th>操作</th>
                                     <th>创建时间</th>
                                 </tr>
-                                <tr v-for="tutorial in processOne.tutorials">
+                                <tr v-for="(tutorial,i) in processOne.tutorials">
                                     <td class="text-info">@{{tutorial.name}}</td>
                                     <td >@{{tutorial.owner_name}}</td>
                                     <td>@can('二次加工管理-教程管理')@endcan</td>
                                     <td >@{{tutorial.created_at}}</td>
                                 </tr>
-                                <tr v-if="processOne.detailFolding && processOne.tutorialCount>1">
-                                    <td colspan="8" class="text-center">
-                                        <a href="javascript:;" @click="processOne.detailFolding=false">点击收起明细</a>
+                                <tr>
+                                    <td  colspan="4">
+                                        <button class="btn btn-info pull-left">新增或编辑关联教程</button>
                                     </td>
                                 </tr>
                             </table>
                             </div>
-                            <div v-if="processOne.tutorialCount>0 && ! processOne.detailFolding">
+                            <div v-if="processOne.tutorials.length==1 && !processOne.detailFolding">
                                 <a v-for="tutorial in processOne.tutorials" class="text-info">@{{tutorial.name}}</a>
-                                <button  class="btn btn-sm btn-outline-dark pull-right" >删</button>
+                                <button class="btn-sm btn-outline-info pull-right">改</button>
+                                <button  class="btn-sm btn-outline-dark pull-right" >删</button>
                             </div>
                         </div>
                     </td>
@@ -170,6 +181,56 @@
                     <td>@{{ processOne.completed_amount }}</td>
                     <td class="text-muted">@{{ processOne.status }}</td>
                 </tr>
+                <tr v-if="processDailyParticipants.length>0">
+                    <td colspan="2"></td>
+                    <td colspan="16">
+                        <table class="table-sm table-bordered table-condensed">
+                            <tr class="bg-success">
+                                <td>日期</td><td>当日产量</td>
+                                <td>当日剩余</td>
+                                <td colspan="2">操作</td>
+                                <td>参与者</td>
+                                <td>开始时间</td>
+                                <td>结束时间</td>
+                                <td>计时工资</td>
+                                <td>计件工资</td>
+                                <td>晚饭时间</td>
+                                <td>计时工时</td>
+                                <td>备注</td>
+                                <td>打卡工时</td>
+                                <td>工时差</td>
+                                <td>计费工时</td>
+                                <td>计件数量</td>
+                                <td>审核</td>
+                                <td>详情</td>
+                            </tr>
+                            <tr  v-for="processDaily in processDailyParticipants" :id="'processDaily'+processDaily.id">
+                                <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan"><p v-if="processDailies[processDaily.id]">@{{ processDailies[processDaily.id].time }}</p></td>
+                                <td v-if="processDaily.rowspan"  :rowspan="processDaily.rowspan"><p v-if="processDailies[processDaily.id]">@{{ processDailies[processDaily.id].output }}</p></td>
+                                <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan"><p v-if="processDailies[processDaily.id]">@{{ processDailies[processDaily.id].remain }}</p></td>
+                                <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan">
+                                    <button v-if="isAddProcessDailyParticipant" class="btn btn-sm btn-info" @click="addProcessDailyParticipant(processDaily.id);isAddProcessDailyParticipant=false;">新增</button>
+                                    <button v-if="!isAddProcessDailyParticipant" class="btn btn-sm btn-info" @click="addProcessDailyParticipant(processDaily.id);isAddProcessDailyParticipant=true;">取消</button>
+                                </td>
+                                <td></td>
+                                <td>@{{ processDaily.user_name }}</td>
+                                <td>@{{ processDaily.started_at }}</td>
+                                <td>@{{ processDaily.ended_at }}</td>
+                                <td>@{{ processDaily.hour_price }}</td>
+                                <td>@{{ processDaily.unit_price }}</td>
+                                <td>@{{ processDaily.dinner_duration }}</td>
+                                <td>@{{ processDaily.hour_count }}</td>
+                                <td>@{{ processDaily.remark }}</td>
+                                <td>@{{ processDaily.hour }}</td>
+                                <td>@{{ processDaily.diff }}</td>
+                                <td>@{{ processDaily.billingHour }}</td>
+                                <td>@{{ processDaily.unit_count }}</td>
+                                <td>审核</td>
+                                <td>详情</td>
+                            </tr>
+                        </table>
+                    </td>
+                </tr>
             </table>
         </div>
     </div>
@@ -185,11 +246,11 @@
             data:{
                 processes:[
                     @foreach($processes as $processOne)
-                    {code:'{{$processOne->code}}',owner_name:'{{$processOne->owner_name}}',bill_type:'{{$processOne->bill_type}}'
+                    {id:'{{$processOne->id}}',code:'{{$processOne->code}}',owner_name:'{{$processOne->owner_name}}',bill_type:'{{$processOne->bill_type}}'
                         ,wms_code:'{{$processOne->wms_code}}',process_method_name:'{{$processOne->process_method_name}}',amount:'{{$processOne->amount}}'
-                        ,tutorials:'{!! $processOne->tutorials !!}',tutorialCount:'{{count($processOne->tutorials)}}',unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}'
+                        ,tutorials:{!! $processOne->tutorials !!},unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}'
                         ,commodity_barcode:'{{$processOne->commodity_barcode}}',commodity_name:'{{$processOne->commodity_name}}',
-                        completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',detailFolding:false},
+                        completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',detailFolding:false,openProcessHour:false,},
                     @endforeach
                 ],
                 owners:[
@@ -199,6 +260,9 @@
                 ],
                 checkData:[],
                 filterData:{paginate:50,date_start:'',date_end:'',owner_id:'',commodity_barcode:'',wms_code:'',status:''},
+                processDailies:[],
+                processDailyParticipants:[],
+                isAddProcessDailyParticipant:true,
             },
             watch:{
                 checkData:{
@@ -214,7 +278,6 @@
             },
             computed:{
                 isBeingFilterConditions:function(){
-
                     for(let key in this.filterData){
                         if(this.filterData[key]){
                             if(key==='paginate')continue;
@@ -231,6 +294,7 @@
                 $('#process').removeClass('d-none');
             },
             methods:{
+                //回显条件参数
                 initInputs:function(){
                     let data=this;
                     let uriParts =decodeURI(location.href).split("?");
@@ -245,10 +309,12 @@
                         });
                     }
                 },
+                //提交表单
                 submit:function(){
-                    var form = $("#optionSubmit");
+                    let form = $("#optionSubmit");
                     form.submit();
                 },
+                //全选事件
                 checkAll(e){
                     if (e.target.checked){
                         this.processes.forEach((el,i)=>{
@@ -260,6 +326,7 @@
                         this.checkData = [];
                     }
                 },
+                //导出excel,因同步问题不使用formData
                 processExport(e){
                     let val=e;
                     let data=this.filterData;
@@ -276,6 +343,123 @@
                             data.owner_id+"&commodity_barcode="+data.commodity_barcode+"&wms_code="+data.wms_code+
                             "&status="+data.status;
                     }
+                },
+                //获取登记工时
+                openProcessHour(e){
+                    let _this=this;
+                    axios.post("{{url("process/getDailyParticipant")}}",{id:e})
+                        .then(function (response) {
+                            let processDailies=response.data;
+                            for (let i=0;i<processDailies.length;i++){
+                                let processDailyParticipants=processDailies[i].process_daily_participants;
+                                if (!processDailyParticipants)continue;
+                                for (let j=0;j<processDailyParticipants.length;j++){
+                                    let data={};
+                                    data['id']=processDailyParticipants[j].id;
+                                    data['started_at']=processDailyParticipants[j].started_at;
+                                    data['user_name']=processDailyParticipants[j].user_name;
+                                    data['ended_at']=processDailyParticipants[j].ended_at;
+                                    data['hour_price']=processDailyParticipants[j].hour_price;
+                                    data['unit_price']=processDailyParticipants[j].unit_price;
+                                    data['dinner_duration']=processDailyParticipants[j].dinner_duration;
+                                    data['hour_count']=processDailyParticipants[j].hour_count;
+                                    data['remark']=processDailyParticipants[j].remark;
+                                    data['hour']=processDailyParticipants[j].hour;
+                                    data['diff']=processDailyParticipants[j].diff;
+                                    data['billingHour']=processDailyParticipants[j].billingHour;
+                                    data['unit_count']=processDailyParticipants[j].unit_count;
+                                    data['process_id']=processDailies[i].process_id;
+                                    if (!_this.processDailies[processDailies[i].id]){
+                                        data['daily']=processDailies[i].id;
+                                        data['rowspan']=processDailyParticipants.length;
+                                        let obj={};
+                                        obj['time']=processDailies[i].time;
+                                        obj['output']=processDailies[i].output;
+                                        obj['remain']=processDailies[i].remain;
+                                        _this.processDailies[processDailies[i].id]=obj;
+                                    }
+                                    _this.processDailyParticipants.push(data);
+                                }
+                            }
+                            console.log(_this.processDailyParticipants)
+                    }).catch(function (err) {
+                        console.log(err)
+                    });
+                },
+                //删除工时显示
+                closeProcessHour(e){
+                    this.processDailies=[];
+                    this.processDailyParticipants=[];
+                },
+                //新增参与人
+                addProcessDailyParticipant(e){
+                    let html='<tr><td></td><td>@{{ processDaily.user_name}}</td>' +
+                        '<td>@{{ processDaily.started_at }}</td><td>@{{ processDaily.ended_at }}</td>' +
+                        '<td>@{{ processDaily.hour_price }}</td><td>@{{ processDaily.unit_price }}</td>' +
+                        '<td>@{{ processDaily.dinner_duration }}</td><td>@{{ processDaily.hour_count }}</td>' +
+                        '<td>@{{ processDaily.remark }}</td><td>@{{ processDaily.hour }}</td>' +
+                        '<td>@{{ processDaily.diff }}</td><td>@{{ processDaily.billingHour }}</td>' +
+                        '<td>@{{ processDaily.unit_count }}</td><td>审核</td>' +
+                        '<td>详情</td></tr>';
+                    this.processDailyParticipants.every(function (processDailyParticipant) {
+                        if (processDailyParticipant.id==e){
+                            processDailyParticipant.rowspan=(processDailyParticipant.rowspan)+1;
+                            return false;
+                        }
+                        return  true;
+                    });
+                    $("#processDaily"+e).after(html);
+                },
+                //驳回
+                processReject(id){
+                    let url="{{url('process/reject')}}"+"/"+id;
+                    let _this=this;
+                    axios.post(url)
+                        .then(function (response) {
+                            _this.processes.every(function (process) {
+                                if (process.id==response.data.id){
+                                    process.status=response.data.status;
+                                    return false;
+                                }
+                                return true;
+                            });
+                        }).catch(function (err) {
+                            console.log(err)
+                        })
+                },
+                //接单
+                processReceive(id){
+                    let url="{{url('process/receive')}}"+"/"+id;
+                    let _this=this;
+                    axios.post(url)
+                        .then(function (response) {
+                            _this.processes.every(function (process) {
+                                if (process.id==response.data.id){
+                                    process.status=response.data.status;
+                                    return false;
+                                }
+                                return true;
+                            });
+                        }).catch(function (err) {
+                        console.log(err)
+                    })
+                },
+                //完成
+                processAccomplish(id){
+                    let url="{{url('process/accomplish')}}"+"/"+id;
+                    let _this=this;
+                    axios.post(url)
+                        .then(function (response) {
+                            _this.processes.every(function (process) {
+                                if (process.id==response.data.id){
+                                    process.status=response.data.status;
+                                    return false;
+                                }
+                                return true;
+                            });
+                        }).catch(function (err) {
+                        console.log(err)
+                    })
                 }
             },
         });

+ 0 - 6
resources/views/weight/package/statistics.blade.php

@@ -482,12 +482,6 @@
                         }
                         location.href="{{url('package/statistics?checkSign=')}}"+this.checkData;
                     }else{
-/*                        let formData=new FormData();
-                        formData.append('owner_id',this.selectedOwners);
-                        formData.append('logistic_id',this.selectedLogistics);
-                        formData.append('date_start',this.filterData.date_start);
-                        formData.append('date_end',this.filterData.date_end);
-                        formData.append('checkSign','-1');*/
                         location.href="{{url('package/statistics?owner_id=')}}"+this.selectedOwners+
                             "&logistic_id="+this.selectedLogistics+"&date_start="+this.filterData.date_start
                             +"&date_end="+this.filterData.date_end+"&checkSign=-1";

+ 8 - 2
routes/web.php

@@ -109,5 +109,11 @@ Route::resource('store/storeItem','StoreItemsController');
  * 二次加工单
  */
 Route::resource('process','ProcessController');
-//导出excel
-
+//获取每日参与人
+Route::post('process/getDailyParticipant','ProcessController@getDailyParticipant');
+//驳回
+Route::post('process/reject/{id}','ProcessController@reject');
+//接单
+Route::post('process/receive/{id}','ProcessController@receive');
+//完成
+Route::post('process/accomplish/{id}','ProcessController@accomplish');