From 35b1b26f1fe16550b4ee2881a26d599456fe59b4 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 22 一月 2026 17:01:11 +0800
Subject: [PATCH] #i18n翻译

---
 src/main/webapp/static/js/locDetl/locDetl.js |  107 +++++++++++++++++++++++++++++------------------------
 1 files changed, 58 insertions(+), 49 deletions(-)

diff --git a/src/main/webapp/static/js/locDetl/locDetl.js b/src/main/webapp/static/js/locDetl/locDetl.js
index 90e8841..cd899e3 100644
--- a/src/main/webapp/static/js/locDetl/locDetl.js
+++ b/src/main/webapp/static/js/locDetl/locDetl.js
@@ -1,46 +1,46 @@
 var pageCurr;
 function getCol() {
     var cols = [
-        {field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}
-        ,{field: 'storeDate', align: 'center',title: '搴撻緞(澶�)', sort:true}
-        ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栧彿', sort:true}
-        ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', sort:true}
-        ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: true}
-        ,{field: 'batch', align: 'center',title: '鎵瑰彿', width: 300, sort:true}
-        ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
-        ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜'}
-        ,{field: 'specs', align: 'center',title: '瑙勬牸'}
-        ,{field: 'model', align: 'center',title: '浠g爜', hide: true}
-        ,{field: 'color', align: 'center',title: '棰滆壊', hide: true}
-        ,{field: 'brand', align: 'center',title: '鍝佺墝', hide: true}
-        ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true}
-        ,{field: 'price', align: 'center',title: '鍗曚环', hide: true}
-        ,{field: 'sku', align: 'center',title: 'sku', hide: true}
-        ,{field: 'units', align: 'center',title: '鍗曚綅閲�', hide: true}
-        ,{field: 'barcode', align: 'center',title: '鏉$爜', hide: true}
-        ,{field: 'origin', align: 'center',title: '浜у湴', hide: true}
-        ,{field: 'manu', align: 'center',title: '鍘傚', hide: true}
-        ,{field: 'manuDate', align: 'center',title: '鐢熶骇鏃ユ湡', hide: true}
-        ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�', hide: true}
-        ,{field: 'safeQty', align: 'center',title: '瀹夊叏搴撳瓨閲�', hide: true}
-        ,{field: 'weight', align: 'center',title: '鍗曠鍑�閲�', hide: true}
-        ,{field: 'length', align: 'center',title: '鍗曠姣涢噸', hide: true}
-        ,{field: 'volume', align: 'center',title: '鍗曠浣撶Н', hide: true}
-        ,{field: 'threeCode', align: 'center',title: '绠卞瓙灏哄', hide: true}
-        ,{field: 'supp', align: 'center',title: '渚涘簲鍟�', hide: true}
-        ,{field: 'suppCode', align: 'center',title: '渚涘簲鍟嗙紪鐮�', hide: true}
-        ,{field: 'beBatch$', align: 'center',title: '鏄惁鎵规', hide: true}
-        ,{field: 'deadTime', align: 'center',title: '淇濊川鏈�', hide: true}
-        ,{field: 'deadWarn', align: 'center',title: '棰勮澶╂暟', hide: true}
-        ,{field: 'source$', align: 'center',title: '鍒惰喘', hide: true}
-        ,{field: 'check$', align: 'center',title: '瑕佹眰妫�楠�', hide: true}
-        ,{field: 'danger$', align: 'center',title: '鍗遍櫓鍝�', hide: true}
+        {field: 'locNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('location_no') : 'Location No.'}
+        ,{field: 'storeDate', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('age_days') : 'Age(Days)', sort:true}
+        ,{field: 'matnr', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('product_code') : 'Item No.', sort:true}
+        ,{field: 'maktx', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('product_name') : 'Item Name', sort:true}
+        ,{field: 'orderNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('order_no') : 'Order No.', hide: true}
+        ,{field: 'batch', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('batch_no') : 'Batch No.', width: 300, sort:true}
+        ,{field: 'anfme', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('quantity') : 'Quantity'}
+        ,{field: 'zpallet', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('pallet_barcode') : 'Pallet Code'}
+        ,{field: 'specs', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('spec') : 'Spec'}
+        ,{field: 'model', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('code') : 'Code', hide: true}
+        ,{field: 'color', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('color') : 'Color', hide: true}
+        ,{field: 'brand', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('brand') : 'Brand', hide: true}
+        ,{field: 'unit', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('unit') : 'Unit', hide: true}
+        ,{field: 'price', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('price') : 'Price', hide: true}
+        ,{field: 'sku', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('sku') : 'SKU', hide: true}
+        ,{field: 'units', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('unit_qty') : 'Unit Qty', hide: true}
+        ,{field: 'barcode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('barcode') : 'Barcode', hide: true}
+        ,{field: 'origin', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('origin') : 'Origin', hide: true}
+        ,{field: 'manu', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('manufacturer') : 'Manufacturer', hide: true}
+        ,{field: 'manuDate', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('mfg_date') : 'Mfg Date', hide: true}
+        ,{field: 'itemNum', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('item_count') : 'Item Count', hide: true}
+        ,{field: 'safeQty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('safety_stock') : 'Safety Stock', hide: true}
+        ,{field: 'weight', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('net_weight_box') : 'Net Weight/Box', hide: true}
+        ,{field: 'length', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('gross_weight_box') : 'Gross Weight/Box', hide: true}
+        ,{field: 'volume', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('volume_box') : 'Volume/Box', hide: true}
+        ,{field: 'threeCode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('box_size') : 'Box Size', hide: true}
+        ,{field: 'supp', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('supplier') : 'Supplier', hide: true}
+        ,{field: 'suppCode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('supplier_code') : 'Supplier Code', hide: true}
+        ,{field: 'beBatch$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('batch_managed') : 'Batch Managed', hide: true}
+        ,{field: 'deadTime', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('shelf_life') : 'Shelf Life', hide: true}
+        ,{field: 'deadWarn', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('warning_days') : 'Warning Days', hide: true}
+        ,{field: 'source$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('make_buy') : 'Make/Buy', hide: true}
+        ,{field: 'check$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('inspection_reqd') : 'Inspection Reqd', hide: true}
+        ,{field: 'danger$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('hazardous') : 'Hazardous', hide: true}
 
     ];
 
     // cols.push.apply(cols, detlCols);
-    cols.push({field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',hide: true}
-        ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'}
+    cols.push({field: 'modiUser$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('modifier') : 'Modifier',hide: true}
+        ,{field: 'modiTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('modify_time') : 'Modify Time'}
     )
     return cols;
 }
@@ -82,6 +82,9 @@
         done: function(res, curr, count) {
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
+            }
+            if (typeof I18n !== 'undefined') {
+                I18n.updatePage($('.layui-table-tool'));
             }
             pageCurr=curr;
             limit();
@@ -126,7 +129,7 @@
             case 'addData':
                 layer.open({
                     type: 2,
-                    title: '鏂板',
+                    title: I18n.t('add'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -149,9 +152,9 @@
             case 'deleteData':
                 var data = checkStatus.data;
                 if (data.length === 0){
-                    layer.msg('璇烽�夋嫨鏁版嵁');
+                    layer.msg(I18n.t('please_select_data'));
                 } else {
-                    layer.confirm('纭畾鍒犻櫎'+(data.length===1?'姝�':data.length)+'鏉℃暟鎹悧', function(){
+                    layer.confirm(I18n.t('confirm_delete_prefix') + (data.length===1 ? I18n.t('this') : data.length) + I18n.t('confirm_delete_suffix'), function(){
                         $.ajax({
                             url: baseUrl+"/locDetl/delete/auth",
                             headers: {'token': localStorage.getItem('token')},
@@ -173,7 +176,7 @@
                 }
                 break;
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+                layer.confirm(I18n.t('confirm_export_excel'), {shadeClose: true}, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {
@@ -190,7 +193,7 @@
                         'locDetl': exportData,
                         'fields': fields
                     };
-                    var loadIndex = layer.msg('姝e湪瀵煎嚭...', {icon: 16, shade: 0.01, time: false});
+                    var loadIndex = layer.msg(I18n.t('exporting'), {icon: 16, shade: 0.01, time: false});
                     $.ajax({
                         url: baseUrl+"/locDetl/export/auth",
                         headers: {'token': localStorage.getItem('token')},
@@ -223,7 +226,7 @@
             case 'detail':
                 layer.open({
                     type: 2,
-                    title: '璇︽儏',
+                    title: I18n.t('detail'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -242,7 +245,7 @@
             case 'edit':
                 layer.open({
                     type: 2,
-                    title: '淇敼',
+                    title: I18n.t('modify'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -261,11 +264,11 @@
             case 'locNo':
                 var param = top.reObject(data).locNo;
                 if (param === undefined) {
-                    layer.msg("鏃犳暟鎹�");
+                    layer.msg(I18n.t('no_data_found'));
                 } else {
                    layer.open({
                        type: 2,
-                       title: '搴撲綅鍙疯鎯�',
+                       title: I18n.t('location_no') + I18n.t('detail'),
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
@@ -297,11 +300,11 @@
             case 'modiUser':
                 var param = top.reObject(data).modiUser;
                 if (param === undefined) {
-                    layer.msg("鏃犳暟鎹�");
+                    layer.msg(I18n.t('no_data_found'));
                 } else {
                    layer.open({
                        type: 2,
-                       title: '淇敼浜哄憳璇︽儏',
+                       title: I18n.t('modifier_detail'),
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
@@ -333,11 +336,11 @@
             case 'appeUser':
                 var param = top.reObject(data).appeUser;
                 if (param === undefined) {
-                    layer.msg("鏃犳暟鎹�");
+                    layer.msg(I18n.t('no_data_found'));
                 } else {
                    layer.open({
                        type: 2,
-                       title: '鍒涘缓鑰呰鎯�',
+                       title: I18n.t('creator_detail'),
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
@@ -466,6 +469,12 @@
     });
 
 
+    // 鐩戝惉i18n鏇存柊浜嬩欢锛岄噸鏂版覆鏌撹〃鏍�
+    $(document).on('i18n:updated', function() {
+        table.reload('locDetl', {
+            cols: [getCol()]
+        });
+    });
 });
 
 // 鍏抽棴鍔ㄤ綔

--
Gitblit v1.9.1