From b4c6f129662be7fb14f71235817a24e15f824449 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期五, 19 十二月 2025 16:25:38 +0800
Subject: [PATCH] AGV呼叫,回传功能优化
---
src/main/webapp/static/js/locCache/locCache.js | 126 ++++++++++++++++++++++++++++-------------
1 files changed, 86 insertions(+), 40 deletions(-)
diff --git a/src/main/webapp/static/js/locCache/locCache.js b/src/main/webapp/static/js/locCache/locCache.js
index c2e12b0..b836a62 100644
--- a/src/main/webapp/static/js/locCache/locCache.js
+++ b/src/main/webapp/static/js/locCache/locCache.js
@@ -18,43 +18,26 @@
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: 'sort', 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: 'locSts$', align: 'center', title: '搴撲綅鐘舵��'}
+ , {field: 'row1', align: 'center', title: '鎺�'}
+ , {field: 'bay1', align: 'center', title: '鍒�'}
+ , {field: 'lev1', align: 'center', title: '灞�'}
+ , {field: 'sort', align: 'center', title: '浼樺厛绾�', sort: true}
+ , {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: 160}]
+ ],
+
+
request: {
pageName: 'curr', pageSize: 'limit'
},
@@ -95,6 +78,13 @@
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});
@@ -129,10 +119,11 @@
}
});
+
+
// 鐩戝惉琛屽伐鍏蜂簨浠�
table.on('tool(locCache)', function (obj) {
var data = obj.data;
- console.log(data)
switch (obj.event) {
case 'showDetl':
locNo = data?.locNo;
@@ -144,7 +135,8 @@
area: [top.detailWidth, top.detailHeight],
shadeClose: true,
content: 'locDetail.html',
- success: function(layero, index){
+ success: function (layero, index) {
+
}
});
break;
@@ -159,7 +151,6 @@
// 鍒濆鍖栦繚瀛�
form.on('submit(initDo)', function (data) {
- console.log(data.field)
$.ajax({
url: baseUrl + "/locCache/init/auth",
headers: {'token': localStorage.getItem('token')},
@@ -180,6 +171,62 @@
})
});
+ // 淇敼浼樺厛绾�
+ form.on('submit(updateProi)', function (data) {
+ var checkStatus = table.checkStatus('locCache').data;
+ if (checkStatus.length === 0) {
+ layer.msg('璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁淇℃伅', {icon: 2});
+ return false;
+ }
+ var sortVal = data.field.identifying;
+ var loadIndex = layer.load(2);
+ var promises = checkStatus.map(function (item) {
+ return new Promise(function (resolve, reject) {
+ $.ajax({
+ url: baseUrl + "/locCache/update/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ id: item.id,
+ locNo: item.locNo,
+ sort: sortVal
+ },
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200) resolve(res);
+ else reject(res);
+ },
+ error: function (err) {
+ reject(err);
+ }
+ });
+ });
+ });
+
+ Promise.all(promises).then(function () {
+ layer.close(loadIndex);
+ layer.closeAll();
+ layer.msg("淇敼鎴愬姛");
+ tableReload(false);
+ }).catch(function (err) {
+ layer.close(loadIndex);
+ layer.msg("淇敼澶辫触: " + (err.msg || "鏈煡閿欒"));
+ });
+ return false;
+ });
+
+ function batchModifies() {
+ layer.open({
+ type: 1,
+ title: '鎵归噺淇敼',
+ maxmin: true,
+ area: ["400px"],
+ shadeClose: true,
+ content: $('#batchModify'),
+ success: function (layero, index) {
+
+ }
+ });
+ }
/* 寮圭獥 - 鏂板銆佷慨鏀� */
function showEditModel(mData) {
@@ -221,7 +268,6 @@
/* 鍒犻櫎 */
function del(ids) {
- console.log(ids)
layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
skin: 'layui-layer-admin', shade: .1
}, function (i) {
--
Gitblit v1.9.1