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

登录BUG,退货统计问题等修复

LD пре 5 година
родитељ
комит
02d22f1076

+ 1 - 1
app/Http/Controllers/OrderController.php

@@ -81,7 +81,7 @@ class OrderController extends Controller
     }
 
     public function delivering(Request $request){
-        if(!Gate::allows('订单管理-发运')){ return redirect(url('/'));  }
+        if(!Gate::allows('订单管理-查询')){ return redirect(url('/'));  }
         $paginate=$request->input('paginate')??50;
         $page=$request->input('page')??1;
         $checkData=$request->input('checkData');

+ 15 - 9
app/RejectedAnalyzeOwner.php

@@ -3,6 +3,7 @@
 namespace App;
 
 use App\Traits\ModelTimeFormat;
+use Illuminate\Database\Eloquent\Collection;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Support\Facades\DB;
@@ -20,7 +21,7 @@ class RejectedAnalyzeOwner extends Model
      * created_at:创建时间
      *
      */
-    protected $appends = ['id_owner', 'owner_name', 'bounce_amount', 'check_amount', 'in_storage_count'];
+//    protected $appends = ['id_owner', 'owner_name', 'bounce_amount', 'check_amount', 'in_storage_count', 'not_in_storage_count'];
 
     // 按条件查询    zengjun
     public static function findBy($array = null)
@@ -36,9 +37,10 @@ class RejectedAnalyzeOwner extends Model
             $rao->bounce_amount = $result->bounce_amount;
             $rao->check_amount = $result->check_amount;
             $rao->in_storage_count = $result->in_storage_count;
+            $rao->not_in_storage_count = $result->not_in_storage_count;
             $collection[] = $rao;
         }
-        return $collection;
+        return (new Collection($collection));
     }
 
     // 按条件查询    zengjun
@@ -54,7 +56,7 @@ class RejectedAnalyzeOwner extends Model
                     'check_amount'=>$result->check_amount,
                     'uncheck_amount'=>$result->bounce_amount-$result->check_amount,
                     'in_storage_count'=>$result->in_storage_count,
-                    'not_in_storage_count'=>$result->bounce_amount-$result->in_storage_count,
+                    'not_in_storage_count'=>$result->not_in_storage_count,
             ];
             $list[] = $rao;
         }
@@ -119,23 +121,27 @@ class RejectedAnalyzeOwner extends Model
     // 返回sql    zengjun
     public static  function getQuerySQL($array= null){
         $condition = RejectedAnalyzeOwner::getCondition($array);// 条件
-        $sql = 'select distinct rao.id_owner,owners.name,sum(bounce_amount) bounce_amount,sum(check_amount) check_amount,sum(in_storage_count) in_storage_count from';
+        $sql = 'select distinct rao.id_owner,owners.name,sum(bounce_amount) bounce_amount,sum(check_amount) check_amount,sum(in_storage_count) in_storage_count,sum(not_in_storage_count) not_in_storage_count from';
         $sql .= '(';
         // 退件单数
-        $sql .= ' select  distinct id_owner,count(1) bounce_amount,0 check_amount,0 in_storage_count from rejected_bills  where 1=1 ';
+        $sql .= ' select  distinct id_owner,count(1) bounce_amount,0 check_amount,0 in_storage_count,0 not_in_storage_count from rejected_bills  where deleted_at is null ';
         $sql .= $condition;
         $sql .= ' UNION ';
         // 审核单数
-        $sql .= ' select  distinct id_owner,0 bounce_amount,count(1) check_amount,0 in_storage_count from rejected_bills where is_checked = 1 ';
+        $sql .= ' select  distinct id_owner,0 bounce_amount,count(1) check_amount,0 in_storage_count,0 not_in_storage_count from rejected_bills where is_checked = 1 and deleted_at is null ';
+        $sql .= $condition;
+        $sql .= ' UNION ';
+        // 未入库数
+        $sql .= ' select  distinct id_owner,0 bounce_amount,0 check_amount,0 in_storage_count,count(1) not_in_storage_count from rejected_bills where is_loaded <> 1 and is_loaded is not null and deleted_at is null ';
         $sql .= $condition;
         $sql .= ' UNION ';
         // 入库单数
-        $sql .= ' select  distinct id_owner,0 bounce_amount,0 check_amount,count(1) in_storage_count from rejected_bills  where is_loaded = 1 ';
+        $sql .= ' select  distinct id_owner,0 bounce_amount,0 check_amount,count(1) in_storage_count,0 not_in_storage_count from rejected_bills  where is_loaded = 1 and deleted_at is null ';
         $sql .= $condition;
         $sql .= ') rao ';
 
-        $sql .= ' left join owners on owners.id = rao.id_owner ';
-        $sql .= ' group by rao.id_owner ';
+        $sql .= ' left join owners on owners.id = rao.id_owner and owners.deleted_at is null';
+        $sql .= ' group by rao.id_owner having owners.name is not null order by bounce_amount desc';
         return  $sql;
     }
 

+ 1 - 1
database/migrations/2020_06_04_162259_add_order_authority.php

@@ -9,7 +9,7 @@ class AddOrderAuthority extends Migration
 {
     protected $authNames=[
         "订单管理",
-        "订单管理-发运",
+        "订单管理-查询",
         "订单管理-批量备注",
     ];
     /**

+ 1 - 1
database/migrations/2020_07_02_135957_add_authority_table_process_rollback.php

@@ -25,7 +25,7 @@ class AddAuthorityTableProcessRollback extends Migration
         });
         Schema::table('waybills',function (Blueprint $table){
             $table->decimal('other_charge',7,3)->nullable()->comment('其他收费,原其他费用为其他支出');
-            $table->text('other_charge_remark')->nullable()->comment('其他费备注');
+            $table->text('other_charge_remark')->nullable()->comment('其他费备注');
         });
     }
 

+ 47 - 0
database/migrations/2020_07_06_111337_change_auth_order_index.php

@@ -0,0 +1,47 @@
+<?php
+
+use App\Authority;
+use App\Unit;
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class ChangeAuthOrderIndex extends Migration
+{
+    protected $changeNames=[
+        ['订单管理-发运','订单管理-查询'],
+    ];
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        //修改或没有则添加
+        foreach ($this->changeNames as $namePack){
+            $authority=Authority::where('name',$namePack[0])->orWhere('name',$namePack[1])->first();
+            if(!$authority){
+                (new Authority(['name'=>$namePack[1],'alias_name'=>$namePack[1]]))->save();
+            }elseif($authority['name']==$namePack[0]){
+                $authority['name']=$namePack[1];
+                $authority->save();
+            }
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //改回旧的
+        foreach ($this->changeNames as $namePack){
+            $authority=Authority::where('name',$namePack[1])->first();
+            $authority['name']=$namePack[0];
+            $authority->save();
+        }
+    }
+}

Разлика између датотеке није приказан због своје велике величине
+ 342 - 216
public/js/app.js


+ 1 - 1
resources/js/utilities/tempTip.js

@@ -3,7 +3,7 @@ const tempTip={
     fadingDuration:4500,
     inputType:'input',
     setDuration:function(milliSec){
-        this.fadingDuration=milliSec;
+        this.fadingDuration=parseInt(milliSec);
     },
     setInputType:function(type){
         this.inputType=type;

+ 3 - 3
resources/views/auth/login.blade.php

@@ -98,10 +98,10 @@
             }
         )
         function loginSubmit() {
-            tempTip.setDuration('99999');
+            tempTip.setDuration(99999);
             tempTip.waitingTip('提交中');
             axios.post('{{ route('login') .'?rand='.microtime(true)}}',vue.inputting).then(function (response) {
-                tempTip.setDuration('2000');
+                tempTip.setDuration(2000);
                 tempTip.cancelWaitingTip();
                 if(response.data.success!==true){
                     if(response.data.errors){
@@ -113,7 +113,7 @@
                         return;
                     }
                 }else{
-                    tempTip.setDuration('99999');
+                    tempTip.setDuration(99999);
                     tempTip.waitingTip('页面跳转中');
                     location=response.data.url;
                 }

+ 2 - 2
resources/views/order/index/menu.blade.php

@@ -4,9 +4,9 @@
     <div class="container-fluid nav3">
         <div class="card menu-third" >
             <ul class="nav nav-pills">
-                @can('订单管理-发运')
+                @can('订单管理-查询')
                     <li class="nav-item">
-                        <a class="nav-link text-dark" href="{{url('order/index/delivering')}}" :class="{active:isActive('delivering',3)}">发运</a>
+                        <a class="nav-link text-dark" href="{{url('order/index/delivering')}}" :class="{active:isActive('delivering',3)}">查询</a>
                     </li> @endcan
             </ul>
         </div>

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

@@ -2,9 +2,9 @@
 <div class="container-fluid nav2" id="nav2">
     <div class="card">
         <ul class="nav nav-pills">
-            @can('订单管理-发运')
+            @can('订单管理-查询')
             <li class="nav-item">
-                <a class="nav-link" href="{{url('order/index/delivering')}}" :class="{active:isActive('index',2)}">查询</a>
+                <a class="nav-link" href="{{url('order/index/delivering')}}" :class="{active:isActive('index',2)}">订单</a>
             </li> @endcan
         </ul>
     </div>

+ 9 - 31
resources/views/rejected/search/analyze.blade.php

@@ -103,22 +103,22 @@
                             @{{ index+1 }}
                         </td>
                         <td>
-                            @{{ rejectedBill.ownerName }}
+                            @{{ rejectedBill.owner_name }}
                         </td>
                         <td class="text-muted">
-                            @{{ rejectedBill.bounceAmount }}
+                            @{{ rejectedBill.bounce_amount }}
                         </td>
                         <td class="text-success font-weight-bold">
-                            @{{ rejectedBill.checkAmount }}
+                            @{{ rejectedBill.check_amount }}
                         </td>
                         <td>
-                            @{{ rejectedBill.bounceAmount-rejectedBill.checkAmount }}
+                            @{{ rejectedBill.bounce_amount-rejectedBill.check_amount }}
                         </td>
                         <td class="text-success font-weight-bold">
-                            @{{ rejectedBill.inStorageCount }}
+                            @{{ rejectedBill.in_storage_count }}
                         </td>
                         <td>
-                            @{{ rejectedBill.bounceAmount-rejectedBill.inStorageCount }}
+                            @{{ rejectedBill.not_in_storage_count }}
                         </td>
                     </tr>
                 </table>
@@ -130,33 +130,11 @@
 @section('lastScript')
     <script>
         // 数据
-        let rejectedBills = [
-            @foreach($rejectedBills as $rejectedBill)
-            {
-                id: '{{$rejectedBill->id_owner}}',
-                ownerName: '{{$rejectedBill->owner_name}}',
-                bounceAmount: '{{$rejectedBill->bounce_amount}}',
-                checkAmount: '{{$rejectedBill->check_amount}}',
-                inStorageCount: '{{$rejectedBill->in_storage_count}}',
-            },
-            @endforeach
-        ];
+        let rejectedBills = {!! $rejectedBills !!};
 
         //  客户
-        let owners = [
-            @foreach($owners as $owner)
-            {
-                id: '{{$owner->id}}', name: '{{$owner->name}}'
-            },
-            @endforeach
-        ];
-        let qualityLabels = [
-            @foreach($qualityLabels as $qualityLabel)
-            {
-                id: '{{$qualityLabel->id}}', name: '{{$qualityLabel->name}}'
-            },
-            @endforeach
-        ];
+        let owners = {!! $owners !!};
+        let qualityLabels = {!! $qualityLabels !!};
             @if(isset($paginateParams))
         let paginateParams ={!! json_encode($paginateParams) !!};
             @endif

+ 27 - 25
resources/views/waybill/edit.blade.php

@@ -87,7 +87,7 @@
                     </div>
                     {{--编辑区--}}
                     <div class="form-group row">
-                        <label  class="col-2 col-form-label text-right text-secondary">收费(元)</label>
+                        <label  class="col-2 col-form-label text-right text-secondary">运输收费(元)</label>
                         <div class="col-8">
                             <input type="text" class="form-control @error('charge') is-invalid @enderror"
                                    id="charge" name="charge" value="@if(old('charge')){{ old('charge') }}@else{{$waybill->charge}}@endif " >
@@ -98,6 +98,32 @@
                                     </span>
                         @enderror
                     </div>
+
+                    <div class="form-group row">
+                        <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他收费(元)</label>
+                        <div class="col-8">
+                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
+                                   name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@else{{$waybill->other_charge}}@endif"  >
+                            @error('other_charge')
+                            <span class="invalid-feedback" role="alert">
+                                        <strong>{{ $message }}</strong>
+                                    </span>
+                            @enderror
+                        </div>
+                    </div>
+                    <div class="form-group row">
+                        <label for="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他收费备注</label>
+                        <div class="col-8">
+                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
+                                   name="other_charge_remark" autocomplete="off" value="@if(old('other_charge_remark')){{ old('other_charge_remark') }}@else{{$waybill->other_charge_remark}}@endif"  >
+                            @error('other_charge_remark')
+                            <span class="invalid-feedback" role="alert">
+                                        <strong>{{ $message }}</strong>
+                                    </span>·
+                            @enderror
+                        </div>
+                    </div>
+
                     <div class="form-group row" style="margin-bottom: 20px">
                         <label for="carrier_id" class="col-2 col-form-label text-right text-primary">承运商 *</label>
                         <div class="col-8" style="position: relative">
@@ -322,30 +348,6 @@
                             @enderror
                         </div>
                     </div>
-                    <div class="form-group row">
-                        <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他费用(元)</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
-                                   name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@else{{$waybill->other_charge}}@endif"  >
-                            @error('other_charge')
-                            <span class="invalid-feedback" role="alert">
-                                        <strong>{{ $message }}</strong>
-                                    </span>
-                            @enderror
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他费用备注</label>
-                        <div class="col-8">
-                            <textarea class="form-control @error('other_charge_remark') is-invalid @enderror"
-                                      name="other_charge_remark" autocomplete="off"  >@if(old('other_charge_remark')){{ old('other_charge_remark') }}@else{{$waybill->other_charge_remark}}@endif</textarea>
-                            @error('other_charge_remark')
-                            <span class="invalid-feedback" role="alert">
-                                        <strong>{{ $message }}</strong>
-                                    </span>
-                            @enderror
-                        </div>
-                    </div>
                     <div class="form-group row">
                         <label for="dispatch_remark" class="col-2 col-form-label text-right text-muted">调度备注</label>
                         <div class="col-8">

+ 4 - 2
resources/views/waybill/index.blade.php

@@ -162,8 +162,9 @@
                     <th class="td-warm">上游单号</th>
                     <th class="td-warm">WMS订单号</th>
                     <th class="td-warm">运单号</th>
-                    <th class="td-warm">其他费用</th>
-                    <th class="td-warm">其他费用备注</th>
+                    <th class="td-warm">运输收费</th>
+                    <th class="td-warm">其他收费</th>
+                    <th class="td-warm">其他收费备注</th>
                     @can('运输管理-图片上传')<th class="td-warm">照片</th>@endcan
                     <th class="td-cool">收件人</th>
                     <th class="td-cool">收件人电话</th>
@@ -248,6 +249,7 @@
                     <td class="td-warm toptd" :title="waybill.remark? '置顶备注:'+waybill.remark :''">@{{waybill.source_bill}}</td>
                     <td class="td-warm" >@{{waybill.wms_bill_number}}</td>
                     <td class="td-warm">@{{waybill.waybill_number}}</td>
+                    <td class="td-warm">@{{waybill.charge}}</td>
                     <td class="td-warm">@{{waybill.other_charge}}</td>
                     <td class="td-warm">@{{waybill.other_charge_remark}}</td>
                     <td class="td-warm">

Разлика између датотеке није приказан због своје велике величине
+ 3 - 0
tests/wcsBatchSeeds.http


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