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

Merge branch 'master' of ssh://47.103.131.176:10022/var/git/bswas

zhouzhendong 4 лет назад
Родитель
Сommit
66d199e991

+ 4 - 2
app/Http/Controllers/ReceivingDashboardController.php

@@ -3,6 +3,7 @@
 namespace App\Http\Controllers;
 
 use App\Services\UserService;
+use App\UserWorkgroup;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Collection;
 use Illuminate\Http\Request;
@@ -21,7 +22,8 @@ class ReceivingDashboardController extends Controller
     public function punctualityProgress(Request $request)
     {
         $owners = $this->getOwners();
-        return view('store.receivingDashboard.punctualityProgress.index', compact('owners'));
+        $workGroups = UserWorkgroup::query()->get();
+        return view('store.receivingDashboard.punctualityProgress.index', compact('owners', 'workGroups'));
     }
 
 
@@ -32,7 +34,7 @@ class ReceivingDashboardController extends Controller
     {
         /** @var UserService $userService */
         $userService = app('UserService');
-        $ownerIds = $userService->getPermittingOwnerIds(auth()->user());
+        $ownerIds = $userService->getUserHasOwners(auth()->id());
         $owners = \App\Owner::query()->select(['id', 'name', 'code'])->whereIn('id', $ownerIds)->get();
         return $owners;
     }

+ 13 - 17
resources/views/kpi/ownerPcsReport/index.blade.php

@@ -70,8 +70,7 @@
             },
             created() {
                 this.initSearchDate();
-                let url = this.getBaseUrl() + '/api/report/customerOrderQty/listGrouped';
-                this.fetch(url);
+                this.pagination();
             },
             mounted: function () {
                 $('#list').removeClass('d-none');
@@ -111,14 +110,6 @@
                     this.search.startTime = s1;
                     this.search.endTime = s2;
                 },
-                fetch(url) {
-                    axios.post(url, this.search).then(res => {
-                        this.details.data = res.data.data;
-                    });
-                },
-                searchData() {
-                    this.pagination();
-                },
                 //根据环境获取不同的url
                 getBaseUrl() {
                     let url = null;
@@ -130,18 +121,23 @@
                     }
                     return url;
                 },
+                getSearchDate() {
+                    let search = Object.assign({}, this.search);
+                    search.startTime += ' 00:00:00';
+                    search.endTime += ' 00:00:00';
+                    return search;
+                },
+                searchData() {
+                    this.pagination();
+                },
                 pagination() {
+                    tempTip.showSuccess('开始查询,请稍后!');
                     let url = this.getBaseUrl() + '/api/report/customerOrderQty/listGrouped';
-                    function formatSearchDate() {
-                        let search = Object.assign({}, this.search);
-                        search.startTime += ' 00:00:00';
-                        search.endTime += ' 00:00:00';
-                        return search;
-                    }
-                    axios.post(url, formatSearchDate.call(this)).then(res => {
+                    axios.post(url, this.getSearchDate()).then(res => {
                         if (res.data.data === undefined) {
                             this.details.data = [];
                         } else {
+                            tempTip.showSuccess('查询成功!');
                             this.details.data = res.data.data;
                         }
                     });

+ 208 - 87
resources/views/store/receivingDashboard/punctualityProgress/index.blade.php

@@ -13,56 +13,125 @@
                     <option value="1000">1000</option>
                 </select>
             </div>
+            <div class="form-group m-2" style="max-width: 200px !important;">
+                <select v-model="search.customerId" class="selectpicker form-control" title="选择货主"
+                        data-actions-box="true"
+                        data-live-search="true"
+                        data-live-search-placeholder="搜索"
+                >
+                    <option v-for="(v,k) of searchSelects.owners" :value="v.id" :key="v.id">@{{ v.name }}</option>
+                </select>
+            </div>
+            <div class="form-group m-2" style="max-width: 200px !important;">
+                <select v-model="search.workGroupId" class="selectpicker form-control" title="工作组"
+                        data-actions-box="true"
+                        data-live-search="true"
+                        data-live-search-placeholder="搜索"
+                >
+                    <option v-for="(v,k) of searchSelects.workGroups" :value="v.id" :key="v.id">@{{ v.name }}</option>
+                </select>
+            </div>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="货主">
+                <input v-model="search.receiveTaskNo" 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.reservationNo" class="form-control" type="text" step="01" placeholder="预约号">
+            </div>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="货主">
+                <select v-model="search.status" class="selectpicker form-control" title="选择状态"
+                        data-actions-box="true"
+                        data-live-search="true"
+                        data-live-search-placeholder="搜索"
+                >
+                    <option v-for="v of searchSelects.statuses" :value="v" :key="v.id">@{{ v }}</option>
+                </select>
+            </div>
             <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="货主">
-                <input v-model="search.customerName" class="form-control" type="text" step="01" placeholder="货主">
+                <input v-model="search.asnNo" class="form-control" type="text" step="01" placeholder="ASN号">
             </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">
+                <input v-model="search.createSingleStartTime" 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">
+                <input v-model="search.createSingleEndTime" 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"
+        <table class="table table-striped table-bordered table-hover text-nowrap "
                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.erpOrderNo }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.logisticNumber }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.province }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.warehouseCode }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.payTime }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.issueTime }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.checkTime }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.logisticBranch }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.pickupTime }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.transferTime }}</span></td>
-                <td class="td-warm text-muted"><span>@{{ item.receiveTime }}</span></td>
+            <tr v-for="(item,i) in resData.details.data" :key="i">
+                <td class="td-warm text-muted "><span>@{{ i+1 }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.receiveTaskNo }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.status }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.asnNo }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.reservationNo }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.customerName }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.workGroupName }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.expectancyAmount }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.putawayAmount }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.receiveAverageConsumeDuration }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.putawayAverageConsumeDuration }}</span></td>
+                <td class="td-warm text-muted">
+                    <button @click="showDetail(item.receiveTaskNo,item.reservationNo,item.asnNo)" type="button"
+                            class="btn btn-primary" data-toggle="modal"
+                            data-target="#staticBackdrop">
+                        查看明细
+                    </button>
+                </td>
             </tr>
         </table>
 
-        <nav aria-label="...">
+        <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':''">
+                <li class="page-item" :class="current===resData.details.pages?'disabled':''">
                     <button class="page-link" @click="pagination('next')">下一页</button>
                 </li>
             </ul>
         </nav>
+
+
+        <!-- Modal -->
+        <div class="modal fade" id="staticBackdrop" tabindex="-1" aria-labelledby="staticBackdropLabel"
+             aria-hidden="true">
+            <div class="modal-dialog modal-xl" style="max-width:90% !important;">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <h5 class="modal-title" id="staticBackdropLabel">明细</h5>
+                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                            <span aria-hidden="true">&times;</span>
+                        </button>
+                    </div>
+                    <div class="modal-body">
+                        <!-- Scrollable modal -->
+                        <div class="modal-dialog-scrollable">
+                            <table class="table table-sm text-nowrap"
+                                   style="background: #fff;" id="table_inner">
+                                <tr v-for="(item,i) in resData.itemDetail" :key="i" >
+                                    <td class="td-warm text-muted in"><span>@{{ i+1 }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.receiveTaskNo }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.asnNo }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.reservationNo }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.container }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.commName }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.commSku }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.commBarcode }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.receiveQty }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.putawayTime }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.receiveConsumeDuration }}</span></td>
+                                    <td class="td-warm text-muted"><span>@{{ item.putawayConsumeDuration }}</span></td>
+                                </tr>
+                            </table>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
     </div>
 
 
@@ -71,52 +140,114 @@
 @section('lastScript')
     <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
     <script>
+        /**
+         * @Description: 轮询执行方法
+         * @param {func} function 需要轮询的方法
+         * @param {time} number 轮询间隔,默认1s
+         * @param {endTime} number 可轮询时间, 为空时一直轮询
+         * @param {immedaite} boolean 第一次是否立即执行
+         * @author: XuLijuan
+         */
+        const pollingFunction = (func, time = 1000, endTime, immediate = false) => {
+            immediate && func(); //是否立即执行一次,由实际决定
+            const startTime = new Date().getTime();
+            const pollTimer = setInterval(() => {
+                const nowTime = new Date().getTime();
+                if (endTime && nowTime - startTime >= endTime) {
+                    pollTimer && clearInterval(pollTimer);
+                }
+                func();
+            }, time);
+            return pollTimer;
+        };
         let vue = new Vue({
             el: "#list",
             data: {
-                selectTr: null,
-                details: {
-                    data: [],
-                    total: null,
-                    current: 1,
-                    pages: null,
-                    size: 50,
+                timer: null,
+                resData: {
+                    details: {
+                        data: [],
+                        total: null,
+                        current: 1,
+                        pages: null,
+                        size: 50,
+                    },
+                    itemDetail: null,
+                },
+                searchSelects: {
+                    owners: {!! $owners !!},
+                    workGroups: {!! $workGroups !!},
+                    statuses: ['创建', '进行中', '完成', '超时完成'],
                 },
+                selectTr: null,
                 search: {
-                    startTime: null,
-                    endTime: null,
-                    customerName: null,
-                    ownerIdList: {!! $ownerIds !!}
+                    customerId: null,
+                    receiveTaskNo: null,
+                    reservationNo: null,
+                    status: null,
+                    asnNo: null,
+                    createSingleStartTime: null,
+                    createSingleEndTime: null,
+                    finishedReceiveTime: null,
+                    receivePerson: null,
+                    workGroupId: null,
                 },
                 size: 50,
                 current: 1,
             },
             created() {
-                let url = this.getBaseUrl() + `/api/report/orderOperationLog/list?size=${this.size}&current=${this.current}`
+                let url = this.getBaseUrl() + `/api/receiveBoard/agingScheduleList?size=${this.size}&current=${this.current}`
                 this.initSearchDate();
                 this.getPageResult(url);
             },
+            beforeDestroy() {
+                clearInterval(this.timer)
+            },
             mounted: function () {
                 $('#list').removeClass('d-none');
-                //ASN号	预约号	容器号	商品名称	SKU	条码	收货数量	收货任务生成时间	收货任务完结时间	上架时间
+                pollingFunction(this.searchData, 1000 * 30)
 
                 let column = [
-                    {name: 'ownerName', value: 'ASN号'},
-                    {name: 'erpOrderNo', value: '预约号'},
-                    {name: 'logisticNumber', value: '容器号'},
-                    {name: 'province', value: '商品名称'},
-                    {name: 'warehouseCode', value: 'SKU'},
-                    {name: 'payTime', value: '条码'},
-                    {name: 'issueTime', value: '收货数量'},
-                    {name: 'checkTime', value: '收货任务生成时间'},
-                    {name: 'logisticBranch', value: ' 收货任务完结时间'},
-                    {name: 'pickupTime', value: '上架时间'},
+                    {name: 'receiveTaskNo', value: '收货任务号'},
+                    {name: 'status', value: '任务状态'},
+                    {name: 'asnNo', value: 'ASN号'},
+                    {name: 'reservationNo', value: '预约号'},
+                    {name: 'customerName', value: '货主'},
+                    {name: 'workGroupName', value: '操作组'},
+                    {name: 'expectancyAmount', value: '预期总数'},
+                    {name: 'putawayAmount', value: '已上架总数'},
+                    {name: 'receiveAverageConsumeDuration', value: ' 收货平均耗时'},
+                    {name: 'putawayAverageConsumeDuration', value: '上架平均耗时'},
+
                 ];
                 new Header({
                     el: "table",
                     name: "details",
                     column: column,
-                    data: this.details.data,
+                    data: this.resData.details.data,
+                    restorationColumn: 'addtime',
+                    fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
+                }).init();
+
+                let column2 = [
+                    {name: 'receiveTaskNo', value: '收货任务号'},
+                    {name: 'asnNo', value: 'ASN号'},
+                    {name: 'reservationNo', value: '预约号'},
+                    {name: 'container', value: '容器号'},
+                    {name: 'commName', value: '商品名称'},
+                    {name: 'commSku', value: 'SKU'},
+                    {name: 'commBarcode', value: '条码'},
+                    {name: 'receiveQty', value: '收货数量'},
+                    {name: 'putawayTime', value: '上架时间'},
+                    {name: 'receiveConsumeDuration', value: '收货耗时'},
+                    {name: 'putawayConsumeDuration', value: '上架耗时'},
+
+                ];
+                new Header({
+                    el: "table_inner",
+                    name: "details",
+                    column: column2,
+                    data: this.resData.details.data,
                     restorationColumn: 'addtime',
                     fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
                 }).init();
@@ -126,18 +257,18 @@
                     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;
+                        if (res.data.code !== 200) {
+                            this.resData.details.data = [];
+                            this.resData.details.total = 0
+                            this.resData.details.current = 1
+                            this.resData.details.pages = 0
+                            this.resData.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;
+                            this.resData.details.data = res.data.data.list;
+                            this.resData.details.total = res.data.data.page.total;
+                            this.resData.details.current = res.data.data.page.pageNum;
+                            this.resData.details.pages = res.data.data.page.pages
+                            this.resData.details.size = res.data.data.page.pageSize;
                         }
                     });
                 },
@@ -145,6 +276,7 @@
                     let search = Object.assign({}, this.search);
                     search.startTime += ' 00:00:00';
                     search.endTime += ' 23:59:59';
+                    console.log(search);
                     return search;
                 },
                 //初始化日期为今天和昨天
@@ -168,45 +300,34 @@
                     let url = null;
                     let env = "{{ config('app.env') }}";
                     if (env === 'local') {
-                        url = 'http://127.0.0.1:8111'
+                        url = 'http://127.0.0.1:8116'
                     } else if (env === 'production') {
-                        url = 'https://stat.baoshi56.com'
+                        url = 'https://device.baoshi56.com'
                     }
                     return url;
                 },
                 pagination(flag) {
                     if (flag === 'pre' && this.current > 1) {
                         this.current--;
-                    } else if (flag === 'next' && this.current < this.details.pages) {
+                    } else if (flag === 'next' && this.current < this.resData.details.pages) {
                         this.current++;
                     }
-                    let url = this.getBaseUrl() + `/api/report/orderOperationLog/list?size=${this.size}&current=${this.current}`
+                    let url = this.getBaseUrl() + `/api/receiveBoard/agingScheduleList?size=${this.size}&current=${this.current}`
                     this.getPageResult(url);
                 },
-                downExcel() {
-                    let url = this.getBaseUrl();
-                    url += '/api/report/orderOperationLog/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/orderOperationLog/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('导出成功!');
+                showDetail(receiveTaskNo, reservationNo, asnNo) {
+                    let url = this.getBaseUrl() + `/api/receiveBoard/agingScheduleDetail?receiveTaskNo=${receiveTaskNo}&reservationNo=${reservationNo}&asnNo=${asnNo}`
+                    tempTip.showSuccess('开始查询,请稍后!');
+                    axios.get(url, this.getSearch()).then(res => {
+                        tempTip.showSuccess('查询成功!');
+                        if (res.data.code !== 200) {
+                            this.resData.itemDetail = null;
                         } else {
-                            tempTip.setDuration(3000);
-                            tempTip.show(res.data.data);
+                            this.resData.itemDetail = res.data.data;
                         }
-                    })
+                    });
                 }
+
             },
 
         });

+ 4 - 4
resources/views/store/receivingDashboard/receivingTableList/index.blade.php

@@ -92,7 +92,7 @@
         <!-- Modal -->
         <div class="modal fade" id="staticBackdrop" tabindex="-1" aria-labelledby="staticBackdropLabel"
              aria-hidden="true">
-            <div class="modal-dialog modal-xl">
+            <div class="modal-dialog modal-xl" style="max-width:90% !important;">
                 <div class="modal-content modal-xl">
                     <div class="modal-header modal-xl">
                         <h5 class="modal-title" id="staticBackdropLabel">明细</h5>
@@ -103,7 +103,7 @@
                     <div class="modal-body modal-xl">
                         <!-- Scrollable modal -->
                         <div class="modal-dialog modal-xl modal-dialog-scrollable">
-                            <table class="table table-striped table-bordered table-hover text-nowrap waybill-table"
+                            <table class="table table-sm"
                                    style="background: #fff;" id="table_inner">
                                 <tr v-for="(item,i) in resData.itemDetail" :key="i">
                                     <td class="td-warm text-muted"><span>@{{ i+1 }}</span></td>
@@ -242,7 +242,7 @@
                     tempTip.showSuccess('开始查询,请稍后!');
                     axios.post(url, this.getSearch()).then(res => {
                         tempTip.showSuccess('查询成功!');
-                        if (res.data.data === undefined) {
+                        if (res.data.code !== 200) {
                             this.resData.details.data = [];
                             this.resData.details.total = 0
                             this.resData.details.current = 1
@@ -305,7 +305,7 @@
                     tempTip.showSuccess('开始查询,请稍后!');
                     axios.get(url, this.getSearch()).then(res => {
                         tempTip.showSuccess('查询成功!');
-                        if (res.data.data === undefined) {
+                        if (res.data.code !== 200) {
                             this.resData.itemDetail = null;
                         } else {
                             this.resData.itemDetail = res.data.data;