From 539a56279625242c497b4b4093f2defbb9d80334 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 29 一月 2026 14:05:44 +0800
Subject: [PATCH] #i18n翻译

---
 src/main/webapp/static/js/order/out.js |  199 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 122 insertions(+), 77 deletions(-)

diff --git a/src/main/webapp/static/js/order/out.js b/src/main/webapp/static/js/order/out.js
index be85831..2e324ab 100644
--- a/src/main/webapp/static/js/order/out.js
+++ b/src/main/webapp/static/js/order/out.js
@@ -18,67 +18,107 @@
     var tableMerge = layui.tableMerge;
     var tableX = layui.tableX;
 
-    insTb2 = table.render({
-        elem: '#orderDetlTable',
-        headers: {token: localStorage.getItem('token')},
-        url: baseUrl+'/orderDetl/pakout/list/auth',
-        page: true,
-        limit: 15,
-        limits: [15, 30, 50, 100, 200, 500],
-        toolbar: '#orderDetToolbar',
-        height: 'full-120',
-        where: {order_id: 9999999999},
-        cols: [[
-            {type: 'checkbox'}
-            ,{type: 'numbers', title: '#'}
-            ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl', width: 160}
-            ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栫爜', width: 160}
-            ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', width: 200}
-            ,{field: 'batch', align: 'center',title: '搴忓垪鐮�'}
-            ,{field: 'specs', align: 'center',title: '瑙勬牸'}
-            // ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
-            // ,{field: 'qty', align: 'center',title: '浣滀笟鏁伴噺', style: 'font-weight: bold'}
-            ,{field: 'enableQty', align: 'center',title: '寰呭嚭鏁伴噺', style: 'font-weight: bold'}
-            // ,{field: 'name', align: 'center',title: '鍚嶇О'}
-            // ,{field: 'model', align: 'center',title: '鍨嬪彿'}
-            ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true}
-            ,{field: 'barcode', align: 'center',title: '鍟嗗搧鏉$爜', hide: true}
-            // ,{field: 'supplier', align: 'center',title: '渚涘簲鍟�'}
-            // ,{field: 'unitPrice', align: 'center',title: '鍗曚环'}
-            // ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�'}
-            // ,{field: 'count', align: 'center',title: '鏁伴噺'}
-            // ,{field: 'weight', align: 'center',title: '閲嶉噺'}
-            // ,{field: 'status$', align: 'center',title: '鐘舵��'}
-            // ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳'}
-            // ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
-            // ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
-            // ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
-            // ,{field: 'memo', align: 'center',title: '澶囨敞'}
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 160}
-        ]],
-        request: {
-            pageName: 'curr',
-            pageSize: 'limit'
-        },
-        parseData: function (res) {
-            return {
-                'code': res.code,
-                'msg': res.msg,
-                'count': res.data.total,
-                'data': res.data.records
+    var initTable = function() {
+        insTb2 = table.render({
+            elem: '#orderDetlTable',
+            headers: {token: localStorage.getItem('token')},
+            url: baseUrl+'/orderDetl/pakout/list/auth',
+            page: true,
+            limit: 15,
+            limits: [15, 30, 50, 100, 200, 500],
+            toolbar: '#orderDetToolbar',
+            height: 'full-120',
+            text: {none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鏁版嵁'},
+            where: {order_id: 9999999999},
+            cols: [[
+                {type: 'checkbox'}
+                ,{type: 'numbers', title: '#'}
+                ,{field: 'orderNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('order_no') : '鍗曟嵁缂栧彿', templet: '#orderNoTpl', width: 160}
+                ,{field: 'matnr', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('mat_code') : '鐗╂枡缂栫爜', width: 160}
+                ,{field: 'maktx', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('mat_name') : '鐗╂枡鍚嶇О', width: 200}
+                ,{field: 'batch', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('serial_code') : '鎵瑰彿'}
+                ,{field: 'specs', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('spec') : '瑙勬牸'}
+                // ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
+                // ,{field: 'qty', align: 'center',title: '浣滀笟鏁伴噺', style: 'font-weight: bold'}
+                ,{field: 'enableQty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('outbound_pending_qty') : '寰呭嚭搴撴暟閲�', style: 'font-weight: bold'}
+                // ,{field: 'name', align: 'center',title: '鍚嶇О'}
+                // ,{field: 'model', align: 'center',title: '鍨嬪彿'}
+                ,{field: 'unit', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('unit') : '鍗曚綅', hide: true}
+                ,{field: 'barcode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('barcode') : '鏉$爜', hide: true}
+                // ,{field: 'supplier', align: 'center',title: '渚涘簲鍟�'}
+                // ,{field: 'unitPrice', align: 'center',title: '鍗曚环'}
+                // ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�'}
+                // ,{field: 'count', align: 'center',title: '鏁伴噺'}
+                // ,{field: 'weight', align: 'center',title: '閲嶉噺'}
+                // ,{field: 'status$', align: 'center',title: '鐘舵��'}
+                // ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳'}
+                // ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
+                // ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
+                // ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
+                // ,{field: 'memo', align: 'center',title: '澶囨敞'}
+                ,{fixed: 'right', title: typeof I18n !== 'undefined' ? I18n.t('operation') : '鎿嶄綔', align: 'center', toolbar: '#operate', width: 160}
+            ]],
+    
+            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.isReady()) {
+                    I18n.updatePage();
+                    I18n.updateLayuiPagination();
+                    if (count === 0) {
+                        $('#orderDetlTable+.layui-table-view .layui-table-empty').text(I18n.t('no_data'));
+                    }
+                }
             }
-        },
-        response: {
-            statusCode: 200
-        },
-        done: function(res, curr, count) {
-            if (res.code === 403) {
-                top.location.href = baseUrl+"/";
-            }
-            pageCurr=curr;
-            limit();
-        }
+        });
+    }
+
+    if (typeof I18n !== 'undefined' && I18n.isReady()) {
+        initTable();
+    } else {
+        $(document).on('i18n:ready', function() {
+            initTable();
+        });
+    }
+
+    // 鐩戝惉璇█鍒囨崲
+    $(document).on('i18n:languageChanged', function () {
+        insTb2.reload({
+            text: {none: I18n.t('no_data')},
+            cols: [[
+                {type: 'checkbox'}
+                ,{type: 'numbers', title: '#'}
+                ,{field: 'orderNo', align: 'center',title: I18n.t('order_no'), templet: '#orderNoTpl', width: 160}
+                ,{field: 'matnr', align: 'center',title: I18n.t('mat_code'), width: 160}
+                ,{field: 'maktx', align: 'center',title: I18n.t('mat_name'), width: 200}
+                ,{field: 'batch', align: 'center',title: I18n.t('serial_code')}
+                ,{field: 'specs', align: 'center',title: I18n.t('spec')}
+                ,{field: 'enableQty', align: 'center',title: I18n.t('outbound_pending_qty'), style: 'font-weight: bold'}
+                ,{field: 'unit', align: 'center',title: I18n.t('unit'), hide: true}
+                ,{field: 'barcode', align: 'center',title: I18n.t('barcode'), hide: true}
+                ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width: 160}
+            ]]
+        });
     });
+
 
     /* 琛ㄦ牸2鎼滅储 */
     form.on('submit(sensorTbSearch)', function (data) {
@@ -92,7 +132,7 @@
         var checkStatus = table.checkStatus(obj.config.id).data;
         if (obj.event === 'pakoutPreview') { // 娣诲姞
             if (checkStatus.length === 0) {
-                layer.msg('璇烽�夋嫨鑷冲皯涓�鏉″嚭搴撴槑缁�', {icon: 2});
+                layer.msg(I18n.t('select_at_least_one_outbound_detail'), {icon: 2});
                 return;
             }
             pakoutPreview(checkStatus.map(function (d) {
@@ -101,7 +141,7 @@
         } else if (obj.event === 'del') { // 鍒犻櫎
             var checkRows = table.checkStatus('sensorTable');
             if (checkRows.data.length === 0) {
-                layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+                layer.msg(I18n.t('please_select_data_to_delete'), {icon: 2});
                 return;
             }
             var ids = checkRows.data.map(function (d) {
@@ -143,11 +183,12 @@
                         ,area: ['1200px', '700px']
                         ,shade: 0.5
                         ,shadeClose: false
-                        ,btn: ['绔嬪嵆鍑哄簱', '绋嶅悗澶勭悊']
+                        ,btn: [I18n.t('immediate_outbound'), I18n.t('process_later')]
                         ,btnAlign: 'c'
                         ,moveType: 1 //鎷栨嫿妯″紡锛�0鎴栬��1
                         ,content: $('#pakoutPreviewBox').html()
                         ,success: function(layero, index){
+                            I18n.updatePage($(layero));
                             stoPreTabIdx = table.render({
                                 elem: '#stoPreTab',
                                 data: res.data,
@@ -157,18 +198,20 @@
                                 cellMinWidth: 100,
                                 cols: [[
                                     // {type: 'checkbox', merge: ['orderNo']},
-                                    {field: 'orderNo', title: '鍗曟嵁缂栧彿', merge: true, align: 'center'},
-                                    {field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350},
-                                    {field: 'batch', title: '搴忓垪鐮�', align: 'center'},
-                                    {field: 'anfme', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'},
-                                    {field: 'locNo', title: '璐т綅', align: 'center', width: 100, templet: '#locNoTpl'},
-                                    {field: 'staNos', align: 'center', title: '鍑哄簱绔�', merge: ['locNo'], templet: '#tbBasicTbStaNos'},
+                                    {field: 'orderNo', title: I18n.t('order_no'), merge: true, align: 'center'},
+                                    {field: 'title', title: I18n.t('item'), merge: true, align: 'center', width: 350},
+                                    {field: 'batch', title: I18n.t('serial_code'), align: 'center'},
+                                    {field: 'anfme', title: I18n.t('quantity'), align: 'center', width: 90, style: 'font-weight: bold'},
+                                    {field: 'locNo', title: I18n.t('location'), align: 'center', width: 100, templet: '#locNoTpl'},
+                                    {field: 'staNos', align: 'center', title: I18n.t('station_outbound'), merge: ['locNo'], templet: '#tbBasicTbStaNos'},
                                     {type: 'checkbox', merge: ['locNo']},
                                 ]],
                                 done: function (res) {
                                     tableMerge.render(this);
                                     $('.layui-table-body.layui-table-main').css("overflow", "auto");
                                     tableCache = tableData = table.cache.stoPreTab;
+                                    I18n.updatePage($('.layui-table-view[lay-id="stoPreTab"]'));
+                                    form.render('select');
                                 }
                             });
                             // 淇敼鍑哄簱绔�
@@ -187,7 +230,7 @@
                             form.on('submit(batchModifySta)', function () {
                                 let stoPreTabData = layui.table.checkStatus('stoPreTab').data;
                                 if (stoPreTabData.length < 1) {
-                                    layer.msg("璇疯嚦灏戦�夋嫨涓�鏉′互涓婂悎骞舵暟鎹�", {icon: 7});
+                                    layer.msg(I18n.t('select_at_least_one_merge_data'), {icon: 7});
                                     return false;
                                 }
                                 modifySta(stoPreTabData);
@@ -211,19 +254,21 @@
                                     }
                                 }
                                 if (staBatchSelectVal.length === 0) {
-                                    layer.msg("鍑哄簱绔欐病鏈変氦闆嗭紝鏃犳硶鎵归噺淇敼", {icon: 2});
+                                    layer.msg(I18n.t('no_intersection_outbound_station'), {icon: 2});
                                     return;
                                 }
                                 admin.open({
                                     type: 1,
                                     area: '300px',
                                     offset: 'auto',
-                                    title: '璇烽�夋嫨绔欑偣',
+                                    title: I18n.t('please_select_station'),
                                     content: $('#staBatchSelectDialog').html(),
                                     success: function (layero, ddIndex) {
+                                        I18n.updatePage($(layero));
                                         // 娓叉煋涓嬫媺妗�
                                         let template = Handlebars.compile($('#batchStaSelectTpl').html());
                                         $('#batchSelectStaBox').html(template({list: staBatchSelectVal}));
+                                        I18n.updatePage($('#batchSelectStaBox'));
                                         // 纭
                                         form.on('submit(staBatchSelectConfirm)', function (obj) {
                                             let loadIdx = layer.load(2);
@@ -279,7 +324,7 @@
 
     function pakout(tableCache, layerIndex) {
         // let loadIndex = layer.load(2);
-        notice.msg('姝e湪鐢熸垚鍑哄簱浠诲姟......', {icon: 4});
+        notice.msg(I18n.t('generating_outbound_task'), {icon: 4});
         $.ajax({
             url: baseUrl + "/out/pakout/auth",
             headers: {'token': localStorage.getItem('token')},
@@ -290,13 +335,13 @@
                 notice.destroy();
                 if (res.code === 200) {
                     layer.close(layerIndex);
-                    layer.msg(res.msg, {icon: 1});
+                    layer.msg(I18n.t(res.msg), {icon: 1});
                     insTb.reload({where: null});
                     insTb2.reload({where: null, page: {curr: 1}});
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/";
                 } else {
-                    layer.msg(res.msg, {icon: 2})
+                    layer.msg(I18n.t(res.msg), {icon: 2})
                 }
             }
         });
@@ -306,7 +351,7 @@
 
     /* 鍒犻櫎璁㈠崟 */
     function doDelSensor(obj) {
-        layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
+        layer.confirm(I18n.t('confirm_delete_data'), {
             skin: 'layui-layer-admin',
             shade: .1
         }, function (i) {
@@ -364,7 +409,7 @@
  * 涓�閿嚭搴�
  */
 function autoOut(orderId) {
-    let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+    let loadIndex = layer.msg(I18n.t('requesting'), {icon: 16, shade: 0.01, time: false});
     $.ajax({
         url: baseUrl + "/out/pakout/orderDetlIds/auth",
         headers: {'token': localStorage.getItem('token')},
@@ -377,7 +422,7 @@
             } else if (res.code === 403){
                 top.location.href = baseUrl+"/";
             } else {
-                layer.msg(res.msg, {icon: 2});
+                layer.msg(I18n.t(res.msg), {icon: 2});
             }
         }
     })

--
Gitblit v1.9.1