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/ioWorks/stockOut.js |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/src/main/webapp/static/js/ioWorks/stockOut.js b/src/main/webapp/static/js/ioWorks/stockOut.js
index 7823220..723efec 100644
--- a/src/main/webapp/static/js/ioWorks/stockOut.js
+++ b/src/main/webapp/static/js/ioWorks/stockOut.js
@@ -2,9 +2,9 @@
 var locDetlData = [];
 function getCol() {
     var cols = [
-        {field: 'count', align: 'center',title: '鍑哄簱鏁伴噺', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
-        ,{field: 'anfme', align: 'center',title: '鍘熸暟閲�'}
-        ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�'}
+        {field: 'count', align: 'center',title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('outbound_quantity') : '鍑哄簱鏁伴噺', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
+        ,{field: 'anfme', align: 'center',title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('original_quantity') : '鍘熸暟閲�'}
+        ,{field: 'locNo', align: 'center',title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('location_no') : '搴撲綅鍙�'}
     ];
     arrRemove(detlCols,  'field', 'anfme');
     cols.push.apply(cols, detlCols);
@@ -43,7 +43,7 @@
         switch (obj.event) {
             case 'outbound':
                 if (data.length === 0){
-                    layer.msg('璇峰厛娣诲姞搴撲綅鐗╂枡');
+                    layer.msg(I18n.t('please_add_location_material'));
                 } else {
                     var locDetls = [];
                     data.forEach(function(elem) {
@@ -62,11 +62,11 @@
                                     limit();
                                     // getOutBound();
                                 }});
-                                layer.msg(res.msg, {icon: 1});
+                                layer.msg(I18n.t(res.msg, res), {icon: 1});
                             } else if (res.code === 403){
                                 top.location.href = baseUrl+"/";
                             } else {
-                                layer.msg(res.msg)
+                                layer.msg(I18n.t(res.msg, res))
                             }
                         }
                     });
@@ -95,13 +95,13 @@
 
     function updateLocDetlData(locNo, matnr, count) {
         if (isNaN(count)) {
-            layer.msg("璇疯緭鍏ユ暟瀛�");
+            layer.msg(I18n.t("please_enter_number"));
         } else {
             if (count > 0) {
                 for (var i=0;i<locDetlData.length;i++){
                     if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){
                         if (count > locDetlData[i]["anfme"]) {
-                            layer.msg("涓嶈兘瓒呰繃鍘熸暟閲�");
+                            layer.msg(I18n.t("cannot_exceed_original_quantity"));
                         } else {
                             locDetlData[i]["count"] = count;
                         }
@@ -109,7 +109,7 @@
                     }
                 }
             } else {
-                layer.msg("鏁伴噺蹇呴』澶т簬闆�");
+                layer.msg(I18n.t("quantity_must_be_greater_than_zero"));
             }
         }
         tableIns.reload({data: locDetlData,done:function (res) {
@@ -127,15 +127,30 @@
             async: false,
             success: function (res) {
                 if (res.code === 200){
+                    var list = res.data;
+                    if (typeof I18n !== 'undefined') {
+                        $.each(list, function(index, item) {
+                            var desc = item.desc;
+                            var start = desc.indexOf('锛�');
+                            var end = desc.indexOf('锛�');
+                            if (start !== -1 && end !== -1) {
+                                var key = desc.substring(start + 1, end);
+                                var translated = I18n.t(key);
+                                if (translated !== key) {
+                                    item.desc = desc.substring(0, start + 1) + translated + desc.substring(end);
+                                }
+                            }
+                        });
+                    }
                     var tpl = $("#takeSiteSelectTemplate").html();
                     var template = Handlebars.compile(tpl);
-                    var html = template(res);
+                    var html = template({data: list});
                     $('#staNoSelect').append(html);
                     form.render('select');
                 } else if (res.code === 403){
                     top.location.href = baseUrl+"/";
                 }else {
-                    layer.msg(res.msg)
+                    layer.msg(I18n.t(res.msg, res))
                 }
             }
         })
@@ -147,7 +162,7 @@
 function getLocDetl() {
     locDetlLayerIdx = layer.open({
         type: 2,
-        title: '鎻愬彇鍑鸿揣鍐呭',
+        title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('extract_delivery_content') : '鎻愬彇鍑鸿揣鍐呭',
         maxmin: true,
         area: [top.detailWidth, top.detailHeight],
         shadeClose: true,

--
Gitblit v1.9.1