Преглед изворни кода

盘点优化---整合盲收,盘点到同一页面

haozi пре 5 година
родитељ
комит
f00367b31a

+ 2 - 2
app/Commodity.php

@@ -16,8 +16,8 @@ class Commodity extends Model
     public function setNameAttribute($value){
     public function setNameAttribute($value){
         $this->attributes['name']=str_replace(PHP_EOL,'',$value);
         $this->attributes['name']=str_replace(PHP_EOL,'',$value);
     }
     }
-    public function getNameAttAttribute(){
-        return $this['name']=str_replace(array("\r\n","\n","\r"),'',$this['name']);
+    public function getNameAttribute($value){
+        return $this->attributes['name']=str_replace(array("\r\n","\n","\r",""",'"'),'',$value);
     }
     }
     public function barcodes()
     public function barcodes()
     {
     {

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

@@ -103,7 +103,9 @@ class InventoryAccountController extends Controller
         /** @var InventoryAccountService $inventoryService */
         /** @var InventoryAccountService $inventoryService */
         $inventoryService=app('inventoryAccountService');
         $inventoryService=app('inventoryAccountService');
         $inventoryAccount=$inventoryService->updateInventory($inventoryId);
         $inventoryAccount=$inventoryService->updateInventory($inventoryId);
-        if ($inventoryAccountMissions&&$inventoryAccount) return ['success'=>true,'status'=>'盲收盘点成功'];
+        if ($inventoryAccountMissions&&$inventoryAccount)
+        $stockInventoryPersons=$inventoryAccountMissions[0]->stockInventoryPersons;
+        return ['success'=>true,'inventoryMissions'=>$inventoryAccountMissions,'inventory'=>$inventoryAccount,'stockInventoryPersons'=>$stockInventoryPersons];
     }
     }
     //根据该库存和产品条码查询该条盘点记录??
     //根据该库存和产品条码查询该条盘点记录??
     public function searchStockInventoryRecord(Request $request){
     public function searchStockInventoryRecord(Request $request){
@@ -236,7 +238,8 @@ class InventoryAccountController extends Controller
             /** @var InventoryAccountService $inventoryService */
             /** @var InventoryAccountService $inventoryService */
             $inventoryService=app('inventoryAccountService');
             $inventoryService=app('inventoryAccountService');
             $inventoryAccount=$inventoryService->updateInventory($inventoryId);
             $inventoryAccount=$inventoryService->updateInventory($inventoryId);
-            return ['success'=>true,'inventoryMission'=>$inventoryAccountMission,'inventory'=>$inventoryAccount];
+            $stockInventoryPersons=$inventoryAccountMission[0]->stockInventoryPersons;
+            return ['success'=>true,'inventoryMission'=>$inventoryAccountMission,'inventory'=>$inventoryAccount,'stockInventoryPersons'=>$stockInventoryPersons];
         }else{
         }else{
             /** @var InventoryAccountService $inventoryAccountMission */
             /** @var InventoryAccountService $inventoryAccountMission */
             $inventoryAccountService=app('inventoryAccountService');
             $inventoryAccountService=app('inventoryAccountService');

+ 1 - 0
app/Services/InventoryAccountService.php

@@ -480,6 +480,7 @@ class InventoryAccountService
             $inventoryAccount->returned=$inventoryAccount->getReturnedAmount(); //复盘归位数
             $inventoryAccount->returned=$inventoryAccount->getReturnedAmount(); //复盘归位数
             $inventoryAccount->update();
             $inventoryAccount->update();
             Controller::logS(__METHOD__,"修改盘点任务记录".__FUNCTION__,json_encode($inventoryId));
             Controller::logS(__METHOD__,"修改盘点任务记录".__FUNCTION__,json_encode($inventoryId));
+            $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])->where('id',$inventoryAccountMission->id)->first();
             return $inventoryAccountMission;
             return $inventoryAccountMission;
         }else{
         }else{
             return null;
             return null;

+ 3 - 3
app/Services/InventoryCompareService.php

@@ -151,15 +151,15 @@ class InventoryCompareService
         if ($differ=='有'){
         if ($differ=='有'){
             $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
             $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
                 $query->with('barcodes');
                 $query->with('barcodes');
-            }])->where('differ','>',0)->orderByDesc('id')->whereIn('owner_id',$ownerIds);
+            }])->where('differ','>',0)->orderByDesc('id')->whereIn('inventory_compares.owner_id',$ownerIds);
         }elseif ($differ=='无'){
         }elseif ($differ=='无'){
             $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
             $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
                 $query->with('barcodes');
                 $query->with('barcodes');
-            }])->where('differ','<',0)->orderByDesc('id')->whereIn('owner_id',$ownerIds);
+            }])->where('differ','<',0)->orderByDesc('id')->whereIn('inventory_compares.owner_id',$ownerIds);
         }else{
         }else{
             $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
             $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
                 $query->with('barcodes');
                 $query->with('barcodes');
-            }])->orderByDesc('id')->whereIn('owner_id',$ownerIds);
+            }])->orderByDesc('id')->whereIn('inventory_compares.owner_id',$ownerIds);
         }
         }
         unset($param['differ']);
         unset($param['differ']);
         $columnQueryRules=[
         $columnQueryRules=[

+ 2 - 3
resources/views/inventory/stockInventory/blindReceive.blade.php

@@ -163,6 +163,7 @@
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
+
     </div>
     </div>
 @endsection
 @endsection
 
 
@@ -198,13 +199,11 @@
                     this.status.amountDisable=false;
                     this.status.amountDisable=false;
                     this.isManualInputtingAmount=true;
                     this.isManualInputtingAmount=true;
                     $('#amountLabel').text('输入数量:');
                     $('#amountLabel').text('输入数量:');
-                    // $('#amount').attr('placeholder','数字');
                 },
                 },
                 changeToScanInputAmount:function(){
                 changeToScanInputAmount:function(){
                     this.status.amountDisable=true;
                     this.status.amountDisable=true;
                     this.isManualInputtingAmount=false;
                     this.isManualInputtingAmount=false;
                     $('#amountLabel').text('自动扫入数量:');
                     $('#amountLabel').text('自动扫入数量:');
-                    // $('#amount').attr('placeholder','自动');
                 },
                 },
                 changeToManualInputBarcode:function(){
                 changeToManualInputBarcode:function(){
                     this.status.barcodeDisable=false;
                     this.status.barcodeDisable=false;
@@ -306,7 +305,6 @@
                         data.focusOutDocument();
                         data.focusOutDocument();
                         window.tempTip.confirm('扫到其它条码,是否切换至新条码并记录?',doIt,function () {
                         window.tempTip.confirm('扫到其它条码,是否切换至新条码并记录?',doIt,function () {
                             data.inputting.barcode=data.lastScannedBarcode;
                             data.inputting.barcode=data.lastScannedBarcode;
-                            // data.cleanInputs();
                             data.focusDocument();
                             data.focusDocument();
                         })
                         })
                     }else{
                     }else{
@@ -520,6 +518,7 @@
                     }
                     }
                 }
                 }
             }
             }
+
         });
         });
     </script>
     </script>
 @endsection
 @endsection

Разлика између датотеке није приказан због своје велике величине
+ 692 - 240
resources/views/inventory/stockInventory/inventoryMission.blade.php


Неке датотеке нису приказане због велике количине промена