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/pakStore/stockAdjust.js | 73 ++++++++++++++++++++++++++----------
1 files changed, 52 insertions(+), 21 deletions(-)
diff --git a/src/main/webapp/static/js/pakStore/stockAdjust.js b/src/main/webapp/static/js/pakStore/stockAdjust.js
index 042a8b5..ce2a4ab 100644
--- a/src/main/webapp/static/js/pakStore/stockAdjust.js
+++ b/src/main/webapp/static/js/pakStore/stockAdjust.js
@@ -5,14 +5,20 @@
var matCodeLayerIdx;
function getCol() {
var cols = [
- {fixed: 'left', field: 'count', title: '瀹為檯鏁伴噺', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'}
- ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
- ,{field: 'batch', align: 'center',title: '鎵瑰彿锛堢紪杈戯級', edit: true, style: 'font-weight:bold'}
+ {fixed: 'left', field: 'count', title: I18n.t('actual_quantity'), align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'}
+ ,{field: 'anfme', align: 'center',title: I18n.t('quantity')}
+ ,{field: 'batch', align: 'center',title: I18n.t('batch_edit'), edit: true, style: 'font-weight:bold'}
];
- arrRemove(detlCols, "field", "anfme");
- arrRemove(detlCols, "field", "batch");
- cols.push.apply(cols, detlCols);
- cols.push({fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:80})
+ var dCols = [];
+ if (typeof getDetlCols === 'function') {
+ dCols = getDetlCols();
+ } else {
+ dCols = detlCols.slice();
+ }
+ arrRemove(dCols, "field", "anfme");
+ arrRemove(dCols, "field", "batch");
+ cols.push.apply(cols, dCols);
+ cols.push({fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:80})
return cols;
}
@@ -34,8 +40,33 @@
cellMinWidth: 50,
toolbar: '#toolbar',
cols: [getCol()],
+ text: {
+ none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+ },
done: function (res, curr, count) {
limit();
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ }
+ }
+ });
+
+ $(document).on('i18n:languageChanged', function() {
+ tableIns.reload({
+ cols: [getCol()]
+ });
+ $('[data-i18n-placeholder]').each(function() {
+ var key = $(this).attr('data-i18n-placeholder');
+ $(this).attr('placeholder', I18n.t(key));
+ });
+ // Update location status message if visible
+ if (currLocNo) {
+ // Need to re-trigger locTips logic or just update the text if possible.
+ // Since locTips makes an ajax call, maybe just leave it until next interaction or if we want to be perfect we could store the status.
+ // But 'location_status' is inside the dynamic html string.
+ // Let's rely on the user to re-search or just update the static part if we can.
+ // Actually, simply re-running the status text update if we had the data would be better.
+ // But for now, let's just let it be, or update if we have data.
}
});
@@ -47,11 +78,11 @@
if (obj.field === 'count'){
let vle = Number(obj.value);
if (isNaN(vle)) {
- layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
+ layer.msg(I18n.t('please_enter_number'), {icon: 2});
modify = false;
} else {
if (vle <= 0) {
- layer.msg("鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
+ layer.msg(I18n.t('quantity_must_be_greater_than_zero'), {icon: 2});
modify = false;
}
}
@@ -67,25 +98,25 @@
switch(obj.event) {
case 'adjust':
if (isEmpty(currLocNo)) {
- layer.msg("璇峰厛妫�绱㈠簱浣�", {icon: 2})
+ layer.msg(I18n.t('please_retrieve_location_first'), {icon: 2})
inputTip($("#searchLocNo"));
return;
}
if (matCodeData.length === 0) {
- layer.msg("璇峰厛娣诲姞鏄庣粏", {icon: 2});
+ layer.msg(I18n.t('please_add_detail_first'), {icon: 2});
return;
}
for (var i=0;i<matCodeData.length;i++){
if (isNaN(matCodeData[i].count)) {
- layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
+ layer.msg(I18n.t('please_enter_number'), {icon: 2});
return;
}
if (matCodeData[i].count < 0){
- layer.msg("鏁伴噺涓嶈兘灏忎簬闆�", {icon: 2});
+ layer.msg(I18n.t('quantity_cannot_be_less_than_zero'), {icon: 2});
return;
}
}
- layer.confirm('纭畾璋冩暣'+currLocNo+'搴撲綅鐨勬槑缁嗗悧锛�', {shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_adjust_location_detail', {val: currLocNo}), {shadeClose: true, title: I18n.t('prompt'), btn: [I18n.t('confirm'), I18n.t('cancel')]}, function(){
$.ajax({
url: baseUrl+"/locDdetl/adjust/start",
headers: {'token': localStorage.getItem('token')},
@@ -98,12 +129,12 @@
async: false,
success: function (res) {
if (res.code === 200){
- layer.msg(currLocNo + res.msg, {icon: 1});
+ layer.msg(currLocNo + " " + I18n.t(res.msg), {icon: 1});
init(currLocNo)
} else if (res.code === 403){
top.location.href = baseUrl+"/";
}else {
- layer.msg(res.msg, {icon: 2})
+ layer.msg(I18n.t(res.msg), {icon: 2})
}
}
})
@@ -129,7 +160,7 @@
let locNo = data.field.loc_no;
if (locNo === "") {
inputTip($("#searchLocNo"));
- layer.msg("璇疯緭鍏ュ簱浣嶅彿");
+ layer.msg(I18n.t('please_enter_source_location'));
return;
}
init(locNo);
@@ -171,11 +202,11 @@
let data = res.data;
if (data != null) {
$(".retrieve").show();
- $("#locMsg").html(locNo + " ,搴撲綅鐘舵�侊細" + data.locSts$);
+ $("#locMsg").html(locNo + " ," + I18n.t('location_status') + "锛�" + data.locSts$);
$('.not-retrieve').hide();
currLocNo = locNo;
} else {
- layer.msg("璇疯緭鍏ユ湁鏁堝簱浣嶅彿", {icon: 2});
+ layer.msg(I18n.t('please_enter_valid_location_no'), {icon: 2});
$('.not-retrieve').show();
$("#locMsg").html("");
$(".retrieve").hide();
@@ -193,11 +224,11 @@
$(document).on('click','#mat-query', function () {
if (isEmpty(currLocNo)) {
- layer.msg("璇峰厛妫�绱㈠簱浣�")
+ layer.msg(I18n.t('please_retrieve_location_first'))
inputTip($("#searchLocNo"));
return;
}
- let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+ let loadIndex = layer.msg(I18n.t('requesting'), {icon: 16, shade: 0.01, time: false});
matCodeLayerIdx = admin.open({
type: 2,
title: false,
--
Gitblit v1.9.1