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

计件宝 添加搜索条件 页面修改

yuang 4 лет назад
Родитель
Сommit
1fd934562e
1 измененных файлов с 65 добавлено и 17 удалено
  1. 65 17
      resources/views/personnel/scanInfo/index.blade.php

+ 65 - 17
resources/views/personnel/scanInfo/index.blade.php

@@ -25,11 +25,11 @@
                 </select>
             </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 +49,15 @@
             <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.userId }}</span></td>
+                <td class="td-warm text-muted"><span>打包员</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,6 +99,27 @@
                 }
             },
             created() {
+                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;
+                }
+
                 this.initData();
                 let url = this.getBaseUrl();
                 url += `/api/device/group/listPage?size=${this.size}&current=${this.current}`;
@@ -105,19 +133,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() {
@@ -156,11 +172,12 @@
 
                     url += `/api/device/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) {
@@ -195,6 +212,37 @@
                         }, 50);
                     });
                 },
+
+                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: '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"},
+
+
+                    ];
+                    new Header({
+                        el: "table",
+                        name: "details",
+                        column: column,
+                        data: this.details.data,
+                        restorationColumn: 'id',
+                        fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 2,
+                        before: [
+                            {colspan: '4', 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>