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

device 的代码拆分到report 前端页面修改地址

yuang 4 лет назад
Родитель
Сommit
baee43cedd

+ 7 - 30
resources/views/order/scanInfo/index.blade.php

@@ -15,15 +15,10 @@
                 </select>
             </div>
             <!--用户-->
-            <div class="form-group m-2" style="max-width: 200px !important;">
-                <select v-model="search.userIds" class="selectpicker form-control" multiple title="选择用户"
-                        data-actions-box="true"
-                        data-live-search="true"
-                        data-live-search-placeholder="搜索"
-                >
-                    <option v-for="(v,k) of users" :value="v.id" :key="v.id">@{{ v.name }}</option>
-                </select>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="用户名">
+                <input v-model="search.username" class="form-control" type="text" 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">
             </div>
@@ -105,9 +100,8 @@
                 }
             },
             created() {
-                this.initData();
                 let url = this.getBaseUrl();
-                url += `/api/device/listPage?size=${this.size}&current=${this.current}`;
+                url += `/api/report/scanInfo/listPage?size=${this.size}&current=${this.current}`;
                 axios.post(url, this.search).then(res => {
                     this.details.data = res.data.data.list;
                     this.details.total = res.data.data.page.total;
@@ -156,9 +150,9 @@
                     let url = '';
                     let env = "{{ config('app.env') }}";
                     if (env === 'local') {
-                        url = 'http://127.0.0.1:8116'
+                        url = 'http://127.0.0.1:8111'
                     } else if (env === 'production') {
-                        url = 'https://device.baoshi56.com'
+                        url = 'https://stat.baoshi56.com'
                     }
                     return url;
                 },
@@ -172,7 +166,7 @@
                     console.log(env);
                     let url = this.getBaseUrl();
 
-                    url += `/api/device/listPage?size=${this.size}&current=${this.current}`;
+                    url += `/api/report/scanInfo/listPage?size=${this.size}&current=${this.current}`;
                     let search = Object.assign({}, this.search)
                     if (search.startTime != null && search.startTime !== '') {
                         search.startTime += " 00:00:00";
@@ -196,23 +190,6 @@
                         }
                     });
                 },
-
-                //初始化数据 大类型和小类型的初始化,完成后才可以渲染页面
-                initData() {
-                    let names = ['device/users'];
-                    let requests = names.map(name => axios.get(this.getBaseUrl() + "/api/" + name));
-                    Promise.all(requests).then(resList => {
-                        for (let res of resList) {
-                            if ((res.config.url + '').endsWith('users')) {
-                                this.users = res.data.data;
-                            }
-                        }
-                        setTimeout(() => {
-                            $(".selectpicker").selectpicker('refresh');
-                            $('#list').removeClass('d-none');
-                        }, 50);
-                    });
-                },
             },
         });
     </script>

+ 70 - 45
resources/views/personnel/scanInfo/index.blade.php

@@ -15,21 +15,16 @@
                 </select>
             </div>
             <!--用户-->
-            <div class="form-group m-2" style="max-width: 200px !important;">
-                <select v-model="search.userIds" class="selectpicker form-control" multiple title="选择用户"
-                        data-actions-box="true"
-                        data-live-search="true"
-                        data-live-search-placeholder="搜索"
-                >
-                    <option v-for="(v,k) of users" :value="v.id" :key="v.id">@{{ v.name }}</option>
-                </select>
+            <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="用户名">
+                <input v-model="search.username" class="form-control" type="text" 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">
+                <input v-model="search.startTime" class="form-control" type="datetime-local" 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">
+                <input v-model="search.endTime" class="form-control" type="datetime-local" step="01">
             </div>
 
             <div class="form-group m-2">
@@ -49,8 +44,16 @@
             <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.username }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.empno }}</span></td>
+                <td class="td-warm text-muted"><span>打包员</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.customerName }}</span></td>
                 <td class="td-warm text-muted"><span>@{{ item.count }}</span></td>
                 <td class="td-warm text-muted"><span>@{{ item.commodityNum }}</span></td>
+                <td class="td-warm text-muted"><span>0</span></td>
+                <td class="td-warm text-muted"><span>0</span></td>
+                <td class="td-warm text-muted"><span>0</span></td>
+                <td class="td-warm text-muted"><span>0</span></td>
+
             </tr>
         </table>
         <nav aria-label="...">
@@ -92,9 +95,29 @@
                 }
             },
             created() {
-                this.initData();
+                Date.prototype.format = function(fmt) {
+                    var o = {
+                        "M+": this.getMonth() + 1, //月份
+                        "d+": this.getDate(), //日
+                        "h+": this.getHours(), //小时
+                        "m+": this.getMinutes(), //分
+                        "s+": this.getSeconds(), //秒
+                        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+                        "S": this.getMilliseconds() //毫秒
+                    };
+                    if (/(y+)/.test(fmt)) {
+                        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+                    }
+                    for (var k in o) {
+                        if (new RegExp("(" + k + ")").test(fmt)) {
+                            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+                        }
+                    }
+                    return fmt;
+                }
+
                 let url = this.getBaseUrl();
-                url += `/api/device/group/listPage?size=${this.size}&current=${this.current}`;
+                url += `/api/report/scanInfo/group/listPage?size=${this.size}&current=${this.current}`;
                 axios.post(url, this.search).then(res => {
                     this.details.data = res.data.data.list;
                     this.details.total = res.data.data.page.total;
@@ -105,19 +128,7 @@
             },
             mounted: function () {
                 $('#list').removeClass('d-none');
-                let column = [
-                    {name: 'username', value: '用户'},
-                    {name: 'count', value: '快递数量'},
-                    {name: 'commodity_num', value: '商品数量'},
-                ];
-                new Header({
-                    el: "table",
-                    name: "details",
-                    column: column,
-                    data: this.details.data,
-                    restorationColumn: 'addtime',
-                    fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
-                }).init();
+                this.rendingHeader();
             },
             methods: {
                 resetSearch() {
@@ -138,9 +149,9 @@
                     let url = '';
                     let env = "{{ config('app.env') }}";
                     if (env === 'local') {
-                        url = 'http://127.0.0.1:8116'
+                        url = 'http://127.0.0.1:8111'
                     } else if (env === 'production') {
-                        url = 'https://device.baoshi56.com'
+                        url = 'https://stat.baoshi56.com'
                     }
                     return url;
                 },
@@ -154,13 +165,13 @@
                     console.log(env);
                     let url = this.getBaseUrl();
 
-                    url += `/api/device/group/listPage?size=${this.size}&current=${this.current}`;
+                    url += `/api/report/scanInfo/group/listPage?size=${this.size}&current=${this.current}`;
                     let search = Object.assign({}, this.search)
                     if (search.startTime != null && search.startTime !== '') {
-                        search.startTime += " 00:00:00";
+                        search.startTime = new Date(Date.parse(search.startTime)).format("yyyy-MM-dd hh:mm:ss");
                     }
                     if (search.endTime != null && search.endTime !== '') {
-                        search.endTime += " 23:59:59";
+                        search.endTime =new Date(Date.parse(search.endTime)).format("yyyy-MM-dd hh:mm:ss");
                     }
                     axios.post(url, search).then(res => {
                         if (res.data.data === undefined) {
@@ -178,24 +189,38 @@
                         }
                     });
                 },
+                rendingHeader() {
+                    let column = [
+                        {name: 'name', value: '姓名', neglect: true, class: "td-cool"},
+                        {name: 'work_code', value: '工号', neglect: true, class: "td-warm"},
+                        {name: 'work_type', value: '岗位', neglect: true, class: "td-warm"},
+                        {name: 'owner_name', value: '货主', neglect: true, class: "td-warm"},
+                        {name: 'package_order_num', value: '订单数', neglect: true, class: "td-warm"},
+                        {name: 'package_commodity_num', value: '单品数', neglect: true, class: "td-warm"},
+                        {name: 'invoice_order_num', value: '订单数', neglect: true, class: "td-warm"},
+                        {name: 'invoice_commodity_num', value: '单品数', neglect: true, class: "td-warm"},
+                        {name: 'scan_order_num', value: '订单数', neglect: true, class: "td-warm"},
+                        {name: 'scan_commodity_num', value: '单品数', neglect: true, class: "td-warm"},
 
-                //初始化数据 大类型和小类型的初始化,完成后才可以渲染页面
-                initData() {
-                    let names = ['device/users'];
-                    let requests = names.map(name => axios.get(this.getBaseUrl() + "/api/" + name));
-                    Promise.all(requests).then(resList => {
-                        for (let res of resList) {
-                            if ((res.config.url + '').endsWith('users')) {
-                                this.users = res.data.data;
-                            }
-                        }
-                        setTimeout(() => {
-                            $(".selectpicker").selectpicker('refresh');
-                            $('#list').removeClass('d-none');
-                        }, 50);
-                    });
+
+                    ];
+                    new Header({
+                        el: "table",
+                        name: "details",
+                        column: column,
+                        data: this.details.data,
+                        restorationColumn: 'id',
+                        fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 2,
+                        before: [
+                            {colspan: '5', value: '员工信息', class: "table-header-layer-1"},
+                            {colspan: '2', value: '打包业绩', class: "table-header-layer-1"},
+                            {colspan: '2', value: '配货业绩', class: "table-header-layer-1"},
+                            {colspan: '2', value: '扫描业绩', class: "table-header-layer-1"},
+                        ],
+                    }).init();
                 },
             },
         });
     </script>
 @endsection
+