Browse Source

手持入库聚焦,更新测试服同步项目和数据库脚本

haozi 4 năm trước cách đây
mục cha
commit
e7076cb4b2

+ 23 - 7
app/Http/Controllers/HandInStorageController.php

@@ -17,6 +17,7 @@ class HandInStorageController extends Controller
      */
     public function selectAsn(Request $request)
     {
+        $this->gate("入库管理-手持入库-收货");
         /** @var HandInStorageService $handInStorageService  */
         $handInStorageService=app('HandInStorageService');
         $asnno= $request->input('asnno');
@@ -34,8 +35,10 @@ class HandInStorageController extends Controller
      * @param $asnno
      * 跳转到收货明细页面
      */
+
     public function receiveDetailPage($asnno,$customerid)
     {
+        $this->gate("入库管理-手持入库-收货");
         /** @var HandInStorageService $handInStorageService  */
         $handInStorageService=app('HandInStorageService');
         if (!$customerid||$customerid=='undefined')
@@ -52,6 +55,7 @@ class HandInStorageController extends Controller
      */
     public function selectAsnDetails(Request $request)
     {
+        $this->gate("入库管理-手持入库-收货");
         $asnno= $request->input('asnno');
         $asnDetails =app('HandInStorageService')->selectAsnDetails($asnno);
         if (count($asnDetails)>0)$this->success($asnDetails);
@@ -80,6 +84,7 @@ class HandInStorageController extends Controller
      */
     public function fluxHandIn(Request $request)
     {
+        $this->gate("入库管理-手持入库-收货");
         $info=$request->input('info');
         if (!$info['customerid']||!$info['sku']||!$info['asnno']) $this->error('参数错误');
         if ($info['amount']+$info['receivedqty']>$info['expectedqty'])$this->error('收货数大于预期数');
@@ -92,17 +97,22 @@ class HandInStorageController extends Controller
 //        }
         /** @var HandInStorageService $handInStorageService  */
         $handInStorageService=app('HandInStorageService');
-        $result=$handInStorageService->fluxHandIn($info);
-        if ($result)$this->success("收货成功");
-        else $this->error("收货失败");
+        try {
+            $result = $handInStorageService->fluxHandIn($info);
+            if ($result)$this->success("收货成功");
+            else $this->error("收货失败");
+        } catch (\Exception $e) {
+            app('LogService')->log(__METHOD__,'error_'.__FUNCTION__,json_encode($info).'|catch:'.$e->getMessage());
+        }
     }
 
     /**
      * @param Request $request
-     * 根据商品条码 获取要上架的任务列表
+     * 根据商品条码和跟踪号 获取要上架的任务列表
      */
     public function getTsk(Request $request)
     {
+        $this->gate("入库管理-手持入库-上架");
         $barCode=$request->input('barCode');
         $trackNumber=$request->input('trackNumber');
         if(!$barCode)$this->error('条码不能为空');
@@ -116,9 +126,11 @@ class HandInStorageController extends Controller
 
     /**
      * @throws \Throwable
+     * 上架
      */
     public function handFluxPa(Request $request)
     {
+        $this->gate("入库管理-手持入库-上架");
         $info=$request->input('info');
         if (!$info['location']||!$info['amount']||!$info['trackNumber']||!$info['barCode']) $this->error('参数错误');
         if (count($request->input('checkData'))==0) $this->error('请勾选要上架任务');
@@ -130,9 +142,13 @@ class HandInStorageController extends Controller
         if (!$location)$this->error('目标库位不存在');
         /** @var HandInStorageService $handInStorageService  */
         $handInStorageService=app('HandInStorageService');
-        $result=$handInStorageService->fluxHandPa($info,$checkData);
-        if ($result)$this->success("上架成功");
-        else $this->error("上架失败");
+        try {
+            $result = $handInStorageService->fluxHandPa($info, $checkData);
+            if ($result)$this->success("上架成功");
+            else $this->error("上架失败");
+        } catch (\Exception $e) {
+            app('LogService')->log(__METHOD__,'error_'.__FUNCTION__,json_encode($info).'|catch:'.$e->getMessage());
+        }
     }
 
 

+ 3 - 3
app/Services/HandInStorageService.php

@@ -26,7 +26,7 @@ class HandInStorageService
     /**
      * @param $asn
      * @return Builder[]|Collection
-     * 获取富勒asn_header
+     * 获取富勒asn_header  根据货主,asn,或者条码
      *
      */
     public function selectAsn($asn)
@@ -38,7 +38,7 @@ class HandInStorageService
             ->limit(50)
             ->get();
 
-        if ($asn && strpos(strtoupper($asn),'ASN')!==false){
+        if (strpos(strtoupper($asn),'ASN')!==false){
             return OracleDOCASNHeader::query()
                 ->select(['asnno','asnreference1','asnstatus','addtime','customerid'])
                 ->where('asnno',$asn)
@@ -87,7 +87,7 @@ sql;
      * @param $asnno
      * @param $skuOrBarcode
      * @return Builder|Model|object|null
-     *
+     *根据sku 或者条码获取asn_detail
      */
     public function getAsnDetail($asnno,$skuOrBarcode)
     {

+ 3 - 3
bashupMysql.sh

@@ -1,11 +1,11 @@
 #!/bin/bash
 #设置mysql的备份保存目录
-folder=/etc/bashupMysql
-cd $folder
+#folder=/etc/bashupMysql
+#cd $folder
 #当前日期
 time_now=$(date  "+%Y-%m-%d")
 #当前时间的前30天 %H:%M:%S
-time_30day_ago=$(date -d"25 day ago" "+%Y-%m-%d 00:00:00")
+time_30day_ago=$(date -d"20 day ago" "+%Y-%m-%d 00:00:00")
 #数据库服务器ip
 host="was.baoshi56.com"
 test_host="101.133.135.193"

+ 2 - 2
resources/views/store/handInStorage/androidIndex.blade.php

@@ -19,8 +19,8 @@
     <div class="text-center h-75">
         <div class="w-100 center h-75 row align-items-center justify-content-center">
             <div class="w-100">
-                <a href="{{url('')}}"><button class="btn btn-info w-75 text-white" style="height: 60px"><h4>收货</h4></button></a>
-                <a href="{{url('')}}"><button class="btn btn-info w-75 mt-3 text-white" style="height: 60px"><h4>上架</h4></button></a>
+                <a  href="{{url('store/handInStorage/receive')}}"><button class="btn btn-info w-75 text-white" style="height: 60px"><h4>收货</h4></button></a>
+                <a  href="{{url('store/handInStorage/putaway')}}"><button class="btn btn-info w-75 mt-3 text-white" style="height: 60px"><h4>上架</h4></button></a>
             </div>
         </div>
     </div>

+ 4 - 0
resources/views/store/handInStorage/putaway.blade.php

@@ -117,6 +117,7 @@
                         if (navigator.userAgent.indexOf("Android") !== -1) this.isAndroid = true;
                         this.pageInit();
                         $("#container").removeClass("d-none");
+                        document.getElementById("trackNumber").focus();
                     },
                     methods: {
                         //页面初始化
@@ -222,6 +223,8 @@
                                         this.checkData=[];
                                         this.tasks=[];
                                         this.$forceUpdate()
+                                        document.getElementById("trackNumber").focus();
+                                        return;
                                     }
                                     window.tempTip.setDuration(2000);
                                     window.tempTip.show(res.data.data);
@@ -234,6 +237,7 @@
                         cancel() {
                             setTimeout(function () {
                                 window.location.reload();
+                                document.getElementById("trackNumber").focus();
                             }, 100);
                         },
                         enterVal(e) {

+ 5 - 0
resources/views/store/handInStorage/receive.blade.php

@@ -89,6 +89,7 @@
                 $("#container").removeClass("d-none");
                 this.height=window.screen.availHeight;
                 document.getElementById('cardTable').style.height=this.height*0.45+'px';
+                document.getElementById("asn").focus();
             },
             methods:{
                 //页面初始化
@@ -159,6 +160,9 @@
                         this.info.customerid=asn.customerid;
                     }
                 },
+                onfocus(){
+                    document.getElementById("asn").focus();
+                },
                 ensure(){
                     let error = {};
                     if (!this.info.asn)error.asn = ["ASN号必填"];
@@ -169,6 +173,7 @@
                 cancel(){
                     setTimeout(function () {
                         window.location.reload();
+                        this.onfocus();
                     },100);
                 },
             },

+ 3 - 5
resources/views/store/handInStorage/receiveDetailPage.blade.php

@@ -164,9 +164,9 @@
             },
             mounted(){
                 if (navigator.userAgent.indexOf("Android")!==-1)this.isAndroid = true;
-                this.codeFocus();
                 this.pageInit();
                 $("#container").removeClass("d-none");
+                document.getElementById("sku").focus();
             },
             methods:{
                 //页面初始化
@@ -239,10 +239,6 @@
                     this.info.amount=Number(this.info.expectedqty)-Number(this.info.receivedqty);
                     this.info.asnlineno=asnDetail.asnlineno;
                 },
-                //聚焦 白名单
-                codeFocus(){
-                    document.getElementById("sku").focus();
-                },
                 checkInfo(){
                     let error = {};
                     if (!this.info.sku)error.sku = ["条码必填"];
@@ -300,6 +296,7 @@
                                 window.tempTip.showSuccess(res.data.data);
                                 this.info={};
                                 this.$forceUpdate();
+                                document.getElementById("sku").focus();
                                 return;
                             }
                             window.tempTip.setDuration(2000);
@@ -312,6 +309,7 @@
                 cancel(){
                     setTimeout(function () {
                         window.location.reload();
+                        document.getElementById("sku").focus();
                     },100);
                 },
             },

+ 1 - 1
syncProject.sh

@@ -3,7 +3,7 @@ Ip="was.baoshi56.com"
 username="haozi"
 password="haozi"
 files=("app" "config" "database" "public" "resources" "routes" "webpack.mix.js" "composer.json" "tests")
-src=/var/www/bswas_test_
+src=/var/www/bswas_test
 dsc=/var/www/was
 cd $src
 for i in ${files[*]}

+ 5 - 0
yarn.lock

@@ -4351,6 +4351,11 @@ map-visit@^1.0.0:
   dependencies:
     object-visit "^1.0.0"
 
+marked@^2.1.3:
+  version "2.1.3"
+  resolved "https://registry.yarnpkg.com/marked/-/marked-2.1.3.tgz#bd017cef6431724fd4b27e0657f5ceb14bff3753"
+  integrity sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==
+
 md5.js@^1.3.4:
   version "1.3.5"
   resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"