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/wrkMast/wrkMast.js | 187 ++++++++++++++++++++++------------------------
1 files changed, 89 insertions(+), 98 deletions(-)
diff --git a/src/main/webapp/static/js/wrkMast/wrkMast.js b/src/main/webapp/static/js/wrkMast/wrkMast.js
index fe33064..abe97fe 100644
--- a/src/main/webapp/static/js/wrkMast/wrkMast.js
+++ b/src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -1,11 +1,67 @@
var pageCurr;
var wrkNo;
+
layui.use(['table','laydate', 'form'], function(){
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
var layDate = layui.laydate;
var form = layui.form;
+ var doneCallback = function(res, curr, count) {
+ if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ }
+ pageCurr=curr;
+ limit();
+ 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';
+ }
+ });
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ I18n.updateLayuiPagination();
+ }
+ };
+
+ $(document).on('i18n:languageChanged', function() {
+ tableIns.reload({
+ cols: getCol(),
+ done: doneCallback
+ });
+ });
+ function getCol() {
+ return [[
+ {type: 'checkbox'}
+ ,{field: 'wrkNo', align: 'center',title: I18n.t('work_no'),sort: true, width: 85}
+ ,{field: 'ioTime$', align: 'center',title: I18n.t('work_time'),sort: true, width: 160}
+ ,{field: 'wrkSts', align: 'center',title: I18n.t('work_status'), templet: function(d) {
+ var key = 'wrk_status_' + d.wrkSts;
+ var text = I18n.t(key);
+ return text === key ? d.wrkSts$ : text;
+ }}
+ ,{field: 'ioType', align: 'center',title: I18n.t('transaction_type'), templet: function(d) {
+ var key = 'io_type_' + d.ioType;
+ var text = I18n.t(key);
+ return text === key ? d.ioType$ : text;
+ }}
+ ,{field: 'ioPri', align: 'center',title: I18n.t('priority')}
+ ,{field: 'crnNo$', align: 'center',title: I18n.t('crane')}
+ ,{field: 'sourceStaNo$', align: 'center',title: I18n.t('source_station')}
+ ,{field: 'staNo$', align: 'center',title: I18n.t('target_station')}
+ ,{field: 'sourceLocNo$', align: 'center',title: I18n.t('source_location')}
+ ,{field: 'locNo$', align: 'center',title: I18n.t('target_location')}
+ ,{field: 'barcode', align: 'center',title: I18n.t('barcode')}
+ ,{field: 'preHave', align: 'center',title: I18n.t('pre_existing'), hide: true}
+ ,{field: 'takeNone', align: 'center',title: I18n.t('empty_op'), hide: true}
+ ,{field: 'modiUser$', align: 'center',title: I18n.t('modifier'), hide:true}
+ ,{field: 'modiTime$', align: 'center',title: I18n.t('modify_time'), hide:true, width: 160}
+ ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:250}
+ ]];
+ }
// 鏁版嵁娓叉煋
tableIns = table.render({
@@ -18,56 +74,7 @@
even: true,
toolbar: '#toolbar',
cellMinWidth: 50,
- cols: [[
- {type: 'checkbox'}
- ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�',sort: true, width: 85}
- ,{field: 'ioTime$', align: 'center',title: '宸ヤ綔鏃堕棿',sort: true, width: 160}
- ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��'}
- ,{field: 'ioType$', align: 'center',title: '鍏ュ嚭搴撶被鍨�'}
- ,{field: 'ioPri', align: 'center',title: '浼樺厛绾�'}
- ,{field: 'crnNo$', align: 'center',title: '鍫嗗灈鏈�'}
- ,{field: 'sourceStaNo$', align: 'center',title: '婧愮珯'}
- ,{field: 'staNo$', align: 'center',title: '鐩爣绔�'}
- ,{field: 'sourceLocNo$', align: 'center',title: '婧愬簱浣�'}
- ,{field: 'locNo$', align: 'center',title: '鐩爣搴撲綅'}
- ,{field: 'barcode', align: 'center',title: '鏉$爜'}
- ,{field: 'preHave', align: 'center',title: '鍏堝叆鍝�', hide: true}
- ,{field: 'takeNone', align: 'center',title: '绌烘搷浣�', hide: true}
- // ,{field: 'picking', align: 'center',title: '鎷f枡', templet:function(row){
- // var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
- // if(row.picking === 'Y'){html += " checked ";}
- // html += ">";
- // return html;
- // }}
- // ,{field: 'exitMk', align: 'center',title: '閫�鍑�', templet:function(row){
- // var html = "<input value='exitMk' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
- // if(row.exitMk === 'Y'){html += " checked ";}
- // html += ">";
- // return html;
- // }}
- // ,{field: 'emptyMk', align: 'center',title: '绌烘澘', templet:function(row){
- // var html = "<input value='emptyMk' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
- // if(row.emptyMk === 'Y'){html += " checked ";}
- // html += ">";
- // return html;
- // }}
- //
- // ,{field: 'crnStrTime$', align: 'center',title: '鍫嗗灈鏈哄惎鍔ㄦ椂闂�'}
- // ,{field: 'crnEndTime$', align: 'center',title: '鍫嗗灈鏈哄仠姝㈡椂闂�'}
- // ,{field: 'refIotime$', align: 'center',title: '鎷f枡鏃堕棿'}
- ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide:true}
- ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true, width: 160}
- // ,{field: 'memo', align: 'center',title: '澶囨敞'}
- //
- // ,{field: 'fullPlt', align: 'center',title: '婊℃澘', templet:function(row){
- // var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
- // if(row.fullPlt === 'Y'){html += " checked ";}
- // html += ">";
- // return html;
- // }}
-
- ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:250}
- ]],
+ cols: getCol(),
request: {
pageName: 'curr',
pageSize: 'limit'
@@ -83,21 +90,7 @@
response: {
statusCode: 200
},
- done: function(res, curr, count) {
- if (res.code === 403) {
- top.location.href = baseUrl+"/";
- }
- pageCurr=curr;
- limit();
- 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';
- }
- });
- }
+ done: doneCallback
});
// 鐩戝惉鎺掑簭浜嬩欢
@@ -113,13 +106,7 @@
page: {
curr: 1
},
- done: function (res, curr, count) {
- if (res.code === 403) {
- top.location.href = baseUrl+"/";
- }
- pageCurr=curr;
- limit();
- }
+ done: doneCallback
});
});
@@ -190,7 +177,7 @@
case 'addData':
layer.open({
type: 2,
- title: '鏂板',
+ title: I18n.t('add'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
@@ -205,9 +192,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+I18n.t('confirm_delete_suffix'), function(){
$.ajax({
url: baseUrl+"/wrkMast/delete/auth",
headers: {'token': localStorage.getItem('token')},
@@ -229,7 +216,7 @@
}
break;
case 'exportData':
- layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_export'), {shadeClose: true}, function(){
var titles=[];
var fields=[];
obj.config.cols[0].map(function (col) {
@@ -281,7 +268,7 @@
// 寮瑰眰鏄剧ず
layer.open({
type: 2,
- title: '宸ヤ綔妗f槑缁�',
+ title: I18n.t('work_order_detail'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: true,
@@ -292,7 +279,7 @@
break;
// 瀹屾垚
case 'complete':
- layer.confirm('纭瀹屾垚璇ョ瑪宸ヤ綔妗o紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_complete_work_order'), {title: I18n.t('work_no')+'锛�'+data.wrkNo, shadeClose: true}, function(){
http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:1}, function (res) {
$(".layui-laypage-btn")[0].click();
layer.msg(data.wrkNo + res.msg);
@@ -304,7 +291,7 @@
// 鍙栨秷
case 'cancel':
if (data.pdcType === "Y") {
- layer.confirm('褰撳墠浠诲姟鍏宠仈ERP閿�鍞崟锛屽彇娑堝皢閲嶆柊鐢熸垚鍑哄簱浣滀笟锛屾槸鍚︾户缁紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_cancel_erp_order'), {title: I18n.t('work_no')+'锛�'+data.wrkNo, shadeClose: true}, function(){
http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:2}, function (res) {
$(".layui-laypage-btn")[0].click();
layer.msg(data.wrkNo + res.msg);
@@ -312,7 +299,7 @@
layer.closeAll();
});
} else {
- layer.confirm('纭鍙栨秷璇ョ瑪宸ヤ綔妗o紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_cancel_work_order'), {title: I18n.t('work_no')+'锛�'+data.wrkNo, shadeClose: true}, function(){
http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:2}, function (res) {
$(".layui-laypage-btn")[0].click();
layer.msg(data.wrkNo + res.msg);
@@ -323,7 +310,7 @@
break;
// 鎷f枡鍏ュ簱
case 'pick':
- layer.confirm('鎷f枡鍏ュ簱璇ョ瑪宸ヤ綔妗o紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_pick_work_order'), {title: I18n.t('work_no')+'锛�'+data.wrkNo, shadeClose: true}, function(){
http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:3}, function (res) {
$(".layui-laypage-btn")[0].click();
layer.msg(data.wrkNo + res.msg);
@@ -333,7 +320,7 @@
break;
// 鍏堝叆鍝�
case 'preHave':
- layer.confirm('浠诲姟鍙戠敓鍏堝叆鍝佸紓甯搞�傚闇�閲嶆柊鍏ュ簱锛岃纭繚璐х墿宸叉斁鑷冲爢鍨涙満鍑哄簱绔欙紒', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_pre_existing_exception'), {title: I18n.t('work_no')+'锛�'+data.wrkNo, shadeClose: true}, function(){
http.post(baseUrl+"/deal/preHave/start", {wrkNo: data.wrkNo}, function (res) {
$(".layui-laypage-btn")[0].click();
layer.msg(data.wrkNo + res.msg, {icon: 1});
@@ -343,7 +330,7 @@
break;
// 绌烘搷浣�
case 'takeNone':
- layer.confirm('浠诲姟鍙戦�佺┖鎿嶄綔寮傚父锛佹槸鍚︺�傘�傘�傘�傘�傘�傘�傘�傦紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_empty_op_exception'), {title: I18n.t('work_no')+'锛�'+data.wrkNo, shadeClose: true}, function(){
});
break;
}
@@ -546,22 +533,22 @@
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: '澶囨敞'}
+ ,{field: 'wrkNo', align: 'center',title: I18n.t('work_no')}
+ ,{field: 'ioTime$', align: 'center',title: I18n.t('work_time')}
+ ,{field: 'matnr', align: 'center',title: I18n.t('material')}
+ ,{field: 'lgnum', align: 'center',title: I18n.t('warehouse_no')}
+ ,{field: 'tbnum', align: 'center',title: I18n.t('transfer_req_no')}
+ ,{field: 'tbpos', align: 'center',title: I18n.t('item_no')}
+ ,{field: 'zmatid', align: 'center',title: I18n.t('material_label_id')}
+ ,{field: 'maktx', align: 'center',title: I18n.t('material_desc')}
+ ,{field: 'werks', align: 'center',title: I18n.t('factory')}
+ ,{field: 'anfme', align: 'center',title: I18n.t('quantity')}
+ ,{field: 'altme', align: 'center',title: I18n.t('unit')}
+ ,{field: 'zpallet', align: 'center',title: I18n.t('pallet_barcode')}
+ ,{field: 'bname', align: 'center',title: I18n.t('user_id')}
+ ,{field: 'memo', align: 'center',title: I18n.t('remark')}
- ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:50}
+ ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:50}
]],
request: {
pageName: 'curr',
@@ -616,6 +603,10 @@
if (res.code === 403) {
top.location.href = baseUrl+"/";
}
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ I18n.updateLayuiPagination();
+ }
pageCurr=curr;
if (res.data.length === 0 && count !== 0) {
tableIns.reload({
--
Gitblit v1.9.1