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

Merge branch 'Haozi'

# Conflicts:
#	app/Http/Controllers/TestController.php
zhouzhendong 4 лет назад
Родитель
Сommit
0a7740dfb6

+ 9 - 3
app/Http/Controllers/HandInStorageController.php

@@ -3,6 +3,7 @@
 namespace App\Http\Controllers;
 
 use App\Components\AsyncResponse;
+use App\OracleDOCASNDetail;
 use App\OracleDOCASNHeader;
 use App\Services\HandInStorageService;
 use Carbon\Carbon;
@@ -55,8 +56,11 @@ class HandInStorageController extends Controller
             $customerid=OracleDOCASNHeader::query()->where('asnno',$asnno)->value('customerid');
         $qualityStatus=$handInStorageService->getQualityStatus();
         $attributeLocations=$handInStorageService->getAttributeLocation();
+        $asnQty=$handInStorageService->getAsnQty($asnno);
         return view('store.handInStorage.receiveDetailPage')
-            ->with(['asnno'=>$asnno,'customerid'=>$customerid,'qualityStatus'=>$qualityStatus,'attributeLocations'=>$attributeLocations]);
+            ->with(['asn_expectedqty'=>$asnQty->expectedqty,'asn_receivedqty'=>$asnQty->receivedqty,
+                'asnno'=>$asnno,'customerid'=>$customerid,
+                'qualityStatus'=>$qualityStatus,'attributeLocations'=>$attributeLocations]);
     }
 
     /**
@@ -113,8 +117,10 @@ class HandInStorageController extends Controller
         if ($handInStorageService->checkForwardingLoc($info)===1)$this->error('请维护拣货位');
         try {
             $result = $handInStorageService->fluxHandIn($info);
-            if ($result)$this->success("收货成功");
-            else $this->error("收货失败");
+            if ($result){
+                $asnQty=$handInStorageService->getAsnQty($info['asnno']);
+                $this->success($asnQty);
+            } else $this->error("收货失败");
         } catch (\Exception $e) {
             app('LogService')->log(__METHOD__,'error_'.__FUNCTION__,json_encode($info).'|catch:'.$e->getMessage());
         }

+ 20 - 0
app/Services/HandInStorageService.php

@@ -24,11 +24,31 @@ use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\DB;
 use Monolog\Handler\IFTTTHandler;
+use phpDocumentor\Reflection\Types\Object_;
 
 class HandInStorageService
 {
     use ServiceAppAop;
 
+    /**
+     * @param $asnno
+     * @return object
+     * 根据asn单号获取 总预期数量 总已收数量
+     */
+    public function getAsnQty($asnno)
+    {
+        $asnQty=OracleDOCASNDetail::query()
+            ->select('expectedqty','receivedqty')
+            ->where('asnno',$asnno)
+            ->get();
+        $expectedqty=0;
+        $receivedqty=0;
+        foreach ($asnQty as $qty){
+            $expectedqty+=$qty->expectedqty;
+            $receivedqty+=$qty->receivedqty;
+        }
+        return (object)array('expectedqty'=>$expectedqty,'receivedqty'=>$receivedqty);
+    }
     /**
      * @param array $info
      * @return bool|int

+ 6 - 6
resources/views/store/handInStorage/putaway.blade.php

@@ -149,7 +149,7 @@
                                             return true;
                                         } else {
                                             $('#'+element.id).prop('checked', false);
-                                            window.tempTip.setDuration(2000);
+                                            window.tempTip.setDuration(3000);
                                             window.tempTip.show('货主,批次不同,不可同时上架');
                                         }
                                     });
@@ -195,10 +195,10 @@
                                         }, 100);
                                         return;
                                     }
-                                    window.tempTip.setDuration(2000);
+                                    window.tempTip.setDuration(3000);
                                     window.tempTip.show(res.data.data);
                                 }).catch(err => {
-                                window.tempTip.setDuration(2000);
+                                window.tempTip.setDuration(3000);
                                 window.tempTip.show("网络错误:" + err);
                             })
                         },
@@ -217,7 +217,7 @@
                             if (JSON.stringify(this.errors)==='{}') window.axios.post(url,{info:this.info,checkData:this.checkData})
                                 .then(res=>{
                                     if (res.data.success){
-                                        window.tempTip.setDuration(2000);
+                                        window.tempTip.setDuration(3000);
                                         window.tempTip.showSuccess(res.data.data);
                                         this.info={};
                                         this.checkData=[];
@@ -226,10 +226,10 @@
                                         document.getElementById("trackNumber").focus();
                                         return;
                                     }
-                                    window.tempTip.setDuration(2000);
+                                    window.tempTip.setDuration(3000);
                                     window.tempTip.show(res.data.data);
                                 }).catch(err=>{
-                                window.tempTip.setDuration(2000);
+                                window.tempTip.setDuration(3000);
                                 window.tempTip.show("网络错误:"+err);
                             })
 

+ 27 - 6
resources/views/store/handInStorage/receiveDetailPage.blade.php

@@ -9,6 +9,10 @@
             </div>
             <div class="card-body">
                 <div class="form-group row m-1">
+                    <span class="font-weight-bold text-sm-right" v-if="asnno">
+                        @{{ asnno }}_已收/待收数量: @{{ asn_receivedqty }}/@{{ asn_expectedqty }}</span>
+                </div>
+                <div class="form-group row m-1 mt-1">
                         <span class="text-right">
                             <span class="fa fa-search fa-lg" aria-hidden="true" @click="selectAsnDetails()"></span>
                             <label for="sku" class="text-right text-danger font-weight-bold">产品:</label>
@@ -146,6 +150,8 @@
             data:{
                 asnno:'{!! $asnno !!}',
                 customerid:'{!! $customerid !!}',
+                asn_expectedqty:'{!! $asn_expectedqty !!}',
+                asn_receivedqty:'{!! $asn_receivedqty !!}',
                 qualityStatus:{!! $qualityStatus !!},
                 attributeLocations:{!! $attributeLocations !!},
                 basSku:{},
@@ -233,6 +239,14 @@
                     this.info.name='';
                     this.info.expectedqty=0;
                     this.info.receivedqty=0;
+                    this.info.amount='';
+                    this.info.asnlineno='';
+                    this.info.lotatt01='';
+                    this.info.lotatt02='';
+                    this.info.lotatt03='';
+                    this.info.lotatt04='';
+                    this.info.lotatt05='';
+                    this.info.lotatt08='';
                     this.$forceUpdate()
                 },
                 fillInfo(asnDetail){
@@ -260,7 +274,10 @@
                 enterVal(e){
                     let index = this.element.indexOf(e.target.id)+1;
                     let element = document.getElementById(this.element[index]);
-                    if (element)element.focus();
+                    if (element){
+                        element.focus();
+                        element.select();
+                    }
                     e.preventDefault();
                     return false;
                 },
@@ -275,12 +292,12 @@
                                 this.$forceUpdate()
                                 return;
                             }else {
-                                window.tempTip.setDuration(2000);
+                                window.tempTip.setDuration(3000);
                                 window.tempTip.show(res.data.data);
                                 this.isInit=true;
                             }
                         }).catch(err=>{
-                        window.tempTip.setDuration(2000);
+                        window.tempTip.setDuration(3000);
                         window.tempTip.show("网络错误:"+err);
                     })
                 },
@@ -300,14 +317,18 @@
                         .then(res=>{
                             if (res.data.success){
                                 window.tempTip.setDuration(2000);
-                                window.tempTip.showSuccess(res.data.data);
-                                this.info={};
+                                window.tempTip.showSuccess('收货成功');
+                                // this.info={};
+                                this.clearInfo();
+                                this.asn_expectedqty=res.data.data.expectedqty;
+                                this.asn_receivedqty=res.data.data.receivedqty;
                                 this.asnDetails=[];
                                 this.$forceUpdate();
                                 document.getElementById("sku").focus();
+                                document.getElementById("sku").select();
                                 return;
                             }
-                            window.tempTip.setDuration(2000);
+                            window.tempTip.setDuration(3000);
                             window.tempTip.show(res.data.data);
                         }).catch(err=>{
                         window.tempTip.setDuration(2000);