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 | 161 ++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 115 insertions(+), 46 deletions(-)
diff --git a/src/main/webapp/static/js/locDetl/locDetl.js b/src/main/webapp/static/js/locDetl/locDetl.js
index 87ce65e..2b8b618 100644
--- a/src/main/webapp/static/js/locDetl/locDetl.js
+++ b/src/main/webapp/static/js/locDetl/locDetl.js
@@ -1,4 +1,50 @@
var pageCurr;
+function getCol() {
+ 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;
+}
+
layui.use(['table','laydate', 'form'], function(){
var table = layui.table;
var $ = layui.jquery;
@@ -12,30 +58,12 @@
headers: {token: localStorage.getItem('token')},
url: baseUrl+'/locDetl/list/auth',
page: true,
- limit: 10,
- skin: 'line',
+ limit: 16,
+ limits: [16, 30, 50, 100, 200, 500],
even: true,
toolbar: '#toolbar',
cellMinWidth: 50,
- cols: [[
- {type: 'checkbox'}
-// ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
- ,{field: 'locNo$', align: 'center',title: '搴撲綅鍙�',event: 'locNo', style: 'cursor:pointer'}
- ,{field: 'matnr', align: 'center',title: '鐗╂枡'}
- ,{field: 'lgnum', align: 'center',title: '浠撳簱鍙�', width:80}
- ,{field: 'tbnum', align: 'center',title: '杞偍璇锋眰缂栧彿'}
- // ,{field: 'tbpos', align: 'center',title: '琛岄」鐩�'}
- ,{field: 'zmatid', align: 'center',title: '鐗╂枡鏍囩ID', width:200}
- ,{field: 'maktx', align: 'center',title: '鐗╂枡鎻忚堪', width:150}
- ,{field: 'werks', align: 'center',title: '宸ュ巶'}
- ,{field: 'anfme', align: 'center',title: '鏁伴噺', width:80}
- ,{field: 'altme', align: 'center',title: '鍗曚綅', width:80}
- ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜'}
- ,{field: 'bname', align: 'center',title: '鐢ㄦ埛ID'}
- // ,{field: 'memo', align: 'center',title: '澶囨敞'}
-
- // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
- ]],
+ cols: [getCol()],
request: {
pageName: 'curr',
pageSize: 'limit'
@@ -53,7 +81,13 @@
},
done: function(res, curr, count) {
if (res.code === 403) {
- top.location.href = "/";
+ top.location.href = baseUrl+"/";
+ }
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-tool'));
+ setTimeout(function() {
+ I18n.updateLayuiPagination();
+ }, 50);
}
pageCurr=curr;
limit();
@@ -83,7 +117,13 @@
},
done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = "/";
+ top.location.href = baseUrl+"/";
+ }
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-tool'));
+ setTimeout(function() {
+ I18n.updateLayuiPagination();
+ }, 50);
}
pageCurr=curr;
limit();
@@ -98,7 +138,7 @@
case 'addData':
layer.open({
type: 2,
- title: '鏂板',
+ title: I18n.t('add'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
@@ -121,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')},
@@ -135,9 +175,9 @@
layer.closeAll();
tableReload(false);
} else if (res.code === 403){
- top.location.href = "/";
+ top.location.href = baseUrl+"/";
} else {
- layer.msg(res.msg)
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
}
}
})
@@ -145,7 +185,7 @@
}
break;
case 'exportData':
- layer.confirm('纭畾瀵煎嚭Excel鍚�', function(){
+ layer.confirm(I18n.t('confirm_export_excel'), {shadeClose: true}, function(){
var titles=[];
var fields=[];
obj.config.cols[0].map(function (col) {
@@ -162,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')},
@@ -170,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 = "/";
+ top.location.href = baseUrl+"/";
} else {
- layer.msg(res.msg)
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
}
}
});
@@ -193,7 +235,7 @@
case 'detail':
layer.open({
type: 2,
- title: '璇︽儏',
+ title: I18n.t('detail'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
@@ -212,7 +254,7 @@
case 'edit':
layer.open({
type: 2,
- title: '淇敼',
+ title: I18n.t('modify'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
@@ -231,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,
@@ -256,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})
}
}
})
@@ -267,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,
@@ -292,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})
}
}
})
@@ -303,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,
@@ -328,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})
}
}
})
@@ -392,9 +434,9 @@
$(this).val("");
});
} else if (res.code === 403){
- top.location.href = "/";
+ 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);
}
@@ -417,6 +459,7 @@
tableReload(false);
});
+
// 鎼滅储鏍忛噸缃簨浠�
form.on('submit(reset)', function (data) {
pageCurr = 1;
@@ -435,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();
+ }
+ });
+ });
});
// 鍏抽棴鍔ㄤ綔
@@ -443,7 +505,8 @@
});
function tableReload(child) {
- var searchData = {};
+ var searchData = {
+ };
$.each($('#search-box [name]').serializeArray(), function() {
searchData[this.name] = this.value;
});
@@ -454,7 +517,13 @@
},
done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = "/";
+ 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) {
--
Gitblit v1.9.1