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/inOut.js |   61 +++++++++++++++++++++++-------
 1 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/src/main/webapp/static/js/report/inOut.js b/src/main/webapp/static/js/report/inOut.js
index add532f..c8b7312 100644
--- a/src/main/webapp/static/js/report/inOut.js
+++ b/src/main/webapp/static/js/report/inOut.js
@@ -7,6 +7,17 @@
     var form = layui.form;
 
 
+    // Define columns function
+    function getCols() {
+        return [[
+            {field: 'ymd', align: 'center', title: typeof I18n !== 'undefined' ? I18n.t('date') : '鏃ユ湡'}
+            ,{field: 'source_sta_no', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('source_station') : '绔欑偣'}
+            ,{field: 'sto_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('inbound_count') : '鍏ュ簱娆℃暟'}
+            ,{field: 'ret_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('outbound_count') : '鍑哄簱娆℃暟'}
+            ,{field: 'total_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('total_count') : '鍏ュ嚭鎬绘暟'}
+        ]];
+    }
+
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#inOut',
@@ -16,14 +27,10 @@
         limit: 10,
         toolbar: '#toolbar',
         cellMinWidth: 50,
-        cols: [[
-            {type: 'checkbox'}
-            ,{field: 'ymd', align: 'center', title: '鏃ユ湡', sort: true}
-            ,{field: 'source_sta_no', align: 'center',title: '绔欑偣'}
-            ,{field: 'sto_qty', align: 'center',title: '鍏ュ簱娆℃暟'}
-            ,{field: 'ret_qty', align: 'center',title: '鍑哄簱娆℃暟'}
-            ,{field: 'total_qty', align: 'center',title: '鍏ュ嚭鎬绘暟'}
-        ]],
+        text: {
+            none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+        },
+        cols: getCols(),
         request: {
             pageName: 'curr',
             pageSize: 'limit'
@@ -41,11 +48,36 @@
         },
         done: function(res, curr, count) {
             if (res.code === 403) {
-                top.location.href = "/";
+                top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
             limit();
+            if (typeof I18n !== 'undefined') {
+                I18n.updateLayuiPagination();
+                I18n.updatePage();
+                $('#btn-export').text(I18n.t('export'));
+            }
         }
+    });
+
+    // Listen for language change
+    $(document).on('i18n:languageChanged', function() {
+        tableIns.reload({
+            cols: getCols(),
+            text: {
+                none: I18n.t('no_data')
+            },
+            done: function(res, curr, count) {
+                if (res.code === 403) {
+                    top.location.href = baseUrl+"/";
+                }
+                pageCurr=curr;
+                limit();
+                I18n.updateLayuiPagination();
+                I18n.updatePage();
+                $('#btn-export').text(I18n.t('export'));
+            }
+        });
     });
 
     // 鐩戝惉鎺掑簭浜嬩欢
@@ -63,7 +95,7 @@
             },
             done: function (res, curr, count) {
                 if (res.code === 403) {
-                    top.location.href = "/";
+                    top.location.href = baseUrl+"/";
                 }
                 pageCurr=curr;
                 limit();
@@ -76,7 +108,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) {
@@ -96,14 +128,13 @@
                         contentType:'application/json;charset=UTF-8',
                         method: 'POST',
                         success: function (res) {
-                            console.log(res);
                             layer.closeAll();
                             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})
                             }
                         }
                     });
@@ -136,7 +167,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) {

--
Gitblit v1.9.1