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/locDetl/locDetl.js |  124 +++++++++++++++++++++++++++++++++-------
 1 files changed, 101 insertions(+), 23 deletions(-)

diff --git a/src/main/webapp/static/js/locDetl/locDetl.js b/src/main/webapp/static/js/locDetl/locDetl.js
index eca2026..2b8b618 100644
--- a/src/main/webapp/static/js/locDetl/locDetl.js
+++ b/src/main/webapp/static/js/locDetl/locDetl.js
@@ -1,9 +1,46 @@
 var pageCurr;
 function getCol() {
-    var cols = [{field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}];
-    cols.push.apply(cols, detlCols);
-    cols.push({field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',hide: true}
-        ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'}
+    var cols = [
+        {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: 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;
 }
@@ -46,6 +83,12 @@
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
             }
+            if (typeof I18n !== 'undefined') {
+                I18n.updatePage($('.layui-table-tool'));
+                setTimeout(function() {
+                    I18n.updateLayuiPagination();
+                }, 50);
+            }
             pageCurr=curr;
             limit();
             form.on('checkbox(tableCheckbox)', function (data) {
@@ -76,6 +119,12 @@
                 if (res.code === 403) {
                     top.location.href = baseUrl+"/";
                 }
+                if (typeof I18n !== 'undefined') {
+                    I18n.updatePage($('.layui-table-tool'));
+                    setTimeout(function() {
+                        I18n.updateLayuiPagination();
+                    }, 50);
+                }
                 pageCurr=curr;
                 limit();
             }
@@ -89,7 +138,7 @@
             case 'addData':
                 layer.open({
                     type: 2,
-                    title: '鏂板',
+                    title: I18n.t('add'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -112,9 +161,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')},
@@ -128,7 +177,7 @@
                                 } else if (res.code === 403){
                                     top.location.href = baseUrl+"/";
                                 } else {
-                                    layer.msg(res.msg)
+                                    layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                 }
                             }
                         })
@@ -136,7 +185,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) {
@@ -153,6 +202,7 @@
                         'locDetl': exportData,
                         'fields': fields
                     };
+                    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')},
@@ -161,13 +211,14 @@
                         contentType:'application/json;charset=UTF-8',
                         method: 'POST',
                         success: function (res) {
+                            layer.close(loadIndex);
                             layer.closeAll();
                             if (res.code === 200) {
                                 table.exportFile(titles,res.data,'xls');
                             } else if (res.code === 403) {
                                 top.location.href = baseUrl+"/";
                             } else {
-                                layer.msg(res.msg)
+                                layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                             }
                         }
                     });
@@ -184,7 +235,7 @@
             case 'detail':
                 layer.open({
                     type: 2,
-                    title: '璇︽儏',
+                    title: I18n.t('detail'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -203,7 +254,7 @@
             case 'edit':
                 layer.open({
                     type: 2,
-                    title: '淇敼',
+                    title: I18n.t('modify'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -222,11 +273,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,
@@ -247,7 +298,7 @@
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
-                                       layer.msg(res.msg)
+                                       layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                    }
                                }
                            })
@@ -258,11 +309,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,
@@ -283,7 +334,7 @@
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
-                                       layer.msg(res.msg)
+                                       layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                    }
                                }
                            })
@@ -294,11 +345,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,
@@ -319,7 +370,7 @@
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
-                                       layer.msg(res.msg)
+                                       layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                    }
                                }
                            })
@@ -385,7 +436,7 @@
                 } else if (res.code === 403){
                     top.location.href = baseUrl+"/";
                 }else {
-                    layer.msg(res.msg)
+                    layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                 }
                 layer.close(index);
             }
@@ -408,6 +459,7 @@
         tableReload(false);
     });
 
+
     // 鎼滅储鏍忛噸缃簨浠�
     form.on('submit(reset)', function (data) {
         pageCurr = 1;
@@ -426,6 +478,25 @@
     });
 
 
+    // 鐩戝惉璇█鍒囨崲浜嬩欢
+    $(document).on('i18n:languageChanged', function() {
+        tableIns.reload({
+            cols: [getCol()],
+            text: {
+                none: I18n.t('no_data')
+            },
+            done: function(res, curr, count) {
+                if (typeof I18n !== 'undefined') {
+                    I18n.updatePage($('.layui-table-tool'));
+                    setTimeout(function() {
+                        I18n.updateLayuiPagination();
+                    }, 50);
+                }
+                pageCurr=curr;
+                limit();
+            }
+        });
+    });
 });
 
 // 鍏抽棴鍔ㄤ綔
@@ -434,7 +505,8 @@
 });
 
 function tableReload(child) {
-    var searchData = {};
+    var searchData = {
+    };
     $.each($('#search-box [name]').serializeArray(), function() {
         searchData[this.name] = this.value;
     });
@@ -447,6 +519,12 @@
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
             }
+            if (typeof I18n !== 'undefined') {
+                I18n.updatePage($('.layui-table-tool'));
+                setTimeout(function() {
+                    I18n.updateLayuiPagination();
+                }, 50);
+            }
             pageCurr=curr;
             if (res.data.length === 0 && count !== 0) {
                 tableIns.reload({

--
Gitblit v1.9.1