From 8e943b7104561c3b14cf223016698709c5ade4b5 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 03 二月 2026 15:37:26 +0800
Subject: [PATCH] #pda料箱组托和换码

---
 src/main/webapp/static/js/report/stayTime.js |  150 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 101 insertions(+), 49 deletions(-)

diff --git a/src/main/webapp/static/js/report/stayTime.js b/src/main/webapp/static/js/report/stayTime.js
index f78b8fa..0a2a551 100644
--- a/src/main/webapp/static/js/report/stayTime.js
+++ b/src/main/webapp/static/js/report/stayTime.js
@@ -1,4 +1,18 @@
 var pageCurr;
+function getCol() {
+    var cols = [
+        {field: 'appeTime$', title: typeof I18n !== 'undefined' ? I18n.t('鍏ュ簱鏃堕棿') : '鍏ュ簱鏃堕棿', align: 'center', width: 200}
+        ,{field: 'stay_time', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('婊炵暀澶╂暟') : '婊炵暀澶╂暟'}
+        ,{field: 'loc_no', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('搴撲綅鍙�') : '搴撲綅鍙�'}
+    ];
+    if (typeof getDetlCols === 'function') {
+        cols.push.apply(cols, getDetlCols());
+    } else if (typeof detlCols !== 'undefined') {
+        cols.push.apply(cols, detlCols);
+    }
+    return cols;
+}
+
 layui.use(['table','laydate', 'form'], function(){
     var table = layui.table;
     var $ = layui.jquery;
@@ -8,52 +22,81 @@
 
 
     // 鏁版嵁娓叉煋
-    tableIns = table.render({
-        elem: '#stayTime',
-        headers: {token: localStorage.getItem('token')},
-        url: baseUrl+'/report/viewStayTimeList.action',
-        page: true,
-        limit: 16,
-        toolbar: '#toolbar',
-        cellMinWidth: 50,
-        cols: [[
-            {type: 'checkbox'}
-            ,{field: 'appe_time', title: '鍏ュ簱鏃堕棿', sort: true, align: 'center'}
-            ,{field: 'stay_time', align: 'center',title: '婊炵暀澶╂暟'}
-            ,{field: 'loc_no', align: 'center',title: '搴撲綅鍙�'}
-            ,{field: 'matnr', align: 'center',title: '鐗╂枡'}
-            ,{field: 'maktx', align: 'center',title: '鐗╂枡鎻忚堪'}
-            ,{field: 'lgnum', align: 'center',title: '浠撳簱鍙�'}
-            ,{field: 'tbnum', align: 'center',title: '璇锋眰缂栧彿'}
-            ,{field: 'zmatid', align: 'center',title: '鐗╂枡鏍囩ID'}
-            ,{field: 'werks', align: 'center',title: '宸ュ巶'}
-            ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
-            ,{field: 'altme', align: 'center',title: '鍗曚綅'}
-            ,{field: 'zpallet', align: 'center',title: '鎵樼洏鐮�'}
-            ,{field: 'bname', align: 'center',title: '鐢ㄦ埛ID',fixed: 'right'}
-        ]],
-        request: {
-            pageName: 'curr',
-            pageSize: 'limit'
-        },
-        parseData: function (res) {
-            return {
-                'code': res.code,
-                'msg': res.msg,
-                'count': res.data.total,
-                'data': res.data.records
+    function initTable() {
+        tableIns = table.render({
+            elem: '#stayTime',
+            headers: {token: localStorage.getItem('token')},
+            url: baseUrl+'/report/viewStayTimeList.action',
+            page: true,
+            limit: 16,
+            limits: [16, 30, 50, 100, 200, 500],
+            toolbar: '#toolbar',
+            cellMinWidth: 50,
+            cols: [getCol()],
+            text: {
+                none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+            },
+            request: {
+                pageName: 'curr',
+                pageSize: 'limit'
+            },
+            parseData: function (res) {
+                return {
+                    'code': res.code,
+                    'msg': res.msg,
+                    'count': res.data.total,
+                    'data': res.data.records
+                }
+            },
+            response: {
+                statusCode: 200
+            },
+            done: function(res, curr, count) {
+                if (res.code === 403) {
+                    top.location.href = baseUrl+"/";
+                }
+                pageCurr=curr;
+                limit();
+                if (typeof I18n !== 'undefined') {
+                    I18n.updatePage();
+                    setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
+                }
             }
-        },
-        response: {
-            statusCode: 200
-        },
-        done: function(res, curr, count) {
-            if (res.code === 403) {
-                top.location.href = "/";
-            }
-            pageCurr=curr;
-            limit();
+        });
+    }
+
+    if (typeof I18n !== 'undefined' && I18n.isReady()) {
+        initTable();
+    } else {
+        // Check if I18n is defined but not ready, wait for event
+        if (typeof I18n !== 'undefined') {
+            $(document).on('i18n:ready', initTable);
+        } else {
+            // I18n script not loaded, init anyway
+            initTable();
         }
+    }
+
+    $(document).on('i18n:languageChanged', function () {
+        if (typeof I18n !== 'undefined') {
+            I18n.updatePage();
+        }
+        tableIns.reload({
+            cols: [getCol()],
+            text: {
+                none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+            },
+            done: function (res, curr, count) {
+                if (res.code === 403) {
+                    top.location.href = baseUrl+"/";
+                }
+                pageCurr=curr;
+                limit();
+                if (typeof I18n !== 'undefined') {
+                    setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
+                }
+            }
+        });
     });
 
     // 鐩戝惉鎺掑簭浜嬩欢
@@ -69,12 +112,18 @@
             page: {
                 curr: 1
             },
+            text: {
+                none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+            },
             done: function (res, curr, count) {
                 if (res.code === 403) {
-                    top.location.href = "/";
+                    top.location.href = baseUrl+"/";
                 }
                 pageCurr=curr;
                 limit();
+                if (typeof I18n !== 'undefined') {
+                    setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
+                }
             }
         });
     });
@@ -84,7 +133,7 @@
         var checkStatus = table.checkStatus(obj.config.id);
         switch(obj.event) {
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', function(){
+                layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_export') : '纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {
@@ -108,9 +157,9 @@
                             if (res.code === 200) {
                                 table.exportFile(titles,res.data,'xls');
                             } else if (res.code === 403) {
-                                top.location.href = "/";
+                                top.location.href = baseUrl+"/";
                             } else {
-                                layer.msg(res.msg)
+                                layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                             }
                         }
                     });
@@ -143,7 +192,7 @@
         },
         done: function (res, curr, count) {
             if (res.code === 403) {
-                top.location.href = "/";
+                top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
             if (res.data.length === 0 && count !== 0) {
@@ -156,6 +205,9 @@
                 pageCurr -= 1;
             }
             limit(child);
+            if (typeof I18n !== 'undefined') {
+                setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
+            }
         }
     });
 }

--
Gitblit v1.9.1