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

库存盘点--盘点记录添加跳过按钮,盘点任务盘完之后不可删除,修改确认列重复

haozi 5 лет назад
Родитель
Сommit
008eeb571b

+ 9 - 1
app/Commodity.php

@@ -13,6 +13,10 @@ class Commodity extends Model
     protected $appends=['barcode'];
 //    protected $appends=['barcode','owner_name','owner_code'];
 
+    public function setNameAttribute($value){
+        $this->attributes['name']=str_replace(PHP_EOL,'',$value);
+    }
+
     public function barcodes()
     {
         return $this->hasMany('\App\CommodityBarcode');
@@ -74,6 +78,10 @@ class Commodity extends Model
     }
 
     public function newBarcode($barcode){
-        return CommodityBarcode::query()->firstOrCreate(['commodity_id'=>$this['id'],'code'=>$barcode]);
+        $barcodeModel = $this->barcodes()->where('code', $barcode)->first();
+        if(!$barcodeModel){
+            return CommodityBarcode::query()->create(['commodity_id'=>$this['id'],'code'=>$barcode]);
+        }
+        return $barcodeModel;
     }
 }

+ 29 - 2
app/Http/Controllers/InventoryAccountController.php

@@ -58,6 +58,7 @@ class InventoryAccountController extends Controller
         if (!$id) return ['success'=>false,'data'=>'参数错误!'];
         $inventoryAccount=InventoryAccount::with('owner')->find($id);
         $inventoryAccountMissions=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])->where('inventory_account_id',$id)->orderBy('difference_amount','desc')->get();
+
         return view('inventory.stockInventory.inventoryMission',compact('inventoryAccount','inventoryAccountMissions'));
     }
 
@@ -175,13 +176,16 @@ class InventoryAccountController extends Controller
         return['success'=>true,'data'=>$inventoryAccount];
 
     }
-    public function 增加系统之外的库位记录(Request $request){
+    public function 增加系统之外的盘点记录(Request $request){
         if(!Gate::allows('库存管理-盘点')){return['success'=>false,'data'=>'没有权限'];}
         $location=$request->input('location');
         $barcode=$request->input('barcode');
         $inventoryId=$request->input('inventoryId');
         $count=$request->input('count');
-        $inventoryAccountMission=app('inventoryAccountService')->增加系统之外的库位记录($location,$barcode,$inventoryId,$count);
+        $owner_code=$request->input('owner_code');
+        $param=$request->input('param');
+        if (is_null($count)) return ['success'=>false,'data'=>'盘点数不能为空!'];
+        $inventoryAccountMission=app('inventoryAccountService')->增加系统之外的盘点记录($location,$barcode,$inventoryId,$count,$owner_code,$param);
         if (!$inventoryAccountMission)return ['success'=>false,'data'=>'添加系统之外的库位记录失败!'];
         $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])->where('id',$inventoryAccountMission->id)->first();
         $stockInventoryPersons=$inventoryAccountMission->stockInventoryPersons;
@@ -228,6 +232,16 @@ class InventoryAccountController extends Controller
         $inventoryAccountMission=$inventoryService->删除盘点记录($inventoryAccountMissionId,$inventoryAccountId);
         return ['success'=>true,'data'=>$inventoryAccountMission];
     }
+    public function 跳过盘点记录(Request $request){
+        if(!Gate::allows('库存管理-盘点')){return['success'=>false,'data'=>'没有权限'];}
+        $inventoryAccountMissionId=$request->inventoryAccountMissionId;
+        $inventoryAccountId=$request->input('inventoryAccountId');
+        if(is_null($inventoryAccountMissionId)){return ['success'=>false,'data'=>'传入id为空'];}
+        /** @var InventoryAccountService $inventoryService */
+        $inventoryService=app('inventoryAccountService');
+        $inventoryAccountMission=$inventoryService->跳过盘点记录($inventoryAccountMissionId,$inventoryAccountId);
+        return ['success'=>true,'inventoryAccountMission'=>$inventoryAccountMission];
+    }
     public function exportInventoryAccountMission(Request $request){
         if(!Gate::allows("库存管理-盘点")){ return redirect(url('/'));  }
         $post = Http::post(config('go.export.url'),['type'=>'inventoryAccountMission','data'=>$request->data]);
@@ -239,4 +253,17 @@ class InventoryAccountController extends Controller
             "Content-Disposition"=>"attachment; filename=库存盘点记录-".date('ymdHis').'.xlsx',
         ]);
     }
+    public function searchCommodityByBarcode(Request $request){
+        if(!Gate::allows('库存管理-盘点')){return['success'=>false,'data'=>'没有权限'];}
+        $barcode=$request->input('barcode');
+        $owner_code=$request->input('owner_code');
+        /** @var InventoryAccountService $inventoryService */
+        $inventoryService=app('inventoryAccountService');
+        $commodity=$inventoryService->searchCommodityByBarcode($barcode,$owner_code);
+        if ($commodity){
+            return ['success'=>true,'data'=>$commodity];
+        }else{
+            return ['success'=>false,'data'=>'输入的条码没有对应商品!'];
+        }
+    }
 }

+ 1 - 1
app/InventoryAccount.php

@@ -33,7 +33,7 @@ class InventoryAccount extends Model
         return $this['total'] ? $this['total']-$this['processed']:0;
     }
     public function getProcessedAmount(){
-        return $this->inventoryMissions()->where('checked','是')->where('inventory_account_id',$this['id'])->count();
+        return $this->inventoryMissions()->whereIn('checked',['是','跳过'])->where('inventory_account_id',$this['id'])->count();
     }
     //复盘剩余数
     public function getCheckSurplusAttribute()

+ 1 - 1
app/LaborReport.php

@@ -210,7 +210,7 @@ class LaborReport extends Model
             'status'=>'已退场',
         ]);
         $laborReportStatus->save();
-        $check_in_at=$laborReport->check_in_at;
+        $check_in_at=$laborReport->check_in_at??null;
         $exit_at=$userDutyCheck->checked_at;
         $online_duration=round(Carbon::parse($exit_at)->diffInSeconds(Carbon::parse($check_in_at))/3600,2);
         $laborReport->user_duty_check_id=$userDutyCheck->id;

+ 91 - 16
app/Services/InventoryAccountService.php

@@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
 use App\InventoryAccount;
 use App\InventoryAccountMission;
 use App\OraccleBasCustomer;
+use App\OracleBasSKU;
 use App\OracleInvLotAtt;
 use App\OracleBasCustomer;
 use App\OracleInvLotLocId;
@@ -16,6 +17,7 @@ use App\Services\common\QueryService;
 use Carbon\Carbon;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
+use function GuzzleHttp\Psr7\_parse_message;
 
 class InventoryAccountService
 {
@@ -28,11 +30,11 @@ class InventoryAccountService
     public  function getSql(array $params){
         return $this->conditionQueryInventoryAccountMission($params)->selectRaw("inventory_account_missions.*")
             ->leftJoin('signs','inventory_account_missions.id','signs.signable_id')
-                ->selectRaw('signs.mark stockInventoryPerson')
+            ->selectRaw('signs.mark stockInventoryPerson')
             ->leftJoin('commodities','inventory_account_missions.commodity_id','commodities.id')
-                ->selectRaw('commodities.name commodity_name,commodities.sku commodity_sku')
+            ->selectRaw('commodities.name commodity_name,commodities.sku commodity_sku')
             ->leftJoin('commodity_barcodes','commodity_barcodes.commodity_id','commodities.id')
-                ->selectRaw('commodity_barcodes.code commodity_barcode_code')
+            ->selectRaw('commodity_barcodes.code commodity_barcode_code')
             ->sql();
     }
     private function conditionQuery($queryParam){
@@ -63,7 +65,7 @@ class InventoryAccountService
         if (!$ownerId) return null;
         $descr_c=Owner::where('id',$ownerId)->value('name');
         $sql='select * from (select result.*,rownum rn from (';
-        $sql.=' select customer.Descr_C as 货主,stockLog.客户 客户, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码, ';
+        $sql.=' select customer.Descr_C as 货主,stockLog.客户 客户, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码1, sku.ALTERNATE_SKU2 产品条码2, sku.ALTERNATE_SKU3 产品条码3, ';
         $sql.=' sku.Descr_C 商品名称, lot.LotAtt05 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
         $sql.=' lot.LotAtt04 批号, lot.LotAtt01 生产日期, lot.LotAtt03 入库日期';
         $sql.=' , sum(移出数量)移出数量, sum(移入数量)移入数量 ';
@@ -93,7 +95,7 @@ class InventoryAccountService
         $sql.=' left join INV_LOT_ATT lot on lot.LOTNUM=stockLog.FMLOTNUM ';
         $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';;
         $sql.=' and storeStatus.LocationID=stockLog.库位 ';
-        $sql.=' group by 库位,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1 ';
+        $sql.=' group by 库位,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1,sku.ALTERNATE_SKU2,sku.ALTERNATE_SKU3 ';
         $sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt05,lot.LotAtt01,lot.LotAtt03,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
         $sql.=' , storeStatus.QTY, storeStatus.QtyAllocated,stockLog.客户  ';
         $sql.=' )result where 1=1 ';
@@ -113,7 +115,7 @@ class InventoryAccountService
     private function conditionTotalStock($ownerId){
         $descr_c=Owner::where('id',$ownerId)->value('name');
         $sql='select * from (select result.*,rownum rn from (';
-        $sql.=' select customer.Descr_C as 货主,storeStatus.CUSTOMERID 客户,storeStatus.LocationID 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码, ';
+        $sql.=' select customer.Descr_C as 货主,storeStatus.CUSTOMERID 客户,storeStatus.LocationID 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码1, sku.ALTERNATE_SKU2 产品条码2, sku.ALTERNATE_SKU3 产品条码3, ';
         $sql.=' sku.Descr_C 商品名称, lot.LotAtt05 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, storeStatus.ADDTIME 创建时间, ';
         $sql.=' lot.LotAtt04 批号,lot.LotAtt01 生产日期,lot.LotAtt03 入库日期 ';
         $sql.=' , storeStatus.QTY 在库数量, storeStatus.QtyAllocated 占用数量,count(1) over () as sum from ';
@@ -121,7 +123,7 @@ class InventoryAccountService
         $sql.=' left join BAS_Customer customer on customer.CustomerID=storeStatus.CUSTOMERID ';
         $sql.=' left join BAS_SKU sku on sku.SKU=storeStatus.SKU and sku.CUSTOMERID=storeStatus.CUSTOMERID ';
         $sql.=' left join INV_LOT_ATT lot on lot.LOTNUM = storeStatus.LOTNUM AND lot.CUSTOMERID = storeStatus.CUSTOMERID ';
-        $sql.=' group by storeStatus.LocationID,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1 ';
+        $sql.=' group by storeStatus.LocationID,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1,sku.ALTERNATE_SKU2,sku.ALTERNATE_SKU3 ';
         $sql.=' ,sku.Descr_C,lot.LotAtt05,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
         $sql.=' , storeStatus.QTY, storeStatus.QtyAllocated,storeStatus.CUSTOMERID,storeStatus.ADDTIME,lot.LotAtt01,lot.LotAtt03  ';
         $sql.=' )result where 1=1 ';
@@ -155,7 +157,10 @@ class InventoryAccountService
         ]);
         $inventory->save();
         $inventory->createSignCreator();
+        LogService::log(__METHOD__,'createInventoryAccountMissionRecord -- start','createInventoryAccountMissionRecord');
         $this->createInventoryAccountMissionRecord($ownerId,$inventory['id'],$wmsInventories);
+        LogService::log(__METHOD__,'createInventoryAccountMissionRecord -- end','createInventoryAccountMissionRecord');
+
         $request=[
             'date_start'=>$date_start,
             'date_end'=>$date_end,
@@ -170,29 +175,58 @@ class InventoryAccountService
     public function createInventoryAccountMissionRecord($ownerId,$inventoryAccountId,$wmsInventories){
         $commodities=Commodity::query()
             ->select('id','owner_id','name','sku')
+            ->with('barcodes')
             ->where('owner_id',$ownerId)
             ->whereNotNull(['sku','name'])
             ->get();
+        $commoditiesArr=[];
+        foreach ($commodities as $commodity){
+            $commoditiesArr[$commodity['name'].'|'.$commodity['sku']]=$commodity;
+        }
         $commodityArr=[];
         $inventoryAccountMissions=[];
+        LogService::log(__METHOD__,'foreach -- strat','createInventoryAccountMissionRecord');
         foreach ($wmsInventories as $wmsInventory){
-            $commodity=$commodities->where('name',$wmsInventory->商品名称)->where('sku',$wmsInventory->产品编码)->first();
+            $commodity=$commoditiesArr[$wmsInventory->商品名称.'|'.$wmsInventory->产品编码]??null;
+//            $commodity=$commodities->where('name',$wmsInventory->商品名称)->where('sku',$wmsInventory->产品编码)->first();
             if (!$commodity){
                 $commodity=new Commodity();
                 $commodity->owner_id=$ownerId;
                 $commodity->sku=$wmsInventory->产品编码;
                 $commodity->name=$wmsInventory->商品名称;
                 $commodity->save();
-                $commodity->newBarcode($wmsInventory->产品条码);
+            }
+            if ($wmsInventory->产品条码1){
+                $commodity->newBarcode($wmsInventory->产品条码1);
+                $arr=[
+                    'owner_id'=>$ownerId,
+                    'sku'=>$wmsInventory->产品编码,
+                    'name'=>$wmsInventory->商品名称,
+                    'commodity_id'=>$commodity->id,
+                    'barcode'=>$wmsInventory->产品条码1,
+                ];
+            }
+            if($wmsInventory->产品条码2){
+                $commodity->newBarcode($wmsInventory->产品条码2);
+                $arr=[
+                    'owner_id'=>$ownerId,
+                    'sku'=>$wmsInventory->产品编码,
+                    'name'=>$wmsInventory->商品名称,
+                    'commodity_id'=>$commodity->id,
+                    'barcode'=>$wmsInventory->产品条码2,
+                ];
+            }
+            if($wmsInventory->产品条码3){
+                $commodity->newBarcode($wmsInventory->产品条码3);
                 $arr=[
                     'owner_id'=>$ownerId,
                     'sku'=>$wmsInventory->产品编码,
                     'name'=>$wmsInventory->商品名称,
                     'commodity_id'=>$commodity->id,
-                    'barcode'=>$wmsInventory->产品条码,
+                    'barcode'=>$wmsInventory->产品条码3,
                 ];
-                array_push($commodityArr,$arr);
             }
+            array_push($commodityArr,$arr);
             if($wmsInventory->质量状态=='ZP') $quality='正品';
             if ($wmsInventory->质量状态=='CC') $quality='残次';
             if ($wmsInventory->质量状态=='XS') $quality='箱损';
@@ -216,13 +250,14 @@ class InventoryAccountService
             ];
             array_push($inventoryAccountMissions,$inventoryAccountMission);
         }
+        LogService::log(__METHOD__,'foreach -- strat','createInventoryAccountMissionRecord');
+
         $inventoryAccountMissions=InventoryAccountMission::query()->insert($inventoryAccountMissions);
         if ($commodityArr){
             Controller::logS(__METHOD__,"插入was中没有的商品信息__".__FUNCTION__,json_encode($commodityArr));
         }
         Controller::logS(__METHOD__,"批量插入盘点记录__".__FUNCTION__,json_encode($inventoryAccountMissions));
 
-
     }
     //盘点库存
     public function stockInventory($location,$barcode,$count,$inventoryAccountId){
@@ -294,20 +329,33 @@ class InventoryAccountService
         if ($inventoryAccount->status=='复盘中'){
             $inventoryAccount->status='已完成';
             $inventoryAccount->update();
-            Controller::logS(__METHOD__,"盘点修改盘点任务中的已盘条数__".__FUNCTION__,json_encode($id));
+            Controller::logS(__METHOD__,"盘点修改盘点任务状态__".__FUNCTION__,json_encode($id));
             return $inventoryAccount;
         }else{
             return null;
         }
     }
-    public function 增加系统之外的库位记录($location,$barcode,$inventoryId,$count){
+    public function 增加系统之外的盘点记录($location,$barcode,$inventoryId,$count,$owner_code,$param){
+        if($param=='商品新增'||$param=='库位和商品新增'){
+            $oracleBasSku=OracleBasSKU::query()->where('ALTERNATE_SKU1',$barcode)->where('customerid',$owner_code)->first();
+            //dd($oracleBasSku);
+            $ownerId=Owner::query()->where('code',$owner_code)->value('id');
+            $commodity=Commodity::query()->firstOrCreate([
+                'sku'=>$oracleBasSku->sku,
+                'owner_id'=>$ownerId,
+                'name'=>$oracleBasSku->descr_c
+            ]);
+            $commodity->newBarcode($barcode);
+        }
         $commodity=Commodity::query()->whereHas('barcodes',function ($query)use($barcode){
-            $query->where('code',$barcode);
-        })->orderBy('id','DESC')->first();
+                $query->where('code',$barcode);
+            })->orderBy('id','DESC')->first();
+
         $inventoryAccountMission=new InventoryAccountMission();
         $inventoryAccountMission->location=$location;
         $inventoryAccountMission->inventory_account_id=$inventoryId;
         $inventoryAccountMission->commodity_id=$commodity->id;
+        $inventoryAccountMission->quality='正品';
         $inventoryAccountMission->verified_amount=$count;//盘点数量
         $inventoryAccountMission->difference_amount=$count;//盘点差异
         $inventoryAccountMission->checked='是';
@@ -431,5 +479,32 @@ class InventoryAccountService
         }
         return $inventoryAccountMission;
     }
+    public function 跳过盘点记录($inventoryAccountMissionId,$inventoryAccountId){
+        $inventoryAccountMission=InventoryAccountMission::query()->find($inventoryAccountMissionId);
+        $inventoryAccountMission->checked='跳过';
+        $inventoryAccountMission->update();
+        LogService::log(__METHOD__,"跳过盘点记录修改checked状态",json_encode($inventoryAccountMissionId));
+        if ($inventoryAccountMission->checked=='跳过'){
+            $inventoryAccount=InventoryAccount::query()->find($inventoryAccountId);
+            $inventoryAccount->processed=$inventoryAccount->getProcessedAmount();//已盘点数
+            $inventoryAccount->difference=$inventoryAccount->getDifferenceAmount();//盘点差异数
+            $inventoryAccount->returned=$inventoryAccount->getReturnedAmount(); //复盘归位数
+            $inventoryAccount->update();
+            Controller::logS(__METHOD__,'跳过盘点记录时修改盘点任务信息'.__FUNCTION__,json_encode($inventoryAccountId));
+        }
+        return $inventoryAccountMission;
+    }
+    public function searchCommodityByBarcode($barcode,$owner_code){
+        $oracleBasSku=OracleBasSKU::query()
+            ->where('ALTERNATE_SKU1',$barcode)
+            ->orWhere('ALTERNATE_SKU2',$barcode)
+            ->orWhere('ALTERNATE_SKU3',$barcode)
+            ->where('customerid',$owner_code)->first();
+        if ($oracleBasSku){
+            return $oracleBasSku;
+        }else{
+            return null;
+        }
+    }
 
 }

+ 33 - 0
database/migrations/2020_09_16_115715_change_inventory_account_mission_checked_column_checked_to_four.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeInventoryAccountMissionCheckedColumnCheckedToFour extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        DB::statement("ALTER TABLE inventory_account_missions MODIFY COLUMN checked enum ('是','否','已复核','跳过') default '否'");
+        Schema::table('inventory_account_missions', function (Blueprint $table) {
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        DB::statement("ALTER TABLE inventory_account_missions MODIFY COLUMN checked enum ('是','否','已复核') default '否'");
+        Schema::table('inventory_account_missions', function (Blueprint $table) {
+        });
+    }
+}

+ 349 - 156
resources/views/inventory/stockInventory/inventoryMission.blade.php

@@ -38,7 +38,7 @@
             <span class="form-group  mb-5">
             <label class="text-muted">货主:</label><span class="font-weight-bold">@{{ inventory.owner.name }}</span>
         </span>
-            <span class="form-group  p-2 mb-5" class="text-muted">
+            <span class="form-group  p-2 mb-5">
             <label >盘点单号:</label><span>@{{ inventory.id }}</span>
         </span>
             <span class="form-group p-2 mb-5">
@@ -78,24 +78,26 @@
         </div>
 
 
-        <form id="form"  class="mt-3 form-inline " v-if="!listMode" :class="inventory.status=='盘点中' ||inventory.status=='待盘点'?'row-cols-3':'row-cols-5'">
+        <form id="form"  >
+            <div class="mt-3 form-inline " v-if="!listMode" :class="inventory.status=='盘点中' ||inventory.status=='待盘点'?'row-cols-3':'row-cols-5'">
         <span class="form-group">
             <label for="location" class="text-secondary font-weight-bold">请输库位</label>
             <input id="inventoryInput" @keypress="inputSwitch($event)"
                    name="location" type="text" class="form-control  input"  autocomplete="off" value="@if(old('location')){{old('location')}}@endif">
         </span>
-            <span class="form-group ml-4">
+                <span class="form-group ml-4">
             <label for="barcode" class="text-secondary font-weight-bold">请输产品条码</label>
                 <input id="barcode" name="barcode"  @keypress="inputSwitch($event)"
-                       type="text" value="@if(old('barcode')){{old('barcode')}}@endif" class="form-control  input" autocomplete="off" @blur="searchBarcode">
-        </span>
-            <span class="form-group ml-4">
-            <label for="count" class="text-secondary font-weight-bold">请输盘点数</label>
-            <input type="text" id="count"  @keypress="inputSwitch($event)"
-                   name="count" class="form-control input" value="@if(old('count')){{old('count')}}@endif"  autocomplete="off">
+                       type="text" value="@if(old('barcode')){{old('barcode')}}@endif" class="form-control  input" autocomplete="off" @blur="searchBarcode(inventory.owner.code)">
         </span>
+{{--                v-if="inventoryAccountMissions.length>=1"--}}
+                <span class="form-group ml-4" >
+                        <label for="count" class="text-secondary font-weight-bold">请输盘点数</label>
+                        <input type="text" id="count"  @keypress="inputSwitch($event)"
+                               name="count" class="form-control input" value="@if(old('count')){{old('count')}}@endif"  autocomplete="off">
+                    </span>
 
-            <span v-if="inventory.status=='复盘中'" class="form-group ml-4">
+                <span v-if="inventory.status=='复盘中'" class="form-group ml-4">
             <label for="count" class="text-secondary">上一次盘点数:</label>
             <span v-if="!inventoryMissionRecord.re_checked_amount">
                 <span  class="font-weight-bold" >@{{ inventoryMissionRecord.verified_amount }}</span>
@@ -105,108 +107,127 @@
             </span>
         </span>
 
-            <span v-if="inventory.status=='复盘中'" class="form-group ml-4">
+                <span v-if="inventory.status=='复盘中'" class="form-group ml-4">
             <label for="count" class="text-secondary">盘点差异数:</label>
             <span v-if="inventoryMissionRecord.difference_amount" class="font-weight-bold">@{{ inventoryMissionRecord.difference_amount }}</span>
         </span>
+            </div>
+            <div class="row d-none d-xl-block" v-if="inventoryAccountMissions.length>=1">
+                <div class="col-12 col-md-12 col-sm-12">
+                    <table class="table table-sm table-bordered table-info mt-2" v-if="!listMode">
+                        <tr>
+                            <td>操作</td>
+                            <td class="font-weight-bold">输入盘点数</td>
+                            <td>库位</td>
+                            <td>产品名</td>
+                            <td>产品条码</td>
+                            <td>产品编码</td>
+                            <td>生产日期</td>
+                            <td>失效时期</td>
+                            <td>批号</td>
+                            <td>盘点人</td>
+                            <th>属性仓</th>
+                            <th>质量状态</th>
+                            <td>盘点数量</td>
+                            <td>复盘数量</td>
+                            <td>复盘差异</td>
+                        </tr>
+                        <tr v-for="inventoryMission in inventoryAccountMissions">
+                            <td>
+                                <span class="btn btn-sm btn-outline-primary" @click="盘点选中任务(inventoryMission.id,inventoryMission.produced_at,inventoryMission.valid_at,inventoryMission.batch_number)">选定盘点</span>
+                            </td>
+                            <td>
+                                <input type="text" id="count"  @keypress="inputSwitch($event)"
+                                       name="count" class="form-control-sm input" value="@if(old('count')){{old('count')}}@endif"  autocomplete="off">
+                            </td>
+                            <td>@{{ inventoryMission.location }}</td>
+                            <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</td>
+                            <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</td>
+                            <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.sku }}</td>
+                            <td>
+                                <input type="date"  class="form-control-sm" name="produced_at"  v-model="inventoryMission.produced_at.substr(0,10)" >
+                            </td>
+                            <td>
+                                <input type="date"  class="form-control-sm" name="valid_at"  v-model="inventoryMission.valid_at.substr(0,10)" >
+                            </td>
+                            <td class="text-muted">
+                                <input type="text"  class="form-control-sm" name="batch_number"  v-model="inventoryMission.batch_number" >
+                            </td>
+                            <td v-if="inventoryMission.stockInventoryPersons &&!listMode" class="text-muted" :rowspan="inventoryMission.is_multi_row?2:''">
+                                <a href="#" v-if="inventoryMission.stockInventoryPersons.length>0"  class="dropdown-toggle"  data-toggle="dropdown">
+                                    @{{ inventoryMission.stockInventoryPersons[0].mark }}<b class="caret"></b>
+                                </a>
+                                <div style="position: absolute;width:320px;margin-left:-100px;background-color: white;max-height:150px ;overflow-y:auto" class="small mt-0 dropdown-menu">
+                                    <table class="table table-sm table-striped table-bordered">
+                                        <tr>
+                                            <th>盘点人</th>
+                                            <th>时间</th>
+                                        </tr>
+                                        <tr v-for="stockInventoryPerson in inventoryMission.stockInventoryPersons">
+                                            <td>@{{ stockInventoryPerson.mark }}</td>
+                                            <td>@{{ stockInventoryPerson.created_at }}</td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </td><td v-if="listMode"></td>
+                            <td >@{{ inventoryMission.erp_type_position }}</td>
+                            <td >@{{ inventoryMission.quality }}</td>
+                            <td>@{{ inventoryMission.verified_amount }}</td>
+                            <td>@{{ inventoryMission.re_checked_amount }}</td>
+                            <td>@{{ inventoryMission.difference_amount }}</td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
         </form>
 
-        <div class="row d-none d-xl-block" v-if="inventoryAccountMissions.length>=1">
-            <div class="col-12 col-md-12 col-sm-12">
-                <table class="table table-sm table-bordered table-info mt-2" v-if="!listMode">
-                    <tr>
-                        <td>操作</td>
-                        <td>库位</td>
-                        <td>产品名</td>
-                        <td>产品条码</td>
-                        <td>产品编码</td>
-                        <td>生产日期</td>
-                        <td>失效时期</td>
-                        <td>批号</td>
-                        <td>盘点人</td>
-                        <th>属性仓</th>
-                        <th>质量状态</th>
-                        <td>库存数量</td>
-                        <td>盘点数量</td>
-                        <td>复盘数量</td>
-                        <td>复盘差异</td>
-                    </tr>
-                    <tr v-for="inventoryMission in inventoryAccountMissions">
-                        <td>
-                            <span class="btn btn-sm btn-outline-primary" @click="盘点选中任务(inventoryMission.id,inventoryMission.produced_at,inventoryMission.valid_at,inventoryMission.batch_number)">选定盘点</span>
-                        </td>
-                        <td>@{{ inventoryMission.location }}</td>
-                        <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</td>
-                        <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</td>
-                        <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.sku }}</td>
-                        <td>
-                            <input type="date"  class="form-control-sm" name="produced_at"  v-model="inventoryMission.produced_at.substr(0,10)" >
-                        </td>
-                        <td>
-                            <input type="date"  class="form-control-sm" name="valid_at"  v-model="inventoryMission.valid_at.substr(0,10)" >
-                        </td>
-                        <td class="text-muted">
-                            <input type="text"  class="form-control-sm" name="batch_number"  v-model="inventoryMission.batch_number" >
-                        </td>
-                        <td v-if="inventoryMission.stockInventoryPersons &&!listMode" class="text-muted" :rowspan="inventoryMission.is_multi_row?2:''">
-                            <a href="#" v-if="inventoryMission.stockInventoryPersons.length>0"  class="dropdown-toggle"  data-toggle="dropdown">
-                                @{{ inventoryMission.stockInventoryPersons[0].mark }}<b class="caret"></b>
-                            </a>
-                            <div style="position: absolute;width:320px;margin-left:-100px;background-color: white;max-height:150px ;overflow-y:auto" class="small mt-0 dropdown-menu">
-                                <table class="table table-sm table-striped table-bordered">
-                                    <tr>
-                                        <th>盘点人</th>
-                                        <th>时间</th>
-                                    </tr>
-                                    <tr v-for="stockInventoryPerson in inventoryMission.stockInventoryPersons">
-                                        <td>@{{ stockInventoryPerson.mark }}</td>
-                                        <td>@{{ stockInventoryPerson.created_at }}</td>
-                                    </tr>
-                                </table>
-                            </div>
-                        </td><td v-if="listMode"></td>
-                        <td >@{{ inventoryMission.erp_type_position }}</td>
-                        <td >@{{ inventoryMission.quality }}</td>
-                        <td >@{{ inventoryMission.stored_amount }}</td>
-                        <td>@{{ inventoryMission.verified_amount }}</td>
-                        <td>@{{ inventoryMission.re_checked_amount }}</td>
-                        <td>@{{ inventoryMission.difference_amount }}</td>
-                    </tr>
-                </table>
-            </div>
-        </div>
 
-{{--        <div class="card-header pt-0">--}}
-{{--            <div id="form"></div>--}}
-{{--        </div>--}}
+
+
         <div class="card-body pt-1">
             <label for="all" class="d-none" id="cloneCheckAll">
                 <input id="all" type="checkbox" @click="checkAll($event)">全选
             </label>
             <table class="table table-sm table-bordered d-none text-nowrap " id="headerRoll"></table>
-            <table class="table table-sm table-hover table-striped d-none d-xl-block p-0 text-nowrap table-bordered" id="headerParent">
+            <table class="table table-sm table-striped d-none d-xl-block p-0 text-nowrap table-bordered" id="headerParent">
+                {{--                <span style="position: fixed; top:380px; right:50px;"><button  class="btn btn-sm btn-outline-secondary d-none d-xl-block" v-if="inventory.type=='动盘'" id="lockLocation">以此为起点</button></span>--}}
                 <tr class="p-0" id="header"></tr>
-                <tr v-for="(inventoryMission,i) in inventoryMissions" v-if="inventoryMission.checked==='是'||inventory.status==='复盘中'||listMode"  @click="selectedColor(inventoryMission.id)"
+                <tr v-for="(inventoryMission,i) in inventoryMissions"   @click="selectedColor(inventoryMission.id)"
                     :style="{'font-weight': inventory.id==selectedStyle?'bold':''}" :class="[
                     inventoryMission.mark==='已复盘有差异'?'td-cool':'',
                     inventoryMission.mark==='已复盘无差异'?'td-cool text-muted':'',
                     inventoryMission.mark==='未复盘有差异'?'td-warm font-weight-bold':'',
                     inventoryMission.mark==='无差异'?'text-muted':'',
                     inventoryMission.mark==='未盘'?'td-yellow':'',
+                    inventoryMission.mark==='跳过'?'td-helpful':'',
                     ]">
                     <td>
                         <input type="checkbox" :value="inventoryMission" v-model="checkData">
+                        <span :id="'lockLine'+(i+1)"></span>
                     </td>
                     <td>@{{ i+1 }}</td>
                     <td>@{{ inventoryMission.location }}</td>
-                    <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</td>
-                    <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</td>
-                    <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.sku }}</td>
-                    <td >@{{ inventoryMission.produced_at }}</td>
-                    <td >@{{ inventoryMission.valid_at }}</td>
-                    <td class="text-muted">@{{ inventoryMission.batch_number }}</td>
+                    <td v-if="inventoryMission.commodity"><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.commodity.name }}</span></td>
+                    <td>
+                        <span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">
+                        <span v-if="inventoryMission.commodity_barcodes && inventoryMission.commodity_barcodes.length>0">
+                            <span v-if="inventoryMission.commodity_barcodes.length==1">
+                                @{{ inventoryMission.commodity_barcodes[0].code }}
+                            </span>
+                            <span v-if="inventoryMission.commodity_barcodes.length>1">
+                                <small v-for="barcode in inventoryMission.commodity_barcodes">@{{ barcode.code }}<br></small>
+                            </span>
+                        </span>
+                        </span>
+                    </td>
 
-                    <td v-if="inventoryMission.stockInventoryPersons &&!listMode" class="text-muted" :rowspan="inventoryMission.is_multi_row?2:''">
+                    <td v-if="inventoryMission.commodity"><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.commodity.sku }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.produced_at }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.valid_at }}</span></td>
+                    <td class="text-muted"><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.batch_number }}</span></td>
+
+                    <td v-if="inventoryMission.stockInventoryPersons" class="text-muted" :rowspan="inventoryMission.is_multi_row?2:''">
+                        <span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">
                         <a href="#" v-if="inventoryMission.stockInventoryPersons.length>0"  class="dropdown-toggle"  data-toggle="dropdown">
                             @{{ inventoryMission.stockInventoryPersons[0].mark }}<b class="caret"></b>
                         </a>
@@ -222,27 +243,30 @@
                                 </tr>
                             </table>
                         </div>
-                    </td><td v-if="listMode"></td>
+                            </span>
+                    </td>
 
-                    <td >@{{ inventoryMission.erp_type_position }}</td>
-                    <td >
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.erp_type_position }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">
                         <span v-if="listMode">@{{ inventoryMission.quality }}</span>
                         <select v-else class="form-control-sm" name="quality" id="quality"  v-model="inventoryMission.quality"
                                 @change="updateQuality(inventoryMission.id,inventoryMission.location,inventoryMission.commodity.sku,inventoryMission.quality,inventory.owner.code)">
                             <option value="正品">正品</option>
                             <option value="残次">残次</option>
                         </select>
+                        </span>
                     </td>
-                    <td >@{{ inventoryMission.stored_amount }}</td>
-                    <td >@{{ inventoryMission.valid_amount }}</td>
-                    <td>@{{ inventoryMission.verified_amount }}</td>
-                    <td>@{{ inventoryMission.re_checked_amount }}</td>
-                    <td>@{{ inventoryMission.difference_amount }}</td>
-                    <td>@{{ inventoryMission.occupied_amount }}</td>
-                    @can('库存管理-盘点-删除')
-                    <td>
-                        <span class="btn  btn-sm btn-outline-danger" @click="删除盘点记录(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">删除</span>
-                    </td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.stored_amount }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.valid_amount }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.verified_amount }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.re_checked_amount }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.difference_amount }}</span></td>
+                    <td><span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.occupied_amount }}</span></td>
+                    @can('库存管理-盘点')
+                        <td v-if="!listMode">
+                            {{--                        <span class="btn  btn-sm btn-outline-danger" @click="删除盘点记录(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">删除</span>--}}
+                            <span class="btn  btn-sm btn-outline-secondary" v-if="inventoryMission.checked==='否'" @click="跳过盘点记录(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">跳过</span>
+                        </td>
                     @endcan
                 </tr>
             </table>
@@ -255,7 +279,16 @@
                         <div style="transform:scale(0.9)" class="pl-0">
                             <span class="mr-3 text-nowrap"><span class="font-weight-bold">库位:</span><span >@{{ inventoryMission.location }}</span></span>
                             <span class="mr-3 text-nowrap"><span class="font-weight-bold">产品名称:</span><span  v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</span></span>
-                            <span class="mr-3 text-nowrap"><span class="font-weight-bold">产品条码:</span><span  v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</span></span>
+                            <span class="mr-3 text-nowrap"><span class="font-weight-bold">产品条码:</span>
+                                <span v-if="inventoryMission.commodity_barcodes && inventoryMission.commodity_barcodes.length>0">
+                            <span v-if="inventoryMission.commodity_barcodes.length==1">
+                                @{{ inventoryMission.commodity_barcodes[0].code }}
+                            </span>
+                            <span v-if="inventoryMission.commodity_barcodes.length>1">
+                                <small v-for="barcode in inventoryMission.commodity_barcodes">@{{ barcode.code }}<br></small>
+                            </span>
+                                </span>
+                            </span>
                             <span class="mr-3 text-nowrap"><span class="font-weight-bold">产品编码:</span><span  v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.sku }}</span></span>
                             <span class="mr-3 text-nowrap"><span class="font-weight-bold">生产日期:</span>
                                <input type="date"  class="form-control-sm" name="produced_at"  v-model="inventoryMission.produced_at.substr(0,10)">
@@ -291,7 +324,6 @@
                             <span class="mr-3 text-nowrap"><span >属性仓:</span><span>@{{ inventoryMission.erp_type_position }}</span></span>
                             <span class="mr-3 text-nowrap"><span >质量状态:</span><span>@{{ inventoryMission.quality }}</span></span>
                             <div>
-                                <span class="mr-3 text-nowrap"><span style="color:#783000" >库存数量:</span><span style="color:#af7651">@{{ inventoryMission.stored_amount }}</span></span>
                                 <span class="mr-3 text-nowrap"><span style="color:#783000" >盘点数量:</span><span style="color:#af7651">@{{ inventoryMission.verified_amount }}</span></span>
                                 <span class="mr-3 text-nowrap"><span style="color:#783000" >复盘数量:</span><span style="color:#af7651">@{{ inventoryMission.re_checked_amount }}</span></span>
                                 <span class="mr-3 text-nowrap"><span style="color:#783000" >盘点差异:</span><span >@{{ inventoryMission.difference_amount }}</span></span>
@@ -308,21 +340,28 @@
         </table>
         <!--盘点记录移动端-->
         <table id="listOnPad" class="table table-striped table-sm table-bordered table-hover p-0 d-table  d-xl-none" style="background: rgb(255, 255, 255);" >
+
+            {{--            <span style="position: fixed; top:560px; right:50px;" ><button  class="btn btn-sm btn-outline-secondary d-table  d-xl-none" v-if="inventory.type=='动盘'" id="lockLocationPhone">以此为起点</button></span>--}}
             <tbody>
-            <tr v-for="inventoryMission in inventoryMissions" v-if="inventoryMission.checked==='是'||inventory.status==='复盘中'||listMode"
+            <tr v-for="(inventoryMission,i) in inventoryMissions"
                 :class="[
                     inventoryMission.mark==='已复盘有差异'?'td-cool':'',
                     inventoryMission.mark==='已复盘无差异'?'td-cool text-muted':'',
                     inventoryMission.mark==='未复盘有差异'?'td-warm font-weight-bold':'',
                     inventoryMission.mark==='无差异'?'text-muted':'',
                     inventoryMission.mark==='未盘'?'td-yellow':'',
+                    inventoryMission.mark==='跳过'?'td-helpful':'',
                     ]">
                 <td style="filter:grayscale(30%); ">
+                    <span :id="'lockLinePhone'+(i+1)"></span>
                     <div  class="mt-3">
                         <div style="transform:scale(0.9)" class="pl-0">
-                            <span class="mr-3 text-nowrap"><span class="font-weight-bold">库位:</span><span style="color:#af7651">@{{ inventoryMission.location }}</span></span>
-                            <span class="mr-3 text-nowrap"><span class="font-weight-bold">产品名称:</span><span style="color:#af7651" v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</span></span>
-                            <span class="mr-3 text-nowrap">
+                            <span type="hidden">@{{ i+1 }}</span>
+                            <span class="mr-3 text-nowrap"><span class="font-weight-bold">库位:</span><span style="color:#af7651" >
+                                    @{{ inventoryMission.location }}</span></span>
+                            <span class="mr-3 text-nowrap" v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode"><span class="font-weight-bold">产品名称:</span><span style="color:#af7651" v-if="inventoryMission.commodity">
+                                    @{{ inventoryMission.commodity.name }}</span></span>
+                            <span class="mr-3 text-nowrap" v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">
                                 <span class="font-weight-bold">质量状态:</span>
                                 <span v-if="listMode">@{{ inventoryMission.quality }}</span>
                         <select v-else class="form-control-sm" name="quality" id="quality"
@@ -332,18 +371,35 @@
                         <option value="残次">残次</option>
                          </select>
                             </span>
-                            <span class="mr-3 text-nowrap"><span class="font-weight-bold">产品条码:</span><span style="color:#af7651" v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</span></span>
+                            <span class="mr-3 text-nowrap" v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">
+                                <span class="font-weight-bold">产品条码:</span>
+
+                        <span v-if="inventoryMission.checked==='是'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">
+                        <span v-if="inventoryMission.commodity_barcodes && inventoryMission.commodity_barcodes.length>0">
+                            <span v-if="inventoryMission.commodity_barcodes.length==1">
+                                @{{ inventoryMission.commodity_barcodes[0].code }}
+                            </span>
+                            <span v-if="inventoryMission.commodity_barcodes.length>1">
+                                <small v-for="barcode in inventoryMission.commodity_barcodes">@{{ barcode.code }}<br></small>
+                            </span>
+                        </span>
+                        </span>
+                            </span>
                             <div v-if="inventory.status==='复盘中'">
-                                <span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点数量:</span><span style="color:#af7651">@{{ inventoryMission.verified_amount }}</span></span>
-                                <span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">复盘数量:</span><span style="color:#af7651">@{{ inventoryMission.re_checked_amount }}</span></span>
-                                <span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点差异:</span><span >@{{ inventoryMission.difference_amount }}</span></span>
+                                <span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点数量:</span><span style="color:#af7651">
+                                        @{{ inventoryMission.verified_amount }}</span></span>
+                                <span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">复盘数量:</span><span style="color:#af7651">
+                                        @{{ inventoryMission.re_checked_amount }}</span></span>
+                                <span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点差异:</span><span >
+                                        @{{ inventoryMission.difference_amount }}</span></span>
                             </div>
-                            @can('库存管理-盘点-删除')
-                            <div>
-                                <span  class="mr-3 text-nowrap"><span class="font-weight-bold">操作:</span>
-                                <span class="btn  btn-sm btn-outline-danger" @click="删除盘点记录(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">删除</span>
+                            @can('库存管理-盘点')
+                                <div>
+                                <span  class="mr-3 text-nowrap" v-if="!listMode"><span class="font-weight-bold">操作:</span>
+{{--                                <span class="btn  btn-sm btn-outline-danger" @click="删除盘点记录(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">删除</span>--}}
+                                <span class="btn  btn-sm btn-outline-secondary" v-if="inventoryMission.checked==='否'" @click="跳过盘点记录(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">跳过</span>
                             </span>
-                            </div>
+                                </div>
                             @endcan
                         </div>
                     </div>
@@ -403,7 +459,6 @@
 
 @section('lastScript')
     <script type="text/javascript" src="{{asset('js/queryForm/export200818a.js')}}"></script>
-    {{--    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200828a.js')}}"></script>--}}
     <script type="text/javascript" src="{{asset('js/queryForm/header200826b.js')}}"></script>
     <script>
         let hideHeaderTitle = function (){
@@ -432,6 +487,11 @@
                         commodity_barcode:'{{$inventoryMission->commodity ? $inventoryMission->commodity->barcode : ''}}',
                         commodity:{!! $inventoryMission->commodity  !!},
                         stockInventoryPersons:{!! $inventoryMission->stockInventoryPersons  !!},
+                        commodity_barcodes:[
+                                @foreach($inventoryMission->commodity ? $inventoryMission->commodity->barcodes ?? [] : [] as $barcode)
+                            {code:'{{$barcode->code}}'},
+                            @endforeach
+                        ],
                         stock_persons:[
                                 @foreach($inventoryMission->stockInventoryPersons ? $inventoryMission->stockInventoryPersons ?? [] : [] as $person)
                             {name:'{{$person->mark}}'},
@@ -513,7 +573,7 @@
                         column: column,
                         data: _this.inventoryMissions,
                         restorationColumn: 'id',
-                        fixedTop:($('#form').height())+2,
+                        //fixedTop:($('#form').height())+2,
                         vue:listVue,
                     });
                     header.init();
@@ -532,13 +592,22 @@
                         this.checkData = [];
                     }
                 },
-                inputSwitch(e){
+                skuKeyPress(e,owner_code){
+                    if(e.key==='Enter') {
+                        this.inputSwitch(e);
+                        this.searchBarcode(owner_code);
+                    }
+                },
+                inputSwitch(e,owner_code){
                     if(e.key==='Enter') {
                         let inputs = $("#form .input");
                         let idx = inputs.index($(e.target));     // 获取当前焦点输入框所处的位置
                         let location=document.getElementById('inventoryInput').value.trim();
-                        if (idx == 2) {       // 判断是否是最后一个输入框
-                            if (location==''){
+                        // if (idx === 1){
+                        //     this.searchBarcode(owner_code);
+                        // inputs.length - 1}
+                        if (idx === 2) {       // 判断是否是最后一个输入框
+                            if (location===''){
                                 document.getElementById('inventoryInput').focus();
                                 return;
                             }
@@ -559,20 +628,40 @@
                     this.selectedStyle=id;
                 },
                 //验证输入盘点产品条码对应是否有商品并且查询出初盘时的盘点记录
-                searchBarcode(){
+                searchBarcode(owner_code){
+                    console.log(owner_code)
                     let _this=this;
                     let barcode=document.getElementById('barcode').value.trim();
                     let location=document.getElementById('inventoryInput').value.trim();
                     let inventoryId=_this.inventory.id;
                     let barcodes=[];
-                    setData(location,barcode,inventoryId,count);
+                    setData(location,barcode,inventoryId,owner_code);
                     _this.inventoryMissions.forEach(function (inventoryMission) {
-                        barcodes.push(inventoryMission.commodity.barcode);
+                        if (inventoryMission.commodity_barcodes.length===1){
+                            if (!barcodes.includes(inventoryMission.commodity_barcodes[0].code)){
+                                barcodes.push(inventoryMission.commodity_barcodes[0].code);
+                            }
+                        }else if(inventoryMission.commodity_barcodes.length>1){
+                            inventoryMission.commodity_barcodes.forEach(function (barcode) {
+                                if (!barcodes.includes(barcode)){
+                                    barcodes.push(barcode.code);
+                                }
+                            })
+                        }
                     });
                     if (!barcodes.includes(barcode)){
+                        let url='{{url('inventory/stockInventory/searchCommodityByBarcode')}}';
                         if (barcode!==''){
-                            tempTip.setDuration(2000);
-                            tempTip.show('输入的产品条码没有对应的产品!');
+                            axios.post(url,{barcode:barcode,owner_code:owner_code}).then(function (response) {
+                                if (!response.data.success){
+                                    document.getElementById('inventoryInput').focus();
+                                    tempTip.setDuration(2000);
+                                    tempTip.show(response.data.data);
+                                }
+                            }).catch(function (err) {
+                                tempTip.setDuration(2000);
+                                tempTip.show('网络错误'+err);
+                            })
                         }
                     }else {
                         if (location===''){
@@ -595,12 +684,9 @@
                             });
                         }
                     }
-                    //拷贝_this.inventoryMissions
-                    let allData=JSON.stringify(_this.inventoryMissions);
-                    let allData1=JSON.parse(allData);
-                    allData1.forEach(function (inventoryMission,i) {
+                    _this.inventoryMissions.forEach(function (inventoryMission,i) {
                         if (inventoryMission.location===location && barcode===inventoryMission.commodity.barcode){
-                            if (! _this.inventoryAccountMissions.includes(inventoryMission)){
+                            if (!_this.inventoryAccountMissions.includes(inventoryMission)){
                                 _this.inventoryAccountMissions.push(inventoryMission);
                             }
                         }
@@ -614,6 +700,22 @@
                     let count=document.getElementById('count').value.trim();
                     let inventoryId=_this.inventory.id;
                     let locations=[];
+                    let barcodes=[];
+                    _this.inventoryMissions.forEach(function (inventoryMission) {
+                        if (inventoryMission.commodity_barcodes.length===1){
+                            if (!barcodes.includes(inventoryMission.commodity_barcodes[0].code)){
+                                barcodes.push(inventoryMission.commodity_barcodes[0].code);
+                            }
+                        }else if(inventoryMission.commodity_barcodes.length>1){
+                            inventoryMission.commodity_barcodes.forEach(function (barcode) {
+                                if (!barcodes.includes(barcode)){
+                                    barcodes.push(barcode.code);
+                                }
+                            })
+                        }
+                    });
+                    let arr=getData();
+                    let owner_code=arr[3];
                     _this.inventoryMissions.forEach(function (inventoryMission) {
                         locations.push(inventoryMission.location);
                     });
@@ -621,33 +723,48 @@
                         document.getElementById('inventoryInput').focus();
                         return;
                     }
-                    if (!locations.includes(location)){
+                    if (!locations.includes(location)&&!barcodes.includes(barcode)){
+                        if (_this.inventory.status==='盘点中'||_this.inventory.status==='待盘点'){
+                            if(!confirm('该'+barcode+'条码和'+location+'库位在WAS系统盘点记录中不存在!'+'确定是否需要添加至系统盘点记录中?')){return};
+                            let isBarcode='库位和商品新增';
+                            this.增加系统之外的盘点记录(location,barcode,count,inventoryId,owner_code,isBarcode);
+                        }
+                        return;
+                    }else if (!locations.includes(location)){
                         if (_this.inventory.status==='盘点中'||_this.inventory.status==='待盘点'){
                             if(!confirm('该'+location+'库位在系统盘点记录中不存在!'+'确定是否需要添加至系统盘点记录中?')){return};
-                            this.增加系统之外的库位记录(location,barcode,count,inventoryId);
+                            let isLocation='库位新增';
+                            this.增加系统之外的盘点记录(location,barcode,count,inventoryId,owner_code,isLocation);
+                        }
+                        return;
+                    }else if (!barcodes.includes(barcode)){
+                        if (_this.inventory.status==='盘点中'||_this.inventory.status==='待盘点'){
+                            if(!confirm('该'+barcode+'条码在WAS系统盘点记录中不存在!'+'确定是否需要添加至系统盘点记录中?')){return};
+                            let isBarcode='商品新增';
+                            this.增加系统之外的盘点记录(location,barcode,count,inventoryId,owner_code,isBarcode);
                         }
                         return;
                     }
                     if ( _this.inventoryAccountMissions.length>1){
                         alert('该库位和产品条码下存在多条盘点任务,请选中您需要盘点的任务');
                     }else {
-                        if (_this.inventory.status!=='复盘中'){
-                            _this.inventoryMissions.every(function (inventoryMission,i) {
-                                if (inventoryMission.location===location && barcode===inventoryMission.commodity.barcode){
-                                    if (inventoryMission.stockInventoryPersons.length>0){
-                                        _this.inventoryMissionRecord=inventoryMission;
-                                        _this.stockInventoryPersons=inventoryMission.stockInventoryPersons;
-                                        $("#lastStockInventoryRecord").modal('show');
-                                    }else{
-                                        //初盘且未盘点过
-                                        _this.盘点(location,barcode,inventoryId,count);
-                                        _this.inventoryAccountMissions=[];
-                                    }
-                                    return false;
+                        // if (_this.inventory.status!=='复盘中'){
+                        _this.inventoryMissions.every(function (inventoryMission,i) {
+                            if (inventoryMission.location===location && barcode===inventoryMission.commodity.barcode){
+                                if (inventoryMission.stockInventoryPersons.length>0){
+                                    _this.inventoryMissionRecord=inventoryMission;
+                                    _this.stockInventoryPersons=inventoryMission.stockInventoryPersons;
+                                    $("#lastStockInventoryRecord").modal('show');
+                                }else{
+                                    //初盘且未盘点过
+                                    _this.盘点(location,barcode,inventoryId,count);
+                                    _this.inventoryAccountMissions=[];
                                 }
-                                return true;
-                            });
-                        }
+                                return false;
+                            }
+                            return true;
+                        });
+                        // }
                     }
                 },
                 //结束初盘任务
@@ -690,6 +807,7 @@
                     _this.已复盘无差异列=[];
                     _this.无差异列=[];
                     _this.未盘列=[];
+                    _this.跳过列=[];
                     _this.inventoryMissions.forEach(function (mission,i){
                         switch(mission.checked){
                             case '已复核':
@@ -700,6 +818,8 @@
                                 _this.无差异列.push(mission); mission.mark='无差异'; return;
                             case '否':
                                 _this.未盘列.push(mission); mission.mark='未盘'; return;
+                            case '跳过':
+                                _this.跳过列.push(mission); mission.mark='跳过'; return;
                         }
                     });
                     _this.已复盘有差异列=_this.按库位排序_且合并SKU一起(_this.已复盘有差异列);
@@ -707,6 +827,7 @@
                     _this.已复盘无差异列=_this.按库位排序_且合并SKU一起(_this.已复盘无差异列);
                     _this.无差异列=_this.按库位排序_且合并SKU一起(_this.无差异列);
                     _this.未盘列=_this.按库位排序_且合并SKU一起(_this.未盘列);
+                    _this.跳过列=_this.按库位排序_且合并SKU一起(_this.跳过列);
                     function 重推入(目标数组,推入数组){
                         推入数组.forEach(function (元素){
                             目标数组.push(元素);
@@ -718,6 +839,7 @@
                     重推入(_this.inventoryMissions,_this.未盘列);
                     重推入(_this.inventoryMissions,_this.已复盘无差异列);
                     重推入(_this.inventoryMissions,_this.无差异列);
+                    重推入(_this.inventoryMissions,_this.跳过列);
                 },
                 按库位排序_且合并SKU一起(inventoryMissions){
                     let 结果列=[];
@@ -785,6 +907,32 @@
                         tempTip.show('删除失败,网络链接错误!'+err);
                     });
                 },
+                跳过盘点记录(inventoryAccountMissionId,inventoryAccountId,name){
+                    let _this=this;
+                    if(!confirm('确定要跳过商品为:“'+name+'”的盘点记录吗?')){return};
+                    let url = '{{url('inventory/跳过盘点记录')}}';
+                    axios.post(url,{inventoryAccountMissionId:inventoryAccountMissionId,inventoryAccountId:inventoryAccountId}).then(
+                        function (response) {
+                            if(!response.data.success){
+                                tempTip.setDuration(3000);
+                                tempTip.show('盘点单号:'+inventoryAccountMissionId+'跳过盘点失败!'+response.data.data);
+                            }else {
+                                _this.inventoryMissions.every(function (inventoryAccountMission) {
+                                    if (inventoryAccountMission.id===inventoryAccountMissionId){
+                                        inventoryAccountMission.checked=response.data.inventoryAccountMission.checked;
+                                        return false;
+                                    }
+                                    return true
+                                });
+                            }
+                            _this.重排序并标记全列表类型(_this.inventoryMissions);
+                            tempTip.setDuration(3000);
+                            tempTip.showSuccess('盘点记录:'+inventoryAccountMissionId+'跳过盘点成功!');
+                        }).catch(function (err) {
+                        tempTip.setDuration(3000);
+                        tempTip.show('跳过盘点记录失败,网络链接错误!'+err);
+                    });
+                },
                 完结盘点任务(id,owner_name,type){
                     let _this=this;
                     if(!confirm('确定完结货主为:“'+owner_name+'”的“'+type+'”任务吗?')){return};
@@ -807,14 +955,14 @@
                         tempTip.show('修改完结状态失败!  '+err);
                     })
                 },
-                增加系统之外的库位记录(location,barcode,count,inventoryId){
+                增加系统之外的盘点记录(location,barcode,count,inventoryId,owner_code,param){
                     let _this=this;
-                    let url='{{url('inventory/增加系统之外的库位记录')}}';
-                    axios.post(url,{location:location,barcode:barcode,count:count,inventoryId:inventoryId}).then(
+                    let url='{{url('inventory/增加系统之外的盘点记录')}}';
+                    axios.post(url,{location:location,barcode:barcode,count:count,inventoryId:inventoryId,owner_code:owner_code,param:param}).then(
                         function (response) {
                             if(!response.data.success){
                                 tempTip.setDuration(3000);
-                                tempTip.show('增加系统之外的库位记录失败!');
+                                tempTip.show('增加系统之外的盘点记录失败!');
                             }else {
                                 _this.inventoryMissions.push(response.data.inventoryAccountMission);
                                 _this.inventoryMissions.every(function (inventoryAccountMission,i) {
@@ -830,12 +978,12 @@
                                 _this.重排序并标记全列表类型(_this.inventoryMissions);
                                 $("#form .input").val(' ');
                                 tempTip.setDuration(3000);
-                                tempTip.showSuccess('增加系统之外的库位记录成功!');
+                                tempTip.showSuccess('增加系统之外的盘点记录成功!');
                             }
                         }
                     ).catch(function (err) {
                         tempTip.setDuration(3000);
-                        tempTip.show('增加系统之外的库位记录失败,网络链接错误!'+err);
+                        tempTip.show('增加系统之外的盘点记录失败,网络链接错误!'+err);
                     });
                 },
                 将相邻同样条目总数匹配的标记_供样式使用(inventoryMissions){
@@ -1039,14 +1187,59 @@
         let loc = null;
         let code = null;
         let inventory_id = 0;
-        function setData(location,barcode,inventoryId) {
+        let ownerCode=null;
+        function setData(location,barcode,inventoryId,owner_code) {
             loc = location;
             code = barcode;
             inventory_id = inventoryId;
+            ownerCode =owner_code;
         }
         function getData() {
-            return [loc,code,inventory_id];
+            return [loc,code,inventory_id,ownerCode];
         }
+        // $(window).scroll(function(){
+        //     let lockLocation_top=$('#lockLocation').offset().top;
+        //     //console.log(lockLocation_top)
+        //     listVue.inventoryMissions.every(function (inventoryMission,i) {
+        //         let lockLine_top=$('#lockLine'+(i+1)).offset().top;
+        //         let td=$('#lockLine'+(i+2)).offset().top-$('#lockLine'+(i+1)).offset().top;
+        //         //console.log(lockLine_top)
+        //         if (lockLine_top>=lockLocation_top-18){
+        //             let location=inventoryMission.location;
+        //             //console.log(td)
+        //             //console.log(location)
+        //             return false;
+        //         }
+        //         return true;
+        //     });
+        // });
+
+
+        // $(window).scroll(function(){
+        //     let lockLocation_top=$('#lockLocationPhone').offset().top;
+        //     //console.log(lockLocation_top)
+        //     listVue.inventoryMissions.every(function (inventoryMission,i) {
+        //         let lockLine_top=$('#lockLinePhone'+(i+1)).offset().top;
+        //         let td=$('#lockLinePhone'+(i+2)).offset().top-$('#lockLinePhone'+(i+1)).offset().top;
+        //         //console.log(lockLine_top)
+        //         if (lockLine_top>=lockLocation_top-75){
+        //             let location=inventoryMission.location;
+        //             console.log(td)
+        //             console.log(location)
+        //             return false;
+        //         }
+        //         return true;
+        //     });
+        // listVue.inventoryMissions.every(function (inventoryMission,i) {
+        //     if (listVue.location===inventoryMission.location){
+        //         $('#lockLinePhone'+(i+1)).parent().css("background-color","black");
+        //         return false;
+        //     }
+        //     return true;
+        // });
+        // });
     </script>
 @endsection
 
+
+

+ 1 - 1
resources/views/inventory/stockInventory/mission.blade.php

@@ -64,7 +64,7 @@
                     <td>@{{ inventory.returned }}</td>
                     <td>@{{ inventory.creator }}</td>
                     <td>
-                        <span class="btn  btn-sm btn-outline-danger" @click="deleteStockInventoryMission(inventory.id)">删</span>
+                        <span v-if="inventory.status!='已完成'" class="btn  btn-sm btn-outline-danger" @click="deleteStockInventoryMission(inventory.id)">删</span>
                     </td>
                 </tr>
             </table>

+ 1 - 0
resources/views/waybill/index.blade.php

@@ -1006,5 +1006,6 @@
         $("#exampleModal").on('hide.bs.modal',function(e){
             $('#remark').val('');
         });
+
     </script>
 @endsection

+ 3 - 1
routes/web.php

@@ -347,6 +347,7 @@ Route::group(['prefix'=>'inventory'],function(){
         Route::any('inventoryAccountMission/export','InventoryAccountController@exportInventoryAccountMission');
         Route::get('mission','InventoryAccountController@mission');
         Route::post('createStockInventoryMission','InventoryAccountController@createStockInventoryMission');
+        Route::post('searchCommodityByBarcode','InventoryAccountController@searchCommodityByBarcode');
     });
     /** 库存比对 */
     Route::group(['prefix'=>'inventoryCompare'],function(){
@@ -358,9 +359,10 @@ Route::group(['prefix'=>'inventory'],function(){
 
     Route::get('syncOwners','InventoryAccountController@syncOwners');
     Route::any('删除盘点记录','InventoryAccountController@删除盘点记录');
+    Route::post('跳过盘点记录','InventoryAccountController@跳过盘点记录');
     Route::get('完结盘点任务/{id}','InventoryAccountController@完结盘点任务');
     Route::post('修改质量状态','InventoryAccountController@修改质量状态');
-    Route::post('增加系统之外的库位记录','InventoryAccountController@增加系统之外的库位记录');
+    Route::post('增加系统之外的盘点记录','InventoryAccountController@增加系统之外的盘点记录');
     Route::post('盘点选中任务','InventoryAccountController@盘点选中任务');
     Route::post('stockInventoryEnd','InventoryAccountController@stockInventoryEnd');
     Route::any('deleteStockInventoryMission/{id}','InventoryAccountController@deleteStockInventoryMission');