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

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 5 лет назад
Родитель
Сommit
104f880803

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

@@ -1000,10 +1000,10 @@ class PriceModelController extends Controller
             "name"              => request("name"),
             "counting_type"     => request("counting_type"),
             "using_type"        => request("using_type"),
-            "minimum_area"      => request("minimum_area"),
+            "minimum_area"      => request("minimum_area") ?? 0,
             "price"             => request("price"),
             "discount_type"     => request("discount_type"),
-            "discount_value"    => request("discount_value"),
+            "discount_value"    => request("discount_value") ?? 0,
             "unit_id"           => request("unit_id"),
         ];
         if (request("id"))app('OwnerStoragePriceModelService')->update(["id"=>request("id")],$values);

+ 0 - 1
app/Http/Controllers/TestController.php

@@ -170,7 +170,6 @@ sql;
 
     public function zzd()
     {
-        dd(storage_path('app\\'."156168818641.jpg"));
         return view("test");
     }
 

+ 4 - 6
app/Services/WaybillService.php

@@ -20,12 +20,10 @@ Class WaybillService
      * @return Builder
      */
     private function conditionQuery(array $param){
-        $waybills = Waybill::filterAuthorities()->with(['owner','logistic','originationCity','destinationCity'=>function($query){
-            $query->with('province');
-        },'uploadFile','amountUnit','priceModel','warehouseWeightUnit','carrierWeightUnit',
-            'warehouseWeightUnitOther','carrierWeightUnitOther','carType','uploadFile','waybillAuditLogs' => function ($query) {
-            $query->with('user');
-        }])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
+        $waybills = Waybill::filterAuthorities()->with(['owner','logistic','destinationCity.province',
+            'uploadFile','amountUnit','priceModel','warehouseWeightUnit','carrierWeightUnit',
+            'warehouseWeightUnitOther','carrierWeightUnitOther','carType','uploadFile','waybillAuditLogs.user'])
+            ->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
             ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
             ->whereNull('waybill_on_tops.deleted_at')
             ->orderBy('waybill_on_tops.updated_at','desc')

+ 64 - 4
resources/views/test.blade.php

@@ -10,8 +10,8 @@
         </div>
         <div class="row mt-2">
             <div class="col-10">
-                <div class="row m-0" id="row" onclick="  (this)">
-                    <div class="col-6" id="vi1">
+                <div class="row m-0" id="row" >
+                    <div class="col-6" id="vi1" onclick="selected(this)">
                         <div id="asd">
                             <video src="#"></video>
                         </div>
@@ -22,10 +22,56 @@
             <div class="col-2 border-left border-3 border-primary text-center">
                 <button class="btn btn-danger" type="button" id="imgPool">离 开 云 诊 室</button>
             </div>
+            <img style="width: 50px;height: 100px" src="{{asset('images/demoBin.png')}}" class="image" onclick="imgShow(this)">
+            <div id="outer" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
+            <div id="inner" style="position:absolute;">
+                <img alt="" id="bm" style="border:5px solid #fff;" src="" />
+            </div>
         </div>
     </div>
 
-    <script>
+    <script type="text/javascript">
+        /*$(function(){
+            $(".image").click(function(){
+                var _this = $(this);//将当前的pimg元素作为_this传入函数
+                imgShow("#outer", "#inner", "#bm", _this);
+            });
+        });*/
+        function imgShow(e,outer="#outer", inner="#inner", bm="#bm"){
+            let src = e.src;
+            $(bm).attr("src", src);
+            let img = $("<img alt='' src='"+src+"'/>");
+            img.on('load',function(){
+                let windowW = $(window).width();
+                let windowH = $(window).height();
+                let realWidth = this.width;
+                let realHeight = this.height;
+                let imgWidth, imgHeight;
+                let scale = 0.8;
+                if(realHeight>windowH*scale) {
+                    imgHeight = windowH*scale;
+                    imgWidth = imgHeight/realHeight*realWidth;
+                    if(imgWidth>windowW*scale) {
+                        imgWidth = windowW*scale;
+                    }
+                } else if(realWidth>windowW*scale) {
+                    imgWidth = windowW*scale;
+                    imgHeight = imgWidth/realWidth*realHeight;
+                } else {
+                    imgWidth = realWidth;
+                    imgHeight = realHeight;
+                }
+                $(bm).css("width",imgWidth);
+                let w = (windowW-imgWidth)/2;
+                let h = (windowH-imgHeight)/2;
+                $(inner).css({"top":h, "left":w});
+                $(outer).fadeIn("fast");
+            });
+            $(outer).click(function(){
+                $(this).fadeOut("fast");
+            });
+        }
+
 
         let currentDom = "";
         let hidden = false;
@@ -39,7 +85,7 @@
             if(ev.keyCode === 32 && currentDom) {
                 ev.preventDefault();
                 $("#row").append('<canvas class="col-6" id="video2" onclick="selected(this)"></canvas>');
-                let base64 = $("#"+currentDom)[0].toDataURL('images/png');
+                let base64 = getBase64Img();
                 let imgPool = $("#imgPool");
                 if (!hidden){
                     imgPool.after("<button class='btn btn-success mt-2 mb-0' type='button' onclick='uploadImg()'>上 传 截 图</button>");
@@ -48,6 +94,20 @@
                 imgPool.after("<div class='w-100 mt-2 h-auto' ondblclick='removeImg(this)'><img class='img-fluid images' alt='截图' src='"+base64+"'></div>");
             }
         };
+        //获取base64截图
+        function getBase64Img(){
+            let canvas = $('<canvas></canvas>');
+            let video = $("#"+currentDom).children().children()[0];
+            let ctx = canvas[0].getContext('2d');
+            let w = video.videoWidth;
+            let h = video.videoHeight;
+            canvas.attr({
+                width: w,
+                height: h,
+            });
+            ctx.drawImage(video, 0, 0, w, h);
+            return canvas[0].toDataURL('images/png');
+        }
         function removeImg(e) {
             e.remove();
         }

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

@@ -290,17 +290,20 @@
                         source_bill:'{{$waybill->source_bill}}',
                         wms_bill_number:'{{$waybill->wms_bill_number}}',
                         origination:'{{$waybill->origination}}',
-                        destination:'{{$waybill->destination}}',
+                        destination:'{{$waybill->destination_city_id}}'?
+                            (('{{$waybill->destination}}'.indexOf('{{$waybill->destinationCity->name}}')===-1 &&
+                                '{{$waybill->destination}}'.indexOf('{{$waybill->destinationCity->province->name}}')===-1)?
+                                '{{($waybill->destinationCity->province->name).($waybill->destinationCity->name).($waybill->destination)}}'
+                                :'{{$waybill->destination}}')
+                            :'{{$waybill->destination}}',
                         recipient:'{{$waybill->recipient}}',
                         recipient_mobile:'{{$waybill->recipient_mobile}}',
                         charge:'{{$waybill->charge}}',
                         ordering_remark:'{{preg_replace("/[\n\s]/",' ',($waybill->ordering_remark??""))}}',
                         carrier:'{{$waybill->logistic ? $waybill->logistic->name : ''}}',
                         carrier_bill:'{{$waybill->carrier_bill}}',
-                        origination_city:'{{$waybill->origination_city ? $waybill->origination_city->name : ''}}',
-                        destination_city:'{{$waybill->destination_city ? $waybill->destination_city->name : ''}}',
+                        destination_city:'{{$waybill->destinationCity ? $waybill->destinationCity->name : ''}}',
                         warehouse_weight:'{{$waybill->warehouse_weight}}',
-                        destination_province_name:'{{$waybill->destination_city ? ($waybill->destination_city->province ? $waybill->destination_city->province->name : '') : ''}}',
                         warehouse_weight_unit:'{{$waybill->warehouse_weight_unit ? $waybill->warehouse_weight_unit->name : ''}}',
                         carrier_weight:'{{$waybill->carrier_weight}}',
                         carrier_weight_unit:'{{$waybill->carrier_weight_unit ? $waybill->carrier_weight_unit->name : ''}}',
@@ -953,7 +956,7 @@
                 refreshWaveHouseWeight(wms_bill_number) {
                     let _this=this;
                     let url='{{url('waybill/refreshWaveHouseWeight')}}';
-                    axios.post(url,{'wms_bill_number':wms_bill_number}).then(function (response) {
+                    window.axios.post(url,{'wms_bill_number':wms_bill_number}).then(function (response) {
                         if(response.data.success){
                             _this.waybills.every(function (waybill) {
                                 if (waybill.wms_bill_number==wms_bill_number){
@@ -962,15 +965,15 @@
                                 }
                                 return true;
                             });
-                            tempTip.setDuration(3000);
-                            tempTip.showSuccess('刷新计重成功');
+                            window.tempTip.setDuration(3000);
+                            window.tempTip.showSuccess('刷新计重成功');
                         }else{
-                            tempTip.setDuration(3000);
-                            tempTip.show('刷新计重失败!'+response.data.fail_info);
+                            window.tempTip.setDuration(3000);
+                            window.tempTip.show('刷新计重失败!'+response.data.fail_info);
                         }
                     }).catch(function (err) {
-                        tempTip.setDuration(3000);
-                        tempTip.show('刷新计重失败,网络连接错误!'+err);
+                        window.tempTip.setDuration(3000);
+                        window.tempTip.show('刷新计重失败,网络连接错误!'+err);
                     });
                 },
                 //选择文件
@@ -1062,7 +1065,7 @@
                         return  parseInt(val/1024)+"MB";
                     }
                     return val+"KB";
-                }
+                },
             }
         });
         // modal 隐藏时修改 input 为空