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/errorWrkMast/errorWrkMast.js |  253 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 156 insertions(+), 97 deletions(-)

diff --git a/src/main/webapp/static/js/errorWrkMast/errorWrkMast.js b/src/main/webapp/static/js/errorWrkMast/errorWrkMast.js
index bff82e3..93bf7ae 100644
--- a/src/main/webapp/static/js/errorWrkMast/errorWrkMast.js
+++ b/src/main/webapp/static/js/errorWrkMast/errorWrkMast.js
@@ -6,7 +6,7 @@
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
-
+    
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#wrkMast',
@@ -19,24 +19,11 @@
         even: true,
         toolbar: '#toolbar',
         cellMinWidth: 50,
-        cols: [[
-            // {type: 'checkbox'}
-            {field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�',sort: true}
-            ,{field: 'ioTime$', align: 'center',title: '宸ヤ綔鏃堕棿',sort: true, hide:true}
-            ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��'}
-            ,{field: 'ioType$', align: 'center',title: '鍏ュ嚭搴撶被鍨�'}
-            ,{field: 'crnNo$', align: 'center',title: '鍫嗗灈鏈�', hide:true}
-            ,{field: 'sourceStaNo$', align: 'center',title: '婧愮珯', hide:true}
-            ,{field: 'staNo$', align: 'center',title: '鐩爣绔�', hide:true}
-            ,{field: 'sourceLocNo$', align: 'center',title: '婧愬簱浣�', hide:true}
-            ,{field: 'locNo$', align: 'center',title: '鐩爣搴撲綅', hide:true}
-            ,{field: 'barcode', align: 'center',title: '鏉$爜', hide:true}
-            ,{field: 'updMk', align: 'center',title: '寮傚父鏍囪'}
-            ,{field: 'errorTime$', align: 'center',title: '寮傚父璁板綍鏃堕棿'}
-            ,{field: 'errorMemo', align: 'center',title: '寮傚父鍐呭'}
-            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide:true}
-            ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true}
-        ]],
+        cols: getCols(),
+        text: {
+            none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+        },
+
         request: {
             pageName: 'curr',
             pageSize: 'limit'
@@ -53,11 +40,97 @@
             statusCode: 200
         },
         done: function(res, curr, count) {
-            if (res.code === 403) {
-                top.location.href = baseUrl+"/";
+                if (res.code === 403) {
+                    top.location.href = baseUrl+"/";
+                }
+                pageCurr=curr;
+                limit();
+                I18n.updatePage();
+                setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
             }
-            pageCurr=curr;
-            limit();
+        });
+
+    function getCols() {
+        return [[
+            // {type: 'checkbox'}
+            {field: 'wrkNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('work_no') : '宸ヤ綔鍙�',sort: true}
+            ,{field: 'ioTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('work_time') : '宸ヤ綔鏃堕棿',sort: true, hide:true}
+            ,{field: 'wrkSts$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('work_status') : '宸ヤ綔鐘舵��'}
+            ,{field: 'ioType$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('io_type') : '浠诲姟绫诲瀷'}
+            ,{field: 'crnNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('crane') : '鍫嗗灈鏈�', hide:true}
+            ,{field: 'sourceStaNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('source_station') : '婧愮珯', hide:true}
+            ,{field: 'staNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('target_station') : '鐩爣绔�', hide:true}
+            ,{field: 'sourceLocNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('source_location') : '婧愬簱浣�', hide:true}
+            ,{field: 'locNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('target_location') : '鐩爣搴撲綅', hide:true}
+            ,{field: 'barcode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('barcode') : '鏉$爜', hide:true}
+            ,{field: 'updMk', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('exception_mark') : '寮傚父鏍囪'}
+            ,{field: 'errorTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('error_record_time') : '寮傚父璁板綍鏃堕棿'}
+            ,{field: 'errorMemo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('err_content') : '寮傚父鍐呭'}
+            ,{field: 'modiUser$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('update_by') : '淇敼浜哄憳', hide:true}
+            ,{field: 'modiTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('update_time') : '淇敼鏃堕棿', hide:true}
+        ]];
+    }
+
+    function getDetlCols() {
+        return [[
+            {type: 'checkbox'}
+            ,{field: 'wrkNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('work_no') : '宸ヤ綔鍙�'}
+            ,{field: 'ioTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('work_time') : '宸ヤ綔鏃堕棿'}
+            ,{field: 'matnr', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('mat_code') : '鍟嗗搧缂栫爜'}
+            ,{field: 'lgnum', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('warehouse_no') : '浠撳簱鍙�'}
+            ,{field: 'tbnum', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('transfer_req_no') : '杞偍璇锋眰缂栧彿'}
+            ,{field: 'tbpos', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('line_item') : '琛岄」鐩�'}
+            ,{field: 'zmatid', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('material_label_id') : '鐗╂枡鏍囩ID'}
+            ,{field: 'maktx', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('material_desc') : '鐗╂枡鎻忚堪'}
+            ,{field: 'werks', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('factory') : '宸ュ巶'}
+            ,{field: 'anfme', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('quantity') : '鏁伴噺'}
+            ,{field: 'altme', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('unit') : '鍗曚綅'}
+            ,{field: 'zpallet', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('pallet_code') : '鎵樼洏鐮�'}
+            ,{field: 'bname', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('user_id') : '鐢ㄦ埛ID'}
+            ,{field: 'memo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('remark') : '澶囨敞'}
+            ,{fixed: 'right', title: typeof I18n !== 'undefined' ? I18n.t('operation') : '鎿嶄綔', align: 'center', toolbar: '#operate', minWidth:200}
+        ]];
+    }
+
+    $(document).on('i18n:languageChanged', function () {
+        I18n.updatePage();
+        initLayDate(true);
+        tableIns.reload({
+            cols: getCols(),
+            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();
+                setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
+            }
+        });
+        if(window.tableIns1) {
+            tableIns1.reload({
+                cols: getDetlCols(),
+                text: {
+                    none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+                },
+                done: function(res, curr, count) {
+                    if (res.code === 403) {
+                        top.location.href = baseUrl+"/";
+                    }
+                    pageCur=curr;
+                    form.on('checkbox(tableCheckbox)', function (data) {
+                        var _index = $(data.elem).attr('table-index')||0;
+                        if(data.elem.checked){
+                            res.data[_index][data.value] = 'Y';
+                        }else{
+                            res.data[_index][data.value] = 'N';
+                        }
+                    });
+                    setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
+                }
+            });
         }
     });
 
@@ -87,6 +160,8 @@
                 }
                 pageCurr=curr;
                 limit();
+                I18n.updatePage();
+                setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
             }
         });
     });
@@ -96,7 +171,7 @@
         var checkStatus = table.checkStatus(obj.config.id);
         switch(obj.event) {
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, 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) {
@@ -148,7 +223,7 @@
                 // 寮瑰眰鏄剧ず
                 layer.open({
                     type: 2,
-                    title: '宸ヤ綔妗f槑缁�',
+                    title: typeof I18n !== 'undefined' ? I18n.t('work_order_detail') : '宸ヤ綔妗f槑缁�',
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: true,
@@ -284,59 +359,52 @@
     });
 
     // 鏃堕棿閫夋嫨鍣�
-    layDate.render({
-        elem: '#ymd\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#wrkDate\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#ioTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#crnStrTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#crnEndTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#plcStrTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#crnPosTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#refIotime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#modiTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#appeTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#errorTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '#logErrTime\\$',
-        type: 'datetime'
-    });
-    layDate.render({
-        elem: '.layui-laydate-range'
-        ,type: 'datetime'
-        ,range: true
-    });
+    function initLayDate(isUpdate) {
+        var lang = (typeof I18n !== 'undefined' && I18n.getLanguage().indexOf('en') > -1) ? 'en' : 'cn';
+        var dateFields = [
+            {elem: '#ymd\\$', type: 'datetime'},
+            {elem: '#wrkDate\\$', type: 'datetime'},
+            {elem: '#ioTime\\$', type: 'datetime'},
+            {elem: '#crnStrTime\\$', type: 'datetime'},
+            {elem: '#crnEndTime\\$', type: 'datetime'},
+            {elem: '#plcStrTime\\$', type: 'datetime'},
+            {elem: '#crnPosTime\\$', type: 'datetime'},
+            {elem: '#refIotime\\$', type: 'datetime'},
+            {elem: '#modiTime\\$', type: 'datetime'},
+            {elem: '#appeTime\\$', type: 'datetime'},
+            {elem: '#errorTime\\$', type: 'datetime'},
+            {elem: '#logErrTime\\$', type: 'datetime'},
+            {elem: '.layui-laydate-range', type: 'datetime', range: true}
+        ];
+
+        $.each(dateFields, function(i, item) {
+             if (isUpdate) {
+                 var $input = $(item.elem);
+                 if ($input.length > 0) {
+                     $input.each(function() {
+                         var $this = $(this);
+                         // 鍏嬮殕鍏冪礌浠ョЩ闄ゆ墍鏈夌粦瀹氱殑浜嬩欢鍜屾暟鎹�
+                         var $clone = $this.clone();
+                         // 绉婚櫎 lay-key 灞炴��
+                         $clone.removeAttr('lay-key');
+                         // 鏇挎崲鍘熸湁鍏冪礌
+                         $this.replaceWith($clone);
+                     });
+                 }
+             }
+             
+             var options = {
+                 elem: item.elem,
+                 type: item.type,
+                 lang: lang
+             };
+             if (item.range) {
+                 options.range = true;
+             }
+             layDate.render(options);
+        });
+    }
+    initLayDate(false);
 
     var pageCur;
     function locDetl(param){
@@ -355,25 +423,10 @@
             even: true,
             toolbar: '#toolbar',
             cellMinWidth: 50,
-            cols: [[
-                {type: 'checkbox'}
-                ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�'}
-                ,{field: 'ioTime$', align: 'center',title: '宸ヤ綔鏃堕棿'}
-                ,{field: 'matnr', align: 'center',title: '鐗╂枡'}
-                ,{field: 'lgnum', align: 'center',title: '浠撳簱鍙�'}
-                ,{field: 'tbnum', align: 'center',title: '杞偍璇锋眰缂栧彿'}
-                ,{field: 'tbpos', align: 'center',title: '琛岄」鐩�'}
-                ,{field: 'zmatid', align: 'center',title: '鐗╂枡鏍囩ID'}
-                ,{field: 'maktx', align: 'center',title: '鐗╂枡鎻忚堪'}
-                ,{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'}
-                ,{field: 'memo', align: 'center',title: '澶囨敞'}
-
-                ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:50}
-            ]],
+            cols: getDetlCols(),
+            text: {
+                none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+            },
             request: {
                 pageName: 'curr',
                 pageSize: 'limit'
@@ -402,6 +455,8 @@
                         res.data[_index][data.value] = 'N';
                     }
                 });
+                I18n.updatePage();
+                setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
             }
         });
     }
@@ -423,6 +478,9 @@
         page: {
             curr: pageCurr
         },
+        text: {
+            none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+        },
         done: function (res, curr, count) {
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
@@ -438,6 +496,7 @@
                 pageCurr -= 1;
             }
             limit(child);
+            setTimeout(function(){ I18n.updateLayuiPagination(); }, 300);
         }
     });
 }

--
Gitblit v1.9.1