From c28812eb7e5afa79cb5e2f4fbee7f96c7d7767ed Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期五, 03 四月 2026 14:33:22 +0800
Subject: [PATCH] AGV出库,立库查询库存优化
---
src/main/webapp/static/js/checkOrder/checkOrder.js | 93 ++++++++++++++++++++++++++++++----------------
1 files changed, 61 insertions(+), 32 deletions(-)
diff --git a/src/main/webapp/static/js/checkOrder/checkOrder.js b/src/main/webapp/static/js/checkOrder/checkOrder.js
index 33dfa2d..d19c0c0 100644
--- a/src/main/webapp/static/js/checkOrder/checkOrder.js
+++ b/src/main/webapp/static/js/checkOrder/checkOrder.js
@@ -96,6 +96,8 @@
showEditModel(data);
}else if (layEvent === 'createTask') {
pakoutPreview(data.id);
+ }else if (layEvent === 'createAdjust') {
+ createAdjust(data.id);
}else if (layEvent === 'export') {
export1(data.id);
}else if (layEvent === 'del') {
@@ -107,24 +109,22 @@
var offset = $a.offset();
var top = offset.top;
var left = offset.left;
- layer.open({
+ admin.open({
type: 1,
- title: false,
- area: '1000px',
- offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'],
- shade: .01,
- shadeClose: true,
- fixed: false,
- content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
- success: function (layero) {
+ title: '鍗曟嵁鏄庣粏',
+ height: '450px',
+ content: $('#orderItem').html(),
+ area: '78%',
+ success: function (layero, dIndex) {
table.render({
- elem: '#lookSSXMTable',
- headers: {token: localStorage.getItem('token')},
- url: baseUrl+'/checkOrderDetl/list/auth',
+ elem: '#itemTable',
+ headers: { token: localStorage.getItem('token') },
+ url: baseUrl + '/checkOrderDetl/list/auth',
where: {
order_id: data.id
},
page: true,
+ height: '450px;',
cellMinWidth: 100,
cols: [[
{type: 'numbers'},
@@ -132,18 +132,10 @@
{field: 'zpallet', title: '瀹瑰櫒鐮�', width: 120},
{field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
- {field: 'batch', title: '鎵瑰彿'},
+ {field: 'suppCode', title: '渚涘簲鍟�'},
{field: 'anfme', title: '鏁伴噺'},
{field: 'workQty', title: '鐩樼偣鏁伴噺'},
{field: 'diffQty', title: '宸紓鏁伴噺', style: 'font-weight: bold'},
- // {field: 'unit', title: '鍗曚綅'},
- // {
- // field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
- // return util.toDateString(d.createTime);
- // }, width: 180
- // },
- // {field: 'inQty', title: '宸插叆搴撻噺'},
- // {field: 'color', title: '棰滆壊'},
{field: 'specs', title: '瑙勬牸'},
{field: 'status$', title: '鐘舵��'}
]],
@@ -162,10 +154,7 @@
response: {
statusCode: 200
},
- done: (res) => {
- if(res.code == 403){
- window.top.location.href = baseUrl+"/";
- }
+ done: function () {
$(layero).find('.layui-table-view').css('margin', '0');
},
size: ''
@@ -267,7 +256,7 @@
{field: 'locNo', title: '搴撲綅鍙�'},
{field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 200},
- {field: 'batch', title: '鎵瑰彿'},
+ {field: 'suppCode', title: '渚涘簲鍟�'},
{field: 'specs', title: '瑙勬牸'},
{field: 'anfme', title: '鏁伴噺', minWidth: 110, width: 110},
// {field: 'unit', title: '鍗曚綅', width: 80},
@@ -332,10 +321,17 @@
var isDuplicate = false;
for (var j = 0; j < xxDataList.length; j++) {
if (xxDataList[j].locNo === data[i].locNo && xxDataList[j].matnr === data[i].matnr && xxDataList[j].batch === data[i].batch) {
- isDuplicate = true;
- duplicateCount++;
- break;
+ if (xxDataList[j].diffQty !== 0){
+ isDuplicate = true;
+ duplicateCount++;
+ break;
+ }
+
}
+ }
+ if (undefined !== data[j] && data[j].diffQty !== 0){
+ isDuplicate = true;
+ duplicateCount++;
}
// 濡傛灉涓嶉噸澶嶏紝鍒欐坊鍔犲埌鍒楄〃
if (!isDuplicate) {
@@ -346,7 +342,7 @@
insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
// 鎻愮ず娣诲姞缁撴灉
if (duplicateCount > 0) {
- layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹紝' + duplicateCount + ' 鏉¢噸澶嶆暟鎹凡蹇界暐', {icon: 1});
+ layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹紝' + duplicateCount + ' 鏉℃暟鎹凡蹇界暐', {icon: 1});
} else if (addedCount > 0) {
layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹�', {icon: 1});
}
@@ -445,6 +441,39 @@
});
}
+ function createAdjust(orderId) {
+ layer.confirm('纭畾瑕佺敓鎴愯皟鏁村崟鍚楋紵', {
+ shade: .1,
+ skin: 'layui-layer-admin'
+ }, function (i) {
+ layer.close(i);
+ layer.load(2);
+ $.ajax({
+ url: baseUrl+"/adjustOrder/create/test",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ orderId: orderId
+ },
+ method: 'POST',
+ success: function (res) {
+ layer.closeAll('loading');
+ if (res.code === 200){
+ if (insTbCount === 0) {
+ insTb.reload({page: {curr: 1}});
+ } else {
+ $(".layui-laypage-btn")[0].click();
+ }
+ layer.msg(res.msg, {icon: 1});
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ });
+ }
+
function pakoutPreview(id) {
let loadIndex = layer.load(2);
@@ -483,9 +512,10 @@
// {type: 'checkbox', merge: ['orderNo']},
{field: 'orderNo', title: '鍗曟嵁缂栧彿', merge: true, align: 'center'},
{field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350},
- {field: 'batch', title: '搴忓垪鐮�', align: 'center'},
+ {field: 'suppCode', title: '渚涘簲鍟�', align: 'center'},
{field: 'anfme', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'},
{field: 'locNo', title: '璐т綅', align: 'center', width: 100, templet: '#locNoTpl'},
+ // {field: 'suppCode', title: '渚涘簲鍟�', align: 'center', width: 100},
{field: 'frozen$', title: '鏄庣粏', align: 'center', width: 90, templet: '#locFrozen'},
{field: 'frozenLoc$', title: '搴撲綅', align: 'center', width: 90, templet: '#locFrozenLoc'},
{field: 'staNos', align: 'center', title: '鍑哄簱绔�', merge: ['locNo'], templet: '#tbBasicTbStaNos'},
@@ -666,7 +696,6 @@
layer.close(layerIndex);
layer.msg(res.msg, {icon: 1});
insTb.reload({where: null});
- insTb2.reload({where: null, page: {curr: 1}});
} else if (res.code === 403) {
top.location.href = baseUrl + "/";
} else {
--
Gitblit v1.9.1