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/orderTable.js |  120 ++++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 84 insertions(+), 36 deletions(-)

diff --git a/src/main/webapp/static/js/orderTable.js b/src/main/webapp/static/js/orderTable.js
index 2225c57..40dfc24 100644
--- a/src/main/webapp/static/js/orderTable.js
+++ b/src/main/webapp/static/js/orderTable.js
@@ -1,49 +1,94 @@
+var insTb;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"  // 閰嶇疆妯″潡鎵�鍦ㄧ殑鐩綍
-}).use(['table','laydate', 'form',  'admin'], function() {
+}).use(['table','laydate', 'form',  'admin', 'tableX'], function() {
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
     var admin = layui.admin;
+    var tableX = layui.tableX;
 
     /****************************************** 宸﹁竟琛� *************************************************/
 
-    var insTb = table.render({
-        elem: '#originTable',
-        url: baseUrl + '/order/nav/list/auth',
-        height: 'full-120',
-        headers: {token: localStorage.getItem('token')},
-        request: {
-            pageName: 'curr',
-            pageSize: 'limit'
-        },
-        page: false,
-        parseData: function (res) {
-            return {
-                'code': res.code,
-                'msg': res.msg,
-                'data': res.data
+    var initTable = function() {
+        insTb = table.render({
+            elem: '#originTable',
+            url: baseUrl + '/order/nav/list/auth',
+            height: 'full-120',
+            headers: {token: localStorage.getItem('token')},
+            request: {
+                pageName: 'curr',
+                pageSize: 'limit'
+            },
+            page: false,
+            parseData: function (res) {
+                return {
+                    'code': res.code,
+                    'msg': res.msg,
+                    'data': res.data
+                }
+            },
+            response: {
+                statusCode: 200
+            },
+            text: {none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鏁版嵁'},
+            // toolbar: ['<p>',
+            //     '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon">&#xe654;</i>娣诲姞</button>&nbsp;',
+            //     '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm icon-btn"><i class="layui-icon">&#xe642;</i>淇敼</button>&nbsp;',
+            //     '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon">&#xe640;</i>鍒犻櫎</button>',
+            //     '</p>'].join(''),
+            defaultToolbar: [],
+            cols: [[
+                // {type: 'numbers', title: '#'},
+                {field: 'orderTime', title: typeof I18n !== 'undefined' ? I18n.t('date') : '鏃ユ湡'},
+                {field: 'orderNo', title: typeof I18n !== 'undefined' ? I18n.t('order_no') : '鍗曟嵁缂栧彿', align: 'center'}
+            ]],
+            done: function (res, curr, count) {
+                if (typeof I18n !== 'undefined' && I18n.isReady()) {
+                    I18n.updatePage();
+                    if (count === 0) {
+                        $('.layui-table-empty').text(I18n.t('no_data'));
+                    }
+                }
+                $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
+    
+                // 缁戝畾榧犳爣鍙抽敭
+                tableX.bindCtxMenu('originTable', function (d) {
+                    return [
+                        {
+                            icon: 'layui-icon layui-icon-ok',
+                            name: typeof I18n !== 'undefined' ? I18n.t('one_click_outbound') : '涓�閿嚭搴�',
+                            click: function (d) {
+                                autoOut(d.id);
+                            }
+                        }
+                    ]
+    
+                })
+    
             }
-        },
-        response: {
-            statusCode: 200
-        },
-        // toolbar: ['<p>',
-        //     '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon">&#xe654;</i>娣诲姞</button>&nbsp;',
-        //     '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm icon-btn"><i class="layui-icon">&#xe642;</i>淇敼</button>&nbsp;',
-        //     '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon">&#xe640;</i>鍒犻櫎</button>',
-        //     '</p>'].join(''),
-        defaultToolbar: [],
-        cols: [[
-            // {type: 'numbers', title: '#'},
-            {field: 'orderTime', title: '鏃ユ湡'},
-            {field: 'orderNo', title: '鍗曟嵁缂栧彿', align: 'center'}
-        ]],
-        done: function (res, curr, count) {
-            $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
-        }
+        });
+    }
+
+    if (typeof I18n !== 'undefined' && I18n.isReady()) {
+        initTable();
+    } else {
+        $(document).on('i18n:ready', function() {
+            initTable();
+        });
+    }
+
+    // 鐩戝惉璇█鍒囨崲
+    $(document).on('i18n:languageChanged', function () {
+        insTb.reload({
+            text: {none: I18n.t('no_data')},
+            cols: [[
+                {field: 'orderTime', title: I18n.t('date')},
+                {field: 'orderNo', title: I18n.t('order_no'), align: 'center'}
+            ]]
+        });
     });
 
     /* 琛ㄦ牸鎼滅储 */
@@ -76,9 +121,11 @@
         }
     });
 
+
     /* 鐩戝惉琛屽崟鍑讳簨浠� */
     var selObj;
     table.on('row(originTable)', function (obj) {
+
         selObj = obj;
         obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
         insTb2.reload({where: {order_id: obj.data.id}, page: {curr: 1}});
@@ -88,9 +135,10 @@
     function showEdit(mData) {
         admin.open({
             type: 1,
-            title: (mData ? '淇敼' : '娣诲姞') + '椤圭洰',
+            title: (mData ? (typeof I18n !== 'undefined' ? I18n.t('modify_project') : '淇敼椤圭洰') : (typeof I18n !== 'undefined' ? I18n.t('add_project') : '娣诲姞椤圭洰')),
             content: $('#hostEditDialog').html(),
             success: function (layero, dIndex) {
+                I18n.updatePage($(layero));
                 // 鍥炴樉琛ㄥ崟鏁版嵁
                 form.val('hostEditForm', mData);
                 // 琛ㄥ崟鎻愪氦浜嬩欢
@@ -123,7 +171,7 @@
 
     /* 鍒犻櫎 */
     function doDel(obj) {
-        layer.confirm('纭畾瑕佸垹闄ゆ鍗曟嵁绫诲瀷鍚楋紵', {
+        layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_delete_doc_type') : '纭畾瑕佸垹闄ゆ鍗曟嵁绫诲瀷鍚楋紵', {
             skin: 'layui-layer-admin',
             shade: .1
         }, function (i) {

--
Gitblit v1.9.1