Kaynağa Gözat

退件时效表

yuang 4 yıl önce
ebeveyn
işleme
cb7c7d0857

+ 6 - 0
app/Http/Controllers/KpiController.php

@@ -55,6 +55,12 @@ class KpiController extends Controller
         return view('kpi.orderOperationLog.index', compact('ownerIds'));
     }
 
+    public function logisticReturnPunctuality()
+    {
+        $ownerIds = $this->getOwners()->pluck('id');
+        return view('kpi.logisticReturnPunctuality.index', compact('ownerIds'));
+    }
+
     /**
      * @return Builder[]|Collection
      */

+ 206 - 0
resources/views/kpi/logisticReturnPunctuality/index.blade.php

@@ -0,0 +1,206 @@
+@extends('layouts.app')
+@section('title')退件时效表@endsection
+@section('content')
+    <div class="d-none" id="list">
+        <!--查询            -->
+        <div class="row m-3" style="background-color: #fff;">
+            <div class="form-group m-2">
+                <select class="form-control selectpicker" title="分页大小" v-model="size">
+                    <option value="50">50</option>
+                    <option value="100">100</option>
+                    <option value="200">200</option>
+                    <option value="500">500</option>
+                    <option value="1000">1000</option>
+                </select>
+            </div>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="货主">
+                <input v-model="search.ownerName" class="form-control" type="text" step="01" placeholder="货主">
+            </div>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="承运商">
+                <input v-model="search.logisticName" class="form-control" type="text" step="01" placeholder="承运商">
+            </div>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="起始日期">
+                <input v-model="search.startTime" class="form-control" type="date" step="01">
+            </div>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="截止日期">
+                <input v-model="search.endTime" class="form-control" type="date" step="01">
+            </div>
+            <div class="form-group m-2">
+                <button class="form-control btn btn-sm btn-info" @click="searchData()">查询</button>
+            </div>
+
+            <div class="form-group m-2">
+                <button class="form-control btn btn-sm btn-success" @click="downExcel()">导出EXCEL</button>
+            </div>
+        </div>
+
+        <!--            导出-->
+        <span class="dropdown"></span>
+        <!--            表格-->
+        <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="(item,i) in details.data" :key="i">
+                <td class="td-warm text-muted"><span>@{{ i+1 }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.ownerName }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.logisticName }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.totalAmount }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.overTimeCheckAmount }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.unreceiveAmount }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.avgCheckTime }}</span></td>
+            </tr>
+        </table>
+
+        <nav aria-label="...">
+            <ul class="pagination">
+                <li class="page-item" :class="current===1?'disabled':''">
+                    <button class="page-link" @click="pagination('pre')">上一页</button>
+                </li>
+                <li class="page-item" :class="current===details.pages?'disabled':''">
+                    <button class="page-link" @click="pagination('next')">下一页</button>
+                </li>
+            </ul>
+        </nav>
+    </div>
+
+
+@endsection
+
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
+    <script>
+        let vue = new Vue({
+            el: "#list",
+            data: {
+                selectTr: null,
+                details: {
+                    data: [],
+                    total: null,
+                    current: 1,
+                    pages: null,
+                    size: 50,
+                },
+                search: {
+                    startTime: null,
+                    endTime: null,
+                    ownerName: null,
+                    logisticName: null,
+                    ownerIdList: {!! $ownerIds !!}
+                },
+                size: 50,
+                current: 1,
+            },
+            created() {
+                let url = this.getBaseUrl() + `/api/report/logisticReturnTimeliness/list?size=${this.size}&current=${this.current}`
+                this.initSearchDate();
+                this.getPageResult(url);
+            },
+            mounted: function () {
+                $('#list').removeClass('d-none');
+                let column = [
+                    {name: 'ownerName', value: '货主'},
+                    {name: 'logisticName', value: '承运商'},
+                    {name: 'totalAmount', value: '全部'},
+                    {name: 'overTimeCheckAmount', value: '超时登记数'},
+                    {name: 'unreceiveAmount', value: '未签收登记数'},
+                    {name: 'avgCheckTime', value: '平均登记时间(小时)'},
+                ];
+                new Header({
+                    el: "table",
+                    name: "details",
+                    column: column,
+                    data: this.details.data,
+                    restorationColumn: 'addtime',
+                    fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
+                }).init();
+            },
+            methods: {
+                getPageResult(url) {
+                    tempTip.showSuccess('开始查询,请稍后!');
+                    axios.post(url, this.getSearch()).then(res => {
+                        tempTip.showSuccess('查询成功!');
+                        if (res.data.data === undefined) {
+                            this.details.data = [];
+                            this.details.total = 0
+                            this.details.current = 1
+                            this.details.pages = 0
+                            this.details.size = 50;
+                        } else {
+                            this.details.data = res.data.data.list;
+                            this.details.total = res.data.data.page.total;
+                            this.details.current = res.data.data.page.pageNum;
+                            this.details.pages = res.data.data.page.pages
+                            this.details.size = res.data.data.page.pageSize;
+                        }
+                    });
+                },
+                getSearch() {
+                    let search = Object.assign({}, this.search);
+                    search.startTime += ' 00:00:00';
+                    search.endTime += ' 23:59:59';
+                    return search;
+                },
+                //初始化日期为今天和昨天
+                initSearchDate() {
+                    let day1 = new Date();
+                    day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
+                    let s1 = day1.getFullYear() + "-" + ((day1.getMonth() + 1) >= 10 ? (day1.getMonth() + 1) : ('0' + (day1.getMonth() + 1))) + "-" + (day1.getDate() >= 10 ? day1.getDate() : ('0' + day1.getDate()));
+                    //今天的时间
+                    let day2 = new Date();
+                    day2.setTime(day2.getTime());
+                    let s2 = day2.getFullYear() + "-" + ((day2.getMonth() + 1) >= 10 ? (day2.getMonth() + 1) : ('0' + (day2.getMonth() + 1))) + "-" + (day2.getDate() >= 10 ? day2.getDate() : ('0' + day2.getDate()));
+                    this.search.startTime = s1;
+                    this.search.endTime = s2;
+                },
+                searchData() {
+                    this.current = 1;
+                    this.pagination();
+                },
+                //根据环境获取不同的url
+                getBaseUrl() {
+                    let url = null;
+                    let env = "{{ config('app.env') }}";
+                    if (env === 'local') {
+                        url = 'http://127.0.0.1:8111'
+                    } else if (env === 'production') {
+                        url = 'https://stat.baoshi56.com'
+                    }
+                    return url;
+                },
+                pagination(flag) {
+                    if (flag === 'pre' && this.current > 1) {
+                        this.current--;
+                    } else if (flag === 'next' && this.current < this.details.pages) {
+                        this.current++;
+                    }
+                    let url = this.getBaseUrl() + `/api/report/logisticReturnTimeliness/list?size=${this.size}&current=${this.current}`
+                    this.getPageResult(url);
+                },
+                downExcel() {
+                    let url = this.getBaseUrl();
+                    url += '/api/report/logisticReturnTimeliness/export';
+                    let search = Object.assign({}, this.search);
+                    search.startTime += ' 00:00:00';
+                    search.endTime += ' 23:59:59';
+                    axios.post(url, search).then(res => {
+                        if (res.data.code === 200) {
+                            let filename = res.data.data;
+                            let downUrl = this.getBaseUrl() + '/api/report/logisticReturnTimeliness/export/' + filename;
+                            let link = document.createElement('a');
+                            link.style.display = 'none';
+                            link.href = downUrl;
+                            link.download = `${filename}.xlsx`;
+                            document.body.appendChild(link);
+                            link.click();
+                            document.body.removeChild(link);
+                            tempTip.showSuccess('导出成功!');
+                        } else {
+                            tempTip.setDuration(3000);
+                            tempTip.show(res.data.data);
+                        }
+                    })
+                }
+            },
+
+        });
+    </script>
+@endsection

+ 1 - 0
routes/web.php

@@ -1198,6 +1198,7 @@ Route::group(['middleware' => 'auth'], function ($route) {
         Route::get('ownerPcsReport', 'KpiController@ownerPcsReport');
         Route::get('logisticsPunctuality', 'KpiController@logisticsPunctuality');
         Route::get('orderOperationLog', 'KpiController@orderOperationLog');
+        Route::get('logisticReturnPunctuality', 'KpiController@logisticReturnPunctuality');
     });
 });