From a25ca87edcfd4c8ef831f2af31d7aed0f9d6f625 Mon Sep 17 00:00:00 2001
From: chen.llin <1442464845@qq.comm>
Date: 星期六, 27 十二月 2025 16:41:01 +0800
Subject: [PATCH] 越库相关sql
---
src/main/webapp/static/js/locCache/locCache.js | 155 +++++++++++++++++++++++++++++++++------------------
1 files changed, 101 insertions(+), 54 deletions(-)
diff --git a/src/main/webapp/static/js/locCache/locCache.js b/src/main/webapp/static/js/locCache/locCache.js
index eeebfef..e9f2228 100644
--- a/src/main/webapp/static/js/locCache/locCache.js
+++ b/src/main/webapp/static/js/locCache/locCache.js
@@ -12,50 +12,32 @@
// 鏁版嵁娓叉煋
tableIns = table.render({
elem: '#locCache',
- headers: {token: localStorage.getItem('token')},
+ headers: { token: localStorage.getItem('token') },
url: baseUrl + '/locCache/list/auth',
page: true,
limit: 15,
limits: [15, 30, 50, 100, 200, 500],
toolbar: '#toolbar',
- cellMinWidth: 50,
+ cellMinWidth: 80,
height: 'full-120',
- cols: [[{type: 'checkbox'}, {field: 'locNo', align: 'center', title: '搴撲綅鍙�'}, {
- field: 'barcode',
- align: 'center',
- title: '鎵樼洏鐮�'
- }, {field: 'areaName', align: 'center', title: '搴撳尯鍚嶇О'}, {
- field: 'whsType$',
- align: 'center',
- title: '搴撲綅绫诲瀷'
- }, {field: 'locSts', align: 'center', title: '搴撲綅鐘舵��'}, {
- field: 'row1',
- align: 'center',
- title: '鎺�'
- }, {field: 'bay1', align: 'center', title: '鍒�'}, {
- field: 'lev1',
- align: 'center',
- title: '灞�'
- }, {field: 'locType', align: 'center', title: '搴撲綅绫诲瀷'}, {
- field: 'modiUser$',
- align: 'center',
- title: '淇敼浜哄憳'
- }, {field: 'modiTime$', align: 'center', title: '淇敼鏃堕棿'}, {
- field: 'appeUser$',
- align: 'center',
- title: '鍒涘缓鑰�'
- }, {field: 'appeTime$', align: 'center', title: '娣诲姞鏃堕棿'}, {
- field: 'frozen',
- align: 'center',
- title: '鏄惁鍐荤粨,0.鏈喕缁擄紝1.宸插喕缁�',
- hide: true
- }, {field: 'frozenMemo', align: 'center', title: '鍐荤粨澶囨敞', hide: true}, {
- fixed: 'right',
- title: '鎿嶄綔',
- align: 'center',
- toolbar: '#operate',
- width: 120
- }]],
+ cols: [[{ type: 'checkbox' }, { field: 'locNo', align: 'center', title: '搴撲綅鍙�', width: 120 }
+ , { field: 'barcode', align: 'center', title: '鎵樼洏鐮�' }
+ , { field: 'areaName', align: 'center', title: '搴撳尯鍚嶇О' }
+ // , {field: 'whsType$', align: 'center', title: '搴撲綅绫诲瀷'}
+ , { field: 'locSts', align: 'center', title: '搴撲綅鐘舵��' }
+ , { field: 'row1', align: 'center', title: '鎺�' }
+ , { field: 'bay1', align: 'center', title: '鍒�' }
+ , { field: 'lev1', align: 'center', title: '灞�' }
+ // , {field: 'locType', align: 'center', title: '搴撲綅绫诲瀷'}
+ , { field: 'sort', align: 'center', title: '浼樺厛绾�' }
+ , { field: 'modiUser$', align: 'center', title: '淇敼浜哄憳', hide: true }
+ , { field: 'modiTime$', align: 'center', title: '淇敼鏃堕棿' }
+ , { field: 'appeUser$', align: 'center', title: '鍒涘缓鑰�', hide: true }
+ , { field: 'appeTime$', align: 'center', title: '娣诲姞鏃堕棿', hide: true }
+ , { field: 'frozen', align: 'center', title: '鏄惁鍐荤粨', hide: true }
+ , { field: 'frozenMemo', align: 'center', title: '鍐荤粨澶囨敞', hide: true }
+ , { fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 200 }]
+ ],
request: {
pageName: 'curr', pageSize: 'limit'
},
@@ -85,7 +67,7 @@
searchData['orderByField'] = obj.field;
searchData['orderByType'] = obj.type;
tableIns.reload({
- where: searchData, page: {curr: 1}
+ where: searchData, page: { curr: 1 }
});
});
@@ -96,9 +78,16 @@
case 'addData':
showEditModel();
break;
+ case 'batchModifties':
+ if (checkStatus.length === 0) {
+ layer.msg('璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁淇℃伅', { icon: 2 });
+ return;
+ }
+ batchModifies();
+ break;
case 'deleteData':
if (checkStatus.length === 0) {
- layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+ layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', { icon: 2 });
return;
}
del(checkStatus.map(function (d) {
@@ -106,8 +95,8 @@
}));
break;
case 'init':
- layer.prompt({title: '璇疯緭鍏ュ彛浠わ紝骞堕噸缃簱浣�', formType: 1, shadeClose: true}, function (pass, idx) {
- http.get(baseUrl + "/locMast/init/pwd", {pwd: pass}, function (res) {
+ layer.prompt({ title: '璇疯緭鍏ュ彛浠わ紝骞堕噸缃簱浣�', formType: 1, shadeClose: true }, function (pass, idx) {
+ http.get(baseUrl + "/locMast/init/pwd", { pwd: pass }, function (res) {
if (res.data) {
layer.open({
type: 1,
@@ -130,10 +119,26 @@
}
});
+
+
// 鐩戝惉琛屽伐鍏蜂簨浠�
table.on('tool(locCache)', function (obj) {
var data = obj.data;
switch (obj.event) {
+ case 'showDetl':
+ locNo = data?.locNo;
+ // 寮瑰眰鏄剧ず
+ layer.open({
+ type: 2,
+ title: '搴撲綅鏄庣粏',
+ maxmin: true,
+ area: [top.detailWidth, top.detailHeight],
+ shadeClose: true,
+ content: 'locDetail.html',
+ success: function (layero, index) {
+ }
+ });
+ break;
case 'edit':
showEditModel(data);
break;
@@ -148,7 +153,7 @@
console.log(data.field)
$.ajax({
url: baseUrl + "/locCache/init/auth",
- headers: {'token': localStorage.getItem('token')},
+ headers: { 'token': localStorage.getItem('token') },
data: data.field,
method: 'POST',
async: false,
@@ -166,34 +171,77 @@
})
});
+ function batchModifies() {
+ layer.open({
+ type: 1,
+ title: '鎵归噺淇敼',
+ maxmin: true,
+ area: ["400px"],
+ shadeClose: true,
+ content: $('#batchModify'),
+ success: function (layero, index) {
+
+ }
+ });
+ }
/* 寮圭獥 - 鏂板銆佷慨鏀� */
function showEditModel(mData) {
admin.open({
type: 1,
area: '600px',
- title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+ title: (mData ? '淇敼' : '娣诲姞') + '搴撲綅缂撳瓨',
content: $('#editDialog').html(),
success: function (layero, dIndex) {
layDateRender(mData);
- form.val('detail', mData);
+ // 鍔犺浇搴撳尯鍒楄〃
+ $.ajax({
+ url: baseUrl + "/basAreasQuery/auth",
+ headers: { 'token': localStorage.getItem('token') },
+ data: { condition: '' },
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200) {
+ var areaSelect = $(layero).find('select[name="areaName"]');
+ areaSelect.empty();
+ areaSelect.append('<option value="">璇烽�夋嫨搴撳尯</option>');
+ var list = res.data;
+ for (var i = 0; i < list.length; i++) {
+ areaSelect.append('<option value="' + list[i].value + '" data-id="' + list[i].id + '">' + list[i].value + '</option>');
+ }
+ // 璁剧疆琛ㄥ崟鍊�
+ form.val('detail', mData);
+ // 濡傛灉鏈夋暟鎹紝璁剧疆閫変腑鐨勫簱鍖�
+ if (mData && mData.areaName) {
+ areaSelect.val(mData.areaName);
+ }
+ form.render('select');
+ }
+ }
+ });
+ // 鐩戝惉搴撳尯閫夋嫨鍙樺寲锛屽悓姝reaId
+ form.on('select(editAreaName)', function (data) {
+ var selectedOption = $(data.elem).find('option:selected');
+ var areaId = selectedOption.attr('data-id') || '';
+ $(layero).find('input[name="areaId"]').val(areaId);
+ });
form.on('submit(editSubmit)', function (data) {
var loadIndex = layer.load(2);
$.ajax({
url: baseUrl + "/locCache/" + (mData ? 'update' : 'add') + "/auth",
- headers: {'token': localStorage.getItem('token')},
+ headers: { 'token': localStorage.getItem('token') },
data: data.field,
method: 'POST',
success: function (res) {
layer.close(loadIndex);
if (res.code === 200) {
layer.close(dIndex);
- layer.msg(res.msg, {icon: 1});
+ layer.msg(res.msg, { icon: 1 });
tableReload();
} else if (res.code === 403) {
top.location.href = baseUrl + "/";
} else {
- layer.msg(res.msg, {icon: 2});
+ layer.msg(res.msg, { icon: 2 });
}
}
})
@@ -207,7 +255,6 @@
/* 鍒犻櫎 */
function del(ids) {
- console.log(ids)
layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
skin: 'layui-layer-admin', shade: .1
}, function (i) {
@@ -215,18 +262,18 @@
var loadIndex = layer.load(2);
$.ajax({
url: baseUrl + "/locCache/delete/auth",
- headers: {'token': localStorage.getItem('token')},
- data: {ids: ids},
+ headers: { 'token': localStorage.getItem('token') },
+ data: { ids: ids },
method: 'POST',
success: function (res) {
layer.close(loadIndex);
if (res.code === 200) {
- layer.msg(res.msg, {icon: 1});
+ layer.msg(res.msg, { icon: 1 });
tableReload();
} else if (res.code === 403) {
top.location.href = baseUrl + "/";
} else {
- layer.msg(res.msg, {icon: 2});
+ layer.msg(res.msg, { icon: 2 });
}
}
})
@@ -286,6 +333,6 @@
searchData[this.name] = this.value;
});
tableIns.reload({
- where: searchData, page: {curr: pageCurr}
+ where: searchData, page: { curr: pageCurr }
});
}
--
Gitblit v1.9.1