Sfoglia il codice sorgente

Merge branch 'master' into zengjun

# Conflicts:
#	app/Http/Controllers/RejectedController.php
#	app/Services/WaybillService.php
#	public/js/app.js
#	resources/js/queryForm/queryForm.js
#	resources/views/order/index/delivering.blade.php
#	routes/web.php
#	webpack.mix.js
ajun 5 anni fa
parent
commit
ef3e6592fe
64 ha cambiato i file con 1327 aggiunte e 2212 eliminazioni
  1. 1 5
      app/Commodity.php
  2. 5 4
      app/Events/ExportEvent.php
  3. 1 0
      app/Events/GuardAuditEvent.php
  4. 6 4
      app/Events/ImportEvent.php
  5. 0 42
      app/Exports/DefaultExport.php
  6. 11 8
      app/Http/Controllers/InventoryController.php
  7. 20 22
      app/Http/Controllers/LaborReportController.php
  8. 0 4
      app/Http/Controllers/MeasureMonitorController.php
  9. 6 3
      app/Http/Controllers/PersonnelController.php
  10. 74 32
      app/Http/Controllers/ProcessController.php
  11. 7 15
      app/Http/Controllers/RejectedController.php
  12. 2 2
      app/Http/Controllers/TestController.php
  13. 63 53
      app/Http/Controllers/UserDutyCheckController.php
  14. 2 2
      app/Http/Controllers/WaveController.php
  15. 74 79
      app/Http/Controllers/WaybillController.php
  16. 9 9
      app/Http/Controllers/api/thirdPart/flux/WaybillController.php
  17. 20 6
      app/LaborReport.php
  18. 13 4
      app/ProcessesContent.php
  19. 28 25
      app/RejectedAnalyzeOwner.php
  20. 3 0
      app/Services/CarrierService.php
  21. 35 11
      app/Services/LaborReportService.php
  22. 7 6
      app/Services/ProcessService.php
  23. 0 9
      app/Services/UserDutyCheckService.php
  24. 13 0
      app/Services/WaybillPayoffService.php
  25. 13 0
      app/Services/WaybillPriceModelService.php
  26. 45 15
      app/Services/WaybillService.php
  27. 8 0
      app/Waybill.php
  28. 0 5
      package-lock.json
  29. 2 2
      public/js/app.js
  30. 0 537
      public/js/singles/rejectedIndex.js
  31. 1 1
      resources/js/queryForm/export.js
  32. 78 100
      resources/js/queryForm/queryForm.js
  33. 1 1
      resources/js/queryForm/queryForm说明.txt
  34. 0 401
      resources/js/singles/rejectedIndex.js
  35. 0 396
      resources/js/singles/searchAnalyze.js
  36. 62 0
      resources/js/utilities/sort.js
  37. 13 9
      resources/js/utilities/tempTip.js
  38. 10 0
      resources/sass/text.scss
  39. 1 1
      resources/views/inventory/menu.blade.php
  40. 31 9
      resources/views/inventory/statement/changeInventory.blade.php
  41. 1 1
      resources/views/inventory/statement/menu.blade.php
  42. 1 1
      resources/views/layouts/menu.blade.php
  43. 6 6
      resources/views/order/index/delivering.blade.php
  44. 4 5
      resources/views/order/wave/search.blade.php
  45. 0 2
      resources/views/personnel/checking-in/getQRcode.blade.php
  46. 1 1
      resources/views/personnel/checking-in/updateUserLaborCompanies.blade.php
  47. 139 106
      resources/views/personnel/laborReport/index.blade.php
  48. 104 47
      resources/views/process/create.blade.php
  49. 42 19
      resources/views/process/index.blade.php
  50. 2 2
      resources/views/process/show.blade.php
  51. 1 1
      resources/views/rejected/recycle.blade.php
  52. 112 139
      resources/views/rejected/search/analyze.blade.php
  53. 4 4
      resources/views/rejected/search/general.blade.php
  54. 32 6
      resources/views/waybill/create.blade.php
  55. 13 11
      resources/views/waybill/edit.blade.php
  56. 148 15
      resources/views/waybill/index.blade.php
  57. 1 1
      resources/views/waybill/menu.blade.php
  58. 27 1
      resources/views/waybill/waybillEdit.blade.php
  59. 4 4
      resources/views/weight/package/index.blade.php
  60. 1 5
      routes/api.php
  61. 1 1
      routes/api/thirdPart/flux.php
  62. 1 0
      routes/apiLocal.php
  63. 12 6
      routes/web.php
  64. 5 6
      webpack.mix.js

+ 1 - 5
app/Commodity.php

@@ -74,10 +74,6 @@ class Commodity extends Model
     }
 
     public function newBarcode($barcode){
-        $commodityBarcode=CommodityBarcode::where('commodity_id',$this['id'])->where('code',$barcode)->first();
-        if(!$commodityBarcode){
-            $commodityBarcode=new CommodityBarcode(['commodity_id'=>$this['id'],'code'=>$barcode]);
-            $commodityBarcode->save();
-        }
+        return CommodityBarcode::query()->firstOrCreate(['commodity_id'=>$this['id'],'code'=>$barcode]);
     }
 }

+ 5 - 4
app/Events/ExportEvent.php

@@ -2,6 +2,7 @@
 
 namespace App\Events;
 
+use App\LaborReport;
 use App\UserDutyCheck;
 use Illuminate\Broadcasting\Channel;
 use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -12,16 +13,16 @@ class ExportEvent implements ShouldBroadcast
 {
     use  SerializesModels;
 
-    public $userDutyCheck;
+    public $laborReport;
 
     /**
      * Create a new event instance.
      *
      * @return void
      */
-    public function __construct(UserDutyCheck $userDutyCheck)
+    public function __construct(LaborReport $laborReport)
     {
-        $this->userDutyCheck=$userDutyCheck;
+        $this->laborReport=$laborReport;
     }
 
     /**
@@ -31,7 +32,7 @@ class ExportEvent implements ShouldBroadcast
      */
     public function broadcastOn()
     {
-        return new Channel('userDutyCheck');
+        return new Channel('laborReport');
     }
 
 }

+ 1 - 0
app/Events/GuardAuditEvent.php

@@ -2,6 +2,7 @@
 
 namespace App\Events;
 
+use App\LaborReport;
 use App\UserDutyCheck;
 use Illuminate\Broadcasting\Channel;
 use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

+ 6 - 4
app/Events/ImportEvent.php

@@ -2,6 +2,7 @@
 
 namespace App\Events;
 
+use App\LaborReport;
 use App\UserDutyCheck;
 use Illuminate\Broadcasting\Channel;
 use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -12,16 +13,16 @@ class ImportEvent implements ShouldBroadcast
 {
     use  SerializesModels;
 
-    public $userDutyCheck;
+    public $laborReport;
 
     /**
      * Create a new event instance.
      *
      * @return void
      */
-    public function __construct(UserDutyCheck $userDutyCheck)
+    public function __construct(LaborReport $laborReport)
     {
-        $this->userDutyCheck=$userDutyCheck;
+        $this->laborReport=$laborReport;
     }
 
     /**
@@ -31,7 +32,8 @@ class ImportEvent implements ShouldBroadcast
      */
     public function broadcastOn()
     {
-        return new Channel('userDutyCheck');
+        return new Channel(LaborReport::tokenOfBroadcastEnterAndLeave());
+        //return new Channel('laborReport');
     }
 
 }

+ 0 - 42
app/Exports/DefaultExport.php

@@ -1,42 +0,0 @@
-<?php
-
-namespace App\Exports;
-
-use Maatwebsite\Excel\Concerns\FromCollection;
-
-class DefaultExport implements FromCollection
-{
-    private $head;
-    private $body;
-
-    public function __construct($head, $body)
-    {
-        $this->head = $head;
-        $this->body = $body;
-    }
-
-    /**
-     * @return \Illuminate\Support\Collection
-     */
-    public function collection()
-    {
-        $head = $this->head;
-        $body = $this->body;
-
-        // 表头设置
-        foreach ($head[0] as $key=>$value) {
-            $head_arr[] = $key;
-        }
-        // 表数据
-        foreach ($body as $key => &$value) {
-            $js = [];
-            for ($i = 0; $i < count($head_arr); $i++) {
-                $js = array_merge($js,[ $head_arr[$i] => $value[ $head_arr[$i] ] ]);
-
-            }
-            array_push($head, $js);
-            unset($val);
-        }
-        return collect($head);
-    }
-}

+ 11 - 8
app/Http/Controllers/InventoryController.php

@@ -13,10 +13,9 @@ class InventoryController extends Controller
 {
     public function conditionQuery(Request $request,$page=null,$paginate=null){
         if(!Gate::allows("库存管理-动库报表")){ return redirect(url('/'));  }
-
-
         $date_start=$request->input('date_start');
-        if ($request->input('range'))$date_start=date('Y-m-d',strtotime('-'.$request->input('range')." day"));
+        $range = $request->input('range');
+        if ($range)$date_start=date('Y-m-d',strtotime('-'.$range." day"));
         $date_end=$request->input('date_end');
         $TOLocation=$request->input('TOLocation');
         $LotAtt05=$request->input('LotAtt05');
@@ -35,7 +34,6 @@ class InventoryController extends Controller
         $sql.=" from ACT_Transaction_Log where TransactionType='PA' ";
         if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
-        if (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
         if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
         if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
         $sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
@@ -43,7 +41,6 @@ class InventoryController extends Controller
         $sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
         if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
-        if (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
         if ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."' ";
         if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
         $sql.=' group by FMCustomerID, FMLocation,FMSKU,FMLotNum union all ';
@@ -51,7 +48,6 @@ class InventoryController extends Controller
         $sql.=" from ACT_Transaction_Log  where TransactionType='MV' ";
         if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
-        if (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
         if ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."' ";
         if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
         $sql.=' group by FMLocation,FMCUSTOMERID,FMSKU,FMLotNum union all ';
@@ -59,7 +55,6 @@ class InventoryController extends Controller
         $sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
         if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
-        if (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
         if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
         if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
         $sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
@@ -75,7 +70,15 @@ class InventoryController extends Controller
         if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
         if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
         if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
-        if ($descr_c)$sql.=" and 货主 ='".$descr_c."' ";
+        if ($descr_c){
+            $sql .= ' and 货主 in (';
+            $descr_cs = explode(',',$descr_c);
+            foreach ($descr_cs as $index => $descr_c){
+                if ($index != 0)$sql .= ',';
+                $sql .= "'".$descr_c."'";
+            }
+            $sql .= ') ';
+        }
         if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
         if ($page&&$paginate)$sql.="  and ROWNUM<='".$page*$paginate."'";
         $sql.=' )  ';

+ 20 - 22
app/Http/Controllers/LaborReportController.php

@@ -32,31 +32,29 @@ class LaborReportController extends Controller
      */
     public function index(Request $request)
     {
-        //if(!Gate::allows('人事管理')){ return redirect(url('/'));  }
         if(!Gate::allows('人事管理-临时工报表')){ return redirect(url('/'));  }
         $paginateParams=$request->input();
         $user=Auth::user();
         if (!$user)return redirect('/');
-        $userWorkgroupIds=$user->getPermittingWorkgroupIds(Gate::allows('人事管理-临时工报表-可见全部组'));
-        $permittingWorkgroups=UserWorkgroup::whereIn('id',$userWorkgroupIds)->get();
-        if($permittingWorkgroups->isEmpty())$permittingWorkgroups="[]";
         $laravelEchoPrefix = config('database.redis.options.prefix');
-        $laborReportsBuilder=LaborReport::with(['user','userDutyCheck','userWorkgroup'])->whereIn('user_workgroup_id',$userWorkgroupIds);
+        $tokenOfBroadcastEnterAndLeave='';
         if(Gate::allows('人事管理-临时工报表-可见全部组')||Gate::allows('人事管理-门卫审核')){
-            $laborReportsBuilder->orWhereNull('user_workgroup_id');
+            $tokenOfBroadcastEnterAndLeave=LaborReport::tokenOfBroadcastEnterAndLeave();
         }
+        $userWorkgroupIds=$user->getPermittingWorkgroupIds(Gate::allows('人事管理-临时工报表-可见全部组'));
+        $permittingWorkgroups=UserWorkgroup::whereIn('id',$userWorkgroupIds)->get();
+        if($permittingWorkgroups->isEmpty())$permittingWorkgroups="[]";
         $laborReports=app('laborReportService')->paginate($request);
-//        $laborReportsPaginate = $laborReports;
-//        $laborReports=$laborReports->sortBy('name');
+//        $laborReports=$laborReports->sortBy('name');按名字排序
         foreach ($laborReports as $laborReport){
-//            if (!$laborReport->group_user_id){
-//                //三十分钟之内组长未审核实行软删除
-//                $tenMinutesLater=Carbon::parse($laborReport->created_at)->subMinutes(-30)->format('Y-m-d H:i:s');
-//                if (Carbon::now()->format('Y-m-d H:i:s')>$tenMinutesLater){
-//                    $laborReport->delete();
-//                    $this->log(__METHOD__,"组长未审核该条记录将在10分钟后实行软删除__".__FUNCTION__,$laborReport->toJson(),Auth::user()['id']);
-//                }
-//            }
+            if (!$laborReport->group_user_id){
+                //2小时之内组长未审核实行软删除
+                $tenMinutesLater=Carbon::parse($laborReport->created_at)->subHours(-2)->format('Y-m-d H:i:s');
+                if (Carbon::now()->format('Y-m-d H:i:s')>$tenMinutesLater){
+                    $laborReport->delete();
+                    $this->log(__METHOD__,"组长未审核该条记录将在10分钟后实行软删除__".__FUNCTION__,$laborReport->toJson(),Auth::user()['id']);
+                }
+            }
             $addOneHourCheckedAt=Carbon::parse($laborReport->userDutyCheck['checked_at'])->subHours(-1)->format('Y-m-d H:i:s');
             if (!$laborReport->userDutyCheck['verify_user_id']&&Carbon::now()->format('Y-m-d H:i:s')>$addOneHourCheckedAt){
                 $laborReport->delete();
@@ -64,7 +62,7 @@ class LaborReportController extends Controller
             }
         }
         $userWorkGroups=UserWorkgroup::select('id','name')->get();
-        return view('personnel/laborReport/index',compact('laborReports','userWorkGroups','laravelEchoPrefix','permittingWorkgroups','paginateParams'));
+        return view('personnel/laborReport/index',compact('laborReports','userWorkGroups','laravelEchoPrefix','permittingWorkgroups','paginateParams','tokenOfBroadcastEnterAndLeave'));
     }
     public function export(Request $request){
         if (!Gate::allows('人事管理-临时工报表')){return redirect(url('/')); }
@@ -78,16 +76,16 @@ class LaborReportController extends Controller
         }
         $row=[[
             'id'=>'ID',
-            'enter_at'=>'进场时间',
-            'exit_at'=>'退场时间',
             'enter_number'=>'进厂编号',
             'user_workgroup_name'=>'小组',
             'name'=>'临时工',
             'mobile_phone'=>'电话',
             'identity_number'=>'身份证号',
             'labor_company'=>'劳务所',
+            'enter_at'=>'进场时间',
             'check_in_at'=>'进组时间',
             'check_out_at'=>'退组时间',
+            'exit_at'=>'退场时间',
             'verify_at'=>'审核时间',
             'group_user_id'=>'审核人',
             'relax_time'=>'晚饭时间(分)',
@@ -100,16 +98,16 @@ class LaborReportController extends Controller
             $laborReport=$laborReports[$i];
             $w=[
                 'id'=>isset($laborReport->id)?$laborReport->id:'',
-                'enter_at'=>isset($laborReport->enter_at)?$laborReport->enter_at:'',
-                'exit_at'=>isset($laborReport->exit_at)?$laborReport->exit_at:'',
                 'enter_number'=>isset($laborReport->enter_number)?$laborReport->enter_number:'',
                 'user_workgroup_name'=>isset($laborReport->userWorkgroup->name)?$laborReport->userWorkgroup->name:'',
                 'name'=>isset($laborReport->name)?$laborReport->name:'',
                 'mobile_phone'=>isset($laborReport->mobile_phone)?$laborReport->mobile_phone:'',
                 'identity_number'=>isset($laborReport->identity_number)?$laborReport->identity_number:'',
                 'labor_company'=>isset($laborReport->labor_company)?$laborReport->labor_company:'',
+                'enter_at'=>isset($laborReport->enter_at)?$laborReport->enter_at:'',
                 'check_in_at'=>isset($laborReport->check_in_at)?$laborReport->check_in_at:'',
                 'check_out_at'=>isset($laborReport->check_out_at)?$laborReport->check_out_at:'',
+                'exit_at'=>isset($laborReport->exit_at)?$laborReport->exit_at:'',
                 'verify_at'=>isset($laborReport->verify_at)?$laborReport->verify_at:'',
                 'group_user_id'=>isset($laborReport->user->name)?$laborReport->user->name:'',
                 'relax_time'=>isset($laborReport->relax_time)?$laborReport->relax_time:'',
@@ -126,7 +124,7 @@ class LaborReportController extends Controller
     public function guardClockAudit(Request $request){
         if(!Gate::allows('人事管理-门卫审核')){ return ["success"=>false,"data"=>"您无此权限操作!!!"];  }
         $id=$request->input('id');
-        $userDutyCheckId=$request->input('userDutyCheckId');
+        $userDutyCheckId=$request->input('user_duty_check_id');
         $laborReportStatus=new LaborReportStatus([
             'labor_report_id'=>$id,
             'status'=>'已入场',

+ 0 - 4
app/Http/Controllers/MeasureMonitorController.php

@@ -2,13 +2,9 @@
 
 namespace App\Http\Controllers;
 
-use App\Events\TeamAuditEvent;
-use App\Events\WeighedEvent;
 use App\MeasuringMachine;
 use App\Package;
 use Illuminate\Http\Request;
-use Illuminate\Support\Facades\DB;
-use Illuminate\Support\Facades\Gate;
 require_once '../app/library/baidu-api-speech/AipSpeech.php';
 class MeasureMonitorController extends Controller
 {

+ 6 - 3
app/Http/Controllers/PersonnelController.php

@@ -44,6 +44,9 @@ class PersonnelController extends Controller
         if ($userDutyCheckImport&&$userDutyCheck->type=='登入')return ['result'=>true,'data'=>'已存在进场记录!'];
         $userDutyCheckExport=UserDutyCheck::where('user_id',$user_id)->where('checked_at','like',$checkedAtDate.'%')->where('type','登出')->orderBy('id','desc')->first();
         if ($userDutyCheckExport&&$userDutyCheck->type=='登出')return ['result'=>true,'data'=>'已存在出场记录!'];
+//        $userDutyCheckBefore=UserDutyCheck::where('user_id',$user_id)->orderBy('id','desc')->first();
+//        if ($userDutyCheckBefore['type']=='登入'&&$userDutyCheck->type=='登入')return ['result'=>true,'data'=>'已存在进场记录!'];
+//        if ($userDutyCheckBefore['type']=='登出'&&$userDutyCheck->type=='登出')return ['result'=>true,'data'=>'已存在出场记录!'];
         if ($type=='登出')$userDutyCheck->verify_user_id=Auth::user()['id'];
         $userDutyCheck->save();
         $this->log(__METHOD__,"录入补卡".__FUNCTION__,json_encode($userDutyCheck),Auth::user()['id']);
@@ -59,7 +62,7 @@ class PersonnelController extends Controller
         if (!$laborReport&&$userDutyCheck->type=='登入'){
             $newReport=$userDutyCheck->makeEnteringRecord();
             $this->log(__METHOD__,"进场创建临时工报表记录__".__FUNCTION__,json_encode([$userDutyCheck]));
-            if ($newReport) event(new ImportEvent($userDutyCheck));
+            if ($newReport) event(new ImportEvent($newReport));
         }
         else if(!$laborReport&&$userDutyCheck->type=='登出'){
             //退场时间跨天情况
@@ -72,7 +75,7 @@ class PersonnelController extends Controller
             if ($laborReportYesterday){
                 $exportReport=$laborReportService->exportReplenishToCreateLaborReportData($laborReportYesterday,$userDutyCheck);
                 $this->log(__METHOD__,"补退场卡修改临时工报表记录__".__FUNCTION__,json_encode([$laborReportYesterday,$userDutyCheck]));
-                if ($exportReport) event(new ExportEvent($userDutyCheck));
+                if ($exportReport) event(new ExportEvent($exportReport));
             }
         }else if($laborReport){
             if (!$laborReport->check_out_at){
@@ -81,7 +84,7 @@ class PersonnelController extends Controller
             }
             $exportReport=$laborReportService->exportReplenishToCreateLaborReportData($laborReport,$userDutyCheck);
             $this->log(__METHOD__,"补退场卡修改临时工报表记录__".__FUNCTION__,json_encode([$laborReport,$userDutyCheck]));
-            if ($exportReport) event(new ExportEvent($userDutyCheck));
+            if ($exportReport) event(new ExportEvent($exportReport));
         }
     }
 

+ 74 - 32
app/Http/Controllers/ProcessController.php

@@ -58,9 +58,10 @@ class ProcessController extends Controller
         $id=$request->input('id');
         $processDailies=ProcessDaily::with(['processDailyParticipants','process'])->orderBy('date','DESC')
             ->where('process_id',$id)->get();
-        $process=Process::find($id);
+        $process=Process::query()->with('automaticSupplementSign')->find($id);
         if (count($processDailies)>0){
-            if ((($process->amount)-($process->completed_amount))<=0 || $process->status=='交接完成')$result=true;
+            if ((($process->amount)-($process->completed_amount))<=0 ||
+                $process->status=='交接完成' || $process->automaticSupplementSign)$result=true;
             else $result=$this->createDeficiencyData($processDailies,$today);
             if ($result){
                 $processDailies=ProcessDaily::with(['processDailyParticipants','process'])
@@ -161,7 +162,6 @@ class ProcessController extends Controller
                 $remain=$remain-($processDailiesArr[$date]->output);
             }
         }
-        $this->log(__METHOD__,"生成加工单每日记录".__FUNCTION__,json_encode($processDailies),Auth::user()['id']);
         return true;
     }
 
@@ -550,13 +550,27 @@ class ProcessController extends Controller
                 if ($processContent['type'])$processContentOne->type='成品单';
                 $processContentOne->save();
                 if (isset($processContent['is_update_commodity_name'])){
-                    Sign::create([
+                    Sign::query()->create([
                         'signable_type'=>'processes_contents',
                         'signable_id'=>$processContentOne->id,
                         'field'=>'commodity_name',
                         'mark'=>$processContent['commodity_name'],
                     ]);
                 }
+                if (isset($processContent['commodity_barcode'])){
+                    CommodityBarcode::query()->firstOrCreate([
+                        'commodity_id'=>$processContent['commodity_id'],
+                        'code'=>$processContent['commodity_barcode']]
+                    );
+                }
+                if (isset($processContent['is_update_commodity_sku'])){
+                    Sign::query()->create([
+                        'signable_type'=>'processes_contents',
+                        'signable_id'=>$processContentOne->id,
+                        'field'=>'commodity_sku',
+                        'mark'=>$processContent['commodity_sku'],
+                    ]);
+                }
             }
         }
         $process->code='P'.date ("Ymd").str_pad($process->id,3,"0",STR_PAD_LEFT);
@@ -796,8 +810,14 @@ class ProcessController extends Controller
     //质量验收
     function checkAndAccept(Request $request){
 
-        $process= Process::find($request->id);
+        $process = Process::query()->with('processDailies')->find($request->id);
         if (!$process)return ['success'=>false];
+        $process->load(['processesContents'=>function($query){
+            $query->where('type','成品单');
+        }]);
+        if (count($process->processesContents) == 0)return ['success'=>false,'data'=>'该单下属单据无成本单存在!'];
+        $result=$this->statistic($process);
+        if (!$result['success'])return $result;
         $process->update([
             'status'=>'待交接'
         ]);
@@ -894,7 +914,7 @@ class ProcessController extends Controller
 
     //增加填充标记
     private function createAutomaticSupplement($process_id){
-        Sign::create([
+        Sign::query()->firstOrCreate([
             'signable_type'=>'processes',
             'signable_id'=>$process_id,
             'field'=>'automatic_supplement',
@@ -912,9 +932,14 @@ class ProcessController extends Controller
         $commodities = explode("\n",$request->data); //拆分行
         $owner='';
         $processContents=[];
-        foreach ($commodities as $commodity){
-            $commodity = array_filter(preg_split('/[\t]+/is',$commodity)); //拆分列
+        $errors = [];
+        foreach ($commodities as $i => $commodity){
+            if ($i==0 && mb_strpos($commodity,'货主')!==false && mb_strpos($commodity,'品名')!==false
+                && mb_strpos($commodity,'数量')!==false)continue;
+            $commodity = explode("\t",$commodity); //拆分列
+            $head="第".($i+1)."行";
             if (count($commodity)<count($request->rows)){
+                $errors[$head] = ['数据不完整'];
                 unset($commodity);
                 continue;
             }
@@ -922,49 +947,66 @@ class ProcessController extends Controller
             $wmsCode='';
             $barcode='';
             $amount=0;
+            $errors[$head] = [];
             foreach ($request->rows as $index => $row){
                 if ($row == '货主'){
-                    if (isset($commodity[$index]) && $commodity[$index] && !$owner){
-                        $owner=Owner::where('code',$commodity[$index])->orWhere('name',$commodity[$index])->first();
-                        if (!$owner){
-                            $owner = Owner::create([
-                                'code' => $commodity[$index],
-                                'name' => $commodity[$index]
-                            ]);
-                        }
+                    if ($commodity[$index] && !$owner){
+                        $owner = $commodity[$index];
                     }
+                    if (!$commodity[$index])array_push($errors[$head],"货主为空");
                 }
                 if ($row == '单据'){
-                    $wmsCode = isset($commodity[$index]) ? $commodity[$index] : '';
+                    $wmsCode = $commodity[$index] ?? '';
                 }
                 if ($row == 'SKU'){
-                    $commodityData['sku'] = isset($commodity[$index]) ? $commodity[$index] : '';
+                    $commodityData['sku'] = $commodity[$index] ?? '';
+                    if (!$commodity[$index])array_push($errors[$head],"SKU为空");
                 }
                 if ($row == '品名'){
-                    $commodityData['name'] = isset($commodity[$index]) ? $commodity[$index] : '';
+                    $commodityData['name'] = $commodity[$index] ?? '';
+                    if (!$commodity[$index])array_push($errors[$head],"品名为空");
                 }
                 if ($row == '条码'){
-                    $barcode = isset($commodity[$index]) ? $commodity[$index] : '';
+                    $barcode = $commodity[$index] ?? '';
                 }
                 if ($row == '数量'){
-                    $amount = isset($commodity[$index]) ? $commodity[$index] : '';
+                    $amount = $commodity[$index] ?? '';
+                    if (!$commodity[$index])array_push($errors[$head],"数量为空");
+                    if (!is_numeric($commodity[$index]) || $commodity[$index] < 1)array_push($errors[$head],"数量为空或小于1");
                 }
             }
-            $commodity = Commodity::query()->whereNull('owner_id')
-                ->where('sku',$commodityData['sku'])->where('name',$commodityData['name'])->first();
-            if (!$commodity)$commodity = Commodity::create($commodityData);
-            $commodityBarCode=CommodityBarcode::create([
-                'code' => $barcode,
-                'commodity_id' => $commodity->id
-            ]);
+            if (count($errors[$head]) > 0)continue;
+            else unset($errors[$head]);
+            if (!is_object($owner)){
+                $str = $owner;
+                if (!$str) throw new \Exception('未找到货主!');
+                $owner=Owner::where('code',$str)->orWhere('name',$str)->first();
+                if (!$owner){
+                    $owner = Owner::create([
+                        'code' => $str,
+                        'name' => $str
+                    ]);
+                    $this->log(__METHOD__,"二次加工单录入导入商品数据时添加货主".__FUNCTION__,json_encode($owner),Auth::user()['id']);
+                }
+            }
+            $commodity = Commodity::query()->with('barcodes')->whereNull('owner_id')
+                ->where('sku',$commodityData['sku'])->first();
+            if (!$commodity){
+                $commodity = Commodity::create($commodityData);
+                $commodityBarCode=CommodityBarcode::create([
+                    'code' => $barcode,
+                    'commodity_id' => $commodity->id
+                ]);
+                $commodity_barcodes = [$commodityBarCode];
+            }else $commodity_barcodes = $commodity->barcodes;
+            $this->log(__METHOD__,"二次加工单录入导入商品数据时添加商品及条码".__FUNCTION__,
+                json_encode($commodity)." || ".json_encode($commodity_barcodes),Auth::user()['id']);
             $processContent=['bill_type'=>'入库单','commodity_id'=>$commodity->id,'wms_code'=>$wmsCode,'amount'=>$amount,
-                'commodity_name'=>$commodity->name,'commodity_barcodes'=>[$commodityBarCode],'commodity_sku'=>$commodity->sku,
+                'commodity_name'=>$commodity->name,'commodity_barcodes'=>$commodity_barcodes,'commodity_sku'=>$commodity->sku,
                 'lineNo'=>1,'owner_id'=>$owner->id,'owner_name'=>$owner->name,'addBtnShow'=>false,'type'=>false];
             array_push($processContents,$processContent);
-            $processContent['type']=true;
-            array_push($processContents,$processContent);
         }
-        return ['success'=>true,'data'=>$processContents];
+        return ['success'=>true,'data'=>$processContents,'errors'=>count($errors)>0?$errors:''];
     }
 
 

+ 7 - 15
app/Http/Controllers/RejectedController.php

@@ -2,7 +2,7 @@
 
 namespace App\Http\Controllers;
 
-use App\Exports\DefaultExport;
+use App\Exports\Export;
 use App\Exports\RejectedExport;
 use App\Imports\RejectedImport;
 use App\Logistic;
@@ -466,35 +466,27 @@ class RejectedController extends Controller
             'paginateParams','qualityLabels'));
     }
 
+    // 统计查询参数获取 zengjun
     private function getAnalyzeSearchParams(Request $request)
     {
         $searchParams = [
             'owner_id' => $request->input('owner_id'),
-            'ids'=> $request->input('ids'),
+            'data'=> $request->input('data'),
             'created_at_start' => $request->input('created_at_start'),
             'created_at_end' => $request->input('created_at_end')
         ];
         return $searchParams;
     }
 
-    public function exportExcelOnParams(Request $request){
-        ini_set('max_execution_time',2500);
-        ini_set('memory_limit','1526M');
-        $row = RejectedAnalyzeOwner::getExcelFromHead();
-        $searchParams = $this->getAnalyzeSearchParams($request);
-        $data = RejectedAnalyzeOwner::getFindBy($searchParams);
-//        $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-        return Excel::download(new DefaultExport($row,$data),date('YmdHis', time()).'-退货统计记录单.xlsx');
-    }
 
-    public function exportAllExcelOnParams(Request $request){
+    //统计页导出
+    public function exportAnalyze(Request $request){
         ini_set('max_execution_time',2500);
         ini_set('memory_limit','1526M');
-        $searchParams = $this->getAnalyzeSearchParams($request);
         $row = RejectedAnalyzeOwner::getExcelFromHead();
+        $searchParams = $this->getAnalyzeSearchParams($request);
         $data = RejectedAnalyzeOwner::getFindBy($searchParams);
-//        $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-        return Excel::download(new DefaultExport($row,$data),date('YmdHis', time()).'-退货统计记录单.xlsx');
+        return Excel::download(new Export($row,$data),date('YmdHis', time()).'-退货统计记录单.xlsx');
     }
 
     public function ajaxGetRejected(Request $request){

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

@@ -7,8 +7,6 @@ use App\Authority;
 use App\Batch;
 use App\City;
 use App\Events\CancelOrder;
-use App\Events\WmsReceiveNewEvent;
-use App\Http\Controllers\Api\thirdPart\flux\WaybillController;
 use App\Logistic;
 use App\OracleActAllocationDetails;
 use App\OracleDOCOrderHeader;
@@ -277,6 +275,8 @@ class TestController extends Controller
     /*1*/
     function test(Request $request)
     {/**/
+        $str = (int)'b';
+        dd($str);
     }
 
 }

+ 63 - 53
app/Http/Controllers/UserDutyCheckController.php

@@ -3,9 +3,6 @@
 namespace App\Http\Controllers;
 
 use App\Events\ClockinEvent;
-use App\Events\ClockoutEvent;
-use App\Events\ExportEvent;
-use App\Events\ImportEvent;
 use App\LaborCompany;
 use App\LaborReport;
 use App\Services\LaborReportService;
@@ -52,6 +49,7 @@ class UserDutyCheckController extends Controller
             $user_id = Cache::get('dutyCheckTokenStr_' . $userLaborToken);
             $userDetail = UserDetail::find($user_id);
             if (!$userDetail) return redirect('personnel/checking-in/userDutyCheck/createUserDetail/' . $userDetail->mobile_phone)->with("importAndExportQRCodeType", $importAndExportQRCodeType);
+            if($importAndExportQRCodeType=='import') return redirect('personnel/checking-in/userDutyCheck/updateUserLaborCompanies/' . $userDetail->mobile_phone)->with("importAndExportQRCodeType", $importAndExportQRCodeType);
             $userDutyCheck = $this->importAndExportDutyCheck($user_id, $importAndExportQRCodeType);
             if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
             if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
@@ -80,9 +78,9 @@ class UserDutyCheckController extends Controller
         $lastDate = Carbon::parse($userDutyCheckOld['checked_at']);
         $thisDate = Carbon::parse($date);
         $diffDate = $thisDate->diffInMinutes($lastDate);
-        //七天未登录从新选择劳务所
-        if ($diffDate > 7 * 1440) {
-            return redirect('personnel/checking-in/userDutyCheck/updateUserDetail/' . $mobile_phone)->with("importAndExportQRCodeType", $importAndExportQRCodeType);
+        //未登录从新选择劳务所
+        if ($diffDate > 0.5 * 1440 ||!$userDutyCheckOld) {
+            return redirect('personnel/checking-in/userDutyCheck/updateUserLaborCompanies/' . $mobile_phone)->with("importAndExportQRCodeType", $importAndExportQRCodeType);
         }
         $userDutyCheck=$this->importAndExportDutyCheck($userDetail->user_id, $importAndExportQRCodeType);
         if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
@@ -110,12 +108,12 @@ class UserDutyCheckController extends Controller
             'checked_at' => $date,
             'source' => '正常',
         ]);
+        //跨天登出情况
         if (!$userDutyCheckOld) {
-            //跨天登出情况
+            //当前日期的前一天
+            $yesterday = Carbon::yesterday()->format('Y-m-d');
+            $userDutyCheckYesterday = UserDutyCheck::where('user_id', $user_id)->where('checked_at', 'like', $yesterday . '%')->orderBy('id', 'desc')->limit(10)->first();
             if ($importAndExportQRCodeType && $importAndExportQRCodeType == 'export') {
-                //当前日期的前一天
-                $yesterday = Carbon::yesterday()->format('Y-m-d');
-                $userDutyCheckYesterday = UserDutyCheck::where('user_id', $user_id)->where('checked_at', 'like', $yesterday . '%')->orderBy('id', 'desc')->limit(10)->first();
                 if ($userDutyCheckYesterday && $userDutyCheckYesterday->type == '登入') {
                     $userDutyCheck->verify_user_id = $userDutyCheckYesterday->verify_user_id;
                     $userDutyCheck->type = '登出';
@@ -123,6 +121,12 @@ class UserDutyCheckController extends Controller
                     return $userDutyCheck;
                 }
             }
+            if ($importAndExportQRCodeType && $importAndExportQRCodeType == 'import') {
+                if ($userDutyCheckYesterday && $userDutyCheckYesterday->type == '登入') {
+                    $userDutyCheck->import = true;//已入场的不能再入场
+                    return $userDutyCheck;
+                }
+            }
             if ($importAndExportQRCodeType == 'export') {
                 $userDutyCheck->isNotImport = true;//还未进场,不可出场
                 return $userDutyCheck;
@@ -149,7 +153,6 @@ class UserDutyCheckController extends Controller
         $userDutyCheck->save();
         return $userDutyCheck;
     }
-
     //去往登记资料页面
     public function createUserDetail($mobile_phone)
     {
@@ -157,17 +160,16 @@ class UserDutyCheckController extends Controller
         $laborCompanies = LaborCompany::select('id', 'name')->get();
         return view('personnel/checking-in/createUserDetail', ['mobile_phone' => $mobile_phone, 'importAndExportQRCodeType' => $importAndExportQRCodeType, 'laborCompanies' => $laborCompanies]);
     }
-
-    //七天未打卡去往选择劳务所页面
-    public function updateUserDetail($mobile_phone)
+    //未打卡去往选择劳务所页面
+    public function updateUserLaborCompanies($mobile_phone)
     {
         $importAndExportQRCodeType = session("importAndExportQRCodeType");
         $laborCompanies = LaborCompany::select('id', 'name')->get();
-        return view('personnel/checking-in/updateUserDetail', ['mobile_phone' => $mobile_phone, 'importAndExportQRCodeType' => $importAndExportQRCodeType, 'laborCompanies' => $laborCompanies]);
+        return view('personnel/checking-in/updateUserLaborCompanies', ['mobile_phone' => $mobile_phone, 'importAndExportQRCodeType' => $importAndExportQRCodeType, 'laborCompanies' => $laborCompanies]);
     }
 
     //打卡修改临时工劳务所信息并生成进场记录 AndMakeEnterRecord
-    public function storeUpdateUserDetail(Request $request)
+    public function storeUpdateUserLaborCompanies(Request $request)
     {
         $this->updateValidator($request)->validate();
         $importAndExportQRCodeType = $request->input('importAndExportQRCodeType');
@@ -181,12 +183,16 @@ class UserDutyCheckController extends Controller
         ]);
         $this->log(__METHOD__, "更改临时工劳务所信息" . __FUNCTION__, json_encode($userLabor), Auth::user()['id']);
         $userDutyCheck=$this->importAndExportDutyCheck($userDetail->user_id,$importAndExportQRCodeType);
+        if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
+        if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
+        if ($userDutyCheck && $userDutyCheck->export == true) return "<h1 style='color: darkred;text-align:center'>您已出场,不可再次出场!!</h1>";
+        if (!$userDutyCheck) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+        $userLaborToken = $userDetail->getDutyCheckToken(config('users.token_check_in_expire_minutes'));
         $laborReportService = app('LaborReportService');
-        $laborReportService->makeLaborReportByUserDutyCheck($userDutyCheck);
+        $laborReportService->makeOrChangeLaborReportByUserDutyCheck($userDutyCheck, $importAndExportQRCodeType);
         $laravelEchoPrefix = config('database.redis.options.prefix');
-        $userLaborToken=$userDetail->getDutyCheckToken(config('users.token_check_in_expire_minutes'));
         return response()->view('personnel/checking-in/importAndExportSuccess',['full_name'=>$userDetail->full_name,'checked_at'=>$userDutyCheck->checked_at,'type'=>$userDutyCheck->type,'laravelEchoPrefix'=>$laravelEchoPrefix])
-            ->cookie('userLaborToken',$userLaborToken,config('users.token_check_in_expire_minutes'),'/');
+            ->cookie('userLaborToken', $userLaborToken, config('users.token_check_in_expire_minutes'), '/');
     }
 
     public function updateValidator(Request $request)
@@ -288,49 +294,34 @@ class UserDutyCheckController extends Controller
             $html=$this->updateLaborReport($user_id,$userWorkgroupID);
             if ($html)return $html;
         }
-        //return view("personnel/checking-in/clock", compact('userWorkgroupID'));
+        return "<h1 style='color: red;text-align:center'>进场还未打卡,暂无法进组!</h1>";
     }
-    public function updateLaborReport($user_id,$userWorkgroupID){
+    public function updateLaborReport($user_id,$userWorkgroupID)
+    {
         $userDetail = UserDetail::find($user_id);
         $group_name = UserWorkgroup::where('id', $userWorkgroupID)->value('name');
         $laravelEchoPrefix = config('database.redis.options.prefix');
         $laborReportService = app('LaborReportService');
         //判断是否是第一次进组
-        $laborReport = LaborReport::where('user_id', $user_id)->where('user_workgroup_id', null)->where('created_at', 'like',Carbon::now()->format('Y-m-d'). '%')->orderBy('id', 'desc')->first();
+        $laborReport = LaborReport::where('user_id', $user_id)->where('user_workgroup_id', null)->where('created_at', 'like', Carbon::now()->format('Y-m-d') . '%')->orderBy('id', 'desc')->first();
         if ($laborReport) {
             $newLaborReport = $laborReportService->enterGroupAndUpdateLaborReport($laborReport, $userWorkgroupID);
             $this->log(__METHOD__, "当日首次进组更新临时工报表记录__" . __FUNCTION__, json_encode($userWorkgroupID));
             if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
-            if ($newLaborReport) {
-                event(new ClockinEvent($newLaborReport));
-            }
-            return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix]);
+            if ($newLaborReport) event(new ClockinEvent($newLaborReport));
         } else {
             //换组判断上一条临时工报表信息是否退组
-            $laborReportNow = LaborReport::where('user_id', $user_id)->whereNotNull('group_user_id')->orderBy('id', 'desc')->first();
-            if ($laborReportNow && !$laborReportNow['check_out_at']) return "<h1 style='color: darkred;text-align:center'>您还未退组,暂不可换组,请联系之前组长!</h1>";
-            $laborReport = LaborReport::where('user_id', $user_id)->where('user_workgroup_id', $userWorkgroupID)->where('created_at', 'like', Carbon::now()->format('Y-m-d'). '%')->orderBy('id', 'desc')->first();
-            //此处表示临时工当日换组操作
-            if (!$laborReport) {
-                $newLaborReport = $laborReportService->changeGroupAndMakeLaborReport($user_id, $userWorkgroupID);
-                $this->log(__METHOD__, "当日临时工换组新建临时工报表记录__" . __FUNCTION__, json_encode([$user_id, $userWorkgroupID]));
-                if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
-                if ($newLaborReport) {
-                    event(new ClockinEvent($newLaborReport));
-                }
-                return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix]);
-            } else if ($laborReport['enter_number'] != $laborReportNow['enter_number']) {
-                $newLaborReport = $laborReportService->changeGroupAndMakeLaborReport($user_id, $userWorkgroupID);
-                $this->log(__METHOD__, "当日临时工换组新建临时工报表记录__" . __FUNCTION__, json_encode([$user_id, $userWorkgroupID]));
-                if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
-                if ($newLaborReport) {
-                    event(new ClockinEvent($newLaborReport));
-                }
-                return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix]);
-            } else {
-                return "<h1 style='color: darkred;text-align:center'>重复打卡!</h1>";
-            }
+            $laborReportNow = LaborReport::where('user_id', $user_id)->orderBy('id', 'desc')->first();
+            if ($laborReportNow['group_user_id'] && !$laborReportNow['check_out_at']) return "<h1 style='color: darkred;text-align:center'>您还未退组,暂不可换组,请联系之前组长!</h1>";
+            if ($laborReportNow['user_workgroup_id'] == $userWorkgroupID) return "<h1 style='color: darkred;text-align:center'>您已进组,不可再次进组!</h1>";
+            //if (!$laborReportNow['group_user_id']) return "<h1 style='color: darkred;text-align:center'>换组前是否已经其他组!</h1>";
+            //此处表示临时工换组操作
+            $newLaborReport = $laborReportService->changeGroupAndMakeLaborReport($user_id, $userWorkgroupID);
+            $this->log(__METHOD__, "当日临时工换组新建临时工报表记录__" . __FUNCTION__, json_encode([$user_id, $userWorkgroupID]));
+            if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+            if ($newLaborReport) event(new ClockinEvent($newLaborReport));
         }
+        return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix]);
     }
 
 
@@ -349,10 +340,29 @@ class UserDutyCheckController extends Controller
 
 
 
+//$laborReport = LaborReport::where('user_id', $user_id)->where('user_workgroup_id', $userWorkgroupID)->where('created_at', 'like', Carbon::now()->format('Y-m-d'). '%')->orderBy('id', 'desc')->first();
+//    //此处表示临时工当日换组操作
+//if (!$laborReport) {
+//$newLaborReport = $laborReportService->changeGroupAndMakeLaborReport($user_id, $userWorkgroupID);
+//$this->log(__METHOD__, "当日临时工换组新建临时工报表记录__" . __FUNCTION__, json_encode([$user_id, $userWorkgroupID]));
+//if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+//if ($newLaborReport) {
+//event(new ClockinEvent($newLaborReport));
+//}
+//return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix]);
+//} else if ($laborReport['enter_number'] != $laborReportNow['enter_number']) {
+//    $newLaborReport = $laborReportService->changeGroupAndMakeLaborReport($user_id, $userWorkgroupID);
+//    $this->log(__METHOD__, "当日临时工换组新建临时工报表记录__" . __FUNCTION__, json_encode([$user_id, $userWorkgroupID]));
+//    if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+//    if ($newLaborReport) {
+//        event(new ClockinEvent($newLaborReport));
+//    }
+//    return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix]);
+//} else {
+//    return "<h1 style='color: darkred;text-align:center'>重复打卡!</h1>";
+//}
 
-
-
-    //进组提交打卡
+        //进组提交打卡
 //    public function importGroupClock(Request $request)
 //    {
 //        $mobile_phone = $request->input('mobile_phone');
@@ -397,4 +407,4 @@ class UserDutyCheckController extends Controller
 //    }
 
 
-}
+    }

+ 2 - 2
app/Http/Controllers/WaveController.php

@@ -2,7 +2,7 @@
 
 namespace App\Http\Controllers;
 
-use App\Exports\DefaultExport;
+use App\Exports\Export;
 use App\Services\WaveService;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
@@ -130,7 +130,7 @@ class WaveController extends Controller
             }
             $data[] = $arr;
         }
-        return Excel::download(new DefaultExport($row,$data),date('YmdHis', time()).'-波次表.xlsx');
+        return Excel::download(new Export($row,$data),date('YmdHis', time()).'-波次表.xlsx');
     }
 
 }

+ 74 - 79
app/Http/Controllers/WaybillController.php

@@ -8,6 +8,8 @@ use App\Services\CarTypeService;
 use App\Services\CityService;
 use App\Services\OwnerService;
 use App\Services\UnitService;
+use App\Services\WaybillPayoffService;
+use App\Services\WaybillPriceModelService;
 use App\Services\WaybillService;
 use App\UploadFile;
 use App\WaybillAuditLog;
@@ -93,10 +95,10 @@ class WaybillController extends Controller
         return view('waybill/edit',['waybill'=>$waybill,'carriers'=>$carrierService->getSelection(),'cities'=>$cities,'units'=>$units,'carTypes'=>$carTypes]);
     }
 
-    public function update(Request $request, $id , CityService $cityService)
+    public function update(Request $request, $id,WaybillPriceModelService $waybillPriceModelService,
+                           CarrierService $carrierService,WaybillPayoffService $waybillPayoffService)
     {
         if(!Gate::allows('运输管理-调度')){ return redirect(url('/'));  }
-        $waybill=app('waybillService')->find($id);
         if (!$request->warehouse_weight && $request->warehouse_weight_unit_id){
             $request->offsetUnset('warehouse_weight_unit_id');
         }
@@ -110,86 +112,45 @@ class WaybillController extends Controller
             $request->offsetUnset('carrier_weight_unit_id_other');
         }
         $this->validatorWaybillDispatch($request,$id)->validate();
-        //替换换行符
-        if ($request->dispatch_remark){
-            $request->dispatch_remark = str_replace(PHP_EOL,' ',$request->dispatch_remark);
-        }
-        if (!$request->destination)$request->destination = $waybill->destination;
-        if ($request->destination_city_id && $waybill->destination_city_id != $request->destination_city_id){
-            $city=$cityService->find($request->destination_city_id);
-            if ($city && (mb_strpos($request->destination,$city->name)===false || mb_strpos($request->destination,$city->province_name)===false)){
-                if (mb_strpos($request->destination,$city->name)===false && mb_strpos($request->destination,$city->province_name)===false){
-                    $request->destination=$city->province_name.$city->name.$request->destination;
-                    goto sign;
-                }
-                if (mb_strpos($request->destination,$city->province_name)===false){
-                    $request->destination=$city->province_name.$request->destination;
-                }
-                if (mb_strpos($request->destination,$city->name)===false){
-                    $province_name=$city->province_name;
-                    $start_index=mb_strpos($request->destination,$city->province_name.'省');
-                    if ($start_index===false)$start_index=mb_strpos($request->destination,$city->province_name);
-                    else $province_name=$province_name.'省';
-                    $strBefore=mb_substr($request->destination,$start_index,mb_strlen($province_name));
-                    $strAfter=mb_substr($request->destination,$start_index+mb_strlen($province_name));
-                    $request->destination=$strBefore.$city->name.$strAfter;
-                }
-            }
-        }
-        sign:
-        $total_receivable=0;
-        $waybill->fill($request->input());
-        if ($waybill->save()){
-            if ($waybill->type=="直发车"){
-                if ($waybill->charge)$total_receivable=($waybill->charge);
-                elseif ($waybill->collect_fee)$total_receivable=($waybill->collect_fee);
-                $total_expense=($waybill->fee)+($waybill->other_fee)-($waybill->collect_fee);
-            }else {
-                $waybillPriceModel_id=$request->input('waybillPriceModel');
-                if ($waybillPriceModel_id){
-                    $carrier_weight=$request->input('carrier_weight');
-                    $waybillPriceModel=WaybillPriceModel::find($waybillPriceModel_id);
-                    $carrier=Carrier::find($waybill->carrier_id);
-                    if ($carrier_weight<$waybillPriceModel->initial_weight){
-                        $fee=(($waybillPriceModel->unit_price)*($waybillPriceModel->initial_weight))+$carrier->delivery_fee;
-                    }else{
-                        $fee=(($waybillPriceModel->unit_price)*$carrier_weight)+$carrier->delivery_fee;
-                    }
-                    if ($waybillPriceModel->base_fee&&$fee<$waybillPriceModel->base_fee){
-                        $fee=$waybillPriceModel->base_fee;
-                    }
-                    $waybill->fee=$fee;
-                    $waybill->waybill_price_model_id=$waybillPriceModel_id;
+        $waybillPayoffParam = [];
+        $waybillPayoffParam['total_receivable']=0;
+        $waybill = app('waybillService')->update($request,$id);
+        if ($waybill->type=="直发车"){
+            if ($waybill->charge)$waybillPayoffParam['total_receivable'] = ($waybill->charge);
+            elseif ($waybill->collect_fee)$waybillPayoffParam['total_receivable'] = ($waybill->collect_fee);
+            $waybillPayoffParam['total_expense'] = ($waybill->fee)+($waybill->other_fee)-($waybill->collect_fee);
+        }else {
+            $waybillPriceModel_id=$request->input('waybillPriceModel');
+            if ($waybillPriceModel_id){
+                $carrier_weight=$request->input('carrier_weight');
+                $waybillPriceModel=$waybillPriceModelService->find($waybillPriceModel_id);
+                $carrier=$carrierService->find($waybill->carrier_id);
+                if ($carrier_weight<$waybillPriceModel->initial_weight){
+                    $fee=(($waybillPriceModel->unit_price)*($waybillPriceModel->initial_weight))+$carrier->delivery_fee;
+                }else{
+                    $fee=(($waybillPriceModel->unit_price)*$carrier_weight)+$carrier->delivery_fee;
                 }
-                $waybill->save();
-                if ($waybill->charge)$total_receivable=($waybill->charge);
-                elseif($waybill->collect_fee) {
-                    $total_receivable=($waybill->collect_fee);
+                if ($waybillPriceModel->base_fee&&$fee<$waybillPriceModel->base_fee){
+                    $fee=$waybillPriceModel->base_fee;
                 }
-                $total_expense=($waybill->pick_up_fee)+($waybill->other_fee)+($waybill->fee);
+                $waybill->fee=$fee;
+                $waybill->waybill_price_model_id=$waybillPriceModel_id;
             }
-            if ($total_receivable>0){
-                $waybillPayoff=WaybillPayoff::where('waybill_id','=',$id)->first();
-                if ($waybillPayoff){
-                    $waybillPayoff->waybill_id=$id;
-                    $waybillPayoff->total_expense=$total_expense;
-                    $waybillPayoff->total_receivable=$total_receivable;
-                    $waybillPayoff->gross_margin=$total_receivable-$total_expense;
-                    $waybillPayoff->gross_profit_rate=(($total_receivable-$total_expense)/$total_receivable);
-                    $waybillPayoff->save();
-                }else{
-                    WaybillPayoff::create([
-                        'waybill_id'=>$id,
-                        'total_expense'=>$total_expense,
-                        'total_receivable'=>$total_receivable,
-                        'gross_margin'=>$total_receivable-$total_expense,
-                        'gross_profit_rate'=>(($total_receivable-$total_expense)/$total_receivable),
-                    ]);
-                };
+            $waybill->save();
+            if ($waybill->charge)$waybillPayoffParam['total_receivable'] = ($waybill->charge);
+            elseif($waybill->collect_fee) {
+                $waybillPayoffParam['total_receivable'] = $waybill->collect_fee;
             }
-            $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-            return redirect('waybill/index')->with('successTip','运单“'.$waybill->waybill_number.'”调度成功');
+            $waybillPayoffParam['total_expense'] = ($waybill->pick_up_fee)+($waybill->other_fee)+($waybill->fee);
         }
+        if ($waybillPayoffParam['total_receivable'] > 0){
+            $waybillPayoffParam['waybill_id'] = $id;
+            $waybillPayoffParam['gross_margin'] = $waybillPayoffParam['total_receivable'] - $waybillPayoffParam['total_expense'];
+            $waybillPayoffParam['gross_profit_rate'] = $waybillPayoffParam['gross_margin']/$waybillPayoffParam['total_receivable'];
+            $waybillPayoffService->updateOrCreate($waybillPayoffParam);
+        }
+        $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+        return redirect('waybill/index')->with('successTip','运单“'.$waybill->waybill_number.'”调度成功');
     }
 
     public function checkWaybillPriceModel($carrier_id,$destination_city_id,$carrier_weight,$carrier_weight_unit_id){
@@ -259,7 +220,7 @@ class WaybillController extends Controller
                 }
             }
             if ($waybillPriceModelProvinceRangeOne)return $waybillPriceModelProvinceRangeOne->id;
-            if ($waybillPriceModelProvinceRangeOne)return $waybillPriceModelProvinceRangeOne->id;
+            if ($waybillPriceModelProvinceRangeTwo)return $waybillPriceModelProvinceRangeTwo->id;
         };
         for ($i=0;$i<count($carrier_weight);$i++){
             if ($carrier_weight[$i]&&$carrier_weight_unit_id[$i]){
@@ -797,6 +758,7 @@ class WaybillController extends Controller
         return $validator;
     }
     public function addCounty(Request $request){
+        if ($request->destination_city =='undefined')$request->offsetUnset('destination_city');
         $rule =[
             'destination_city' => ['required', 'string','unique:cities,name'],
         ];
@@ -841,7 +803,6 @@ class WaybillController extends Controller
 
     // 软删除恢复
     public function apiRestoreSelected(Request $request){
-        DB::enableQueryLog();
         if(!Gate::allows('运输管理-删除')){return ['success'=>'false','fail_info'=>'没有权限'];}
         $ids = $request->input('ids')??'';
         if($ids == ''){return ['success'=>'false','fail_info'=>'没有可恢复对象'];}
@@ -865,6 +826,18 @@ class WaybillController extends Controller
         $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
         return ['success'=>$result,'status'=>$result];
     }
+    // 修改运输收费
+    public function changeCharge(Request $request){
+        if(!Gate::allows('运输管理-运单编辑')){return ['success'=>'false','fail_info'=>'没有权限'];}
+        $wayBillId = $request->id;
+        $waybillCharge = $request->input('charge');
+        if(is_null($wayBillId) or is_null($waybillCharge)){
+            return ['success'=>'false','fail_info'=>'参数异常'];
+        }
+        $result = Waybill::where('id',$wayBillId)->update(['charge'=>$waybillCharge]);
+        $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+        return ['success'=>$result,'status'=>$result];
+    }
     // 置顶
     public function waybillOnTop(Request $request){
         $id =  $request->input('id');
@@ -894,5 +867,27 @@ class WaybillController extends Controller
         $result = WaybillOnTop::where('waybill_id',$id)->forceDelete();
         return ['success'=>$result,'status'=>$result];
     }
+    //同步刷新仓库计重
+    public function refreshWaveHouseWeight(Request $request){
+        $wms_bill_number=$request->input('wms_bill_number');
+        if(is_null($wms_bill_number)) return  ['success'=>false,'fail_info'=>'传参错误'];
+        $waybills=DB::connection('oracle')->table('DOC_ORDER_DETAILS')->where('orderno',$wms_bill_number)->get();
+        if($waybills->isEmpty()) return  ['success'=>false,'fail_info'=>'传参错误'];
+        $warehouseWeight=0;
+        foreach ($waybills as $waybill){
+            if ($waybill->grossweight) $warehouseWeight += $waybill->grossweight;
+            if (!$waybill->grossweight&& $waybill->netweight) $warehouseWeight +=$waybill->netweight;
+        }
+        $warehouseWeight=round($warehouseWeight,2);
+        if ($warehouseWeight!=0){
+            $waybill=Waybill::where('wms_bill_number',$wms_bill_number)->first();
+            if ($waybill['warehouse_weight_other']!=$warehouseWeight){
+                $waybill['warehouse_weight_other']=$warehouseWeight;
+                $waybill->update();
+                $this->log(__METHOD__,'刷新仓库计重'.__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+            }
+        }
+        return ['success'=>true,'warehouseWeight'=>$warehouseWeight];
+    }
 
 }

+ 9 - 9
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -39,14 +39,14 @@ class WaybillController extends Controller
                     ->setEncodingOptions(JSON_UNESCAPED_UNICODE);
             }
             if(isset($receiveInputting['order_list'])&&$receiveInputting['order_list']){
+                $warehouseVolume=0;
                 $warehouseWeight=0;
-                $warehouseWeightOther=0;
                 $sign=false;
                 foreach ($receiveInputting['order_list'] as $orderInputting){
-                    if ($orderInputting['Cubic'])$warehouseWeight += $orderInputting['Cubic'];
+                    if ($orderInputting['Cubic'])$warehouseVolume += $orderInputting['Cubic'];
                     if ($orderInputting['Cubic']==0)$sign=true;
-                    if ($orderInputting['GrossWeight'])$warehouseWeightOther +=$orderInputting['GrossWeight'];
-                    if (!$orderInputting['GrossWeight'] && $orderInputting['NetWeight']) $warehouseWeightOther +=$orderInputting['NetWeight'];
+                    if ($orderInputting['GrossWeight'])$warehouseWeight +=$orderInputting['GrossWeight'];
+                    if (!$orderInputting['GrossWeight'] && $orderInputting['NetWeight']) $warehouseWeight +=$orderInputting['NetWeight'];
                     $orderInputting['OrderNo']=$receiveInputting['OrderNo'];
                     if(!WMSWaybillOrder::create($orderInputting)){
                         Controller::logS(__METHOD__,'error_'.__FUNCTION__,'运单订单行WMS写入错误'.'|'.json_encode($orderInputting));
@@ -55,7 +55,7 @@ class WaybillController extends Controller
                             ->setEncodingOptions(JSON_UNESCAPED_UNICODE);
                     }
                 }
-                if ($sign)$warehouseWeight=0;
+                if ($sign)$warehouseVolume=0;
             }
             $owner=Owner::where('code',$receiveInputting['CustomerID'])->first();
             if (!$owner){$owner=new Owner(['name'=>$receiveInputting['CustomerID'],'code'=>$receiveInputting['CustomerID']]);$owner->save();}
@@ -84,13 +84,13 @@ class WaybillController extends Controller
             ]);
             $dflist=config('merchantsInfo.waybill.DFList');
             if (isset($dflist[$receiveInputting['CarrierID']]) && $dflist[$receiveInputting['CarrierID']])$waybill->collect_fee=0;
-            if (isset($warehouseWeight)&&$warehouseWeight){
-                $waybill->warehouse_weight=$warehouseWeight;
+            if (isset($warehouseVolume)&&$warehouseVolume){
+                $waybill->warehouse_weight=$warehouseVolume;
                 $unit=Unit::where('name','m³')->first();
                 if ($unit)$waybill->warehouse_weight_unit_id=$unit->id;
             }
-            if (isset($warehouseWeightOther)){
-                $waybill->warehouse_weight_other=$warehouseWeightOther;
+            if (isset($warehouseWeight)){
+                $waybill->warehouse_weight_other=$warehouseWeight;
                 $unit=Unit::where('name','kg')->first();
                 if ($unit)$waybill->warehouse_weight_unit_id_other=$unit->id;
             }

+ 20 - 6
app/LaborReport.php

@@ -8,6 +8,8 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Support\Arr;
 use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Gate;
 use function Matrix\add;
 
 class LaborReport extends Model
@@ -21,7 +23,7 @@ class LaborReport extends Model
     ];
     protected $appends = [
         'is_exportGroup','is_export', 'exit_at','enter_at','sequence', 'amountOfJoined','remark','thisRecordOnlineTime','thisRecordWorkingTime',
-        'totalOnlineTime',
+        'totalOnlineTime','verifyPerson','userDutyCheckVerifyUserId',
     ];
     protected $tempFields = [
         'temEnteringRecord',
@@ -29,6 +31,10 @@ class LaborReport extends Model
         'amountOfJoined',
     ];
 
+    static function tokenOfBroadcastEnterAndLeave(){
+        return md5('tokenOfListAll'.Carbon::now()->format('Y-m-d'));
+    }
+
     public function userWorkgroup(){
         return $this->belongsTo('App\UserWorkgroup','user_workgroup_id','id');
     }
@@ -36,7 +42,7 @@ class LaborReport extends Model
         return $this->belongsTo('App\User','group_user_id','id');
     }
     public function userDutyCheck(){
-        return $this->belongsTo('App\UserDutyCheck');
+        return $this->belongsTo('App\UserDutyCheck','user_duty_check_id','id');
     }
     public function laborReportStatus(){
         return $this->belongsTo('App\LaborReportStatus','id','labor_report_id');
@@ -52,12 +58,20 @@ class LaborReport extends Model
     public function getIsExportGroupAttribute(){
         return $this['check_out_at']? true:false;
     }
+
+    public function getVerifyPersonAttribute(){
+        if ($this['group_user_id']&&$this['group_user_id']==Auth::user()['id'])
+        return Auth::user()['name'];
+    }
+    public function getUserDutyCheckVerifyUserIdAttribute(){
+        return $this['userDutyCheck']['verify_user_id']?$this['userDutyCheck']['verify_user_id']:'';
+    }
     //总在线时长
     public function getTotalOnlineTimeAttribute(){
         $laborReports=LaborReport::where('enter_number',$this['enter_number'])->get();
         $totalOnlineTime=$laborReports->reduce(function ($value,$laborReport){
-            return $value+$laborReport['thisRecordOnlineTime'];
-        },0);
+            return ($value??0)+$laborReport['thisRecordOnlineTime'];
+        });
         return $totalOnlineTime;
     }
     //总工作时长
@@ -159,7 +173,7 @@ class LaborReport extends Model
 //        return $this['enteringRecord']->userDutyCheck['checked_at'];
         $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','未审核')->orderBy('id','desc')->first();
         if (empty($laborReportStatus))return null;
-        return $laborReportStatus['created_at'];
+        return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
     }
 
     public function getEnteringRecordAttribute()
@@ -199,7 +213,7 @@ class LaborReport extends Model
     {
         $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','已退场')->orderBy('id','desc')->first();
         if (empty($laborReportStatus))return null;
-        return $laborReportStatus['created_at'];
+        return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
     }
 
     //创建或获取进场编号

+ 13 - 4
app/ProcessesContent.php

@@ -13,7 +13,8 @@ class ProcessesContent extends Model
     ];
     protected $appends=[
         'commodity_name',
-        'sign_mark',
+        'sign_commodity_name_mark',
+        'sign_commodity_sku_mark',
     ];
 
     public function process(){
@@ -22,17 +23,25 @@ class ProcessesContent extends Model
     public function commodity(){
         return $this->belongsTo('App\Commodity','commodity_id','id');
     }
-    public function sign(){
+    public function signCommodityName(){
         return $this->hasOne('App\Sign','signable_id','id')
             ->where('signable_type','processes_contents')->where('field','commodity_name');
     }
+    public function signCommoditySku(){
+        return $this->hasOne('App\Sign','signable_id','id')
+            ->where('signable_type','processes_contents')->where('field','commodity_sku');
+    }
 
     public function getCommodityNameAttribute()
     {
         return $this['commodity']? $this['commodity']['name']:null;
     }
-    public function getSignMarkAttribute()
+    public function getSignCommodityNameMarkAttribute()
+    {
+        return $this['signCommodityName']? $this['signCommodityName']['mark']:null;
+    }
+    public function getSignCommoditySkuMarkAttribute()
     {
-        return $this['sign']? $this['sign']['mark']:null;
+        return $this['signCommodityName']? $this['signCommoditySku']['mark']:null;
     }
 }

+ 28 - 25
app/RejectedAnalyzeOwner.php

@@ -76,28 +76,27 @@ class RejectedAnalyzeOwner extends Model
         return $arr;
     }
 
-    // 拼接条件 没有ids     zengjun
+    // 拼接条件     zengjun
     public static function getCondition($array)
     {
-        $condition = '';
-        if (!is_null($array)) {
-            foreach ($array as $key => $value) {
-                if (!is_null($value)) {
-                    if ($key == 'owner_id' and $value!= '' and $value!='null' and $value!= '""') {
-                        $condition .= ' and id_owner = ';
-                        $condition .= $value;
-                    }
-                    if($key == 'ids'){
-                        $sql=RejectedAnalyzeOwner::getSqlToIDs($value);
-                        $condition.=$sql;
-                    }
-                    if ($key == 'created_at_start' and !is_null($value) and $value!= "null" and $value!= '""') {
-                        $value =  str_replace('"','',$value);
-                        $condition .= ' and created_at > "';$condition .= $value;$condition .= '"';
-                    }
-                    if ($key == 'created_at_end' and !is_null($value) and $value!= "null" and $value!= '""') {
-                        $value =  str_replace('"','',$value);
-                        $condition .= ' and created_at < "';$condition .= $value;$condition .= '"';
+        if (isset($array['data'])){
+            $condition=RejectedAnalyzeOwner::getSqlToIDs($array['data']);
+        }else{
+            $condition = '';
+            if (!is_null($array)) {
+                foreach ($array as $key => $value) {
+                    if (!is_null($value)) {
+                        if ($key == 'owner_id' and $value!= '' and $value!='null' and $value!= '""') {
+                            $condition .= RejectedAnalyzeOwner::getSqlToIDs($value);
+                        }
+                        if ($key == 'created_at_start' and !is_null($value) and $value!= "null" and $value!= '""') {
+                            $value =  str_replace('"','',$value);
+                            $condition .= ' and created_at > "';$condition .= $value;$condition .= '"';
+                        }
+                        if ($key == 'created_at_end' and !is_null($value) and $value!= "null" and $value!= '""') {
+                            $value =  str_replace('"','',$value);
+                            $condition .= ' and created_at < "';$condition .= $value;$condition .= '"';
+                        }
                     }
                 }
             }
@@ -108,12 +107,16 @@ class RejectedAnalyzeOwner extends Model
 
     public static function getSqlToIDs($ids):string
     {
-        $sql = '';
+        $sql='';
         if(!is_null($ids) && $ids !='' ) {
-            $ids = str_replace('[','(',$ids);
-            $ids = str_replace(']',')',$ids);
-            $ids = str_replace('"','',$ids);
-            $sql = $sql.' and id_owner in '.$ids;
+            $ids = explode(',',$ids);
+            $sql = ' and id_owner in (';
+            foreach ($ids as $index => $id){
+                if ($index!=0)
+                    $sql .=',';
+                $sql .= $id;
+            }
+            $sql .= ') ';
         }
         return $sql;
     }

+ 3 - 0
app/Services/CarrierService.php

@@ -10,4 +10,7 @@ Class CarrierService
         return Carrier::query()->select('id','name')->get();
     }
 
+    public function find($id){
+        return Carrier::query()->find($id);
+    }
 }

+ 35 - 11
app/Services/LaborReportService.php

@@ -16,20 +16,37 @@ use App\UserDutyCheck;
 use App\UserLabor;
 use Carbon\Carbon;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Gate;
 
 
 class LaborReportService
 {
     private function conditionQuery(Request $request){
-        $laborReports=LaborReport::query()->orderBy('id','DESC');
+        $user=Auth::user();
+        $laborReports=LaborReport::query()->with(['user','userDutyCheck','userWorkgroup'])->orderBy('id','DESC')->whereIn('user_workgroup_id',
+            $user?$user->getPermittingWorkgroupIds(Gate::allows('人事管理-临时工报表-可见全部组')):[]);
+        $laborStatus=LaborReportStatus::select('labor_report_id')->where('status','已退场')->get();
+        $enterNumbers=[];
+        foreach ($laborStatus as $laborId){
+            $enterNumber=LaborReport::where('id',$laborId['labor_report_id'])->value('enter_number');
+            if($enterNumber!=null)
+            array_push($enterNumbers,$enterNumber);
+        }
+        if (!$request->is_export){
+            $laborReports->whereNotIn('enter_number',$enterNumbers);
+        }else $request->offsetUnset('is_export');
         $columnQueryRules=[
-            'enter_number' => ['like' => ''],
+            'enter_number' => ['timeLimit' => 15],
             'created_at_start' => ['alias' => 'created_at' , 'startDate' => ' 00:00:00'],
             'created_at_end' => ['alias' => 'created_at' , 'endDate' => ' 23:59:59'],
-            'identity_number' => ['like' => ''],
-            'mobile_phone' => ['like' => ''],
+            'identity_number' => ['timeLimit' => 15]
         ];
         $laborReports = app(QueryService::class)->query($request,$laborReports,$columnQueryRules);
+        if(Gate::allows('人事管理-临时工报表-可见全部组')||Gate::allows('人事管理-门卫审核')){
+            $laborReports->orWhereNull('user_workgroup_id');
+        }
         return $laborReports;
     }
     public function paginate(Request $request){
@@ -40,18 +57,17 @@ class LaborReportService
     }
     public function some(Request $request){
         return LaborReport::query()->orderBy('id','DESC')
-                        ->whereIn('id',$request->data)->get();
+                        ->whereIn('id',explode(',',$request->data))->get();
     }
-
     //根据进场记录创建临时工报表
     public function makeLaborReportByUserDutyCheck($userDutyCheck){
         $dateNow=Carbon::now()->format('Y-m-d');
         $laborReport=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$dateNow.'%')->orderBy('id','desc')->first();
         if (!$laborReport){
-            $newReport=$userDutyCheck->laborEnterCheck();
+            $newReport=$userDutyCheck->makeEnteringRecord();
             Controller::logS(__METHOD__,"进场创建临时工报表记录__".__FUNCTION__,json_encode([$userDutyCheck]));
             if ($newReport){
-                event(new ImportEvent($userDutyCheck));
+                event(new ImportEvent($newReport));
             }
         }
     }
@@ -63,7 +79,7 @@ class LaborReportService
         if ($userDutyCheck->type=='登入'&&$importAndExportQRCodeType=='import'){
             $newReport=$userDutyCheck->makeEnteringRecord();
             Controller::logS(__METHOD__,"进场创建临时工报表记录__".__FUNCTION__,json_encode([$userDutyCheck]));
-            if ($newReport) event(new ImportEvent($userDutyCheck));
+            if ($newReport) event(new ImportEvent($newReport));
         }
         if(!$laborReport&&$importAndExportQRCodeType=='export'){
             //退场时间跨天情况
@@ -75,7 +91,7 @@ class LaborReportService
             }
                 $exportReport=LaborReport::exitAndChangeLaborReport($laborReportYesterday,$userDutyCheck);
                 Controller::logS(__METHOD__,"退场更改临时工报表信息__".__FUNCTION__,json_encode([$laborReportYesterday,$userDutyCheck]));
-                if ($exportReport) event(new ExportEvent($userDutyCheck));
+                if ($exportReport) event(new ExportEvent($exportReport));
         }
         if($laborReport&&$importAndExportQRCodeType=='export'){
             if (!$laborReport['check_out_at']&&$laborReport['user_workgroup_id']){
@@ -84,7 +100,7 @@ class LaborReportService
             }
             $exportReport=LaborReport::exitAndChangeLaborReport($laborReport,$userDutyCheck);
             Controller::logS(__METHOD__,"退场更改临时工报表信息__".__FUNCTION__,json_encode([$laborReport,$userDutyCheck]));
-            if ($exportReport) event(new ExportEvent($userDutyCheck));
+            if ($exportReport) event(new ExportEvent($exportReport));
         }
     }
 
@@ -121,6 +137,14 @@ class LaborReportService
     public function changeGroupAndMakeLaborReport($user_id,$userWorkgroupID){
         $laborReportBefore=LaborReport::where('user_id',$user_id)->orderby('id','desc')->first();
         if ($laborReportBefore&&$laborReportBefore['status']!='已退场')$userDutyCheck=$laborReportBefore->userDutyCheck;
+        if ($laborReportBefore&&!$laborReportBefore['group_user_id']){
+            if ($laborReportBefore['user_workgroup_id']!=$userWorkgroupID){
+                $laborReportBefore['user_workgroup_id']=$userWorkgroupID;
+                $laborReportBefore['check_in_at']=Carbon::now()->format('Y-m-d H:i:s');
+                $laborReportBefore->update();
+                return $laborReportBefore;
+            }
+        }
         $userDetail=UserDetail::find($user_id);
         $name=$userDetail['full_name'];
         $mobile_phone=$userDetail['mobile_phone'];

+ 7 - 6
app/Services/ProcessService.php

@@ -1,6 +1,6 @@
-<?php 
+<?php
 
-namespace App\Services; 
+namespace App\Services;
 
 use App\Process;
 use App\Services\common\QueryService;
@@ -8,10 +8,11 @@ use Carbon\Carbon;
 use Illuminate\Http\Request;
 
 Class ProcessService
-{ 
+{
     private function conditionQuery(Request $request){
-        $processes=Process::filterAuthorities()->with(['tutorials','signs','signUnitPrice','processesContents'=>function($query){
-            return $query->with(['commodity'=>function($query){
+        $processes=Process::filterAuthorities()->with(['tutorials','signs',
+            'signUnitPrice','processesContents'=>function($query){
+            return $query->with(['signCommodityName','signCommoditySku','commodity'=>function($query){
                 return $query->with('barcodes');
             }]);
         }])->orderBy('processes.id','DESC');
@@ -62,4 +63,4 @@ Class ProcessService
         }])->orderBy('processes.id','DESC')->whereIn('processes.id',explode(',',$request->data))->get();
     }
 
-}
+}

+ 0 - 9
app/Services/UserDutyCheckService.php

@@ -2,15 +2,6 @@
 
 
 namespace App\Services;
-use App\Http\Controllers\Controller;
-use App\Events\ExportEvent;
-use App\Events\ImportEvent;
-use App\Http\Controllers\UserDutyCheckController;
-use App\LaborReport;
-use App\UserDutyCheck;
-use Carbon\Carbon;
-use phpDocumentor\Reflection\DocBlock\Tags\Return_;
-
 class UserDutyCheckService
 {
 

+ 13 - 0
app/Services/WaybillPayoffService.php

@@ -0,0 +1,13 @@
+<?php 
+
+namespace App\Services; 
+
+use App\WaybillPayoff;
+
+Class WaybillPayoffService
+{ 
+    public function updateOrCreate(array $waybillPayoffParam){
+        return WaybillPayoff::query()->updateOrCreate(['waybill_id' => $waybillPayoffParam['waybill_id']],$waybillPayoffParam);
+    }
+
+}

+ 13 - 0
app/Services/WaybillPriceModelService.php

@@ -0,0 +1,13 @@
+<?php 
+
+namespace App\Services; 
+
+use App\WaybillPriceModel;
+
+Class WaybillPriceModelService
+{ 
+    public function find($id){
+        return WaybillPriceModel::query()->find($id);
+    }
+
+}

+ 45 - 15
app/Services/WaybillService.php

@@ -2,16 +2,19 @@
 
 namespace App\Services;
 
+use App\Owner;
 use App\Services\common\QueryService;
+use App\User;
 use App\Waybill;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
 use Ramsey\Uuid\Uuid;
 
 Class WaybillService
 {
     private function conditionQuery(Request $request){
-        $waybills = Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
+        $waybills = Waybill::filterAuthorities()->with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
             return $query->with('user');
         }])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
             ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
@@ -44,7 +47,7 @@ Class WaybillService
     }
 
     public function some(Request $request){
-        return $waybills = Waybill::with(['owner'])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
+        return $waybills = Waybill::filterAuthorities()->with(['owner'])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
             ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
             ->whereNull('waybill_on_tops.deleted_at')
             ->orderBy('waybill_on_tops.updated_at','desc')
@@ -55,19 +58,11 @@ Class WaybillService
 
     public function store(Request $request){
         return DB::transaction(function ()use($request){
-            $waybill=new Waybill([
-                'type'=>$request->type,
-                'status'=>'未审核',
-                'waybill_number'=>Uuid::uuid1(),
-                'owner_id'=>$request->owner_id,
-                'wms_bill_number'=>$request->wms_bill_number,
-                'origination'=>$request->origination,
-                'destination'=>$request->destination,
-                'recipient'=>$request->recipient,
-                'recipient_mobile'=>$request->recipient_mobile,
-                'charge'=>$request->charge,
-                'ordering_remark'=>$request->ordering_remark
-            ]);
+            $waybill=new Waybill();
+            $inputs = $request->all();
+            $inputs['status']='未审核';
+            $inputs['waybill_number']=Uuid::uuid1();
+            $waybill->fill($inputs);
             if ($request->collect_fee)$waybill->collect_fee=$request->collect_fee;
             $waybill->save();
             $number_id=$waybill->id;
@@ -82,4 +77,39 @@ Class WaybillService
     public function find($id){
         return Waybill::query()->find($id);
     }
+
+    public function update(Request $request,$id)
+    {
+        $waybill = $this->find($id);
+        //替换换行符
+        if ($request->dispatch_remark) {
+            $request->offsetSet('dispatch_remark', str_replace(PHP_EOL, ' ', $request->dispatch_remark));
+        }
+        if (!$request->destination) $request->offsetSet('destination', $waybill->destination);
+        if ($request->destination_city_id && $waybill->destination_city_id != $request->destination_city_id) {
+            $city = app(CityService::class)->find($request->destination_city_id);
+            if ($city && $city->province_name && (mb_strpos($request->destination, $city->name) === false || mb_strpos($request->destination, $city->province_name) === false)) {
+                if (mb_strpos($request->destination, $city->name) === false && mb_strpos($request->destination, $city->province_name) === false) {
+                    $request->offsetSet('destination', $city->province_name . $city->name . $request->destination);
+                    goto sign;
+                }
+                if (mb_strpos($request->destination, $city->province_name) === false) {
+                    $request->offsetSet('destination', $city->province_name . $request->destination);
+                }
+                if (mb_strpos($request->destination, $city->name) === false) {
+                    $province_name = $city->province_name;
+                    $start_index = mb_strpos($request->destination, $city->province_name . '省');
+                    if ($start_index === false) $start_index = mb_strpos($request->destination, $city->province_name);
+                    else $province_name = $province_name . '省';
+                    $strBefore = mb_substr($request->destination, $start_index, mb_strlen($province_name));
+                    $strAfter = mb_substr($request->destination, $start_index + mb_strlen($province_name));
+                    $request->offsetSet('destination', $strBefore . $city->name . $strAfter);
+                }
+            }
+        }
+        sign:
+        $waybill->fill($request->input());
+        $waybill->update();
+        return $waybill;
+    }
 }

+ 8 - 0
app/Waybill.php

@@ -5,6 +5,7 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\SoftDeletes;
+use Illuminate\Support\Facades\Auth;
 
 class Waybill extends Model
 {
@@ -133,4 +134,11 @@ class Waybill extends Model
     }
 
 
+    public static function filterAuthorities(){
+        $user = Auth::user();
+        $owner_ids=$user->getPermittingOwnerIdsAttribute();
+        return (new static)->newQuery()->whereIn('owner_id',$owner_ids);
+    }
+
+
 }

+ 0 - 5
package-lock.json

@@ -5805,11 +5805,6 @@
                 "webpack-sources": "^1.1.0"
             }
         },
-        "layer": {
-            "version": "0.1.0",
-            "resolved": "https://registry.npm.taobao.org/layer/download/layer-0.1.0.tgz",
-            "integrity": "sha1-dvirzO7Cfw+vtsUjYndJxrTsihw="
-        },
         "lcid": {
             "version": "2.0.0",
             "resolved": "https://registry.npm.taobao.org/lcid/download/lcid-2.0.0.tgz",

+ 2 - 2
public/js/app.js

@@ -2330,7 +2330,7 @@ function fromByteArray (uint8) {
 var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
   typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
   typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
-  typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : 
+  typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
   false;
 
 /**
@@ -61987,4 +61987,4 @@ module.exports = __webpack_require__(/*! D:\phpstudy_pro\WWW\bswas\resources\sas
 
 /***/ })
 
-/******/ });
+/******/ });

+ 0 - 537
public/js/singles/rejectedIndex.js

@@ -1,537 +0,0 @@
-/******/ (function(modules) { // webpackBootstrap
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-/******/
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-/******/
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId]) {
-/******/ 			return installedModules[moduleId].exports;
-/******/ 		}
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			i: moduleId,
-/******/ 			l: false,
-/******/ 			exports: {}
-/******/ 		};
-/******/
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ 		// Flag the module as loaded
-/******/ 		module.l = true;
-/******/
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-/******/
-/******/
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-/******/
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-/******/
-/******/ 	// define getter function for harmony exports
-/******/ 	__webpack_require__.d = function(exports, name, getter) {
-/******/ 		if(!__webpack_require__.o(exports, name)) {
-/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ 		}
-/******/ 	};
-/******/
-/******/ 	// define __esModule on exports
-/******/ 	__webpack_require__.r = function(exports) {
-/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ 		}
-/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
-/******/ 	};
-/******/
-/******/ 	// create a fake namespace object
-/******/ 	// mode & 1: value is a module id, require it
-/******/ 	// mode & 2: merge all properties of value into the ns
-/******/ 	// mode & 4: return value when already ns object
-/******/ 	// mode & 8|1: behave like require
-/******/ 	__webpack_require__.t = function(value, mode) {
-/******/ 		if(mode & 1) value = __webpack_require__(value);
-/******/ 		if(mode & 8) return value;
-/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ 		var ns = Object.create(null);
-/******/ 		__webpack_require__.r(ns);
-/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ 		return ns;
-/******/ 	};
-/******/
-/******/ 	// getDefaultExport function for compatibility with non-harmony modules
-/******/ 	__webpack_require__.n = function(module) {
-/******/ 		var getter = module && module.__esModule ?
-/******/ 			function getDefault() { return module['default']; } :
-/******/ 			function getModuleExports() { return module; };
-/******/ 		__webpack_require__.d(getter, 'a', getter);
-/******/ 		return getter;
-/******/ 	};
-/******/
-/******/ 	// Object.prototype.hasOwnProperty.call
-/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "/";
-/******/
-/******/
-/******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(__webpack_require__.s = 2);
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "./resources/js/singles/rejectedIndex.js":
-/*!***********************************************!*\
-  !*** ./resources/js/singles/rejectedIndex.js ***!
-  \***********************************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-var vueList = new Vue({
-  el: "#list",
-  data: {
-    filterParams: {
-      created_at: '',
-      owner_id: '',
-      order_number: '',
-      logistic_number_return: '',
-      mobile_sender: '',
-      barcode_goods: '',
-      is_checked: '',
-      created_at_start: '',
-      created_at_end: '',
-      id_quality_label: '',
-      is_loaded: '',
-      checked_numbers: '',
-      paginate: '50'
-    },
-    checkBoxAll: [],
-    rejectedBills: rejectedBills,
-    rejectedBills_checkBoxes: [],
-    owners: owners,
-    qualityLabels: qualityLabels
-  },
-  mounted: function mounted() {
-    $(".tooltipTarget").tooltip({
-      'trigger': 'hover'
-    });
-    this.initInputs();
-    $('#list').removeClass('d-none');
-  },
-  methods: {
-    filterRun: function filterRun() {
-      var form = $("<form method='get'></form>");
-      this.filterParams['page'] = '';
-
-      for (var key in this.filterParams) {
-        if (this.filterParams[key]) {
-          form.append($("<input type='hidden' name='" + key + "' value='" + this.filterParams[key] + "'>"));
-        }
-      }
-
-      $("body").append(form);
-      form.submit();
-    },
-    created_at_startChange: function created_at_startChange(e) {
-      this.filterParams.created_at_start = e.target.value;
-      this.filterRun();
-    },
-    created_at_endChange: function created_at_endChange(e) {
-      this.filterParams.created_at_end = e.target.value;
-      this.filterRun();
-    },
-    owner_idChange: function owner_idChange(e) {
-      this.filterParams.owner_id = e.target.value;
-      this.filterRun();
-    },
-    is_checkedChange: function is_checkedChange(e) {
-      this.filterParams.is_checked = e.target.value;
-      this.filterRun();
-    },
-    id_quality_labelChange: function id_quality_labelChange(e) {
-      this.filterParams.id_quality_label = e.target.value;
-      this.filterRun();
-    },
-    is_loadedChange: function is_loadedChange(e) {
-      this.filterParams.is_loaded = e.target.value;
-      this.filterRun();
-    },
-    mobile_senderChange: function mobile_senderChange(e) {
-      this.filterParams.mobile_sender = e.target.value;
-      this.filterRun();
-    },
-    checked_numbersChange: function checked_numbersChange(e) {
-      this.filterParams.checked_numbers = e.target.value;
-      this.filterRun();
-    },
-    initInputs: function initInputs() {
-      var 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);
-      //         data.filterParams[key]=val;
-      //     });
-      // }
-
-      for (var key in paginateParams) {
-        var val = paginateParams[key];
-        $('input[name="' + key + '"]').val(val);
-        $('select[name="' + key + '"]').val(val);
-        data.filterParams[key] = val;
-      }
-    },
-    edit: function edit(e) {
-      var id = $(e.target).parents('tr').attr('data-id');
-      var editFullUri = editUrl + id + "/edit"; // location.href = editFullUri;
-
-      var form = $('<form action=\"' + editFullUri + '\" method="post" target="_blank"></form>');
-      form.append('<input type="hidden" name="filterParams" value=\'' + JSON.stringify(this.filterParams) + '\'/>');
-      form.append(csrfInput);
-      $('body').append(form);
-      form.submit();
-    },
-    destroy: function destroy(rejectedBill) {
-      if (!confirm('确定要删除退货信息“' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '”吗?')) {
-        return;
-      }
-
-      var data = this;
-      var url = destroyUrl + rejectedBill.id;
-      axios["delete"](url, {
-        id: rejectedBill.id
-      }).then(function (response) {
-        if (response.data.success) {
-          for (var i = 0; i < data.rejectedBills.length; i++) {
-            if (data.rejectedBills[i].id === rejectedBill.id) {
-              data.rejectedBills.splice(i, 1);
-              break;
-            }
-          }
-
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('删除退货信息"' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '"成功!');
-        } else {
-          tempTip.setDuration(1000);
-          tempTip.show('删除退货信息"' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '"失败!');
-        }
-      })["catch"](function (err) {
-        tempTip.setDuration(3000);
-        tempTip.show('删除退货信息失败!' + '网络错误:' + err);
-        console.log(err);
-      });
-    },
-    created_at_startEntering: function created_at_startEntering(e) {
-      if (e.key === 'Enter') {
-        this.created_at_startChange(e);
-      }
-    },
-    created_at_endEntering: function created_at_endEntering(e) {
-      if (e.key === 'Enter') {
-        this.created_at_endChange(e);
-      }
-    },
-    owner_idEntering: function owner_idEntering(e) {
-      if (e.key === 'Enter') {
-        e.target.value = $('#owner_id').val();
-        this.owner_idChange(e);
-        e.target.value = '';
-      }
-    },
-    locateOwner: function locateOwner(e) {
-      str = e.target.value.trim();
-      if (str === '') return;
-      $("#owner_id option").attr("selected", false);
-      var selectingOption = $("#owner_id").find("option:contains(" + str + ")").eq(0);
-      selectingOption.attr("selected", true); // this.filterParams.owner_id=selectingOption.val();
-    },
-    order_numberEntering: function order_numberEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.order_number = e.target.value;
-        this.filterRun();
-      }
-    },
-    barcode_goodsEntering: function barcode_goodsEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.barcode_goods = e.target.value;
-        this.filterRun();
-      }
-    },
-    logistic_number_returnEntering: function logistic_number_returnEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.logistic_number_return = e.target.value;
-        this.filterRun();
-      }
-    },
-    logistic_numberEntering: function logistic_numberEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.logistic_number = e.target.value;
-        this.filterRun();
-      }
-    },
-    cancelCheckConfirmAll: function cancelCheckConfirmAll() {
-      $('#checkConfirmingAll').tooltip('hide');
-      setTimeout(function () {
-        $(".tooltipTarget").tooltip({
-          'trigger': 'hover'
-        });
-      }, 10);
-      this.checkBoxAll = false;
-      this.rejectedBills.forEach(function (rejectedBill) {
-        if (rejectedBill.is_checked === -1) rejectedBill.is_checked = '0';
-      });
-    },
-    setIsLoaded_batch: function setIsLoaded_batch(e) {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length === 0) {
-        tempTip.show('没有勾选记录');
-        $(e.target).val("");
-        return;
-      }
-
-      var val = $(e.target).val();
-      var is_loaded = 0;
-      var is_loadedLabel = '否';
-
-      if (val === "1") {
-        is_loaded = 1;
-        is_loadedLabel = '是';
-      } else if (val === "2") {
-        is_loaded = 2;
-        is_loadedLabel = '待推单';
-      } else if (val === "null") {
-        is_loaded = 'null';
-        is_loadedLabel = '无需入库';
-      }
-
-      if (!confirm("确定要标记所有勾选入库情况为'" + is_loadedLabel + "'吗")) {
-        return;
-      }
-
-      axios.post(ajaxCheckUrl, {
-        ids: _this.rejectedBills_checkBoxes,
-        is_loaded: is_loaded
-      }).then(function (response) {
-        if (response.data.success) {
-          _this.rejectedBills_checkBoxes.forEach(function (id) {
-            _this.rejectedBills.forEach(function (bill) {
-              if (bill.id === id) {
-                bill.is_loaded = is_loaded;
-              }
-            });
-          });
-
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('修改勾选记录的入库状态成功');
-        } else {
-          tempTip.setDuration(2500);
-          tempTip.show('修改勾选记录的入库状态失败,错误:' + response.data.fail_info);
-        }
-      })["catch"](function (e) {
-        alert('网络连接错误:' + e);
-        tempTip.setDuration(2500);
-        tempTip.show('审核勾选内容失败,网络连接错误:' + e);
-        console.log(e);
-      });
-      $(e.target).val("");
-    },
-    checkBoxAllToggle: function checkBoxAllToggle(e) {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length >= this.rejectedBills.length) {
-        _this.rejectedBills_checkBoxes = [];
-        _this.checkBoxAll = [];
-      } else {
-        _this.rejectedBills_checkBoxes = [];
-        this.rejectedBills.forEach(function (bill) {
-          _this.rejectedBills_checkBoxes.push(bill.id);
-
-          _this.checkBoxAll = [1];
-        });
-      }
-    },
-    checkAll: function checkAll() {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length === 0) {
-        tempTip.show('没有勾选记录');
-        return;
-      }
-
-      if (!confirm("确定要标记所有勾选内容为'已审核'吗")) {
-        return;
-      }
-
-      axios.post(ajaxCheckAllURL, {
-        ids: _this.rejectedBills_checkBoxes
-      }).then(function (response) {
-        if (response.data.success) {
-          response.data.rejecteds.forEach(function (rejected) {
-            _this.rejectedBills.forEach(function (rejectedBill) {
-              if (parseInt(rejectedBill.id) === parseInt(rejected.id)) {
-                rejectedBill.is_checked = 1;
-                rejectedBill.checked_numbers = rejected.checked_numbers;
-              }
-            });
-          });
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('审核勾选内容成功');
-        } else {
-          tempTip.setDuration(2500);
-          tempTip.show('审核勾选内容失败,错误:' + response.data.fail_info);
-        }
-      })["catch"](function (e) {
-        alert('网络连接错误:' + e);
-        tempTip.setDuration(2500);
-        tempTip.show('审核勾选内容失败,网络连接错误:' + e);
-        console.log(e);
-      });
-    },
-    finishAll: function finishAll() {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length === 0) {
-        tempTip.show('没有勾选记录');
-        return;
-      }
-
-      if (!confirm("确定要标记所有勾选内容为'已完结'吗")) {
-        return;
-      }
-
-      axios.post(ajaxFinishAllUrl, {
-        ids: _this.rejectedBills_checkBoxes
-      }).then(function (response) {
-        if (response.data.success) {
-          _this.rejectedBills.forEach(function (rejectedBill) {
-            _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
-              if (rejectedBill.id === checkedId) {
-                rejectedBill.is_finished = 1;
-              }
-            });
-          });
-
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('标记勾选内容为完结成功');
-        } else {
-          tempTip.setDuration(2500);
-          tempTip.show('标记勾选内容为完结失败,错误:' + response.data.fail_info);
-        }
-      })["catch"](function (e) {
-        alert('网络连接错误:' + e);
-        tempTip.setDuration(2500);
-        tempTip.show('标记勾选内容完结失败,网络连接错误:' + e);
-        console.log(e);
-      });
-    },
-    exportExcel: function exportExcel(val) {
-      var _this = this;
-      var form;
-        alert(val);
-      if (val === "1") {
-        if (_this.rejectedBills_checkBoxes.length === 0) {
-          tempTip.show('没有勾选记录');
-          return;
-        }
-
-        form = $('<form action=\"' + exportExcelURL + '\" method="post" target="_blank"></form>');
-        form.append('<input type="hidden" name="ids" value=\'' + JSON.stringify(_this.rejectedBills_checkBoxes) + '\'/>');
-      }
-
-      if (val === "2") {
-        if (!confirm("确定要导出当前条件下全部页的结果吗?")) {
-          return;
-        }
-
-        if (total > 100000) {
-          tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录', '知道了');
-        }
-
-        form = $('<form action=\"' + exportExcelOnFilterParamsURL + '\" method="post" target="_blank"></form>');
-        form.append('<input type="hidden" name="filterParams" value=\'' + JSON.stringify(_this.filterParams) + '\'/>');
-      }
-
-      form.append(csrfInput);
-      $('#list').append(form);
-      form.submit();
-      tempTip.setDuration(5000);
-      tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截");
-    },
-    setPaginate: function setPaginate(e) {
-      var _this = this; // let val=$(e.target).val();
-
-
-      this.filterParams.paginate = e.target.value;
-      this.filterRun();
-    }
-  },
-  computed: {
-    isBeingFilterConditions: function isBeingFilterConditions() {
-      for (var key in this.filterParams) {
-        if (this.filterParams[key]) {
-          if (key === 'paginate') continue;
-          if (key === 'page') continue;
-          return true;
-        }
-      }
-
-      return false;
-    }
-  },
-  filters: {
-    yesNo: function yesNo(val) {
-      if (!val || val === 0 || val === '0') {
-        return '否';
-      }
-
-      return '是';
-    },
-    yesNoIsLoaded: function yesNoIsLoaded(val) {
-      switch (val) {
-        case 0:
-        case '0':
-          return '否';
-
-        case 1:
-        case '1':
-          return '是';
-
-        case 2:
-        case '2':
-          return '待推单';
-
-        case null:
-        case 'null':
-          return '无需入库';
-      }
-
-      return '';
-    }
-  }
-});
-
-/***/ }),
-
-/***/ 2:
-/*!*****************************************************!*\
-  !*** multi ./resources/js/singles/rejectedIndex.js ***!
-  \*****************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-module.exports = __webpack_require__(/*! D:\Reald\desktop\BsWAS\src\resources\js\singles\rejectedIndex.js */"./resources/js/singles/rejectedIndex.js");
-
-
-/***/ })
-
-/******/ });

+ 1 - 1
resources/js/queryForm/export.js

@@ -11,7 +11,7 @@ function excelExport(checkAllSign,checkData,url,sum,token) {
         location.href=url;
     }else {
         if (checkData && checkData.length <= 0) {
-            tempTip.setDuration(4000);
+            tempTip.setDuration(3000);
             tempTip.showSuccess('没有勾选任何记录');
         } else {
             let form=$('<form hidden method="post" target="_blank" action="'+url+'">' +

+ 78 - 100
resources/js/queryForm/queryForm.js

@@ -6,6 +6,7 @@ const query = function getQueryForm(data) {
         this.url = data.url || getPathname();
         this.condition = data.condition;
         this.paginations = [50, 100, 200, 500,1000] || data.paginations;
+        this.isPaginations = data.isPaginations !== false;
         this.keydownfun = data.keydownfun || undefined;
         this.selectChange = data.selectChange || undefined;
         this.searchClick = data.searchClick || undefined;
@@ -18,10 +19,9 @@ const query = function getQueryForm(data) {
         this.pervPage = pervPage;
         this.goPage = goPage;
         this.getSearchData = getSearchData;
-        this.autoSubmit = (data.autoSubmit === false) ? false : true ;
+        this.autoSubmit = (data.autoSubmit !== false) ;
         this.param = data.param || [];
 
-
         // 提交表单
         this.onsubmit = function () {
             if(!this.autoSubmit){
@@ -36,7 +36,6 @@ const query = function getQueryForm(data) {
                 } else if ('array' === fetchJsType(map.value)) {
                     let string = map.value.join(',');
                     form.append("<input  name='" + key + "' value='" + string + "'>")
-                    console.log("string:"+string);
                 }
             }
             for (let key in this.param){
@@ -117,11 +116,11 @@ const query = function getQueryForm(data) {
                 if ([null, '', undefined].includes(condition.type) && ![null, undefined].includes(condition.name)) {
                     condition.type = 'input';
                 }
-                if (['dataTime_dataTime', 'input_input'].includes(condition.type)) {
+                if (['dateTime_dateTime', 'input_input'].includes(condition.type)) {
                     td = $("<td  style='width: 330px'</td>")
-                } else if (['select_multiple_select', 'time', 'dataTime_select'].includes(condition.type)) {
+                } else if (['select_multiple_select', 'time', 'dateTime_select'].includes(condition.type)) {
                     td = $("<td  style='width: 280px'</td>");
-                } else if (['time', 'dataTime_select'].includes(condition.type)) {
+                } else if (['time', 'dateTime_select'].includes(condition.type)) {
                     td = $("<td  style='width: 320px'</td>");
                 }
                 td.append(createModule(condition));
@@ -144,15 +143,15 @@ const query = function getQueryForm(data) {
         _baseData.condition.forEach(function (conditions, xindex, xarrays) {
             let _width = 0;
             conditions.forEach(function (condition, index, array) {
-                if (['input', 'select', 'dataTime', 'input_select'].includes(condition.type)) {
+                if (['input', 'select', 'dateTime', 'input_select'].includes(condition.type)) {
                     _width += 260;
-                } else if (['dataTime_dataTime', 'input_input'].includes(condition.type)) {
+                } else if (['dateTime_dateTime', 'input_input'].includes(condition.type)) {
                     _width += 330;
                 } else if (['select_multiple_select','search_select'].includes(condition.type)) {
                     _width += 280;
                 } else if (['checkbox'].includes(condition.type)) {
                     _width += 260;
-                } else if (['time', 'dataTime_select'].includes(condition.type)) {
+                } else if (['time', 'dateTime_select'].includes(condition.type)) {
                     _width += 320;
                 } else if ([undefined, null, ''].includes(condition)) {
                     _width += 260;
@@ -204,7 +203,8 @@ const query = function getQueryForm(data) {
 
     // create _pagination
     function createPagination() {
-        _pagination = $("<select id='paginate' name='paginate' class='form-control form-control-sm' style='vertical-align: middle; max-width: 150px;'></select>");
+        let isPaginations = _this.isPaginations ? '' : 'hidden';
+        _pagination = $("<select id='paginate' "+isPaginations+" name='paginate' class='form-control form-control-sm' style='vertical-align: middle; max-width: 150px;'></select>");
         let tr = $("<tr ><td colspan='10'><div class='col p-0' style='height: 100%'></div></td></tr>");
         tr.find('div').append(_pagination);
         _this.paginations.forEach(function (map) {
@@ -312,11 +312,11 @@ const query = function getQueryForm(data) {
             || (type === "select" && getSelect(condition))
             || (type === "search_select" && getSearchSelect(condition))
             || (type === "input_select" && getInputSelect(condition))
-            || (type === "dataTime" && getDataTime(condition))
+            || (type === "dateTime" && getdateTime(condition))
             || (type === "time" && getTime(condition))
             || (type === "input_input" && getInputInput(condition))
-            || (type === "dataTime_dataTime" && getDataTimeDataTime(condition))
-            || (type === "dataTime_select" && getDataTimeSelect(condition))
+            || (type === "dateTime_dateTime" && getdateTimedateTime(condition))
+            || (type === "dateTime_select" && getdateTimeSelect(condition))
             || (type === "select_multiple_select" && getSelectMultipleSelect(condition))
             || (type === "checkbox" && getCheckBox(condition));
     }
@@ -364,16 +364,12 @@ const query = function getQueryForm(data) {
         }
         fillSelectOption(select, condition.data, placeholder);
         input.bind('input propertychange', function () {
-            let value = this.value;let data = condition.data.filter(function (map) {
-            return map.value.includes(value);
+            let value = this.value;
+            let data = condition.data.filter(function (map) {
+                return map.value.includes(value);
             })
             fillSelectOption(select, data || condition.data);
-            if(data.length > 0 && data.length !== condition.data.length){
-                _data[condition.name].select = data[0].name;
-            }
             select.val(_data[condition.name].select);
-            let dom = {name:condition.name,type:'input_select',value:select.val(),mold:'select'};
-            modifyData(dom);
         })
         select.change(function () {
             let dom = {name: condition.name, type: 'input_select', value: this.value, mold: 'select'};
@@ -401,25 +397,25 @@ const query = function getQueryForm(data) {
     }
 
     // datTime
-    function getDataTime(condition) {
-        let dataTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name + "'  style='max-width: 150px' data-toggle='tooltip' data-placement='top' title='" + condition.tip + "' style='width: 200px'>");
-        dataTime.attr('title', controlJsType(condition.tip, 'undefined') ? '' : condition.tip);
-        dataTime.bind('input propertychange', function () {
-            let dom = {name: condition.name, type: 'dataTime', value: this.value, mold: 'dataTime'};
+    function getdateTime(condition) {
+        let dateTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name + "'  style='max-width: 150px' data-toggle='tooltip' data-placement='top' title='" + condition.tip + "' style='width: 200px'>");
+        dateTime.attr('title', controlJsType(condition.tip, 'undefined') ? '' : condition.tip);
+        dateTime.bind('input propertychange', function () {
+            let dom = {name: condition.name, type: 'dateTime', value: this.value, mold: 'dateTime'};
             modifyData(dom);
         })
-        return dataTime;
+        return dateTime;
     }
 
     // time
     function getTime(condition) {
         let div = $("<div class='form-inline'></div>");
-        let dataTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name + "'  style='width:150px' data-toggle='tooltip' data-placement='top' >");
-        dataTime.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
+        let dateTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name + "'  style='width:150px' data-toggle='tooltip' data-placement='top' >");
+        dateTime.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
         let min = $("<input id='" + condition.name + "_min' class='form-control form-control-sm ml-2' style='max-width: 100px;' placeholder='00:00' data-toggle='tooltip' data-placement='top' >");
         min.attr('title', controlJsType(condition.tip[1], 'undefined') ? '' : condition.tip[1]);
 
-        dataTime.bind('input propertychange', function () {
+        dateTime.bind('input propertychange', function () {
             let value = this.value !== '' ? this.value + ' ' + ([null, undefined, ''].includes(min.value) ? '00:00' : min.value) : '';
             let dom = {name: condition.name, type: 'time', value: value, mold: 'time'};
             modifyData(dom);
@@ -428,16 +424,16 @@ const query = function getQueryForm(data) {
             verifyTime(this);
         })
         min.bind('input propertychange', function () {
-            if (['null', 'undefined', ''].includes(dataTime.val())) {
+            if (['null', 'undefined', ''].includes(dateTime.val())) {
                 return;
             }
 
-            let value = ['null', 'undefined', ''].includes(dataTime.val()) ? '' : dataTime.val() + ' ' + min.val();
-            //let value = dataTime.value !== '' ? dataTime.value + ' ' + (min.value === '' ? '00:00' : min. value) : '';
+            let value = ['null', 'undefined', ''].includes(dateTime.val()) ? '' : dateTime.val() + ' ' + min.val();
+            //let value = dateTime.value !== '' ? dateTime.value + ' ' + (min.value === '' ? '00:00' : min. value) : '';
             let dom = {name: condition.name, type: 'time', value: value, mold: 'time'};
             modifyData(dom);
         })
-        return div.append(dataTime).append(min);
+        return div.append(dateTime).append(min);
     }
 
     // input_input
@@ -459,45 +455,45 @@ const query = function getQueryForm(data) {
         return div.append(input1).append(input2);
     }
 
-    // dataTime_dataTime
-    function getDataTimeDataTime(condition) {
-        let div = $("<div class='form-inline' style='width: 330px'></div>");
-        let dataTime1 = $("<input type='date' class='form-control form-control-sm' name='" + condition.name[0] + "'  style='width: 150px' data-toggle='tooltip' data-placement='top' >");
-        dataTime1.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
+    // dateTime_dateTime
+    function getdateTimedateTime(condition) {
+        let div = $("<div class='form-inline'></div>");
+        let dateTime1 = $("<input type='date' class='form-control form-control-sm' name='" + condition.name[0] + "'  style='width: 150px' data-toggle='tooltip' data-placement='top' >");
+        dateTime1.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
 
-        let dataTime2 = $("<input type='date' class='form-control form-control-sm ml-2' name='" + condition.name[1] + "'  style='width: 150px;' data-toggle='tooltip' data-placement='top' >");
-        dataTime2.attr('title', controlJsType(condition.tip[1], 'undefined') ? '' : condition.tip[1]);
+        let dateTime2 = $("<input type='date' class='form-control form-control-sm ml-2' name='" + condition.name[1] + "'  style='width: 150px;' data-toggle='tooltip' data-placement='top' >");
+        dateTime2.attr('title', controlJsType(condition.tip[1], 'undefined') ? '' : condition.tip[1]);
 
-        dataTime1.bind('input propertychange', function () {
-            let dom = {name: this.name, type: 'dataTime_dataTime', value: this.value, mold: 'dataTime'};
+        dateTime1.bind('input propertychange', function () {
+            let dom = {name: this.name, type: 'dateTime_dateTime', value: this.value, mold: 'dateTime'};
             modifyData(dom);
         })
-        dataTime2.bind('input propertychange', function () {
-            let dom = {name: this.name, type: 'dataTime_dataTime', value: this.value, mold: 'dataTime'};
+        dateTime2.bind('input propertychange', function () {
+            let dom = {name: this.name, type: 'dateTime_dateTime', value: this.value, mold: 'dateTime'};
             modifyData(dom);
         })
-        return div.append(dataTime1).append(dataTime2);
+        return div.append(dateTime1).append(dateTime2);
     }
 
-    // dataTime_select
-    function getDataTimeSelect(condition) {
+    // dateTime_select
+    function getdateTimeSelect(condition) {
         let div = $("<div class='form-inline'></div>");
-        let dataTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name[0] + "'  style='max-width: 150px;' data-toggle='tooltip' data-placement='top' >");
-        dataTime.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
+        let dateTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name[0] + "'  style='max-width: 150px;' data-toggle='tooltip' data-placement='top' >");
+        dateTime.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
 
         let select = $("<select name='" + condition.name[1] + "' class='form-control form-control-sm ml-2' data-toggle='tooltip' data-placement='top' style='max-width: 100px'></select>");
         select.attr('title', controlJsType(condition.tip[1], 'undefined') ? '' : condition.tip[1]);
 
         fillSelectOption(select, condition.data)
-        dataTime.bind('input propertychange', function () {
-            let dom = {name: this.name, type: 'dataTime_select', value: this.value, mold: 'dataTime'};
+        dateTime.bind('input propertychange', function () {
+            let dom = {name: this.name, type: 'dateTime_select', value: this.value, mold: 'dateTime'};
             modifyData(dom);
         })
         select.change(function () {
-            let dom = {name: this.name, type: 'dataTime_select', value: this.value, mold: 'select'};
+            let dom = {name: this.name, type: 'dateTime_select', value: this.value, mold: 'select'};
             modifyData(dom);
         })
-        return div.append(dataTime).append(select);
+        return div.append(dateTime).append(select);
     }
 
     // select_multiple_select
@@ -572,8 +568,9 @@ const query = function getQueryForm(data) {
         })
         ul_div.hide();
         ul_div.mouseleave(function () {
-            if(_data[condition.name].value){
+            if(_data[condition.name].value.length>0){
                 _this.onsubmit();
+                ul_div.hide();
             }
         });
         return div;
@@ -594,6 +591,7 @@ const query = function getQueryForm(data) {
                 })
                 let dom = {name: condition.name, type: 'checkbox', value: value, mold: 'check'};
                 modifyData(dom);
+                _this.onsubmit();
             });
         })
         return div1;
@@ -661,7 +659,7 @@ const query = function getQueryForm(data) {
         let label = $('#' + name + '_lab');
         let select = $('#' + name + '_sel');
         let dom_data = _data[name].value;
-        if (dom_data.length === 1 ) {
+        if (dom_data && dom_data.length === 1 ) {
             select.show();
             select.val(dom_data[0]);
             label.hide();
@@ -681,15 +679,21 @@ const query = function getQueryForm(data) {
         _data[dom.name].value = dom.value;
         _data[dom.name].select = dom.value;
         redenerSearchFormOnData(dom.name, dom.value, dom.mold);
+        let killings=_data[dom.name].killings;
+        if(killings){
+            killings.forEach(function(targetName){
+                redenerSearchFormOnData(_data[targetName].name, '', _data[targetName].mold);
+            })
+        }
     }
 
+
     // save search on cookie
     function saveSearchOnCookie() {
         let saveData = {};
         for (const key in _data) {
             if (!['', null, undefined].includes(_data[key].value)) {
                 if (controlJsType(_data[key].value, 'array') && _data[key].value.length === 0) {
-                    //console.log(key);
                     continue;
                 }
                 saveData[key] = {
@@ -794,7 +798,6 @@ const query = function getQueryForm(data) {
             }
         } else {
             $(_form).find("select[name='" + key + "']").val(value);
-            //console.log(value === _this.paginations[0]);
             if (key === 'paginate' && value == _this.paginations[0]) {
                 return;
             }
@@ -879,6 +882,9 @@ const query = function getQueryForm(data) {
                 }
             } else {
                 if (![undefined, null, ''].includes(_data[key].value)) {
+                    if(controlJsType(_data[key].value,'array') && _data[key].value.length === 0 ){
+                        continue;
+                    }
                     bool = true;
                 }
             }
@@ -920,7 +926,7 @@ const query = function getQueryForm(data) {
     }
 
     function redenerSearchFormOnData(key, value, mold) {
-        if (mold === 'input') {
+        if (mold === 'input' ||mold === 'dateTime') {
             rendererSearchFormOnInput(key, value, mold);
         } else if (mold === 'select') {
             rendererSearchFormOnSelect(key, value, mold);
@@ -937,7 +943,7 @@ const query = function getQueryForm(data) {
     function switchData() {
         _this.condition.forEach(function (conditions) {
             conditions.forEach(function (condition) {
-                if (['input', 'select', 'dataTime', 'search_select', 'time', 'select_multiple_select','checkbox'].includes(condition.type)) {
+                if (['input', 'select', 'dateTime', 'search_select', 'time', 'select_multiple_select','checkbox'].includes(condition.type)) {
                     if (!condition.select) {
                         condition.select = '';
                     }
@@ -946,14 +952,18 @@ const query = function getQueryForm(data) {
                         type: condition.type,
                         value: condition.value,
                         select: condition.select,
-                        mold: ['input', 'dataTime'].includes(condition.type) ? 'input' : condition.type,
-                        data:condition.data
+                        mold: ['input', 'dateTime'].includes(condition.type) ? 'input' : condition.type,
+                        data:condition.data,
+                        killings:condition.killings,
                     }
                     if (condition.type === 'search_select') {
                         data.mold = 'select';
                     }
+                    if(condition.type === 'select_multiple_select'){
+                        data.value = [];
+                    }
                     _data[condition.name] = data;
-                } else if (['dataTime_dataTime', 'input_input', 'input_select', 'dataTime_select'].includes(condition.type)) {
+                } else if (['dateTime_dateTime', 'input_input', 'input_select', 'dateTime_select'].includes(condition.type)) {
                     let types = condition.type.split("_");
                     if (!condition.select) {
                         condition.select = ['', ''];
@@ -967,7 +977,11 @@ const query = function getQueryForm(data) {
                             type: types[index],
                             value: condition.value[index],
                             select: condition.select[index],
-                            mold: ['input', 'dataTime'].includes(types[index]) ? 'input' : types[index]
+                            mold: ['input', 'dateTime'].includes(types[index]) ? 'input' : types[index],
+                            killings:condition.killings,
+                        }
+                        if(condition.killings&&Array.isArray(condition.killings)){
+                            data.killings=condition.killings[index];
                         }
                         _data[_name] = data;
                     })
@@ -988,7 +1002,6 @@ const query = function getQueryForm(data) {
     }
 
     function rendererOptionOnCookie() {
-        //console.log('rendererSearchFromOnCookie');
         let data = fetchCookie();
         if (data === undefined) {
             return;
@@ -1011,13 +1024,11 @@ const query = function getQueryForm(data) {
     }
 
     function rendererSearchFormOn_data() {
-        // console.log('rendererSearchFormOn_data', _data);
-
         for (let key in _data) {
             let value = _data[key].value, type = _data[key].type, mold = _data[key].mold;
             _data[key].select = value;
 
-            if (['input', 'dataTime'].includes(mold)) {
+            if (['input', 'dateTime'].includes(mold)) {
                 rendererSearchFormOnInput(key, value, mold);
             } else if (['select'].includes(mold)) {
                 rendererSearchFormOnSelect(key, value, mold);
@@ -1033,39 +1044,6 @@ const query = function getQueryForm(data) {
                 $(_form).find("input[name='" + key + "']").val(value.substr(0, 10));
                 $(_form).find("input[id='" + key + "_min']").val(value.substr(11, value.length));
             }
-
-            /*  if (['input', 'dataTime', 'input_input', 'dataTime_dataTime'].includes(type)) {
-                  rendererSearchFormOnInput(key,value,mold);
-              } else if (['select', 'input_select', 'dataTime_select'].includes(type)) {
-                  if (mold === 'select') {
-                      rendererSearchFormOnSelect(key,value,mold)
-                  } else if (mold === 'input') {
-                      rendererSearchFormOnInput(key,value,mold);
-                  } else if (mold === 'dataTime') {
-                      rendererSearchFormOnInput(key,value,mold);
-                  }
-              } else if (['input_select_text'].includes(type)) {
-                  if (mold === 'input') {
-                      rendererSearchFormOnInput(key,value,mold);
-                  } else if (mold === 'select') {
-                      rendererSearchFormOnSelect(key,value,mold)
-                  }
-              } else if (['checkbox'].includes(type)) {
-                  if (controlJsType(value, 'array')) {
-                      value.forEach(function (map) {
-                          $(_form).find("input[type='checkbox'][name='" + key + "'][value='" + map + "']").attr("checked", true);
-                      })
-                  }
-              } else if (['select_multiple_select'].includes(type)) {
-                  if (controlJsType(value, ['array','string']) ) {
-                      let ul = $(_form).find("ul[name='" + key + "']");
-                      redenerUl(ul);
-                      rendererSearchFormOnMultipleSelect(key,value,mold);
-                  }
-              } else if (['time'].includes(type) && value !== undefined) {
-                  $(_form).find("input[name='"+key+"']").val(value.substr(0,10));
-                  $(_form).find("input[id='"+key+"_min']").val(value.substr(11,value.length));
-              }*/
         }
         if ([undefined, null, ''].includes(data['paginate'])) {
             return;

+ 1 - 1
resources/js/queryForm/queryForm说明.txt

@@ -37,7 +37,7 @@ let data = [
 需要渲染的二维数组 condition
 初始化	init()
 
-input,select,dataTime
+input,select,dateTime
 
 condition:{
 	name:

+ 0 - 401
resources/js/singles/rejectedIndex.js

@@ -1,401 +0,0 @@
-let vueList=new Vue({
-    el:"#list",
-    data:{
-        filterParams:{created_at:'',owner_id:'',order_number:'',logistic_number_return:'',mobile_sender:'',barcode_goods:'',id_logistic_return:'',
-            is_checked:'',created_at_start:'',created_at_end:'',id_quality_label:'',is_loaded:'',checked_numbers:'',paginate:'50'},
-        checkBoxAll:[],
-        rejectedBills:rejectedBills,
-        rejectedBills_checkBoxes:[],
-        owners:owners,
-        logistics:logistics,
-        qualityLabels:qualityLabels,
-    },
-    mounted:function(){
-        $(".tooltipTarget").tooltip({'trigger':'hover'});
-        this.initInputs();
-        $('#list').removeClass('d-none');
-    },
-    methods:{
-        filterRun:function(){
-            let form=$("<form method='get'></form>");
-            this.filterParams['page']='';
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    form.append($("<input type='hidden' name='"+key+"' value='"+this.filterParams[key]+"'>"));
-                }
-            }
-            $("body").append(form);
-            form.submit();
-        },
-        searchByFilters:function(e){
-            this.filterRun();
-        },
-        created_at_startChange:function(e){
-            this.filterParams.created_at_start=e.target.value;
-            this.filterRun();
-        },
-        created_at_endChange:function(e){
-            this.filterParams.created_at_end=e.target.value;
-            this.filterRun();
-        },
-        owner_idChange:function(e){
-            this.filterParams.owner_id=e.target.value;
-            this.filterRun();
-        },
-        is_checkedChange:function(e){
-            this.filterParams.is_checked=e.target.value;
-            this.filterRun();
-        },
-        id_quality_labelChange:function(e){
-            this.filterParams.id_quality_label=e.target.value;
-            this.filterRun();
-        },
-        is_loadedChange:function(e){
-            this.filterParams.is_loaded=e.target.value;
-            this.filterRun();
-        },
-        id_logistic_return_change:function(e){
-            this.filterParams.id_logistic_return=e.target.value;
-            this.filterRun();
-        },
-        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);
-            //         data.filterParams[key]=val;
-            //     });
-            // }
-            for(let key in paginateParams){
-                let val = paginateParams[key];
-                $('input[name="'+key+'"]').val(val);
-                $('select[name="'+key+'"]').val(val);
-                data.filterParams[key]=val;
-            }
-
-        },
-        edit:function(e){
-            let id = $(e.target).parents('tr').attr('data-id');
-            let editFullUri = editUrl+id+"/edit";
-            // location.href = editFullUri;
-            let form=$('<form action=\"'+editFullUri+'\" method="post" target="_blank"></form>');
-            form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(this.filterParams)+'\'/>');
-            form.append(csrfInput);
-            $('body').append(form);
-            form.submit();
-        },
-        destroy:function(rejectedBill){
-            if(!confirm('确定要删除退货信息“' + rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+ '”吗?')){return;}
-            let data=this;
-            let url = destroyUrl+rejectedBill.id;
-            axios.delete(url,{id:rejectedBill.id})
-                .then(function (response) {
-                    if(response.data.success){
-                        for (let i = 0; i < data.rejectedBills.length; i++) {
-                            if (data.rejectedBills[i].id===rejectedBill.id){
-                                data.rejectedBills.splice(i,1);
-                                break;
-                            }
-                        }
-                        tempTip.setDuration(1000);
-                        tempTip.showSuccess('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"成功!')
-                    }else{
-                        tempTip.setDuration(1000);
-                        tempTip.show('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"失败!')
-                    }
-                })
-                .catch(function (err) {
-                    tempTip.setDuration(3000);
-                    tempTip.show('删除退货信息失败!'+'网络错误:' + err);
-                    console.log(err);
-                });
-        },
-        submitFilterOnEnter:function(e){
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        created_at_startEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_startChange(e)
-            }
-        },
-        created_at_endEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_endChange(e)
-            }
-        },
-        owner_idEntering:function(e){
-            if(e.key==='Enter'){
-                e.target.value=$('#owner_id').val();
-                this.owner_idChange(e);
-                e.target.value='';
-            }
-        },
-        locateOwner:function (e) {
-            str = e.target.value.trim()
-            if (str==='')return ;
-            $("#owner_id option").attr("selected",false);
-            let selectingOption=$("#owner_id").find("option:contains("+str+")").eq(0);
-            selectingOption.attr("selected",true);
-            this.filterParams.owner_id=selectingOption.val();
-        },
-        mobile_senderEntering:function(e){
-            this.filterParams.mobile_sender=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        order_numberEntering:function(e){
-            this.filterParams.order_number=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        barcode_goodsEntering:function(e){
-            this.filterParams.barcode_goods=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        checked_numbersEntering:function(e){
-            this.filterParams.checked_numbers=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        logistic_number_returnEntering:function(e){
-            this.filterParams.logistic_number_return=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        logistic_numberEntering:function(e){
-            this.filterParams.logistic_number=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        cancelCheckConfirmAll:function(){
-            $('#checkConfirmingAll').tooltip('hide');
-            setTimeout(function () {
-                $(".tooltipTarget").tooltip({'trigger':'hover'})
-            }, 10);
-            this.checkBoxAll=false;
-            this.rejectedBills.forEach(function(rejectedBill){
-                if(rejectedBill.is_checked===-1)
-                    rejectedBill.is_checked='0';
-            })
-        },
-        setIsLoaded_batch:function(val){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length===0){
-                tempTip.show('没有勾选记录');
-                $(e.target).val("");
-                return;
-            }
-            let is_loaded=0;
-            let is_loadedLabel='否';
-            if(parseInt(val)===1){
-                is_loaded=1;
-                is_loadedLabel='是';
-            }else if(parseInt(val)===2){
-                is_loaded=2;
-                is_loadedLabel='待推单';
-            }else if(parseInt(val)===4){
-                is_loaded=4;
-                is_loadedLabel='待确认';
-            }else if(val==="null"){
-                is_loaded='null';
-                is_loadedLabel='无需入库';
-            }
-            if(!confirm("确定要标记所有勾选入库情况为'"+is_loadedLabel+"'吗")){return;}
-            axios.post(ajaxCheckUrl,{ids:_this.rejectedBills_checkBoxes,is_loaded:is_loaded}).then(function(response){
-                if(response.data.success){
-                    _this.rejectedBills_checkBoxes.forEach(function(id){
-                        _this.rejectedBills.forEach(function(bill){
-                            if(bill.id===id){
-                                bill.is_loaded=is_loaded;
-                            }
-                        });
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('修改勾选记录的入库状态成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.show('修改勾选记录的入库状态失败,错误:'+response.data.fail_info);
-                }
-            }).catch(function (e) {
-                alert('网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-                console.log(e);
-            });
-            $(e.target).val("")
-        },
-        checkBoxAllToggle:function(e){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length>=this.rejectedBills.length){
-                _this.rejectedBills_checkBoxes=[];
-                _this.checkBoxAll=[];
-            }
-            else{
-                _this.rejectedBills_checkBoxes=[];
-                this.rejectedBills.forEach(function(bill){
-                    _this.rejectedBills_checkBoxes.push(bill.id);
-                    _this.checkBoxAll=[1];
-                });
-            }
-        },
-        checkAll:function(){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length===0){
-                tempTip.show('没有勾选记录');
-                return
-            }
-            if(!confirm("确定要标记所有勾选内容为'已审核'吗")){return;}
-            axios.post(ajaxCheckAllURL,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-                if(response.data.success){
-                    response.data.rejecteds.forEach(function (rejected) {
-                        _this.rejectedBills.forEach(function(rejectedBill){
-                            if(parseInt(rejectedBill.id)===parseInt(rejected.id)){
-                                rejectedBill.is_checked=1;
-                                rejectedBill.checked_numbers=rejected.checked_numbers;
-                            }
-                        });
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('审核勾选内容成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.show('审核勾选内容失败,错误:'+response.data.fail_info);
-                }
-            }).catch(function (e) {
-                alert('网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-                console.log(e);
-            })
-        },
-        confirmBeStored:function($e,id){
-            let _this=this;
-            axios.post(ajaxConfirmBeStoredUrl,{id:id}).then(function(response){
-                if(response.data.success){
-                    _this.rejectedBills.forEach(function(rejectedBill){
-                        if(rejectedBill.id===id){
-                            rejectedBill.is_loaded=1;
-                        }
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('确认入库成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.okWindow('数据异常无法确认!请在WMS确定入库状态后,勾选该条目手动修改相应入库状态!','知道了')
-                }
-            }).catch(function (e) {
-                alert('确认失败,网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('确认失败,网络连接错误:'+e);
-                console.log(e);
-            })
-        },
-        finishAll:function(){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length===0){
-                tempTip.show('没有勾选记录');
-                return
-            }
-            if(!confirm("确定要标记所有勾选内容为'已完结'吗")){return;}
-            axios.post(ajaxFinishAllUrl,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-                if(response.data.success){
-                    _this.rejectedBills.forEach(function(rejectedBill){
-                        _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
-                            if(rejectedBill.id===checkedId){
-                                rejectedBill.is_finished=1;
-                            }
-                        });
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('标记勾选内容为完结成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.show('标记勾选内容为完结失败,错误:'+response.data.fail_info);
-                }
-            }).catch(function (e) {
-                alert('网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('标记勾选内容完结失败,网络连接错误:'+e);
-                console.log(e);
-            })
-        },
-        exportExcel:function(val){
-            let _this=this;
-            let form;
-            if(parseInt(val)===1){
-                if(_this.rejectedBills_checkBoxes.length===0){
-                    tempTip.show('没有勾选记录');
-                    return;
-                }
-                form=$('<form action=\"'+exportExcelURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="ids" value=\''+JSON.stringify(_this.rejectedBills_checkBoxes)+'\'/>');
-                form.append('<input type="hidden" name="created_at_start" value=\''+JSON.stringify(_this.created_at_start)+'\'/>');
-                form.append('<input type="hidden" name="created_at_end" value=\''+JSON.stringify(_this.created_at_end)+'\'/>');
-            }
-            if(parseInt(val)===2){
-                if(!confirm("确定要导出当前条件下全部页的结果吗?")){return;}
-                if(total>100000){
-                    tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录','知道了')
-                }
-                form=$('<form action=\"'+exportExcelOnFilterParamsURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(_this.filterParams)+'\'/>');
-
-            }
-            form.append(csrfInput);
-            $('#list').append(form);
-            form.submit();
-            tempTip.setDuration(5000);
-            tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截")
-        },
-        setPaginate:function(e){
-            let _this=this;
-            // let val=$(e.target).val();
-            this.filterParams.paginate=e.target.value;
-            this.filterRun();
-        },
-
-    },
-    computed:{
-        isBeingFilterConditions:function(){
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    if(key==='paginate')continue;
-                    if(key==='page')continue;
-                    return true
-                }
-            }
-            return false;
-        }
-    },
-    filters:{
-        yesNo:function (val) {
-            if(!val||val===0||val==='0'){return '否'}
-            return '是'
-        },
-        yesNoIsLoaded:function (val) {
-            switch(val){
-                case 0:case '0':return '否';
-                case 1:case '1':return '是';
-                case 2:case '2':return '待推单';
-                case 3:case '3':return '交互异常';
-                case 4:case '4':return '待确认';
-                case null:case 'null':return '无需入库';
-            }
-            return '';
-        }
-    }
-});

+ 0 - 396
resources/js/singles/searchAnalyze.js

@@ -1,396 +0,0 @@
-
-let vueList=new Vue({
-    el:"#list",
-    data:{
-        filterParams:{created_at:'',owner_id:'',
-            //,order_number:'',logistic_number_return:'',mobile_sender:'',barcode_goods:'',
-            //is_checked:'',
-            created_at_start:'',created_at_end:'',
-            //id_quality_label:'',
-            //is_loaded:'',
-            //checked_numbers:'',
-           // paginate:'50'
-        },
-        checkBoxAll:[],
-        rejectedBills:rejectedBills,
-        rejectedBills_checkBoxes:[],
-        owners:owners,
-        qualityLabels:qualityLabels,
-    },
-    mounted:function(){
-        $(".tooltipTarget").tooltip({'trigger':'hover'});
-        this.initInputs();
-        $('#list').removeClass('d-none');
-    },
-    methods:{
-        filterRun:function(){
-            let form=$("<form method='get'></form>");
-            this.filterParams['page']='';
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    form.append($("<input type='hidden' name='"+key+"' value='"+this.filterParams[key]+"'>"));
-                }
-            }
-            $("body").append(form);
-            form.submit();
-        },
-        searchByFilters:function(e){
-            this.filterRun();
-        },
-        created_at_startChange:function(e){
-            this.filterParams.created_at_start=e.target.value;
-            this.filterRun();
-        },
-        created_at_endChange:function(e){
-            this.filterParams.created_at_end=e.target.value;
-            this.filterRun();
-        },
-        owner_idChange:function(e){
-            this.filterParams.owner_id=e.target.value;
-            this.filterRun();
-        },
-        is_checkedChange:function(e){
-            this.filterParams.is_checked=e.target.value;
-            this.filterRun();
-        },
-        id_quality_labelChange:function(e){
-            this.filterParams.id_quality_label=e.target.value;
-            this.filterRun();
-        },
-        is_loadedChange:function(e){
-            this.filterParams.is_loaded=e.target.value;
-            this.filterRun();
-        },
-        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);
-                    data.filterParams[key]=val;
-                });
-            }
-            for(let key in paginateParams){
-                let val = paginateParams[key];
-                $('input[name="'+key+'"]').val(val);
-                $('select[name="'+key+'"]').val(val);
-                data.filterParams[key]=val;
-            }
-
-        },
-        // edit:function(e){
-        //     let id = $(e.target).parents('tr').attr('data-id');
-        //     let editFullUri = editUrl+id+"/edit";
-        //     // location.href = editFullUri;
-        //     let form=$('<form action=\"'+editFullUri+'\" method="post" target="_blank"></form>');
-        //     form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(this.filterParams)+'\'/>');
-        //     form.append(csrfInput);
-        //     $('body').append(form);
-        //     form.submit();
-        // },
-        // destroy:function(rejectedBill){
-        //     if(!confirm('确定要删除退货信息“' + rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+ '”吗?')){return;}
-        //     let data=this;
-        //     let url = destroyUrl+rejectedBill.id;
-        //     axios.delete(url,{id:rejectedBill.id})
-        //         .then(function (response) {
-        //             if(response.data.success){
-        //                 for (let i = 0; i < data.rejectedBills.length; i++) {
-        //                     if (data.rejectedBills[i].id===rejectedBill.id){
-        //                         data.rejectedBills.splice(i,1);
-        //                         break;
-        //                     }
-        //                 }
-        //                 tempTip.setDuration(1000);
-        //                 tempTip.showSuccess('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"成功!')
-        //             }else{
-        //                 tempTip.setDuration(1000);
-        //                 tempTip.show('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"失败!')
-        //             }
-        //         })
-        //         .catch(function (err) {
-        //             tempTip.setDuration(3000);
-        //             tempTip.show('删除退货信息失败!'+'网络错误:' + err);
-        //             console.log(err);
-        //         });
-        // },
-        submitFilterOnEnter:function(e){
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        created_at_startEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_startChange(e)
-            }
-        },
-        created_at_endEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_endChange(e)
-            }
-        },
-        owner_idEntering:function(e){
-            if(e.key==='Enter'){
-                e.target.value=$('#owner_id').val();
-                this.owner_idChange(e);
-                e.target.value='';
-            }
-        },
-        locateOwner:function (e) {
-            str = e.target.value.trim()
-            if (str==='')return ;
-            $("#owner_id option").attr("selected",false);
-            let selectingOption=$("#owner_id").find("option:contains("+str+")").eq(0);
-            selectingOption.attr("selected",true);
-            this.filterParams.owner_id=selectingOption.val();
-        },
-        // mobile_senderEntering:function(e){
-        //     this.filterParams.mobile_sender=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        // order_numberEntering:function(e){
-        //     this.filterParams.order_number=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        // barcode_goodsEntering:function(e){
-        //     this.filterParams.barcode_goods=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        // checked_numbersEntering:function(e){
-        //     this.filterParams.checked_numbers=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        logistic_number_returnEntering:function(e){
-            this.filterParams.logistic_number_return=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        logistic_numberEntering:function(e){
-            this.filterParams.logistic_number=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        cancelCheckConfirmAll:function(){
-            $('#checkConfirmingAll').tooltip('hide');
-            setTimeout(function () {
-                $(".tooltipTarget").tooltip({'trigger':'hover'})
-            }, 10);
-            this.checkBoxAll=false;
-            this.rejectedBills.forEach(function(rejectedBill){
-                if(rejectedBill.is_checked===-1)
-                    rejectedBill.is_checked='0';
-            })
-        },
-        // setIsLoaded_batch:function(val){
-        //     let _this=this;
-        //     if(_this.rejectedBills_checkBoxes.length===0){
-        //         tempTip.show('没有勾选记录');
-        //         $(e.target).val("");
-        //         return;
-        //     }
-        //     let is_loaded=0;
-        //     let is_loadedLabel='否';
-        //     if(parseInt(val)===1){
-        //         is_loaded=1;
-        //         is_loadedLabel='是';
-        //     }else if(parseInt(val)===2){
-        //         is_loaded=2;
-        //         is_loadedLabel='待推单';
-        //     }else if(parseInt(val)===4){
-        //         is_loaded=4;
-        //         is_loadedLabel='待确认';
-        //     }else if(val==="null"){
-        //         is_loaded='null';
-        //         is_loadedLabel='无需入库';
-        //     }
-        //     if(!confirm("确定要标记所有勾选入库情况为'"+is_loadedLabel+"'吗")){return;}
-        //     axios.post(ajaxCheckUrl,{ids:_this.rejectedBills_checkBoxes,is_loaded:is_loaded}).then(function(response){
-        //         if(response.data.success){
-        //             _this.rejectedBills_checkBoxes.forEach(function(id){
-        //                 _this.rejectedBills.forEach(function(bill){
-        //                     if(bill.id===id){
-        //                         bill.is_loaded=is_loaded;
-        //                     }
-        //                 });
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('修改勾选记录的入库状态成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.show('修改勾选记录的入库状态失败,错误:'+response.data.fail_info);
-        //         }
-        //     }).catch(function (e) {
-        //         alert('网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     });
-        //     $(e.target).val("")
-        // },
-        checkBoxAllToggle:function(e){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length>=this.rejectedBills.length){
-                _this.rejectedBills_checkBoxes=[];
-                _this.checkBoxAll=[];
-            }
-            else{
-                _this.rejectedBills_checkBoxes=[];
-                this.rejectedBills.forEach(function(bill){
-                    _this.rejectedBills_checkBoxes.push(bill.id);
-                    _this.checkBoxAll=[1];
-                });
-            }
-        },
-        // checkAll:function(){
-        //     let _this=this;
-        //     if(_this.rejectedBills_checkBoxes.length===0){
-        //         tempTip.show('没有勾选记录');
-        //         return
-        //     }
-        //     if(!confirm("确定要标记所有勾选内容为'已审核'吗")){return;}
-        //     axios.post(ajaxCheckAllURL,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-        //         if(response.data.success){
-        //             response.data.rejecteds.forEach(function (rejected) {
-        //                 _this.rejectedBills.forEach(function(rejectedBill){
-        //                     if(parseInt(rejectedBill.id)===parseInt(rejected.id)){
-        //                         rejectedBill.is_checked=1;
-        //                         rejectedBill.checked_numbers=rejected.checked_numbers;
-        //                     }
-        //                 });
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('审核勾选内容成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.show('审核勾选内容失败,错误:'+response.data.fail_info);
-        //         }
-        //     }).catch(function (e) {
-        //         alert('网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     })
-        // },
-        // confirmBeStored:function($e,id){
-        //     let _this=this;
-        //     axios.post(ajaxConfirmBeStoredUrl,{id:id}).then(function(response){
-        //         if(response.data.success){
-        //             _this.rejectedBills.forEach(function(rejectedBill){
-        //                 if(rejectedBill.id===id){
-        //                     rejectedBill.is_loaded=1;
-        //                 }
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('确认入库成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.okWindow('数据异常无法确认!请在WMS确定入库状态后,勾选该条目手动修改相应入库状态!','知道了')
-        //         }
-        //     }).catch(function (e) {
-        //         alert('确认失败,网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('确认失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     })
-        // },
-        // finishAll:function(){
-        //     let _this=this;
-        //     if(_this.rejectedBills_checkBoxes.length===0){
-        //         tempTip.show('没有勾选记录');
-        //         return
-        //     }
-        //     if(!confirm("确定要标记所有勾选内容为'已完结'吗")){return;}
-        //     axios.post(ajaxFinishAllUrl,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-        //         if(response.data.success){
-        //             _this.rejectedBills.forEach(function(rejectedBill){
-        //                 _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
-        //                     if(rejectedBill.id===checkedId){
-        //                         rejectedBill.is_finished=1;
-        //                     }
-        //                 });
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('标记勾选内容为完结成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.show('标记勾选内容为完结失败,错误:'+response.data.fail_info);
-        //         }
-        //     }).catch(function (e) {
-        //         alert('网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('标记勾选内容完结失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     })
-        // },
-        exportExcel:function(val){
-            let _this=this;
-            let form;
-             if(parseInt(val)===1){
-                if(_this.rejectedBills_checkBoxes.length===0){
-                    tempTip.show('没有勾选记录');
-                    return;
-                }
-                form=$('<form action=\"'+exportExcelURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="ids" value=\''+JSON.stringify(_this.rejectedBills_checkBoxes)+'\'/>');
-            }
-            if(parseInt(val)===2){
-                if(!confirm("确定要导出当前条件下全部页的结果吗?")){return;}
-               /* if(total>100000){
-                    tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录','知道了')
-                }*/
-                form=$('<form action=\"'+exportExcelOnFilterParamsURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="owner_id" value=\''+JSON.stringify(_this.filterParams.owner_id)+'\'/>');
-            }
-            form.append('<input type="hidden" name="created_at_start" value=\''+JSON.stringify(_this.filterParams.created_at_start)+'\'/>');
-            form.append('<input type="hidden" name="created_at_end" value=\''+JSON.stringify(_this.filterParams.created_at_end)+'\'/>');
-            form.append(csrfInput);
-            $('#list').append(form);
-            form.submit();
-            tempTip.setDuration(5000);
-            tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截")
-        },
-    },
-    computed:{
-        isBeingFilterConditions:function(){
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    if(key==='paginate')continue;
-                    if(key==='page')continue;
-                    return true
-                }
-            }
-            return false;
-        }
-    },
-    // filters:{
-    //     yesNo:function (val) {
-    //         if(!val||val===0||val==='0'){return '否'}
-    //         return '是'
-    //     },
-    //     yesNoIsLoaded:function (val) {
-    //         switch(val){
-    //             case 0:case '0':return '否';
-    //             case 1:case '1':return '是';
-    //             case 2:case '2':return '待推单';
-    //             case 3:case '3':return '交互异常';
-    //             case 4:case '4':return '待确认';
-    //             case null:case 'null':return '无需入库';
-    //         }
-    //         return '';
-    //     }
-    // }
-});

+ 62 - 0
resources/js/utilities/sort.js

@@ -0,0 +1,62 @@
+var result = [];
+var type = true;
+function sort(array , column , i) {
+    let data = {};
+    data['0']='';data['1']='';data['2']='';data['3']='';data['4']='';data['5']='';data['6']='';data['7']='';data['8']='';
+    data['9']='';data['a']='';data['b']='';data['c']='';data['d']='';data['e']='';data['f']='';data['g']='';data['h']='';
+    data['i']='';data['j']='';data['k']='';data['l']='';data['m']='';data['n']='';data['o']='';data['p']='';data['q']='';
+    data['r']='';data['s']='';data['t']='';data['u']='';data['v']='';data['w']='';data['x']='';data['y']='';data['z']='';
+    data['A']='';data['B']='';data['C']='';data['D']='';data['E']='';data['F']='';data['G']='';data['H']='';data['I']='';
+    data['J']='';data['K']='';data['L']='';data['M']='';data['N']='';data['O']='';data['P']='';data['Q']='';data['R']='';
+    data['S']='';data['T']='';data['U']='';data['V']='';data['W']='';data['X']='';data['Y']='';data['Z']='';
+    array.forEach(function (obj) {
+        if (!data[obj[column].charAt(i)])  data[obj[column].charAt(i)] = [obj];
+        else data[obj[column].charAt(i)].push(obj);
+    });
+    let recursion=[];
+    for (let key in data){
+        if (!data[key]){
+            delete data[key];
+            continue;
+        }
+        if (data[key].length > 1){
+            if ( !(!data[key].some(function (value, index) {
+                return value[column] !== data[key][0][column];
+            }))){
+                recursion.push(key);
+            }
+        }
+    }
+    if (recursion.length > 0){
+        i++;
+        recursion.forEach(function (key) {
+            data[key] = this.sort(data[key] ,column , i);
+        });
+    }
+    return data;
+}
+
+function sortInit(array, column ,type='up', i=0 ) {
+    result = [];
+    if (!Array.isArray(column)) column = [column];
+    if (type === 'up') this.type = true;
+    else this.type = false;
+    let columnName = column[0];
+    column.splice(0,1);
+    merge(sort(array, columnName, i), column);
+    return result;
+}
+
+function merge(object, subordinate = []) {
+    for (let key in object){
+        if (Array.isArray(object[key])){
+            if (object[key].length > 1 && subordinate.length > 0){
+                let subordinateName = subordinate[0];
+                subordinate.splice(0,1);
+                object[key] = merge(sort(object[key], subordinateName, 0), subordinate);
+            }
+            if (this.type) result.push.apply(result,object[key]);
+            else result.unshift.apply(result,object[key]);
+        }else merge(object[key]);
+    }
+}

+ 13 - 9
resources/js/utilities/tempTip.js

@@ -2,6 +2,10 @@
 const tempTip={
     fadingDuration:4500,
     inputType:'input',
+    index:99,
+    setIndex:function(index){
+        this.index=parseInt(index);
+    },
     setDuration:function(milliSec){
         this.fadingDuration=parseInt(milliSec);
     },
@@ -19,7 +23,7 @@ const tempTip={
         $('body').append(tiper)
     },
     show:function(text){
-        let tiper=$("<div class='row' style='color:white;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;'>" +
+        let tiper=$("<div class='row' style='color:white;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:"+this.index+";'>" +
             "<div class='col-8 offset-2'><div class='card'><div class='card-body h2 bg-danger text-center'>" +
             text +
             "</div></div></div></div>");
@@ -29,9 +33,9 @@ const tempTip={
         $('body').append(tiper)
     },
     okWindow:function(text,okText){
-        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:98;background-color:#000;'></div>" );
+        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:"+this.index+";background-color:#000;'></div>" );
         if(typeof(okText)=='undefined')okText='确定';
-        let tiper=$("<div class='row' style='opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:99'>" +
+        let tiper=$("<div class='row' style='opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:"+(this.index+1)+"'>" +
             "<div class='col-8 offset-2'><div class='card'><div class='card-body h2 text-center'>" +
             text +
             "<p><button class='btn btn-success btn-lg okWindow'>"+okText+"</button></p><div>" +
@@ -45,8 +49,8 @@ const tempTip={
         $('body').append(tiper)
     },
     waitingTip:function(text){
-        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:98;background-color:#fff;' class='tipperBg'></div>" );
-        let tipper=$("<div class='row tipper' style='color:white;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:99;'>" +
+        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:"+this.index+";background-color:#fff;' class='tipperBg'></div>" );
+        let tipper=$("<div class='row tipper' style='color:white;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:"+(this.index+1)+";'>" +
             "<div class='col-8 offset-2'><div class='card-body h5 bg-dark text-center' style='border-radius: 50px'>" +
             text +
             "</div></div></div>");
@@ -64,8 +68,8 @@ const tempTip={
         bg.remove();
     },
     confirm:function(text,yesFunc,noFunc){
-        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:98;background-color:#000;'></div>" );
-        let tiper=$("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:99'>" +
+        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:"+this.index+";background-color:#000;'></div>" );
+        let tiper=$("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:"+(this.index+1)+"'>" +
             "<div class='col-8 offset-2'><div class='card'><div class='card-body'><div class='card-title h4'>" +
             text +
             "</div><div class='card-text'><button class='btn btn-dark btn-lg ok'>确定</button>" +
@@ -92,8 +96,8 @@ const tempTip={
         $('body').append(tiper);
     },
     inputVal:function(tipText,resultFunc){
-        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:98;background-color:#000;'></div>" );
-        let tiper=$("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:99'>" +
+        let bg=$("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:"+this.index+";background-color:#000;'></div>" );
+        let tiper=$("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:"+this.index+"'>" +
             "<div class='col-8 offset-2'><div class='card'><div class='card-body'><div class='card-title h5'>" +
             tipText +
             "</div><div><input type='"+this.inputType+"' class='input form-control mb-3'/></div>" +

+ 10 - 0
resources/sass/text.scss

@@ -48,3 +48,13 @@
     -ms-user-select: none; /* Internet Explorer/Edge */
     user-select: none;
 }
+.fa-sort {
+    cursor: pointer;
+    opacity: 0.3;
+}
+.fa-sort-up{
+    cursor: pointer;
+}
+.fa-sort-down{
+    cursor: pointer;
+}

+ 1 - 1
resources/views/inventory/menu.blade.php

@@ -4,7 +4,7 @@
         <ul class="nav nav-pills">
             @can('库存管理')
             <li class="nav-item">
-                <a class="nav-link" href="{{url('inventory/statement/changeInventory')}}" :class="{active:isActive('statement',2)}">查询</a>
+                <a class="nav-link" href="{{url('inventory/statement/changeInventory?range=1')}}" :class="{active:isActive('statement',2)}">查询</a>
             </li> @endcan
         </ul>
     </div>

+ 31 - 9
resources/views/inventory/statement/changeInventory.blade.php

@@ -57,19 +57,22 @@
             <td><span v-if="oracleActTransactingLog.占用数量">@{{ oracleActTransactingLog.占用数量 }}</span><span v-else>0</span></td>
         </tr>
     </table>
-    <div >
+    <div>
         <button type="button" @click="pageUp()" :readonly="page>1?false:true" class="btn btn-sm " :class="page>1?'btn-outline-info':''">上一页</button>
         <button type="button" @click="pageDown()" :readonly="page<maxPage?false:true" class="btn btn-sm m-3" :class="page<maxPage?'btn-outline-info':''">下一页</button>
-        <input  @keyup.enter="pageSkip($event)" class="form-control-sm ml-3 tooltipTarget" :placeholder="'当前页数:'+page+'/'+maxPage" title="去往指定页">
-        <span class="text-muted m-1">共 @{{ sum }} 条</span>
+        <div v-if="isPage">
+            <input  @keyup.enter="pageSkip($event)" class="form-control-sm ml-3 tooltipTarget" :placeholder="'当前页数:'+page+'/'+maxPage" title="去往指定页">
+            <span class="text-muted m-1">共 @{{ sum }} 条</span>
+        </div>
     </div>
 </div>
 @endsection
 
 @section('lastScript')
-    <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
+        $.cookie('xxx', 2223);
         new Vue({
             el:"#list",
             data:{
@@ -83,6 +86,7 @@
                 checkData:[],
                 maxPage:1,
                 sum:0,
+                isPage:true,
                 date:[{name:'1',value:'近一天'},{name:'3',value:'近三天'},{name:'7',value:'近一周'},{name:'30',value:'近一月'},],
             },
             mounted:function () {
@@ -94,18 +98,19 @@
                 }
                 let data=[
                     [
-                        {name:['date_start','range'],type:'dataTime_select',tip:['选择创建日期的起始时间','查询内容的日期范围'],placeholder:['','查询内容的日期范围'],data: this.date},
+                        {name:['date_start','range'],type:'dateTime_select',tip:['选择创建日期的起始时间','查询内容的日期范围'],placeholder:['','查询内容的日期范围'],data: this.date
+                            ,killings:[['range'],['date_start']]},
                         {name:'TOLocation',type:'input',tip:'库位:糊模查找需要在左边打上%符号',placeholder: '库位'},
                         {name:'LotAtt05',type:'input',tip:'属性仓:糊模查找需要在左边打上%符号',placeholder: '属性仓'},
-                        {name:'LotAtt02_start',type:'dataTime',tip:'选择显示失效日期的起始时间'},
+                        {name:'LotAtt02_start',type:'dateTime',tip:'选择显示失效日期的起始时间'},
                         {name:'descr_c',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
                             placeholder:['货主','定位或多选货主'],data:this.owners},
                     ],
                     [
-                        {name:'date_end',type:'dataTime',tip:'选择创建日期的结束时间'},
+                        {name:'date_end',type:'dateTime',tip:'选择创建日期的结束时间',killings:['range']},
                         {name:'SKU',type:'input',tip:'产品编码:糊模查找需要在左边打上%符号',placeholder: '产品编码'},
                         {name:'ALTERNATE_SKU1',type:'input',tip:'产品条码:糊模查找需要在左边打上%符号',placeholder: '产品条码'},
-                        {name:'LotAtt02_end',type:'dataTime',tip:'选择显示失效日期的结束时间'},
+                        {name:'LotAtt02_end',type:'dateTime',tip:'选择显示失效日期的结束时间'},
                     ],
                 ];
                 this.form = new query({
@@ -113,6 +118,23 @@
                     condition:data
                 });
                 this.form.init();
+                let thisUrl=document.URL;
+                let parameter=thisUrl.split('?',2);
+                if (parameter.length > 1){
+                    let _this=this;
+                    let list=['ALTERNATE_SKU1','LotAtt05','LotAtt02_start','descr_c','LotAtt02_end'];
+                    let param=parameter[1].split('&');
+                    param.every(function (data) {
+                        let arr=data.split('=');
+                        if (arr.length > 1){
+                            if (list.includes(arr[0]) && arr[1]){
+                                _this.isPage = false;
+                                return false;
+                            }
+                        }
+                        return true;
+                    });
+                }
             },
             watch:{
                 checkData:{

+ 1 - 1
resources/views/inventory/statement/menu.blade.php

@@ -6,7 +6,7 @@
             <ul class="nav nav-pills">
                 @can('库存管理-动库报表')
                     <li class="nav-item">
-                        <a class="nav-link text-dark" href="{{url('inventory/statement/changeInventory')}}" :class="{active:isActive('changeInventory',3)}">动库报表</a>
+                        <a class="nav-link text-dark" href="{{url('inventory/statement/changeInventory?range=1')}}" :class="{active:isActive('changeInventory',3)}">动库报表</a>
                     </li> @endcan
             </ul>
         </div>

+ 1 - 1
resources/views/layouts/menu.blade.php

@@ -28,7 +28,7 @@
                     <span class="fa fa-balance-scale" style="color: #1b7234"></span>
                     称重管理</a></li> @endcan
         @can('库存管理')
-            <li class="nav-item"><a href="{{url("inventory/statement/changeInventory")}}" class="nav-link"
+            <li class="nav-item"><a href="{{url("inventory/statement/changeInventory?range=1")}}" class="nav-link"
                                     :class="{active:isActive('inventory',1)}">
                     <span class="fa fa-list-alt" style="color: #32721b"></span>
                     库存管理</a></li> @endcan

+ 6 - 6
resources/views/order/index/delivering.blade.php

@@ -130,7 +130,7 @@
                                     <td><div style="width: 180px;overflow: hidden">@{{ oracleDOCOrderDetail.checktime }}</div></td>
                                 </tr>
                                 <tr v-if="isBtn[order.orderno]">
-                                    <td colspan="5">
+                                    <td colspan="6">
                                         <b style="cursor:pointer;color: #4aa0e6;" @click="isBtn[order.orderno]=false;">点击收起明细</b>
                                     </td>
                                 </tr>
@@ -145,9 +145,9 @@
                         <td>
                             @can('订单管理-编辑')
                                 <button v-if="order.releasestatus!=='H'" @click="freeze(order.orderno,order.waveno)" class="btn btn-sm btn-outline-dark text-nowrap"
-                                        :disabled="!(order.codename_c==='创建订单'||order.codename_c==='分配完成'||order.codename_c==='拣货完成'||order.codename_c==='播种完成')">冻结</button>
+                                        :disabled="!(order.ordercodename==='创建订单'||order.ordercodename==='分配完成'||order.ordercodename==='拣货完成'||order.ordercodename==='播种完成')">冻结</button>
                                 <button v-else @click="thaw(order.orderno,order.waveno)" class="btn btn-sm btn-outline-danger text-nowrap"
-                                        :disabled="!(order.codename_c==='创建订单'||order.codename_c==='分配完成'||order.codename_c==='拣货完成'||order.codename_c==='播种完成')">解冻</button>
+                                        :disabled="!(order.ordercodename==='创建订单'||order.ordercodename==='分配完成'||order.ordercodename==='拣货完成'||order.ordercodename==='播种完成')">解冻</button>
                             @else
                                 @{{ order.releasestatus }}
                             @endcan
@@ -174,8 +174,8 @@
 @endsection
 
 @section('lastScript')
-    <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
         new Vue({
             el:"#list",
@@ -221,9 +221,9 @@
                     ],
                     [
                         {name:'codename_c_end',type:'select',placeholder:'订单状态范围',data:this.codes},
+                        {name:'orderdate_end',type:'time',tip:['选择显示指定日期的结束时间','选择显示指定日期的结束时间']},
                         {name:'customerid',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
                             placeholder:['货主','定位或多选货主'],data:this.owners},
-                        {name:'orderdate_end',type:'time',tip:['选择显示指定日期的结束时间','选择显示指定日期的结束时间']},
                         {name:'soreference5',type:'input',tip:'可支持多快递单号,糊模查找需要在左边打上%符号',placeholder: '多快递单号'},
                         {name:'soreference1',type:'input',tip:'客户订单号,糊模查找需要在左边打上%符号',placeholder: '客户订单号'},
                         {name:'waveno',type:'input',tip:'波次编号,模糊查找需要在左边打上%的符号',placeholder: '波次编号'},

+ 4 - 5
resources/views/order/wave/search.blade.php

@@ -73,8 +73,7 @@
                 </tr>
             </table>
             <button type="button" class="btn btn-sm " @click="pervPage" :class="'{{$param['currPage']}}'> 1? 'btn-outline-info ':'disabled'" {{--disabled="'{{$param['currPage']}}'> 1?'':true"--}}>上一页</button>
-            <button type="button" class="btn btn-sm " @click="nextPage" :class="'{{$param['currPage']}}'<'{{$param['pageTotal']}}'? 'btn-outline-info':'disabled'" :disabled="currPage == pageTotal">下一页</button>
-
+            <button type="button" class="btn btn-sm " @click="nextPage" :class="'{{$param['currPage']}}'<'{{$param['pageTotal']}}'?'btn-outline-info':'disabled'" :disabled="currPage == pageTotal">下一页</button>
             <input @keyup.enter="pageTurning($event)" class="form-control-sm ml-3 tooltipTarget"
                    :placeholder="'当前页数:'+'{{$param['currPage']}}'+'/'+'{{$param['pageTotal']}}'" title="去往指定页">
             <span class="text-muted m-1">共 {{$param['count']}} 条 </span>
@@ -83,7 +82,7 @@
 @endsection
 
 @section("lastScript")
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
         let vueList = new Vue({
             el: "#wave_div",
@@ -119,8 +118,8 @@
             mounted: function () {
                 $('#wave_div').removeClass('d-none')
                 let data = [[
-                    {name: 'start_time', type: 'dataTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
-                    {name: 'end_time', type: 'dataTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
+                    {name: 'start_time', type: 'dateTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
+                    {name: 'end_time', type: 'dateTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
                     {name: 'wave_num', type: 'input', tip: '波次编号:如模糊搜索需要在条件前后输入%号,回车提交', placeholder: ''},
                 ]];
                 this.form = new query({

+ 0 - 2
resources/views/personnel/checking-in/getQRcode.blade.php

@@ -27,8 +27,6 @@
 
                 </div>
             </div>
-
-                <h3 v-else>还未录入仓库,请先录入仓库!</h3>
             </div>
         </div>
     </div>

+ 1 - 1
resources/views/personnel/checking-in/updateUserDetail.blade.php → resources/views/personnel/checking-in/updateUserLaborCompanies.blade.php

@@ -8,7 +8,7 @@
 <body>
 <div class="card col-md-8 offset-md-2 mt-5">
     <div class="card-body">
-        <form method="POST" action="{{url('personnel/checking-in/userDutyCheck/storeUpdateUserDetail')}}">
+        <form method="POST" action="{{url('personnel/checking-in/userDutyCheck/storeUpdateUserLaborCompanies')}}">
             @csrf
             <div class="form-group row">
                 <label for="mobile_phone" class="form-check-label col-3 pull-left">电话:</label>

+ 139 - 106
resources/views/personnel/laborReport/index.blade.php

@@ -18,7 +18,7 @@
                     <a class="dropdown-item" @click="laborReportExport(true)" href="javascript:">导出所有页</a>
                 </div>
             </span>
-        <table class="table table-sm table-hover table-striped d-none d-sm-block p-0 text-nowrap table-bordered" >
+        <table class="table table-sm table-hover table-striped d-none d-xl-block p-0 text-nowrap table-bordered" >
             <tr>
                 <th class="text-center">
                     <label for="all">
@@ -28,16 +28,16 @@
                 <th class="text-center">序号</th>
                 {{--                            <th>ID</th>--}}
                 <th class="text-center">操作</th>
-                <th class="text-center">进场时间</th>
-                <th class="text-center">退场时间</th>
                 <th class="text-center"  style="background-color: rgb(241, 234, 190)">进厂编号</th>
                 <th class="text-center" style="background-color: rgb(241, 234, 190)">小组</th>
                 <th class="text-center" style="background-color: rgb(241, 234, 190)">临时工</th>
                 <th class="text-center" style="background-color: rgb(241, 234, 190)">电话</th>
                 <th class="text-center" style="background-color: rgb(241, 234, 190)">身份证号</th>
                 <th class="text-center" style="background-color: rgb(241, 234, 190)">劳务所</th>
+                <th class="text-center">进场时间</th>
                 <th class="text-center">进组时间</th>
                 <th class="text-center">退组时间</th>
+                <th class="text-center">退场时间</th>
                 <th class="text-center">审核时间</th>
                 <th class="text-center">审核人</th>
                 <th class="text-center">晚饭打卡(分)</th>
@@ -45,7 +45,7 @@
                 <th class="text-center">本次工作时长</th>
                 <th class="text-center">备注</th>
             </tr>
-            <tr v-for="(laborReport,i) in laborReports" @click="selectedColor(laborReport.id)" :style="{'font-weight': laborReport.id==selectedStyle?'bold':''}">
+            <tr v-for="(laborReport,i) in laborReports"  @click="selectedColor(laborReport.id)" :style="{'font-weight': laborReport.id==selectedStyle?'bold':''}">
                 <td>
                     <input class="checkItem" type="checkbox" :value="laborReport.id" v-model="checkData">
                 </td>
@@ -55,7 +55,7 @@
                         <span >
                         <span v-if="laborReport.userDutyCheckVerifyUserId&&laborReport.amountOfJoined==1"  class="text-success">已审核</span>
                         <span v-else-if="laborReport.userDutyCheckVerifyUserId&&laborReport.amountOfJoined&&laborReport.sequence"  class="text-black">&nbsp;&nbsp;&nbsp;@{{laborReport.sequence}}/@{{laborReport.amountOfJoined}}</span>
-                        <button v-else class="btn btn-sm btn-outline-secondary"  @click="guardClockAudit(laborReport.id,laborReport.userDutyCheckId)">门卫审核</button>
+                        <button v-else class="btn btn-sm btn-outline-secondary"  @click="guardClockAudit(laborReport.id,laborReport.user_duty_check_id)">门卫审核</button>
                         </span>
                     @else
                         <span v-if="laborReport.userDutyCheckVerifyUserId&&laborReport.amountOfJoined==1"  class="text-success">已审核</span>
@@ -68,41 +68,40 @@
                         <button v-if="laborReport.groupUserId&&!laborReport.is_exportGroup" @click="groupExport(laborReport.id,laborReport.name)" class="btn btn-sm btn-outline-danger">退组</button>
                         <span v-else-if="laborReport.groupUserId&&laborReport.is_exportGroup&&!laborReport.is_export" class="text-info">已退组</span>
                             <span v-else-if="laborReport.is_export" class="text-black">已退场</span>
-                        <button v-else-if="laborReport.userWorkGroupId" @click="groupClockAudit(laborReport.id,laborReport.userWorkgroupNeedRemark)" class="btn btn-sm btn-outline-primary">组长审核</button>
+                        <button v-else-if="laborReport.user_workgroup_id" @click="groupClockAudit(laborReport.id,laborReport.userWorkgroupNeedRemark)" class="btn btn-sm btn-outline-primary">组长审核</button>
                         </span>
                     @else
                         <span  v-if="laborReport.groupUserId&&!laborReport.is_exportGroup"><b class="text-success">在组</b></span>
                         <span v-else-if="laborReport.groupUserId&&laborReport.is_exportGroup&&!laborReport.is_export" class="text-info">已退组</span>
                         <span v-else-if="laborReport.is_export" class="text-black">已退场</span>
-                        <span v-else-if="laborReport.userWorkGroupId" class="text-center"><b class="text-danger">组长未审核</b></span>
+                        <span v-else-if="laborReport.user_workgroup_id" class="text-center"><b class="text-danger">组长未审核</b></span>
                     @endcan
                 </td>
-                <td class="text-muted">@{{laborReport.enter_at}}</td>
-                <td >@{{ laborReport.exit_at }}</td>
-                <td class="text-muted">@{{laborReport.enterNumber}}</td>
+                <td class="text-muted">@{{laborReport.enter_number}}</td>
                 <td>@{{laborReport.userWorkGroupName}}</td>
                 <td >@{{laborReport.name}}</td>
-                <td class="text-muted">@{{laborReport.mobilePhone}}</td>
-                <td class="text-muted">@{{laborReport.identityNumber}}</td>
-                <td class="text-muted">@{{laborReport.laborCompany}}</td>
+                <td class="text-muted">@{{laborReport.mobile_phone}}</td>
+                <td class="text-muted">@{{laborReport.identity_number}}</td>
+                <td class="text-muted">@{{laborReport.labor_company}}</td>
+                <td class="text-muted">@{{laborReport.enter_at}}</td>
                 <td>@{{laborReport.checkInAt}}</td>
                 <td class="text-muted">@{{laborReport.checkOutAt}}</td>
+                <td >@{{ laborReport.exit_at }}</td>
                 <td class="text-muted">@{{laborReport.verifyAt}}</td>
                 <td class="text-muted"><span v-if="laborReport.verifyPerson">@{{laborReport.verifyPerson}}</span></td>
                 <td class="text-muted"><span v-if="laborReport.relax_time">@{{laborReport.relax_time}}</span></td>
-{{--                        <td class="text-muted"><span v-if="laborReport.onlineDuration">@{{laborReport.onlineDuration}}</span></td>--}}
+                {{--                        <td class="text-muted"><span v-if="laborReport.onlineDuration">@{{laborReport.onlineDuration}}</span></td>--}}
                 <td class="text-muted"><span v-if="laborReport.thisRecordOnlineTime">@{{laborReport.thisRecordOnlineTime}}</span></td>
                 <td><span v-if="laborReport.thisRecordWorkingTime">@{{laborReport.thisRecordWorkingTime}}</span></td>
-{{--                        <td><span v-if="laborReport.workingDuration">@{{laborReport.workingDuration}}</span></td>--}}
-                        <td><span v-if="laborReport.remark">@{{laborReport.remark}}</span></td>
-                    </tr>
-                </table>
-                <table class="table table-striped table-sm table-bordered table-hover p-0 d-block d-sm-none" style="background: rgb(255, 255, 255);">
-                    <tbody>
-                    <tr v-for="laborReport in laborReports">
-                        <td style="filter:grayscale(30%); ">
-                            <div  class="pl-3 mt-1">
-                                <div style="transform:scale(1)" class="pl-0">
+                {{--                        <td><span v-if="laborReport.workingDuration">@{{laborReport.workingDuration}}</span></td>--}}
+                <td><span v-if="laborReport.remark">@{{laborReport.remark}}</span></td>
+            </tr>
+        </table>
+        <table class="table table-striped table-bordered table-hover p-0 d-table  d-xl-none" style="background: rgb(255, 255, 255);">
+            <tr v-for="laborReport in laborReports">
+                <td style="filter:grayscale(30%);">
+                    <div  class="pl-3 mt-1">
+                        <div style="transform:scale(1)" class="pl-0">
                                         <span class="mr-3 text-nowrap">
                                             <span >操作:</span>
                                             <span >
@@ -110,7 +109,7 @@
                                                     <span >
                                 <b v-if="laborReport.userDutyCheckVerifyUserId&&laborReport.amountOfJoined==1"   class="text-success">已审核</b>
                                 <b v-else-if="laborReport.userDutyCheckVerifyUserId&&laborReport.amountOfJoined&&laborReport.sequence"  class="text-black">&nbsp;&nbsp;&nbsp;@{{laborReport.sequence}}/@{{laborReport.amountOfJoined}}</b>
-                                <button v-else style="transform:scale(1.1)" class="btn btn-lg btn-outline-secondary"  @click="guardClockAudit(laborReport.id,laborReport.userDutyCheckId)">门卫审核</button>
+                                <button v-else style="transform:scale(1.1)" class="btn btn-lg btn-outline-secondary"  @click="guardClockAudit(laborReport.id,laborReport.user_duty_check_id)">门卫审核</button>
                                 </span>
                                                 @else
                                                     <b v-if="laborReport.userDutyCheckVerifyUserId&&laborReport.amountOfJoined==1"  class="text-success">已审核</b>
@@ -123,37 +122,36 @@
                                 <button v-if="laborReport.groupUserId&&!laborReport.is_exportGroup" @click="groupExport(laborReport.id,laborReport.name)" style="transform:scale(1.1)" class="btn btn-lg btn-danger">退组</button>
                                 <b v-else-if="laborReport.groupUserId&&laborReport.is_exportGroup&&!laborReport.is_export" class="text-info">已退组</b>
                                     <b v-else-if="laborReport.is_export" class="text-black">已退场</b>
-                                <button v-else-if="laborReport.userWorkGroupId" @click="groupClockAudit(laborReport.id,laborReport.userWorkgroupNeedRemark)" class="btn btn-lg btn-outline-primary" style="transform:scale(1.1)" >组长审核</button>
+                                <button v-else-if="laborReport.user_workgroup_id" @click="groupClockAudit(laborReport.id,laborReport.userWorkgroupNeedRemark)" class="btn btn-lg btn-outline-primary" style="transform:scale(1.1)" >组长审核</button>
                                 </span>
                                                 @else
                                                     <span  v-if="laborReport.groupUserId&&!laborReport.is_exportGroup"><b class="text-success">在组</b></span>
                                                     <b v-else-if="laborReport.groupUserId&&laborReport.is_exportGroup&&!laborReport.is_export" class="text-info">已退组</b>
                                                     <b v-else-if="laborReport.is_export" class="text-black">已退场</b>
-                                                    <span v-else-if="laborReport.userWorkGroupId" class="text-center"><b class="text-danger">组长未审核</b></span>
+                                                    <span v-else-if="laborReport.user_workgroup_id" class="text-center"><b class="text-danger">组长未审核</b></span>
                                                 @endcan
                                             </span>
                                         </span>
-                                    <span class="mr-3   text-nowrap"><span class="text-black">进场时间:</span><span class="text-black-50">@{{laborReport.enter_at  }}</span></span>
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">退场时间:</span><span style="color:#af7651">@{{ laborReport.exit_at }}</span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">进场编号:</span><span style="color:#af7651">@{{ laborReport.enterNumber }}</span></span>--}}
-                                    <span class="mr-3  text-nowrap"><span class="text-black">小组:</span><span class="text-black-50">@{{laborReport.userWorkGroupName  }}</span></span>
-                                    <span class="mr-3   text-nowrap"><span class="text-black">临时工:</span><span class="text-black-50">@{{ laborReport.name }} </span></span>
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">电话:</span><span style="color:#af7651" v-if="">@{{ laborReport.mobilePhone }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">身份证号:</span><span style="color:#af7651" v-if="">@{{ laborReport.identityNumber }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">劳务所:</span><span style="color:#af7651" v-if="">@{{ laborReport.laborCompany }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">进组时间:</span><span style="color:#af7651" v-if="">@{{ laborReport.checkInAt }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">退组时间:</span><span style="color:#af7651" v-if="">@{{ laborReport.checkOutAt }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">审核时间:</span><span style="color:#af7651" v-if="">@{{ laborReport.verifyAt }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">审核人:</span><span style="color:#af7651" v-if="">@{{ laborReport.verifyPerson }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">晚饭打卡(分):</span><span style="color:#af7651" v-if="">@{{ laborReport.relax_time }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">在线时长:</span><span style="color:#af7651" v-if="">@{{ laborReport.onlineDuration }} </span></span>--}}
-                                    {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">本次工作时长:</span><span style="color:#af7651" v-if="">@{{ laborReport.workingDuration }} </span></span>--}}
-                                </div>
-                            </div>
-                        </td>
-                    </tr>
-                    </tbody>
-                </table>
+                            <span class="mr-3   text-nowrap"><span class="text-black">进场时间:</span><span class="text-black-50">@{{laborReport.enter_at  }}</span></span>
+                            <span class="mr-3 text-nowrap"><span class="text-muted">退组时间:</span><span style="color:#af7651" v-if="">@{{ laborReport.checkOutAt }} </span></span>
+                            <span class="mr-3 text-nowrap"><span class="text-black">退场时间:</span><span style="color:#af7651">@{{ laborReport.exit_at }}</span></span>
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">进场编号:</span><span style="color:#af7651">@{{ laborReport.enter_number }}</span></span>--}}
+                            <span class="mr-3  text-nowrap"><span class="text-black">小组:</span><span class="text-black-50">@{{laborReport.userWorkGroupName  }}</span></span>
+                            <span class="mr-3   text-nowrap"><span class="text-black">临时工:</span><span class="text-black-50">@{{ laborReport.name }} </span></span>
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">电话:</span><span style="color:#af7651" v-if="">@{{ laborReport.mobile_phone }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">身份证号:</span><span style="color:#af7651" v-if="">@{{ laborReport.identity_number }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">劳务所:</span><span style="color:#af7651" v-if="">@{{ laborReport.labor_company }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">进组时间:</span><span style="color:#af7651" v-if="">@{{ laborReport.checkInAt }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">审核时间:</span><span style="color:#af7651" v-if="">@{{ laborReport.verifyAt }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">审核人:</span><span style="color:#af7651" v-if="">@{{ laborReport.verifyPerson }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">晚饭打卡(分):</span><span style="color:#af7651" v-if="">@{{ laborReport.relax_time }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">在线时长:</span><span style="color:#af7651" v-if="">@{{ laborReport.onlineDuration }} </span></span>--}}
+                            {{--                                    <span class="mr-3 text-nowrap"><span class="text-black">本次工作时长:</span><span style="color:#af7651" v-if="">@{{ laborReport.workingDuration }} </span></span>--}}
+                        </div>
+                    </div>
+                </td>
+            </tr>
+        </table>
         <div class="text-info h5 btn btn">{{$laborReports->count()}}/@{{ sum }}</div>
         <div>{{$laborReports->appends($paginateParams)->links()}}</div>
         {{--      选择晚饭时长弹框      --}}
@@ -233,10 +231,26 @@
 @endsection
 
 @section('lastScript')
-    <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
-            @if(isset($request))
+        let today=(new Date());
+        function isTomorrow(){
+            let now=(new Date());
+            const dateTime=new Date(now.setDate(now.getDate()+1));
+            if(dateTime<=today)return true;
+            else return false;
+        }
+        function reloadOnTomorrow(){
+            if(isTomorrow()){
+                window.location.reload();
+            }
+        }
+        window.onfocus=reloadOnTomorrow;
+        setInterval(reloadOnTomorrow,1000*60*60)
+    </script>
+    <script>
+        @if(isset($request))
         let request={!! json_encode($request) !!};
         @endif
         new Vue({
@@ -244,12 +258,12 @@
             data:{
                 laborReports:[
                         @foreach($laborReports as $laborReport)
-                    {id:'{{$laborReport->id}}',enterNumber:'{{$laborReport->enter_number}}'
-                        ,@if($laborReport->userWorkgroup)userWorkGroupId:'{{$laborReport->userWorkgroup->id}}',
+                    {id:'{{$laborReport->id}}',enter_number:'{{$laborReport->enter_number}}'
+                        ,@if($laborReport->userWorkgroup)user_workgroup_id:'{{$laborReport->userWorkgroup->id}}',
                         userWorkgroupNeedRemark:'{{$laborReport->userWorkgroup->isNeedRemark}}',
                         userWorkGroupName:'{{$laborReport->userWorkgroup->name}}',@endif
                         userId:'{{$laborReport->user_id}}',name:'{{$laborReport->name}}'
-                        ,mobilePhone:'{{$laborReport->mobile_phone}}',identityNumber:'{{$laborReport->identity_number}}',laborCompany:'{{$laborReport->labor_company}}'
+                        ,mobile_phone:'{{$laborReport->mobile_phone}}',identity_number:'{{$laborReport->identity_number}}',labor_company:'{{$laborReport->labor_company}}'
                         ,checkInAt:'{{$laborReport->check_in_at}}', relax_time:'{{$laborReport->relax_time}}',
                         is_exportGroup:'{{$laborReport->is_exportGroup}}',is_export:'{{$laborReport->is_export}}',
                         verifyAt:'{{$laborReport->verify_at}}',groupUserId:'{{$laborReport->group_user_id}}',verifyPerson:'{{$laborReport->user['name']}}',
@@ -259,14 +273,13 @@
                         thisRecordOnlineTime:'{{$laborReport->thisRecordOnlineTime}}',
                         thisRecordWorkingTime:'{{$laborReport->thisRecordWorkingTime}}',
                         sequence:'{{$laborReport->sequence}}',amountOfJoined:'{{$laborReport->amountOfJoined}}',remark:'{{$laborReport->remark}}',
-                        @if($laborReport->userDutyCheck)userDutyCheckId:'{{$laborReport->userDutyCheck->id}}', userDutyCheckVerifyUserId:'{{$laborReport->userDutyCheck->verify_user_id}}'
+                        @if($laborReport->userDutyCheck)user_duty_check_id:'{{$laborReport->userDutyCheck->id}}', userDutyCheckVerifyUserId:'{{$laborReport->userDutyCheck->verify_user_id}}'
                         ,userDutyCheckType:'{{$laborReport->userDutyCheck->type}}',userDutyCheckAt:'{{$laborReport->userDutyCheck->checked_at}}',@endif},
-
                     @endforeach
                 ],
                 i:0,
                 userWorkGroups:[
-                    @foreach($userWorkGroups as $userWorkGroup)
+                        @foreach($userWorkGroups as $userWorkGroup)
                     {name:'{{$userWorkGroup->id}}',value:'{{$userWorkGroup->name}}'},
                     @endforeach
                 ],
@@ -277,77 +290,97 @@
             },
             mounted:function(){
                 initEcho();
+                let _this=this;
+                let laborReports=_this.laborReports;
                 //进场
-                Echo.channel('{{$laravelEchoPrefix}}userDutyCheck').listen('ImportEvent',(e)=>{
-                    window.location.reload();
-                });
+                let tokenOfBroadcastEnterAndLeave='{{$tokenOfBroadcastEnterAndLeave}}';
+                if(tokenOfBroadcastEnterAndLeave)
+                    Echo.channel('{{$laravelEchoPrefix}}'+tokenOfBroadcastEnterAndLeave).listen('ImportEvent',(e)=>{
+                        let labor=e.laborReport;
+                        laborReports.push(labor);
+                    });
                 //退场
-                Echo.channel('{{$laravelEchoPrefix}}userDutyCheck').listen('ExportEvent',(e)=>{
-                    window.location.reload();
+                Echo.channel('{{$laravelEchoPrefix}}laborReport').listen('ExportEvent',(e)=>{
+                    let labor=e.laborReport;
+                    laborReports.every(function (laborReport) {
+                        if (laborReport.id==labor.id){
+                            laborReport.thisRecordOnlineTime=labor.thisRecordOnlineTime;
+                            laborReport.thisRecordWorkingTime=labor.thisRecordWorkingTime;
+                            laborReport.is_export=labor.is_export;
+                            laborReport.exit_at=labor.exit_at;
+                            return false
+                        }
+                        return true;
+                    });
                 });
                 //门卫审核
                 Echo.channel('{{$laravelEchoPrefix}}userDutyCheck').listen('GuardAuditEvent',(e)=>{
-                    setTimeout(function (){
-                        window.location.reload();
-                    }, 500);
+                    let userDutyCheck=e.userDutyCheck;
+                    laborReports.every(function (laborReport) {
+                        if (laborReport.user_duty_check_id==userDutyCheck.id){
+                            laborReport.userDutyCheckVerifyUserId=userDutyCheck.verify_user_id;
+                            laborReport.user_duty_check_id=userDutyCheck.id;
+                            return false
+                        }
+                        return true;
+                    });
                 });
-                {{--Echo.channel('{{$laravelEchoPrefix}}userDutyCheck').listen('GuardAuditEvent',(e)=>{--}}
-                {{--    let userDutyCheck=e.userDutyCheck;--}}
-                {{--    let _this=this;--}}
-                {{--    _this.laborReports.every(function (laborReport) {--}}
-                {{--        if (laborReport.userDutyCheckId==userDutyCheck.id){--}}
-                {{--            laborReport.userDutyCheck=userDutyCheck;--}}
-                {{--            laborReport.userDutyCheckVerifyUserId=userDutyCheck.verify_user_id;--}}
-                {{--            return false--}}
-                {{--        }--}}
-                {{--        return true;--}}
-                {{--    });--}}
-                {{--});--}}
                 //组长审核
                 Echo.channel('{{$laravelEchoPrefix}}laborReport').listen('TeamAuditEvent',(e)=>{
-                    setTimeout(function (){
-                        window.location.reload();
-                    }, 500);
+                    let labor=e.laborReport;
+                    laborReports.every(function (laborReport) {
+                        if (laborReport.id==labor.id){
+                            if(labor.remark){
+                                laborReport.remark=labor.remark;
+                            }
+                            laborReport.verifyAt=labor.verify_at;
+                            laborReport.groupUserId=labor.group_user_id;
+                            laborReport.verifyPerson=labor.verifyPerson;
+                            return false
+                        }
+                        return true;
+                    });
                 });
-                {{--Echo.channel('{{$laravelEchoPrefix}}laborReport').listen('TeamAuditEvent',(e)=>{--}}
-                {{--    let labor=e.laborReport;--}}
-                {{--    let _this=this;--}}
-                {{--    setTimeout(function (){--}}
-                {{--        _this.laborReports.every(function (laborReport) {--}}
-                {{--            if (laborReport.id==labor.id){--}}
-                {{--                laborReport.groupUserId==labor.group_user_id;--}}
-                {{--                return false--}}
-                {{--            }--}}
-                {{--            return true;--}}
-                {{--        });--}}
-                {{--    }, 500);--}}
-                {{--});--}}
                 //进组
-                this.permittingWorkgroups.forEach(function(workgroup){
+                _this.permittingWorkgroups.forEach(function(workgroup){
                     Echo.channel('{{$laravelEchoPrefix}}'+workgroup.token).listen('ClockinEvent',(e)=>{
-                        window.location.reload();
+                        setTimeout(function () {
+                            window.location.reload();
+                        },500);
                     });
                 });
                 //退组
-                this.permittingWorkgroups.forEach(function(workgroup){
+                _this.permittingWorkgroups.forEach(function(workgroup){
                     Echo.channel('{{$laravelEchoPrefix}}'+workgroup.token).listen('ClockoutEvent',(e)=>{
-                        setTimeout(function (){
-                            window.location.reload();
-                        }, 500);
+                        let labor=e.laborReport;
+                        laborReports.every(function (laborReport) {
+                            if (laborReport.id==labor.id){
+                                laborReport.thisRecordOnlineTime=labor.thisRecordOnlineTime;
+                                laborReport.thisRecordWorkingTime=labor.thisRecordWorkingTime;
+                                laborReport.is_exportGroup=labor.is_exportGroup;
+                                laborReport.checkOutAt=labor.check_out_at;
+                                if (labor.relax_time){
+                                    laborReport.relax_time=labor.relax_time;
+                                }
+                                return false
+                            }
+                            return true;
+                        });
                     });
                 });
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 $('#list').removeClass('d-none');
                 let data=[
                     [
-                        {name:'created_at_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
+                        {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
                         {name:'user_workgroup_id',type:'search_select',tip:['',''],placeholder:['小组',''],data:this.userWorkGroups},
-                        {name:'enter_number',type:'input',tip:'进场编号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '进场编号'},
+                        {name:'enter_number',type:'input',tip:'进场编号:支持15天内模糊搜索,15天外精确搜索',placeholder: '进场编号'},
+                        {name:'is_export',type:'checkbox',data:[{name:true,value:'显示已退场'}]},
                     ],
                     [
-                        {name:'created_at_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
-                        {name:'mobile_phone',type:'input',tip:'电话号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '电话号'},
-                        {name:'identity_number',type:'input',tip:'身份证号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '身份证号'},
+                        {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
+                        {name:'mobile_phone',type:'input',tip:'',placeholder: '电话号'},
+                        {name:'identity_number',type:'input',tip:'',placeholder: '身份证号'},
                     ],
                 ];
                 this.form = new query({
@@ -393,10 +426,10 @@
                     excelExport(checkAllSign,this.checkData,url,this.sum,token);
                 },
                 //门卫审核
-                guardClockAudit(id,userDutyCheckId){
+                guardClockAudit(id,user_duty_check_id){
                     let url='{{url("laborReport/guardClockAudit")}}';
                     let _this=this;
-                    axios.post(url,{id:id,userDutyCheckId:userDutyCheckId})
+                    axios.post(url,{id:id,user_duty_check_id:user_duty_check_id})
                         .then(function (response) {
                             if (!response.data.success){
                                 tempTip.setDuration(3000);

+ 104 - 47
resources/views/process/create.blade.php

@@ -14,11 +14,16 @@
                                 <div class="row modal-title font-weight-bold w-100 text-nowrap ml-1 noselect" id="pasteDataTitle">
                                     <span v-for="(row,i) in rows" draggable="true"
                                           @drop="drop($event,i)" @dragover="dragover($event)" @dragstart="dragstart($event,i)"
-                                          :class="row=='货主' || row=='品名' || row=='数量' ? 'text-danger' : ''"
+                                          :class="row=='货主' || row=='品名' || row=='数量' || row=='SKU' ? 'text-danger' : ''"
                                           class="col-2 border" style="cursor: move">@{{ row }}</span>
                                 </div>
                             </div>
-                            <div class="modal-body">
+                            <div class="modal-body" style="text-align:center">
+                                <button type="button" id="popover" class="btn btn-danger"
+                                        data-container="body" data-toggle="popover" data-placement="bottom"
+                                        :data-content="popoverContent" data-html="true">
+                                    部分数据导入失败
+                                </button>
                                 <textarea class="w-100" style="height: 400px;" v-model="pasteData"
                                 placeholder="内容必须为EXCEL复制,请注意表头顺序,可拖拽表头字段调整顺序,以该顺序为准"
                                 ></textarea>
@@ -36,7 +41,7 @@
                             <input class="form-control col-6" v-model="process.wms_code">&nbsp;&nbsp;&nbsp;
                             <button class="btn btn-info btn-sm col-2"  type="button" @click="addProcessContent(false)"> 新增库单据</button>
                             <button class="btn btn-sm btn-dark col-1 ml-1"
-                                    data-toggle="modal" data-target="#pasteData"><small>外部导入</small></button>
+                                    @click="showPasteDataModal()"><small>外部导入</small></button>
                         </div>
                         <div class="form-group row">
                             <div class="col-10 offset-1 pl-0 pt-2 border rounded bg-light">
@@ -61,15 +66,15 @@
                                     </span>
                                 </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">商品名</label>
-                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type" class="form-control form-control-sm col-8" @input="update_commodity_name(processContents[0])" v-model="processContents[0].commodity_name">
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type" class="form-control form-control-sm col-8" @change="update_commodity_name(processContents[0])" v-model="processContents[0].commodity_name">
                                 </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">条码</label>
-                                    <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type && processContents[0].commodity_barcodes && processContents[0].commodity_barcodes.length>0">
-                                        <li v-for="barcode in processContents[0].commodity_barcodes"><small>&nbsp;&nbsp;@{{ barcode.code }}</small></li>
-                                    </ul>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type" class="form-control form-control-sm col-8" @change="update_commodity_barcode(processContents[0],$event)" :value="processContents[0].commodity_barcode ? processContents[0].commodity_barcode :
+                                    (processContents[0].commodity_barcodes[0] ? processContents[0].commodity_barcodes[0].code :'')">
                                 </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">SKU</label>
-                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type" class="col-8">@{{ processContents[0].commodity_sku }}</b></div>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type" class="form-control form-control-sm col-8" @change="update_commodity_sku(processContents[0])" v-model="processContents[0].commodity_sku">
+                                </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">单据类型</label>
                                     <select v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].type"
                                             v-model="processContents[0].bill_type"  class="col-8 form-control form-control-sm">
@@ -105,7 +110,9 @@
                                         <span class="ml-2 font-weight-bold">数量:</span>
                                         <span class="font-weight-bold">@{{ processContent.amount }}</span>
                                         <span class="ml-2 text-muted">条码:</span>
-                                        <span class="text-muted"><small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0"
+                                        <span class="text-muted">
+                                            <small v-if="processContent.commodity_barcode"> @{{ processContent.commodity_barcode }}</small>
+                                            <small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0 && !processContent.commodity_barcode"
                                                                         v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
                                         <button v-if="is_delBtn[processContent.wms_code+'_'+processContent.commodity_id+'_'+false]" @click="deleteProcessContent(processContent.wms_code,processContent.commodity_id,false,processContent.amount)" class="btn btn-sm btn-danger" style="position: absolute;right: 0;bottom: 0">删除</button>
                                     </div>
@@ -124,10 +131,14 @@
                                 <div class="row pt-2 small"><label class="col-3 text-right" >单据号</label>
                                     <b class="col-8" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type">@{{ processContents[0].wms_code }}</b></div> <!---->
                                 <div class="row pt-2" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type">
-                                    <span class="col-12 text-center text-muted small">双击选择商品:</span>
+                                    <span class="col-12 text-center text-muted small">双击选择商品:
+                                        <button class="btn btn-sm btn-outline-info ml-1 mt-0" style="transform: scale(0.8)"
+                                                @click="finishedProductAddAll(processContents[0])"
+                                        >添加所有</button>
+                                    </span>
                                     <span class=" col-11 offset-1 input-group" style=" border-radius: 5px; opacity: 1.5; text-align: center;">
                                         <ul onselectstart="return false;" class="list-group tooltipTarget" style="width: 100%; max-height: 130px; overflow-y: scroll;">
-                                            <li  v-for="commodity in processContents[0].commodities" :id="commodity.id" :style="{'background-color':processContents[0].commodity_id==commodity.id ? '#9fcdff':''}"
+                                            <li  v-for="commodity in processContents[0].commodities" :id="commodity.id" :style="[{'background-color':processContents[0].commodity_id==commodity.id ? '#9fcdff':'' },{'text-decoration':commodityIds.includes(commodity.id+'_true')? 'line-through red' : ''}]"
                                                  @dblclick="selectedCommodity(commodity,processContents[0].wms_code,true)" class="list-group-item list-group-item-action p-0 m-0">
                                                 <div class="form-inline" style="cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
                                                     <small :title="commodity.name" class="text-left text-info col-6" style="overflow: hidden;">@{{ commodity.name }}</small>
@@ -138,15 +149,15 @@
                                     </span>
                                 </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">商品名</label>
-                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type" class="col-8">@{{ processContents[0].commodity_name }}</b>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type" class="form-control form-control-sm col-8" @change="update_commodity_name(processContents[0])" v-model="processContents[0].commodity_name">
                                 </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">条码</label>
-                                    <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type && processContents[0].commodity_barcodes && processContents[0].commodity_barcodes.length>0">
-                                        <li v-for="barcode in processContents[0].commodity_barcodes"><small>&nbsp;&nbsp;@{{ barcode.code }}</small></li>
-                                    </ul>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type" class="form-control form-control-sm col-8" @change="update_commodity_barcode(processContents[0],$event)" :value="processContents[0].commodity_barcode ? processContents[0].commodity_barcode :
+                                        (processContents[0].commodity_barcodes[0] ? processContents[0].commodity_barcodes[0].code :'')">
                                 </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">SKU</label>
-                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type" class="col-8">@{{ processContents[0].commodity_sku }}</b></div>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type" class="form-control form-control-sm col-8" @change="update_commodity_sku(processContents[0])" v-model="processContents[0].commodity_sku">
+                                </div>
                                 <div class="row pt-2 small"><label class="col-3  text-right">单据类型</label>
                                     <select v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].type"
                                             v-model="processContents[0].bill_type"  class="col-8 form-control form-control-sm">
@@ -182,8 +193,10 @@
                                         <span class="ml-2 font-weight-bold">数量:</span>
                                         <span class="font-weight-bold">@{{ processContent.amount }}</span>
                                         <span class="ml-2 text-muted">条码:</span>
-                                        <span class="text-muted"><small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0"
-                                                                        v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
+                                        <span class="text-muted">
+                                            <small v-if="processContent.commodity_barcode"> @{{ processContent.commodity_barcode }}</small>
+                                            <small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0 && !processContent.commodity_barcode"
+                                                   v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
                                         <button v-if="is_delBtn[processContent.wms_code+'_'+processContent.commodity_id+'_'+true]" @click="deleteProcessContent(processContent.wms_code,processContent.commodity_id,true,processContent.amount)" class="btn btn-sm btn-danger" style="position: absolute;right: 0;bottom: 0">删除</button>
                                     </div>
                                 </div>
@@ -267,7 +280,8 @@
                 is_delBtn:[],
                 sum:0,
                 pasteData:'',
-                rows:['货主','单据','品名','SKU','条码','数量'],
+                rows:['货主','单据号','品名','SKU','条码','数量'],
+                popoverContent:'',
             },
             watch:{
                 processContents:{
@@ -388,23 +402,27 @@
                 deleteProcessContent(wms_code,commodity_id,type,amount){
                     let _this=this;
                     let deleteData=[];
-                    if (!type)_this.sum-= Number(amount);
+                    let sum = 0;
                     _this.processContents.some(function (processContent,i) {
                         if (processContent.wms_code===wms_code && processContent.commodity_id===commodity_id && processContent.type===type) {
                             deleteData.unshift(i);
+                            sum += Number(processContent.amount);
                             _this.commodityIds.splice(_this.commodityIds.indexOf(processContent.commodity_id+"_"+type),1);
                             if (type) return true;
                         }
                         if (!type && processContent.wms_code===wms_code && processContent.commodity_id===commodity_id && processContent.type===!type){
                             deleteData.unshift(i);
+                            sum += Number(processContent.amount);
                             _this.commodityIds.splice(_this.commodityIds.indexOf(processContent.commodity_id+"_"+!type),1);
                         }
                     });
+                    _this.sum -= sum;
                     deleteData.forEach(function (data) {
                         _this.processContents.splice(data,1);
                     });
+                    this.$delete(this.is_delBtn,wms_code+'_'+commodity_id+'_'+type);
                 },
-                /*//获取教程
+                {{--//获取教程
                 getTutorial(owner_id){
                     let _this=this;
                     axios.post("{{url('process/ownerGetTutorials')}}"+"/"+owner_id)
@@ -421,7 +439,7 @@
                         tempTip.setDuration(5000);
                         tempTip.show('获取教程失败!网络错误:'+err);
                         });
-                },*/
+                },--}}
                 //选择商品
                 selectedCommodity(commodity,wms_code,type){
                     let _this=this;
@@ -501,10 +519,10 @@
                             return;
                         }
                         if(response.data.success==false){
-                            tempTip.setDuration(5000);
+                            tempTip.setDuration(3000);
                             tempTip.show('提交失败:'+response.data.data);
                         }else {
-                            tempTip.setDuration(5000);
+                            tempTip.setDuration(2000);
                             tempTip.showSuccess('提交成功');
                             setTimeout(function () {
                                 location.href="{{url('process')}}";
@@ -515,7 +533,7 @@
                         tempTip.show('提交失败!网络错误:'+err);
                     });
                 },
-                /*//去往新增教程
+                {{--//去往新增教程
                 addTutorial(){
                     window.open("{{url('maintenance/tutorial/create?owner_id=')}}"+this.process.owner_id);
                 },
@@ -524,7 +542,7 @@
                     if (this.processContents.length>=1 && this.processContents[(this.processContents.length)-1].owner_id){
                         this.getTutorial(this.processContents[(this.processContents.length)-1].owner_id);
                     }
-                },*/
+                },--}}
                 //删除按钮的显示
                 update_delBtn(is_type,wms_code,commodity_id,type){
                     if (is_type) this.$set(this.is_delBtn,wms_code+'_'+commodity_id+'_'+type,true);
@@ -533,28 +551,39 @@
                 update_commodity_name(processContent){
                     this.$set(processContent,'is_update_commodity_name',true);
                 },
+                update_commodity_barcode(processContent,e){
+                    this.$set(processContent,'commodity_barcode',e.target.value);
+                },
+                update_commodity_sku(processContent){
+                    this.$set(processContent,'is_update_commodity_sku',true);
+                },
+                //添加动作
+                _add(processContent,commodity,type){
+                    let content={};
+                    content['bill_type'] = processContent.bill_type ;
+                    content['commodity_id'] = commodity.id ;
+                    content['wms_code'] = processContent.wms_code ;
+                    content['amount'] = commodity.amount ;
+                    content['commodity_name'] = commodity.name ;
+                    content['commodity_barcodes'] = commodity.barcodes ;
+                    content['commodity_sku'] = commodity.sku ;
+                    content['lineNo'] = commodity.lineNo ;
+                    content['owner_id'] = commodity.owner_id ;
+                    content['owner_name'] = commodity.owner_name ;
+                    content['addBtnShow'] = false ;
+                    content['type'] = type ;
+                    this.processContents.unshift(content);
+                    this.commodityIds.push(commodity.id+"_"+content['type']);
+                    this.sum += Number(commodity.amount);
+                    return content;
+                },
                 //添加所有
                 addAll(processContent){
                     let _this=this;
                     processContent.commodities.forEach(function (commodity) {
                         if (!_this.commodityIds.includes(commodity.id+"_"+false)){
-                            let content={};
-                            content['bill_type'] = processContent.bill_type ;
-                            content['commodity_id'] = commodity.id ;
-                            content['wms_code'] = processContent.wms_code ;
-                            content['amount'] = commodity.amount ;
-                            content['commodity_name'] = commodity.name ;
-                            content['commodity_barcodes'] = commodity.barcodes ;
-                            content['commodity_sku'] = commodity.sku ;
-                            content['lineNo'] = commodity.lineNo ;
-                            content['owner_id'] = commodity.owner_id ;
-                            content['owner_name'] = commodity.owner_name ;
-                            content['addBtnShow'] = false ;
-                            content['type'] = false ;
-                            _this.processContents.unshift(content);
-                            _this.commodityIds.push(commodity.id+"_"+content['type']);
-                            _this.sum += Number(commodity.amount);
-                            if (!_this.commodityIds.includes(commodity.id+"_"+true)){
+                            let content = _this._add(processContent,commodity,false);
+                            if (processContent.bill_type==='入库单' && !_this.commodityIds.includes(commodity.id+"_"+true)){
                                 let contentTemp={};
                                 Object.assign(contentTemp,content);
                                 contentTemp['type'] = true;
@@ -566,6 +595,21 @@
                     });
                     _this.$delete(_this.processContents,(_this.processContents.length)-1);
                 },
+                //成本单添加所有
+                finishedProductAddAll(processContent){
+                    let _this=this;
+                    processContent.commodities.forEach(function (commodity) {
+                        if (!_this.commodityIds.includes(commodity.id + "_" + true)) {
+                            _this._add(processContent, commodity, true);
+                            _this.commodityIds.push(commodity.id+"_"+'true');
+                        }
+                    });
+                    _this.$delete(_this.processContents,(_this.processContents.length)-1);
+                },
+                showPasteDataModal(){
+                    $("#popover").attr('hidden','hidden');
+                    $('#pasteData').modal('show');
+                },
                 importPasteData(){
                     let _this=this;
                     if (!this.pasteData){
@@ -577,18 +621,31 @@
                             if (res.data.success){
                                 let sum=0;
                                 res.data.data.forEach(function (processContent) {
-                                    _this.processContents.unshift(processContent);
-                                    _this.commodityIds.push(processContent.commodity_id+"_"+processContent.type);
-                                    if (!processContent.type) sum += Number(processContent.amount);
+                                    if (!_this.commodityIds.includes(processContent.commodity_id+"_"+processContent.type)){
+                                        _this.processContents.push(processContent);
+                                        _this.commodityIds.push(processContent.commodity_id+"_"+processContent.type);
+                                        sum += Number(processContent.amount);
+                                    }
                                 });
                                 _this.sum += sum;
+                                if (res.data.errors){
+                                    let content = '';
+                                    for (let i in res.data.errors){
+                                        content += i+":"+res.data.errors[i]+"</br>";
+                                    }
+                                    _this.popoverContent = content;
+                                    setTimeout(function () {
+                                        $("#popover").removeAttr('hidden').popover('show');
+                                    },1);
+                                    return;
+                                }
                                 $('#pasteData').modal('hide');
                                 tempTip.setDuration(2000);
                                 tempTip.showSuccess('导入完毕');
                             }
                         }).catch(err=>{
                             tempTip.setDuration(4000);
-                            tempTip.showSuccess('网络错误:'+err);
+                            tempTip.show('网络错误:'+err);
                         });
                 },
                 dragover(e){

+ 42 - 19
resources/views/process/index.blade.php

@@ -168,9 +168,15 @@
                     <th>序号</th>
                     <th>操作</th>
                     <th>状态</th>
-                    <th>任务号</th>
+                    <th>
+                        <span class="fa" :class="sort.code ? (sort.code=='up' ? 'fa-sort-up' : 'fa-sort-down') : 'fa-sort'" @click="sortData('code')"></span>
+                        任务号
+                    </th>
                     <th>经手人</th>
-                    <th>货主</th>
+                    <th>
+                        <span class="fa" :class="sort.owner_name ? (sort.owner_name=='up' ? 'fa-sort-up' : 'fa-sort-down') : 'fa-sort'" @click="sortData('owner_name')"></span>
+                        货主
+                    </th>
                     <th>加工类型</th>
                     <th>预期数量</th>
                     <th class="text-center">教程</th>
@@ -307,8 +313,8 @@
                                         <li v-for="barcode in processesContent.commodity.barcodes"><small>@{{ barcode.code }}</small></li>
                                     </ul>
                                 </td>
-                                <td :title="processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name" class="text-muted tooltipTarget" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">
-                                    <div style="width: 180px;overflow:hidden" :class="processesContent.bill_type=='原料单'?'td-warm':'td-cool'">@{{ processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name }}</div></td>
+                                <td :title="processesContent.sign_commodity_name_mark?processesContent.sign_commodity_name_mark:processesContent.commodity_name" class="text-muted tooltipTarget" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">
+                                    <div style="width: 180px;overflow:hidden" :class="processesContent.bill_type=='原料单'?'td-warm':'td-cool'">@{{ processesContent.sign_commodity_name_mark?processesContent.sign_commodity_name_mark:processesContent.commodity_name }}</div></td>
                             </tr>
                             <tr v-if="processUnfold[processOne.code+processOne.id]">
                                <td colspan="5">
@@ -330,7 +336,7 @@
                                 <span v-if="processesContent.commodity && processesContent.commodity.barcodes.length>0">
                                     @{{ processesContent.commodity.barcodes[0].code }}
                                 </span>&nbsp;&nbsp;
-                                <span :title="processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name" class="text-muted tooltipTarget" style="max-width:100px;overflow:hidden;">@{{ processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name }}</span>
+                                <span :title="processesContent.sign_commodity_name_mark?processesContent.sign_commodity_name_mark:processesContent.commodity_name" class="text-muted tooltipTarget" style="max-width:100px;overflow:hidden;">@{{ processesContent.sign_commodity_name_mark?processesContent.sign_commodity_name_mark:processesContent.commodity_name }}</span>
                             </div>
                         </div>
                         <div style="overflow: auto;zoom:1;position:absolute;margin-top: -35px;left:calc(50% - 50px);background-color: white" v-if="!processUnfold[processOne.code+processOne.id] && processOne.processesContents.length>1 &&
@@ -358,8 +364,8 @@
                                             class="btn btn-sm btn-outline-dark">@{{ dateTextMap.end_date }}</button>
                                     <div v-if="is_update_date">
                                         <input type="date" class="form-control form-control-sm" :class="is_update_date=='start_date' ? 'text-info border-info':''"
-                                               style="width: 137px" v-model="date" :max="today"
-                                               :min="is_update_date=='end_date' ? processDailyParticipants[(processDailyParticipants.length)-1].date : ''">
+                                               style="width: 137px" v-model="date" :max="is_update_date=='start_date'&&processDailyParticipants.length>0 ? processDailyParticipants[0].date : ''"
+                                               :min="is_update_date=='end_date'&&processDailyParticipants.length>0 ? processDailyParticipants[(processDailyParticipants.length)-1].date : ''">
                                         <button type="button" @click="update_process_date(processDailyParticipants[0])" class="btn btn-sm btn-outline-success">确定</button>
                                         <button type="button" @click="is_update_date='';dateTextMap.end_date='终';dateTextMap.start_date='起'" class="btn btn-sm btn-outline-danger">取消</button>
                                     </div>
@@ -385,7 +391,7 @@
                                 <td v-if="processDailyParticipant.rowspan"  :rowspan="processDailyParticipant.rowspan">
                                     <div  class="form-inline">
                                         <input :readonly="processDailyParticipant.readonly" v-model="processDailyParticipant.submitOutput"
-                                               class="form-control col-sm-5 " @click="processDailyParticipant.id?processDailyParticipant.readonly=false:processDailyParticipant.readonly=true" type="text" />
+                                               class="form-control col-sm-5 " @click="updateOutput(processDailyParticipant)" type="text" />
                                         @can("二次加工管理-登记工时")<button class="btn btn-sm btn-success" v-if="! processDailyParticipant.readonly" @click="submitOutputData(processDailyParticipant.daily_id,processDailyParticipant.submitOutput,processDailyParticipant.id)">确定</button>
                                         <button class="btn btn-sm btn-danger" v-if="! processDailyParticipant.readonly" @click="processDailyParticipant.readonly=true;processDailyParticipant.submitOutput=processDailyParticipant.output">取消</button>
                                         @endcan
@@ -475,8 +481,9 @@
 @endsection
 
 @section('lastScript')
-    <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/utilities/sort.js')}}"></script>
     <script>
         new Vue({
             el:"#process",
@@ -520,9 +527,9 @@
                 signs:[],
                 is_update_date:false,
                 date:'',
-                today:'',
                 dateTextMap:{'start_date':'起','end_date':'终'},
                 sum:{!! $processes->total() !!},
+                sort : {},
             },
             watch:{
                 checkData:{
@@ -540,8 +547,6 @@
                 this.resetProcessData();
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 $('#process').removeClass('d-none');
-                let today=new Date();
-                this.today = today.getFullYear() + "-" + ((today.getMonth() + 1) < 10 ? "0"+(today.getMonth() + 1) : (today.getMonth() + 1)) + "-" + today.getDate();
                 function focusin() {
                     if(isJustBack())location.reload();
                 }
@@ -557,14 +562,14 @@
                 }
                 let data=[
                     [
-                        {name:'date_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
+                        {name:'date_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
                         {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
                             placeholder:['货主','定位或多选货主'],data:this.owners},
                         {name:'wms_code',type:'input',tip:'单据号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '单据号'},
                         {name:'status',type:'select',placeholder: '状态',data:this.status},
                     ],
                     [
-                        {name:'date_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
+                        {name:'date_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
                         {name:'commodity_barcode',type:'input',tip:'商品条码:可在两侧增加百分号(%)进行模糊搜索',placeholder: '商品条码'},
                         {name:'code',type:'input',tip:'任务号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '任务号'},
                         {name:'is_accomplish',type:'checkbox',data:[{name:'sign',value:'显示交接完成的记录'}]},
@@ -630,7 +635,7 @@
                 processExport(checkAllSign) {
                     let url = '{{url('process/export')}}';
                     let token='{{ csrf_token() }}';
-                    //excelExport 定义在 js/queryForm/export.js
+                    //excelExport 定义在 js/queryForm/export200804.js
                     excelExport(checkAllSign,this.checkData,url,this.sum,token);
                 },
                 //获取登记工时
@@ -1408,14 +1413,15 @@
                                 return;
                             }
                             tempTip.setDuration(3000);
-                            tempTip.show('未知错误,请联系管理员!')
+                            tempTip.show(response.data.data)
                         }).catch(function (err) {
                         tempTip.setDuration(3000);
                         tempTip.show('网络错误:' + err)
                     })
                 },
                 show(id) {
-                    window.location.href = '{{url('process')}}/' + id;
+                    {{--window.location.href = '{{url('process')}}/' + id;--}}
+                    window.open('{{url('process')}}/' + id,'_blank') ;
                 },
                 //修改价格
                 updateUnitPrice(process) {
@@ -1431,7 +1437,7 @@
                             if (response.data.success) {
                                 process.signs.push(response.data.sign);
                                 process.is_update_unit_price = false;
-                                process.unit_price = unit_price;
+                                process.signUnitPrice = unit_price;
                                 tempTip.setDuration(2000);
                                 tempTip.showSuccess('“' + process.code + "”价格修改成功,确认通过后生效!");
                                 return;
@@ -1464,6 +1470,7 @@
                                     _this.signs[process.code]=[];
                                     process.signs=[];
                                     process.unit_price = process.signUnitPrice;
+                                    process.signUnitPrice = '';
                                 }
                                 if (process.is_update_unit_price)process.is_update_unit_price = false;
                                 tempTip.setDuration(2000);
@@ -1568,6 +1575,22 @@
                     let newValue=Number(processDailyParticipantOne.dinner_duration) / 60;
                     processDailyParticipantOne.hour_count += (oldValue-newValue);
                 },
+                //修改每日产量
+                updateOutput(processDailyParticipant){
+                    if (processDailyParticipant.id) processDailyParticipant.readonly=false;
+                    else {
+                        tempTip.setDuration(3000);
+                        tempTip.show('该日无参与人加工信息,请先录入参与人加工信息!');
+                        processDailyParticipant.readonly=true;
+                    }
+                },
+                //点击排序
+                sortData(column){
+                    let type = 'up';
+                    if (this.sort[column]==='up') type = 'down';
+                    this.$set(this.sort,column,type);
+                    this.processes = sortInit(this.processes, column, type);
+                },
             },
         });
     </script>

+ 2 - 2
resources/views/process/show.blade.php

@@ -98,7 +98,7 @@
     </div>
     <div class="col  row">
         <label class="col-2 text-dark" for="tutorials">教程:</label>
-        <span class="col-8  text-danger font-weight-bold" v-if="process.tutorials.length<1">暂无</span>
+        <span class="col-8  font-weight-bold" v-if="process.tutorials.length<1">暂无</span>
         <div v-else id="tutorials" class="col-8  text-muted" style="white-space: normal">
             <b @click="tutorialShow(tutorial.id)" style="cursor: pointer;text-decoration:underline" class="text-primary" v-for="tutorial in process.tutorials">@{{ tutorial.name }}<br></b>
         </div>
@@ -123,4 +123,4 @@
             },
         });
     </script>
-@stop
+@stop

+ 1 - 1
resources/views/rejected/recycle.blade.php

@@ -257,7 +257,7 @@
                         order_number:'{{$rejectedBill->order_number}}',sender:'{{$rejectedBill->sender}}',
                         is_hide:false,
                         mobile_sender:'{{$rejectedBill->mobile_sender}}',logistic_number:'{{$rejectedBill->logistic_number}}',
-                        logistic_number_return:'{{$rejectedBill->logistic_number_return}}',logistic:{!!$rejectedBill->logistic!!},
+                        logistic_number_return:'{{$rejectedBill->logistic_number_return}}',logistic:{!!$rejectedBill->logistic ?? "''"!!},
                         fee_collected:'{{$rejectedBill->fee_collected}}',goods_amount:'{{$rejectedBill->goods_amount}}',
                         is_loaded:'{{$rejectedBill->is_loaded_null}}',operator_name:'{{$rejectedBill->operator_name}}',detailFolding:true,
                         items:{!! $rejectedBill->items !!},is_finished:'{{$rejectedBill->is_finished}}',

+ 112 - 139
resources/views/rejected/search/analyze.blade.php

@@ -6,150 +6,123 @@
         @component('rejected.menu')@endcomponent
         @component('rejected.search.menu')@endcomponent
     </div>
-    <div class="container-fluid">
-        <div >
-            <div class="d-none" id="list">
-                @if(Session::has('successTip'))
-                    <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
-                @endif
-                <div class="col-12" style="background: #fff;">
-                    <div class="row">
-                        <div class="col" v-if="isBeingFilterConditions">
-                            <label for="">
-                                <a href="{{url('rejected/index/analyze')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
-                            </label>
-                        </div>
-                        <table class="table table-sm table-bordered m-0">
-                            <tr>
-                                <td colspan="9">
-                                    <div class="form-control-sm tooltipTarget"></div>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan="2">
-                                    <input type="date" name="created_at_start" class="form-control-sm tooltipTarget"
-                                           style="width:140px"
-                                           :class="filterParams.created_at_start?'bg-warning':''"
-                                           v-model="filterParams.created_at_start"
-                                           @keypress="created_at_startEntering" @change="created_at_startChange"
-                                           title="选择显示指定日期的起始时间">
-                                </td>
-                                <td>
-                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="客户"
-                                           style="width:70px" @input="locateOwner" @keypress="owner_idEntering"
-                                           title="客户:输入关键词快速定位下拉列表,回车确定">
-                                    <select name="owner_id" id="owner_id" class="form-control-sm tooltipTarget"
-                                            :class="filterParams.owner_id?'bg-warning':''"
-                                            v-model="filterParams.owner_id"
-                                            title="选择要显示的客户" @change="owner_idChange">
-                                        <option value="" selected>全部客户</option>
-                                        <option v-for="owner in owners" :value="owner.id">@{{ owner.name }}</option>
-                                    </select>
-                                </td>
-                                <td width="36%"></td>
-                            </tr>
-                            <tr>
-                                <td colspan="2">
-                                    <input type="date" name="created_at_end" class="form-control-sm tooltipTarget"
-                                           style="width:140px"
-                                           :class="filterParams.created_at_end?'bg-warning':''"
-                                           @keypress="created_at_endEntering" @change="created_at_endChange"
-                                           title="选择显示指定日期的结束时间">
-                                </td>
-                                <td><input type="button" class="btn btn-outline-dark btn-sm" @click="searchByFilters"
-                                           value="按条件搜索"/></td>
-                            </tr>
-                            <tr>
-                                <td colspan="9">
-                                    <span class="dropdown">
-                                        <button
-                                            class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
-                                            :class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
-                                            data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
-                                            导出Excel
-                                        </button>
-                                        <div class="dropdown-menu">
-                                            <a class="dropdown-item" @click="exportExcel(1)"
-                                               href="javascript:">导出勾选内容</a>
-                                            <a class="dropdown-item" @click="exportExcel(2)"
-                                               href="javascript:">导出所有页</a>
-                                        </div>
-                                    </span>
-                                </td>
-                            </tr>
-                        </table>
-                    </div>
-                </div>
-
-                <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;">
-                    <tr>
-                        <th>
-                            <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
-                                   id="checkSelectingAll" @click="checkBoxAllToggle" v-model="checkBoxAll" value="1">
-                        </th>
-                        <th>序号</th>
-                        <th>货主</th>
-                        <th class="text-muted">退件数</th>
-                        <th class="text-success font-weight-bold">审核数</th>
-                        <th>未审核数</th>
-                        <th class="text-success font-weight-bold">入库数</th>
-                        <th>未入库数</th>
-                    </tr>
-                    <tr v-for="(rejectedBill,index) in rejectedBills " :data-id="rejectedBill.id">
-                        <td>
-                            <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id">
-                        </td>
-                        <td class="text-muted" style="opacity:0.7">
-                            @{{ index+1 }}
-                        </td>
-                        <td>
-                            @{{ rejectedBill.owner_name }}
-                        </td>
-                        <td class="text-muted">
-                            @{{ rejectedBill.bounce_amount }}
-                        </td>
-                        <td class="text-success font-weight-bold">
-                            @{{ rejectedBill.check_amount }}
-                        </td>
-                        <td>
-                            @{{ rejectedBill.bounce_amount-rejectedBill.check_amount }}
-                        </td>
-                        <td class="text-success font-weight-bold">
-                            @{{ rejectedBill.in_storage_count }}
-                        </td>
-                        <td>
-                            @{{ rejectedBill.not_in_storage_count }}
-                        </td>
-                    </tr>
-                </table>
+    <div class="container-fluid" id="list">
+        <div id="form_div"></div>
+        <span class="dropdown m-1">
+            <button
+                    class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
+                    :class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
+                    data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
+                导出Excel
+            </button>
+            <div class="dropdown-menu">
+                <a class="dropdown-item" @click="exportExcel(false)"
+                   href="javascript:">导出勾选内容</a>
+                <a class="dropdown-item" @click="exportExcel(true)"
+                   href="javascript:">导出所有页</a>
             </div>
-        </div>
+        </span>
+        <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;">
+            <tr>
+                <th>
+                    <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
+                           id="checkSelectingAll" @click="checkBoxAllToggle" v-model="checkBoxAll" value="1">
+                </th>
+                <th>序号</th>
+                <th>货主</th>
+                <th class="text-muted">退件数</th>
+                <th class="text-success font-weight-bold">审核数</th>
+                <th>未审核数</th>
+                <th class="text-success font-weight-bold">入库数</th>
+                <th>未入库数</th>
+            </tr>
+            <tr v-for="(rejectedBill,index) in rejectedBills " :data-id="rejectedBill.id">
+                <td>
+                    <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id_owner">
+                </td>
+                <td class="text-muted" style="opacity:0.7">
+                    @{{ index+1 }}
+                </td>
+                <td>
+                    @{{ rejectedBill.owner_name }}
+                </td>
+                <td class="text-muted">
+                    @{{ rejectedBill.bounce_amount }}
+                </td>
+                <td class="text-success font-weight-bold">
+                    @{{ rejectedBill.check_amount }}
+                </td>
+                <td>
+                    @{{ rejectedBill.bounce_amount-rejectedBill.check_amount }}
+                </td>
+                <td class="text-success font-weight-bold">
+                    @{{ rejectedBill.in_storage_count }}
+                </td>
+                <td>
+                    @{{ rejectedBill.not_in_storage_count }}
+                </td>
+            </tr>
+        </table>
     </div>
 @endsection
 
 @section('lastScript')
+    <script src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
     <script>
-        // 数据
-        let rejectedBills = {!! $rejectedBills !!};
-
-        //  客户
-        let owners = {!! $owners !!};
-        let qualityLabels = {!! $qualityLabels !!};
-            @if(isset($paginateParams))
-        let paginateParams ={!! json_encode($paginateParams) !!};
-            @endif
-        let total = rejectedBills.length;
-        let editUrl = "{{url('rejectedBill')}}/";
-        let destroyUrl = "{{url('rejectedBill')}}/";
-        let ajaxConfirmBeStoredUrl = '{{url("apiLocal/rejectedBill/apiConfirmBeStored")}}';
-        let ajaxCheckUrl = '{{url("apiLocal/rejectedBill/apiSetIsLoadedAll")}}';
-        let ajaxCheckAllURL = '{{url("rejected/ajaxCheckAll")}}';
-        let ajaxFinishAllUrl = '{{url("rejected/ajaxFinishAll")}}';
-        let exportExcelURL = '{{url("rejected/analyze/exportExcelOnParams")}}';
-        let exportExcelOnFilterParamsURL = '{{url("rejected/analyze/exportAllExcelOnParams")}}';
-        let csrfInput = '@csrf';
-    </script>
-    <script>
+        new Vue({
+            el:"#list",
+            data:{
+                rejectedBills : {!! $rejectedBills !!},
+                checkBoxAll:[],
+                sum : '{{count($rejectedBills)}}',
+                rejectedBills_checkBoxes:[],
+                owners:[
+                    @foreach($owners as $owner)
+                    {name:'{{$owner->id}}',value:'{{$owner->name}}'},
+                    @endforeach
+                ],
+            },
+            mounted:function(){
+                $(".tooltipTarget").tooltip({'trigger':'hover'});
+                $('#list').removeClass('d-none');
+                let data=[
+                    [
+                        {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
+                        {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
+                            placeholder:['货主','定位或多选货主'],data:this.owners},
+                    ],[
+                        {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
+                    ]
+                ];
+                this.form=new query({
+                    el:"#form_div",
+                    condition:data,
+                    isPaginations:false,
+                });
+                this.form.init();
+            },
+            methods:{
+                checkBoxAllToggle:function(e){
+                    let _this=this;
+                    if(_this.rejectedBills_checkBoxes.length>=this.rejectedBills.length){
+                        _this.rejectedBills_checkBoxes=[];
+                        _this.checkBoxAll=[];
+                    }
+                    else{
+                        _this.rejectedBills_checkBoxes=[];
+                        this.rejectedBills.forEach(function(bill){
+                            _this.rejectedBills_checkBoxes.push(bill.id_owner);
+                            _this.checkBoxAll=[1];
+                        });
+                    }
+                },
+                exportExcel:function(checkAllSign){
+                    let url = '{{url('rejected/exportAnalyze')}}';
+                    let token='{{ csrf_token() }}';
+                    excelExport(checkAllSign,this.rejectedBills_checkBoxes,url,this.sum,token);
+                },
+            },
+        });
     </script>
-    <script src="{{asset('js/singles/searchAnalyze200513.js')}}"></script>
 @endsection

+ 4 - 4
resources/views/rejected/search/general.blade.php

@@ -208,8 +208,8 @@
         let ajaxFinishAllUrl='{{url("rejected/ajaxFinishAll")}}';
         let csrfInput='@csrf';
     </script>
-    <script src="{{asset('js/queryForm/export.js')}}"></script>
-    <script src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
         new Vue({
             el:"#list",
@@ -238,7 +238,7 @@
                 $('#list').removeClass('d-none');
                 let data=[
                     [
-                        {name:'created_at_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
+                        {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
                         {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
                             placeholder:['货主','定位或多选货主'],data:this.owners},
                         {name:'order_number',type:'input',tip:'订单号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'订单号'},
@@ -247,7 +247,7 @@
                         {name:'is_checked',type:'select',placeholder: '是否审核',data:[{name:1,value:'已审核'},{name:0,value:'未审核'}]},
                         {name:'id_logistic_return',type:'select',placeholder: '快递名称',data:this.logistics},
                     ],[
-                        {name:'created_at_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
+                        {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
                         {name:'barcode_goods',type:'input',tip:'商品条码:可模糊匹配右边未填完的部分,按回车提交',placeholder:'商品条码'},
                         {name:'id_quality_label',type:'select',tip:'是否正品:正品仅显示全部是正品的退单,但残次显示的是包含有残次的退单',placeholder: '是否正品',data:this.qualityLabels},
                         {name:'mobile_sender',type:'input',tip:'寄件人手机:输入完成敲回车提交',placeholder:'寄件人手机'},

+ 32 - 6
resources/views/waybill/create.blade.php

@@ -108,20 +108,46 @@
                         </div>
                     </div>
                     {{--zengjun start--}}
-                    @can('运输管理-运费')
+{{--                    @can('运输管理-运费')--}}
+                        <div class="form-group row">
+                            <label for="charge" class="col-2 col-form-label text-right ">运输收费(元)</label>
+                            <div class="col-8">
+                                <input type="text" class="form-control @error('charge') is-invalid @enderror"
+                                       name="charge" autocomplete="off" value="{{ old('charge') }}" >
+                                @error('charge')
+                                <span class="invalid-feedback" role="alert">
+                                        <strong>{{ $message }}</strong>
+                                    </span>
+                                @enderror
+                            </div>
+                        </div>
+
+
                     <div class="form-group row">
-                        <label for="charge" class="col-2 col-form-label text-right ">收费(元)</label>
+                        <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他收费(元)</label>
                         <div class="col-8">
-                            <input type="text" class="form-control @error('charge') is-invalid @enderror"
-                                   name="charge" autocomplete="off" value="{{ old('charge') }}" >
-                            @error('charge')
+                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
+                                   name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@endif"  >
+                            @error('other_charge')
                             <span class="invalid-feedback" role="alert">
                                         <strong>{{ $message }}</strong>
                                     </span>
                             @enderror
                         </div>
                     </div>
-                    @endcan
+                    <div class="form-group row">
+                        <label for="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他收费备注</label>
+                        <div class="col-8">
+                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
+                                   name="other_charge_remark" autocomplete="off" value="@if(old('other_charge_remark')){{ old('other_charge_remark') }}@endif"  >
+                            @error('other_charge_remark')
+                            <span class="invalid-feedback" role="alert">
+                                        <strong>{{ $message }}</strong>
+                                    </span>·
+                            @enderror
+                        </div>
+                    </div>
+{{--                    @endcan--}}
                     {{--zengjun end--}}
                     <div class="form-group row">
                         <label for="collect_fee" class="col-2 col-form-label text-right text-muted">到付金额(元)</label>

+ 13 - 11
resources/views/waybill/edit.blade.php

@@ -172,7 +172,7 @@
                                 </select>
                                 <input type="text" class="form-control-sm  form-control tooltipTarget" style="vertical-align: middle"
                                        placeholder="输入关键字定位" @input="destination_city_id" v-model="waybill.destination_city" id="destination_city" title="若无法显示区/县级市,可点击后方按钮手动添加" >
-                                <button type="button" class="btn btn-outline-info btn-sm" @click="addCounty" style="transform: scale(0.9)">添加市/县</button>
+                                <button type="button" class="btn btn-outline-info btn-sm" @click="addCounty()" style="transform: scale(0.9)">添加市/县</button>
                             </div>
                         </div>
                     </div>
@@ -604,7 +604,6 @@
                             }
                         });
                 },
-
                 destination_city_id:function (e) {
                     let _this=this;
                     let $val=e.target.value;
@@ -617,25 +616,28 @@
                         });
                 },
                 addCounty:function () {
-                    var add=window.confirm("您确认添加该市/县?");
                     let _this=this;
-                    let url='{{url('waybill/addCounty?destination_city=')}}'+_this.destination_city;
-                    if(add){
+                    if (!_this.waybill.destination_city) {
+                        tempTip.setDuration(2000);
+                        tempTip.show('您未输入市/县!');
+                        return;
+                    }
+                    tempTip.confirm("您确认添加该市/县?", function () {
+                        let url = '{{url('waybill/addCounty?destination_city=')}}' + _this.waybill.destination_city;
                         axios.post(url)
                             .then(function (response) {
-                                if(response.data && response.data.destination_city){
+                                if (response.data && response.data.destination_city) {
                                     tempTip.setDuration(3000);
                                     tempTip.show(response.data.destination_city[0]);
-                                    return ;
+                                    return;
                                 }
                                 _this.cities.push(response.data);
-                                _this.waybill.destination_city_id=response.data.id;
+                                _this.waybill.destination_city_id = response.data.id;
                             }).catch(function (err) {
                             tempTip.setDuration(3000);
-                            tempTip.show("网络错误!"+err);
+                            tempTip.show("网络错误!" + err);
                         });
-                    }
-
+                    })
                 }
             },
         });

+ 148 - 15
resources/views/waybill/index.blade.php

@@ -121,13 +121,15 @@
                                 <button class="btn btn-outline-primary btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>
                             @endcan
                             @can('运输管理-编辑')
-                                <button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>
+{{--                                <button  class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>--}}
+                                    <a target="_blank" class="btn btn-outline-secondary btn-sm" :href= "('{{url('waybill/waybillEdit')}}/'+waybill.id)">修改</a>
                             @endcan
                         </span>
                         <span v-if=waybill.status==="已审核">
                             @can('运输管理-调度')
                                 <button class="btn btn-outline-secondary btn-sm" @click="waybillRetreatAudit(waybill.id,waybill.waybill_number)">取消审核</button>
-                                <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">调度</button>
+{{--                                <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">调度</button>--}}
+                                <a target="_blank" class="btn btn-outline-secondary btn-sm" :href= "('{{url('waybill')}}/'+waybill.id+'/edit')">调度</a>
                             @endcan
                         </span>
                         <span v-if=waybill.status==="待终审">
@@ -135,7 +137,8 @@
                                 <button class="btn btn-outline-success btn-sm" @click="waybillEndAudit(waybill.id,waybill.waybill_number)">完结</button>
                             @endcan
                             @can('运输管理-调度')
-                                <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">改调度</button>
+{{--                                <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">改调度</button>--}}
+                                    <a target="_blank" class="btn btn-outline-secondary btn-sm" :href= "('{{url('waybill')}}/'+waybill.id+'/edit')">改调度</a>
                             @endcan
                         </span>
                     </td>
@@ -158,7 +161,19 @@
                     <td class="td-warm toptd" :title="waybill.remark? '置顶备注:'+waybill.remark :''">@{{waybill.source_bill}}</td>
                     <td class="td-warm" >@{{waybill.wms_bill_number}}</td>
                     <td class="td-warm">@{{waybill.waybill_number}}</td>
-                    <td class="td-warm">@{{waybill.charge}}</td>
+                    @can('运输管理-运单编辑')
+                    <td class="td-warm" >
+                        <span v-if="waybill.charge" class="btn-sm btn-outline-secondary btn" @click="waybillChargeCheck($event)" :data_id="waybill.id">@{{waybill.charge|money}}</span>
+                        <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillCharge($event)" onfocus="$(this).css('width','85px')" :value="waybill.charge" :data_id="waybill.id" >
+                        <input type="number" class="form-control form-control-sm"  @blur="updateWaybillCharge($event)" :value="waybill.charge" :data_id="waybill.id" style="min-width:85px;display: none">
+                    </td>
+                        @else
+                        <td class="td-warm" ><span v-if="waybill.charge">@{{waybill.charge|money}}</span></td>
+                    @endcan
+{{--                    <td class="td-warm ">--}}
+{{--                        @{{waybill.charge}}--}}
+{{--                    </td>--}}
+
                     <td class="td-warm">@{{waybill.other_charge}}</td>
                     <td class="td-warm">@{{waybill.other_charge_remark}}</td>
                     <td class="td-warm">
@@ -181,7 +196,16 @@
                             <span v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span></span></td>
                     <td class="td-cool"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight|filterZero}}  @{{waybill.warehouse_weight_unit}}</span></td>
                     <td class="td-cool"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight|filterZero}}  @{{waybill.carrier_weight_unit}}</span></td>
-                    <td class="td-cool"><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other|filterZero}}  @{{waybill.warehouse_weight_unit_other}}</span></td>
+                    <td class="td-cool text-center" style="position: relative" @mouseenter="btnRefreshWeightZoomOut(waybill)" @mouseleave="btnRefreshWeightZoomIn(waybill)">
+                        <span v-if="waybill.warehouse_weight_other&&waybill.btn_refresh_weight=='zoomIn'"> @{{waybill.warehouse_weight_other}}  @{{waybill.warehouse_weight_unit_other}}</span>
+                        <button type="button" class="btn btn-sm btn-outline-info" @click="refreshWaveHouseWeight(waybill.wms_bill_number)"
+                                :style="[
+                                {position:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'absolute':'static'},
+                                {transform:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'scale(0.55)':'scale(1)'},
+                                {right:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'-10px':'auto'},
+                                {bottom:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'-6px':'auto'},
+                                ]">刷新</button>
+                    </td>
                     <td class="td-cool"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other|filterZero}}  @{{waybill.carrier_weight_unit_other}}</span></td>
                     <td class="td-cool"><span v-if="waybill.amount">@{{waybill.amount}} @{{waybill.amount_unit_name }}</span></td>
                     <td class="td-cool">@{{waybill.mileage|km}} </td>
@@ -361,8 +385,8 @@
             -webkit-animation-play-state: running;
         }
     </style>
-    <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
         let vueList=new Vue({
             el:'#list',
@@ -389,6 +413,7 @@
                         pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
                         collect_fee:'{{$waybill->collect_fee}}', @endcan deliver_at:'{{$waybill->deliver_at}}',dispatch_remark:'{{$waybill->dispatch_remark}}',isBtn:false,
                         waybillAuditLogs:{!! $waybill->waybillAuditLogs !!},
+                        btn_refresh_weight:'zoomIn',
                         @if($waybill->remark)remark:'{{$waybill->remark}}', @else remark:'', @endif
                     },
                     @endforeach
@@ -447,14 +472,14 @@
                     [
                         {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
                             placeholder:['货主','定位或多选货主'],data:this.owners},
-                        {name:'created_at_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
+                        {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
                         {name:'origination',type:'input',tip:'始发地:可在两侧增加百分号(%)进行模糊搜索',placeholder: '始发地'},
                         {name:'carrier_bill',type:'input',tip:'承运商单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '承运商单号'},
                         {name:'status',type:'select',placeholder: '运单状态',data:this.status},
                     ],
                     [
                         {name:'wms_bill_number',type:'input',tip:'WMS单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: 'WMS单号'},
-                        {name:'created_at_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
+                        {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
                         {name:'destination',type:'input',tip:'目的地:可在两侧增加百分号(%)进行模糊搜索',placeholder: '目的地'},
                         {name:'waybill_number',type:'input',tip:'运单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '运单号'},
                         {name:'carrier_id',type:'select',placeholder: '承运商',data:this.carriers},
@@ -470,6 +495,12 @@
                 this.form.init();
             },
             methods:{
+                btnRefreshWeightZoomIn(waybill){
+                    waybill.btn_refresh_weight='zoomIn'
+                },
+                btnRefreshWeightZoomOut(waybill){
+                    waybill.btn_refresh_weight='zoomOut'
+                },
                 lazy(){
                     //可视区域高度
                     let height=window.innerHeight;
@@ -518,9 +549,9 @@
                         tempTip.show('审核失败,网络连接错误!'+err);
                     });
                 },
-                waybillUpdate(id){
-                    location.href="{{url('waybill/waybillEdit')}}/"+id;
-                },
+                {{--waybillUpdate(id){--}}
+                {{--    location.href="{{url('waybill/waybillEdit')}}/"+id;--}}
+                {{--},--}}
                 // 软删除
                 waybillDestroy(id,waybill_number){
                     if(!confirm('确定要删除运单号为:“'+waybill_number+'”的运单吗?')){return};
@@ -574,9 +605,9 @@
                         tempTip.show('审核驳回失败,网络连接错误!'+err);
                     });
                 },
-                job(id){
-                    location.href="{{url('waybill')}}/"+id+"/edit";
-                },
+                {{--job(id){--}}
+                {{--    location.href="{{url('waybill')}}/"+id+"/edit";--}}
+                {{--},--}}
                 waybillEndAudit(id,waybill_number){
                     if(!confirm('确定要通过“'+waybill_number+'”的终审吗?')){return};
                     let _this=this;
@@ -765,6 +796,85 @@
                         tempTip.show("网络错误:"+err);
                     });
                 },
+                // 运输收费修改
+                waybillChargeCheck:function (e) {
+                    let target = $(e.target);
+                    target.hide();
+                    let input = target.next();
+                    input.show();
+                    input.focus();
+                },
+                // 运输收费失焦事件
+                updateWaybillCharge:function (e) {
+                    let target = $(e.target);
+                    let _this = this;
+                    let span = target.prev();
+                    let id = target.attr('data_id');
+                    let oldCharge = span.text();
+                    let charge = target.val();
+                    if(charge !== span.text()){
+                        let ajaxUrl= '{{url("apiLocal/waybill/changeCharge")}}';
+                        axios.post(ajaxUrl,{'id':id,'charge':charge}).then(function (response) {
+                            if(response.data.success){
+                                _this.updateWaybill(id,charge);
+                                tempTip.setDuration(2000);
+                                tempTip.showSuccess('运输收费修改成功');
+                            }else{
+                                tempTip.setDuration(3000);
+                                tempTip.show('运输收费修改失败!'+response.data.fail_info);
+                                _this.updateWaybill(id,oldCharge);
+                            }
+                        }).catch(function (err) {
+                            tempTip.setDuration(3000);
+                            tempTip.show('运输收费修改失败!网络异常:'+err);
+                            _this.updateWaybill(id,oldCharge);
+                        });
+                    }
+                    span.show();
+                    target.hide();
+                },
+                // 为运单添加运输收费
+                addWaybillCharge(e){
+                    let target = $(e.target);
+                    target.css('width','85px');
+                    let _this = this;
+                    let id = target.attr('data_id');
+                    let charge = target.val();
+                    console.log(charge);
+                    let ajaxUrl= '{{url("apiLocal/waybill/changeCharge")}}';
+                    if(charge === ''|| charge === null){
+                        target.css('width','75px');
+                        return;
+                    }else{
+                        axios.post(ajaxUrl,{'id':id,'charge':charge}).then(function (response) {
+                            if(response.data.success){
+                                tempTip.setDuration(2000);
+                                tempTip.showSuccess('运输收费添加成功');
+                                _this.updateWaybill(id,charge);
+                            }else{
+                                tempTip.setDuration(3000);
+                                tempTip.show('运输收费添加失败!'+response.data.fail_info);
+                            }
+                        }).catch(function (err) {
+                            tempTip.setDuration(3000);
+                            tempTip.show('运输收费添加失败!网络异常:'+err);
+                        });
+                        target.css('width','75px');
+                    }
+                },
+                // 修改运输收费更新表格数据
+                updateWaybill(id,newCharge){
+                    this.waybills.some(function(waybill){
+                        if(waybill.id === id){
+                            waybill.charge = newCharge;
+                            return true;
+                        }
+                    })
+                },
+
+
+
+
                 // 运费修改
                 waybillFeeCheck:function (e) {
                     let target = $(e.target);
@@ -912,6 +1022,29 @@
                     let tip = target.parent().find('.toptd');
                     top.show();
                     tip.tooltip('hide');
+                },
+                refreshWaveHouseWeight(wms_bill_number) {
+                    let _this=this;
+                    let url='{{url('waybill/refreshWaveHouseWeight')}}';
+                    axios.post(url,{'wms_bill_number':wms_bill_number}).then(function (response) {
+                        if(response.data.success){
+                            _this.waybills.every(function (waybill) {
+                                if (waybill.wms_bill_number==wms_bill_number){
+                                    waybill.warehouse_weight_other=response.data.warehouseWeight;
+                                    return false;
+                                }
+                                return true;
+                            });
+                            tempTip.setDuration(3000);
+                            tempTip.showSuccess('刷新计重成功');
+                        }else{
+                            tempTip.setDuration(3000);
+                            tempTip.show('刷新计重失败!'+response.data.fail_info);
+                        }
+                    }).catch(function (err) {
+                        tempTip.setDuration(3000);
+                        tempTip.show('刷新计重失败,网络连接错误!'+err);
+                    });
                 }
             },
             filters:{

+ 1 - 1
resources/views/waybill/menu.blade.php

@@ -8,7 +8,7 @@
             </li> @endcan
             @can('运输管理-录入')
             <li class="nav-item">
-                <a class="nav-link" href="{{url('waybill/create?type=ZF')}}" :class="{active:isActive('create',2)}">录入</a>
+                <a class="nav-link" href="{{url('waybill/create?type=ZX')}}" :class="{active:isActive('create',2)}">录入</a>
             </li> @endcan
             @can('运输管理-发运')
             <li class="nav-item">

+ 27 - 1
resources/views/waybill/waybillEdit.blade.php

@@ -96,7 +96,7 @@
                         </div>
                     </div>
                     <div class="form-group row">
-                        <label for="charge" class="col-2 col-form-label text-right text-primary">收费(元) *</label>
+                        <label for="charge" class="col-2 col-form-label text-right text-primary">运输收费(元) *</label>
                         <div class="col-8">
                             <input type="text" class="form-control @error('charge') is-invalid @enderror"
                                    name="charge" autocomplete="off" value="@if(old('charge')){{ old('charge') }}@else{{$waybill->charge}}@endif"  >
@@ -107,6 +107,32 @@
                             @enderror
                         </div>
                     </div>
+
+                    <div class="form-group row">
+                        <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他收费(元)</label>
+                        <div class="col-8">
+                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
+                                   name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@else{{$waybill->other_charge}}@endif"  >
+                            @error('other_charge')
+                            <span class="invalid-feedback" role="alert">
+                                        <strong>{{ $message }}</strong>
+                                    </span>
+                            @enderror
+                        </div>
+                    </div>
+                    <div class="form-group row">
+                        <label for="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他收费备注</label>
+                        <div class="col-8">
+                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
+                                   name="other_charge_remark" autocomplete="off" value="@if(old('other_charge_remark')){{ old('other_charge_remark') }}@else{{$waybill->other_charge_remark}}@endif"  >
+                            @error('other_charge_remark')
+                            <span class="invalid-feedback" role="alert">
+                                        <strong>{{ $message }}</strong>
+                                    </span>·
+                            @enderror
+                        </div>
+                    </div>
+
                     <div class="form-group row">
                         <label for="collect_fee" class="col-2 col-form-label text-right text-muted">到付金额(元)</label>
                         <div class="col-8">

+ 4 - 4
resources/views/weight/package/index.blade.php

@@ -77,8 +77,8 @@
 @endsection
 
 @section('lastScript')
-    <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200806.js')}}"></script>
     <script>
             @if(isset($request))
         let request={!! json_encode($request) !!};
@@ -112,11 +112,11 @@
                 $('#list').removeClass('d-none');
                 let _this = this;
                 let data = [[
-                    {name:'created_at_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
+                    {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
                     {name:'owner_id',type:'search_select',tip:['',''],placeholder:['客户',''],data:_this.owners},
                     {name:'logistic_number',type:'input',tip:'快递单号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'快递单号'},
                 ],[
-                    {name:'created_at_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
+                    {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
                     {name:'batch_number',type:'input',tip:'波次号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'波次号'}
                 ]];
 

+ 1 - 5
routes/api.php

@@ -1,6 +1,7 @@
 <?php
 
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Route;
 
 /*
 |--------------------------------------------------------------------------
@@ -12,10 +13,5 @@ use Illuminate\Http\Request;
 | is assigned the "api" middleware group. Enjoy building your API!
 |
 */
-Route::prefix('log')->group(function(){ //日志记录
-    Route::post('f134g/save', "Api\LogController@save");//记录
-    Route::post('rejected/jianshang/send', "Api\jianshang\RejectedController@fakingReceiveSend");//faking rejected发给笕尚的退货信息
-});
-Route::post('rejected/jianshang/send', "Api\jianshang\RejectedController@fakingReceiveSend");//faking rejected发给笕尚的退货信息
 
 

+ 1 - 1
routes/api/thirdPart/flux.php

@@ -1,6 +1,7 @@
 <?php
 
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Route;
 
 
 /*
@@ -13,7 +14,6 @@ Route::post('receive/new', "ReceiveController@new_");//增加新波次消息
 文件地址前缀:/api/thirdPart/flux/package
 */
 Route::post('package/new', "PackageController@new_");//增加新包裹消息
-Route::post('package/new2', "PackageController2@new_");//增加新包裹消息
 //accomplishToWMS() 发往WMS的称重和纸条包裹信息
 
 /*

+ 1 - 0
routes/apiLocal.php

@@ -27,4 +27,5 @@ Route::post('commodity/getCommodityByBarcode', 'CommodityController@apiGetCommod
 
 Route::post('waybill/recoverSelected', 'WaybillController@apiRestoreSelected');
 Route::post('waybill/changeFee', 'WaybillController@changeFee');
+Route::post('waybill/changeCharge', 'WaybillController@changeCharge');
 

+ 12 - 6
routes/web.php

@@ -81,6 +81,8 @@ Route::get('waybill/recycle', 'WaybillController@recycle');   //回收站
 Route::any('waybill/ontop/top','WaybillController@waybillOnTop');
 Route::any('waybill/ontop/cancel','WaybillController@cancelOnTop');
 
+Route::post('waybill/refreshWaveHouseWeight','WaybillController@refreshWaveHouseWeight');
+
 Route::get('waybill/index','WaybillController@index');
 Route::get('waybill/delivering','WaybillController@delivering');
 Route::post('waybill/storeCarrierBill','WaybillController@storeCarrierBill');
@@ -109,9 +111,12 @@ Route::post('rejected/ajaxCheck', 'RejectedController@ajaxCheck');
 Route::post('rejected/ajaxCheckAll', 'RejectedController@ajaxCheckAll');
 Route::post('rejected/ajaxFinishAll', 'RejectedController@ajaxFinishAll');
 Route::any('rejected/export', 'RejectedController@export');
-Route::resource('rejected', 'RejectedController');
 Route::any('rejected/index/general','RejectedController@index');  // 一般查询
 Route::any('rejected/index/analyze','RejectedController@indexAnalyze');  // 统计查询
+Route::any('rejected/exportAnalyze', 'RejectedController@exportAnalyze');
+Route::resource('rejected', 'RejectedController');
+
+
 Route::post('rejected/analyze/exportExcelOnParams', 'RejectedController@exportExcelOnParams');
 Route::post('rejected/analyze/exportAllExcelOnParams', 'RejectedController@exportAllExcelOnParams');
 Route::post('rejected/ajaxGetRejected', 'RejectedController@ajaxGetRejected');
@@ -163,11 +168,11 @@ Route::group(['prefix'=>'personnel/checking-in/userDutyCheck'],function(){
     //去往登记资料页面
     Route::get('createUserDetail/{mobile_phone}','UserDutyCheckController@createUserDetail');
     //去往修改资料页面
-    Route::get('updateUserDetail/{mobile_phone}','UserDutyCheckController@updateUserDetail');
+    Route::get('updateUserLaborCompanies/{mobile_phone}','UserDutyCheckController@updateUserLaborCompanies');
     //提交登记资料
     Route::post('storeUserDetail','UserDutyCheckController@storeUserDetail');
-    //提交修改资料
-    Route::post('storeUpdateUserDetail','UserDutyCheckController@storeUpdateUserDetail');
+    //提交修改劳务所
+    Route::post('storeUpdateUserLaborCompanies','UserDutyCheckController@storeUpdateUserLaborCompanies');
 });
 Route::group(['prefix'=>'process'],function(){
     //相关设置
@@ -241,8 +246,7 @@ Route::resource('process','ProcessController');
  */
 //临时工报表界面
 Route::resource('personnel/laborReport','LaborReportController');
-//导出
-Route::any('laborReport/export','LaborReportController@export');
+
 Route::get('getLaborReport','LaborReportController@getDailyLabor');
 Route::group(['prefix'=>'laborReport'],function(){
     //门卫打卡审核
@@ -255,6 +259,8 @@ Route::group(['prefix'=>'laborReport'],function(){
     Route::post('groupExport','LaborReportController@groupExport');
     //组长点击退场,是否包含晚饭时间情况
     Route::post('groupExportEnsure','LaborReportController@groupExportEnsure');
+    //导出
+    Route::any('export','LaborReportController@export');
 });
 
 Route::group(['prefix'=>'personnel'],function(){

+ 5 - 6
webpack.mix.js

@@ -12,15 +12,14 @@ const mix = require('laravel-mix');
  */
 
 mix.js('resources/js/app.js', 'public/js')
-    .sass('resources/sass/app.scss', 'public/css/app200721.css');
-mix.js('resources/js/singles/rejectedIndex.js', 'public/js/singles/rejectedIndex200728.js');
-mix.js('resources/js/singles/searchAnalyze.js', 'public/js/singles/searchAnalyze200513.js');
-
+    .sass('resources/sass/app.scss', 'public/css/app200806.css');
 mix.copy('resources/sass/fonts/','public/fonts');
 mix.copy('resources/icon','public/icon');
 mix.copy('resources/images','public/images');
 mix.copy('resources/icon/faviconc.ico','public/faviconc.ico');
 mix.js('resources/js/trix.js','public/js/trix.js');
 mix.copy('resources/sass/trix.css','public/css/trix.css');
-mix.copy('resources/js/queryForm/queryForm.js','public/js/queryForm/queryForm200803a.js');
-mix.copy('resources/js/queryForm/export.js','public/js/queryForm/export.js');
+mix.copy('resources/js/queryForm/queryForm.js','public/js/queryForm/queryForm200806.js');
+mix.copy('resources/js/queryForm/export.js','public/js/queryForm/export200804.js');
+mix.copy('resources/js/utilities/sort.js','public/js/utilities/sort200810.js');
+