소스 검색

运输管理选中效果
header.js修复
用仓报表自动生成

Zhouzhendong 5 년 전
부모
커밋
9ac600b0cd

+ 2 - 1
app/Events/DeliveryAppointmentEvent.php

@@ -16,12 +16,13 @@ class DeliveryAppointmentEvent implements ShouldBroadcast
     /**
      * Create a new event instance.
      *
-     * @param DeliveryAppointmentCar $delivery
+     * @param DeliveryAppointmentCar|\stdClass $delivery
      *
      * @return void
      */
     public function __construct(DeliveryAppointmentCar $delivery)
     {
+        $delivery->warehouse = $delivery->deliveryAppointment->warehouse_id ?? "";
         $this->delivery = $delivery;
     }
 

+ 4 - 4
app/Http/Controllers/DeliveryAppointmentController.php

@@ -24,7 +24,7 @@ class DeliveryAppointmentController extends Controller
 
     public function list()
     {
-        if(!Gate::allows('入库管理-客户预约-预约管理')){ return view("exception.authority");  }
+        if(!Gate::allows('入库管理-入库预约-预约管理')){ return view("exception.authority");  }
         $list = app("DeliveryAppointmentService")->query(request()->input())
             ->paginate(request("paginate") ?? 50);
 
@@ -35,7 +35,7 @@ class DeliveryAppointmentController extends Controller
 
     public function appointment()
     {
-        if(!Gate::allows('入库管理-客户预约-预约')){ return view("exception.authority");  }
+        if(!Gate::allows('入库管理-入库预约-预约')){ return view("exception.authority");  }
         $owners = app("OwnerService")->getIntersectPermitting();
         $cars = CarType::query()->get();
         $warehouses = Warehouse::query()->select("id","name")->get();
@@ -53,7 +53,7 @@ class DeliveryAppointmentController extends Controller
      */
     public function getCapacity()
     {
-        $this->gate("入库管理-客户预约-预约");
+        $this->gate("入库管理-入库预约-预约");
         $model = request("model");
         $errors = $this->appointmentValidator($model)->errors();
         if (count($errors)>0)$this->success(["errors"=>$errors]);
@@ -99,7 +99,7 @@ class DeliveryAppointmentController extends Controller
      */
     public function submitAppointment()
     {
-        $this->gate("入库管理-客户预约-预约");
+        $this->gate("入库管理-入库预约-预约");
         $model = request("model");
         $selectDate = request("date");
         $details = request("details");

+ 1 - 0
app/Observers/OwnerObserver.php

@@ -14,6 +14,7 @@ class OwnerObserver
      */
     public function created(Owner $owner)
     {
+        app("OwnerAreaReportService")->notExistToInsert([$owner]);
         if(env('APP_ENV')=='production')
             app("OwnerService")->syncPush($owner);
             app("OwnerService")->createAuthority($owner);

+ 1 - 1
app/Services/OrderService.php

@@ -1272,7 +1272,7 @@ sql
                     return Province::query()->where("name","like",$provinceName."%")->first();
                 },86400);
                 if (!$province)$logistic_fee = null;
-                $fee = app("OwnerPriceExpressService")->matching($package->weight, $order->owner_id, $order->logistic_id, $province->id);
+                else $fee = app("OwnerPriceExpressService")->matching($package->weight, $order->owner_id, $order->logistic_id, $province->id);
             }
 
             OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$feeBill->id)->where("logistic_bill",$package->logistic_number)->update([

+ 1 - 1
app/Services/OwnerAreaReportService.php

@@ -104,7 +104,7 @@ class OwnerAreaReportService
         if (!$owners)return;
         $reports = OwnerAreaReport::query()
             ->where("counting_month",">=",date("Y-m")."-01")
-            ->whereIn("owner_id",array_column($owners->toArray(),"id"))->get();
+            ->whereIn("owner_id",array_column(is_array($owners) ? $owners : $owners->toArray(),"id"))->get();
         $sign = [];
         foreach ($reports as $report)$sign[$report->owner_id."_".$report->owner_storage_price_model_id] = true;
         $month = date('Y-m-d');

+ 7 - 7
resources/js/queryForm/header.js

@@ -39,7 +39,7 @@ window.Header = function getHeader(object) {
             if (be.class)th.className = be.class;
             tr.appendChild(th);
         });
-        _targetDom.insertBefore(tr, _targetDom.firstChild);
+        _targetDom.insertBefore(tr, _targetDom.firstElementChild);
     }
     function appendFloat(div,cla="") {
         div.style.overflowX = "hidden";
@@ -80,7 +80,7 @@ window.Header = function getHeader(object) {
                 while(trs[0] && trs[0].tagName !== 'TR')trs = trs[0].children;
                 if (trs[0]){
                     for (let j=0;j<trs.length;j++){
-                        trs[j].children[i].firstChild.style.width = wid+"px";
+                        trs[j].children[i].firstElementChild.style.width = wid+"px";
                         trs[j].children[i].style.minWidth = wid+"px";
                     }
                 }
@@ -92,7 +92,7 @@ window.Header = function getHeader(object) {
             tr.appendChild(th);
         }
         bindMove(tr);
-        if (_targetDom.firstChild)_targetDom.insertBefore(tr, _targetDom.firstChild);
+        if (_targetDom.firstElementChild)_targetDom.insertBefore(tr, _targetDom.firstElementChild);
         else _targetDom.appendChild(tr);
     }
 
@@ -245,7 +245,7 @@ window.Header = function getHeader(object) {
                 moveTd.dom.style.cursor = 'default';
                 moveTd.oldX = undefined;
                 setTimeout(function () {
-                    let column = _columns[(_isCheckAllBox && _targetDom.firstChild) ? moveTd.index-1 : moveTd.index];
+                    let column = _columns[(_isCheckAllBox && _targetDom.firstElementChild) ? moveTd.index-1 : moveTd.index];
                     if (column) localStorage.setItem(_name+column.name, moveTd.dom.offsetWidth);
                 });
             }
@@ -254,7 +254,7 @@ window.Header = function getHeader(object) {
             if (moveTd.oldX){
                 event.stopPropagation();
                 let diff = event.clientX-moveTd.oldX;
-                let newWidth = moveTd.dom.firstChild.offsetWidth+diff+"px";
+                let newWidth = moveTd.dom.firstElementChild.offsetWidth+diff+"px";
                 if (diff!==0){
                     let trs = _targetDom.getElementsByTagName("tr");
                     for (let j=(_before ? 1 : 0);j<trs.length;j++){
@@ -263,7 +263,7 @@ window.Header = function getHeader(object) {
                             while (table.tagName!=='TABLE') table = table.parentElement;
                             if (table.id!==object.el)continue;
                         }
-                        trs[j].children[moveTd.index].firstChild.style.width = newWidth;
+                        trs[j].children[moveTd.index].firstElementChild.style.width = newWidth;
                         trs[j].children[moveTd.index].style.minWidth = newWidth;
                     }
                     moveTd.oldX = event.clientX;
@@ -320,7 +320,7 @@ window.Header = function getHeader(object) {
         span.style.color = "white";
         div.onclick = showSetting("setting-1");
         h1.appendChild(span);
-        div.appendChild(h1)
+        div.appendChild(h1);
         document.body.appendChild(div);
     }
     function _createSettingHeader(text,id) {

+ 5 - 0
resources/sass/text.scss

@@ -270,4 +270,9 @@
 .fixed-checkbox:checked+label:after {
     content: "\2714";
     color: white;
+}
+
+//tr选中效果
+.tr-select td{
+    background-color: rgb(170, 199, 234) !important;
 }

+ 3 - 3
resources/views/store/deliveryAppointment/menu.blade.php

@@ -2,11 +2,11 @@
     <div class="container-fluid nav3">
         <div class="card menu-third" >
             <ul class="nav nav-pills">
-                @can('入库管理-客户预约-预约')
+                @can('入库管理-入库预约-预约')
                 <li class="nav-item">
-                    <a target="store/deliveryAppointment/appointment" class="nav-link" href="{{url('store/deliveryAppointment/appointment')}}" :class="{active:isActive('appointment',3)}">客户预约</a>
+                    <a target="store/deliveryAppointment/appointment" class="nav-link" href="{{url('store/deliveryAppointment/appointment')}}" :class="{active:isActive('appointment',3)}">入库预约</a>
                 </li> @endcan
-                @can('入库管理-客户预约-预约管理')
+                @can('入库管理-入库预约-预约管理')
                 <li class="nav-item">
                     <a target="store/deliveryAppointment/list" class="nav-link" href="{{url('store/deliveryAppointment/list')}}" :class="{active:isActive('list',3)}">预约管理</a>
                 </li> @endcan

+ 1 - 1
resources/views/store/deliveryAppointment/success.blade.php

@@ -5,7 +5,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="icon" href="{{asset('icon/faviconc.ico')}}" type="image/x-icon"/>
 
-    <title>预约成功-客户预约</title>
+    <title>预约成功-入库预约</title>
     <link href="{{ mix('css/app.css') }}" rel="stylesheet">
     <style>
         .font{

+ 2 - 2
resources/views/store/menu.blade.php

@@ -10,9 +10,9 @@
             <li class="nav-item">
                 <a target="store/checkingReceive/mission" class="nav-link"  href="{{url('store/checkingReceive/mission')}}" :class="{active:isActive('checkingReceive',2)}">盘收一体</a>
             </li> @endcan
-            @can('入库管理-客户预约')
+            @can('入库管理-入库预约')
                 <li class="nav-item">
-                    <a target="store/deliveryAppointment/appointment" class="nav-link"  href="{{url('store/deliveryAppointment/appointment')}}" :class="{active:isActive('deliveryAppointment',2)}">客户预约</a>
+                    <a target="store/deliveryAppointment/appointment" class="nav-link"  href="{{url('store/deliveryAppointment/appointment')}}" :class="{active:isActive('deliveryAppointment',2)}">入库预约</a>
                 </li> @endcan
             @can('入库管理-快速入库')
                 <li class="nav-item">

+ 8 - 0
resources/views/test.blade.php

@@ -74,8 +74,16 @@
         </div>
     </div>
 </div>
+<div id="tttt">
+    {{--测试--}}
+    <!-- 测试 -->
+    <input value="测试">
+</div>
 <script type="text/javascript">
     function a() {
+        let dom = document.getElementById("tttt");
+        console.log(dom.firstChild,dom.firstElementChild);
+        return;
         let d1 = "1";
         let d2 = "header:2";
         console.log(d1.substring(0,d2.length));

+ 6 - 10
resources/views/transport/waybill/index.blade.php

@@ -47,8 +47,8 @@
                 @endif
             </div>
             <table class="table table-striped table-bordered table-hover text-nowrap waybill-table td-min-width-80" style="background: #fff;" id="table">
-                <tr v-for="(waybill,i) in waybills" :class="waybill.status=='待重审'?'td-red':''||waybill.status=='已完结'?'td-green':''"
-                    :id="'waybill'+waybill.id" @click="selectedColor(waybill.id,$event)" @mouseover="hidetop($event)" @mouseleave="showtop($event)">
+                <tr v-for="(waybill,i) in waybills" :class="[waybill.status=='待重审'?'td-red':''||waybill.status=='已完结'?'td-green':'',selectTr==waybill.id ? 'tr-select' : '']"
+                    :id="'waybill'+waybill.id" @click="selectedColor(waybill.id)" @mouseover="hidetop($event)" @mouseleave="showtop($event)">
                     <td><input class="checkItem" type="checkbox" :value="waybill.id"></td>
                     <td>
                         <span v-if=waybill.status=="未审核"||waybill.status=="待重审">
@@ -335,7 +335,6 @@
                     },
                     @endforeach
                 ],
-                selectedStyle:[],
                 owners:[
                         @foreach($owners as $owner)
                     {name:'{{$owner->id}}',value:'{{$owner->name}}'},
@@ -365,7 +364,7 @@
                 images:[],
                 batchUploadError:[],
                 size:0,
-                selectTr:''
+                selectTr:'',
             },
             mounted:function(){
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
@@ -565,12 +564,9 @@
                     let token='{{ csrf_token() }}';
                     excelExport(checkAllSign,checkData,url,this.sum,token);
                 },
-                selectedColor(id,e){
-                    if (id==this.selectedStyle){
-                        this.selectedStyle='';
-                        return;
-                    }
-                    this.selectedStyle=id;
+                selectedColor(id){
+                    if (id && id===this.selectTr)return;
+                    this.selectTr=id;
                 },
                 mouseleaveOwner:function () {
                     if(!this.isOut&&!this.isBlur){

+ 1 - 1
routes/web.php

@@ -422,7 +422,7 @@ Route::group(['prefix'=>'store'],function(){
         Route::post('destroyItem','StoreCheckingReceiveController@destroyItem');
     });
 
-    /** 客户预约 */
+    /** 入库预约 */
     Route::group(['prefix'=>'deliveryAppointment'],function(){
         Route::get('appointment','DeliveryAppointmentController@appointment');
         Route::post('getCapacity','DeliveryAppointmentController@getCapacity');