From 2aa5cec3577cf0f935f074cd8283af669a07f54c Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期六, 10 一月 2026 10:16:38 +0800
Subject: [PATCH] 出入库测试修改
---
src/main/webapp/static/js/orderPakout/out.js | 138 +++++++++++++++++++++++++++-------------------
1 files changed, 81 insertions(+), 57 deletions(-)
diff --git a/src/main/webapp/static/js/orderPakout/out.js b/src/main/webapp/static/js/orderPakout/out.js
index 0cd07ec..70132ee 100644
--- a/src/main/webapp/static/js/orderPakout/out.js
+++ b/src/main/webapp/static/js/orderPakout/out.js
@@ -4,7 +4,7 @@
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
notice: 'notice/notice',
-}).use(['table','laydate', 'form', 'util', 'admin', 'notice', 'treeTable', 'xmSelect', 'tableMerge', 'tableX'], function(){
+}).use(['table', 'laydate', 'form', 'util', 'admin', 'notice', 'treeTable', 'xmSelect', 'tableMerge', 'tableX'], function () {
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
@@ -21,7 +21,7 @@
insTb2 = table.render({
elem: '#orderDetlTable',
headers: {token: localStorage.getItem('token')},
- url: baseUrl+'/order/pakout/orderDetl/pakout/list/auth',
+ url: baseUrl + '/order/pakout/orderDetl/pakout/list/auth',
page: true,
limit: 15,
limits: [15, 30, 50, 100, 200, 500],
@@ -30,19 +30,19 @@
where: {order_id: 9999999999},
cols: [[
{type: 'checkbox'}
- ,{type: 'numbers', title: '#'}
- ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl', width: 160}
- ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栫爜', width: 160}
- ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', width: 200}
- ,{field: 'standby1', align: 'center',title: '鏈哄彴鍙�'}
- ,{field: 'specs', align: 'center',title: '瑙勬牸'}
+ , {type: 'numbers', title: '#'}
+ , {field: 'orderNo', align: 'center', title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl', width: 160}
+ , {field: 'matnr', align: 'center', title: '鍟嗗搧缂栫爜', width: 160}
+ , {field: 'maktx', align: 'center', title: '鍟嗗搧鍚嶇О', width: 200}
+ , {field: 'standby1', align: 'center', title: '鏈哄彴鍙�'}
+ , {field: 'specs', align: 'center', title: '瑙勬牸'}
// ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
// ,{field: 'qty', align: 'center',title: '浣滀笟鏁伴噺', style: 'font-weight: bold'}
- ,{field: 'enableQty', align: 'center',title: '寰呭嚭鏁伴噺', style: 'font-weight: bold'}
+ , {field: 'enableQty', align: 'center', title: '寰呭嚭鏁伴噺', style: 'font-weight: bold'}
// ,{field: 'name', align: 'center',title: '鍚嶇О'}
// ,{field: 'model', align: 'center',title: '鍨嬪彿'}
- ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true}
- ,{field: 'barcode', align: 'center',title: '鍟嗗搧鏉$爜', hide: true}
+ , {field: 'unit', align: 'center', title: '鍗曚綅', hide: true}
+ , {field: 'barcode', align: 'center', title: '鍟嗗搧鏉$爜', hide: true}
// ,{field: 'supplier', align: 'center',title: '渚涘簲鍟�'}
// ,{field: 'unitPrice', align: 'center',title: '鍗曚环'}
// ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�'}
@@ -54,7 +54,7 @@
// ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
// ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
// ,{field: 'memo', align: 'center',title: '澶囨敞'}
- ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 160}
+ , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 160}
]],
request: {
pageName: 'curr',
@@ -71,11 +71,11 @@
response: {
statusCode: 200
},
- done: function(res, curr, count) {
+ done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
- pageCurr=curr;
+ pageCurr = curr;
limit();
}
});
@@ -134,20 +134,20 @@
success: function (res) {
layer.close(loadIndex);
var tableCache;
- if (res.code === 200){
+ if (res.code === 200) {
layer.open({
type: 1
- ,title: false
- ,closeBtn: false
- ,offset: '50px'
- ,area: ['1200px', '700px']
- ,shade: 0.5
- ,shadeClose: false
- ,btn: ['绔嬪嵆鍑哄簱', '绋嶅悗澶勭悊']
- ,btnAlign: 'c'
- ,moveType: 1 //鎷栨嫿妯″紡锛�0鎴栬��1
- ,content: $('#pakoutPreviewBox').html()
- ,success: function(layero, index){
+ , title: false
+ , closeBtn: false
+ , offset: '50px'
+ , area: ['1200px', '700px']
+ , shade: 0.5
+ , shadeClose: false
+ , btn: ['绔嬪嵆鍑哄簱', '绋嶅悗澶勭悊']
+ , btnAlign: 'c'
+ , moveType: 1 //鎷栨嫿妯″紡锛�0鎴栬��1
+ , content: $('#pakoutPreviewBox').html()
+ , success: function (layero, index) {
stoPreTabIdx = table.render({
elem: '#stoPreTab',
data: res.data,
@@ -160,11 +160,35 @@
{field: 'orderNo', title: '鍗曟嵁缂栧彿', merge: true, align: 'center'},
{field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350},
{field: 'standby1', title: '鏈哄彴鍙�', align: 'center'},
- {field: 'anfme', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'},
+ {
+ field: 'anfme',
+ title: '鏁伴噺',
+ align: 'center',
+ width: 90,
+ style: 'font-weight: bold'
+ },
{field: 'locNo', title: '璐т綅', align: 'center', width: 100, templet: '#locNoTpl'},
- {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'},
+ {
+ 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'
+ },
{type: 'checkbox', merge: ['locNo']},
]],
done: function (res) {
@@ -175,9 +199,9 @@
});
// 淇敼鍑哄簱绔�
form.on('select(tbBasicTbStaNos)', function (obj) {
- let index = obj.othis.parents('tr').attr("data-index");
+ let index = obj.othis.parents('tr').attr("data-index");
let data = tableCache[index];
- for (let i = 0; i<tableCache.length; i++) {
+ for (let i = 0; i < tableCache.length; i++) {
if (tableCache[i].locNo === data.locNo) {
tableCache[i]['staNo'] = Number(obj.elem.value);
}
@@ -194,18 +218,18 @@
}
modifySta(stoPreTabData);
});
+
// 鎵归噺淇敼鍑哄簱绔� - 绔欑偣閫夋嫨
function modifySta(stoPreTabData) {
// 鍑哄簱绔欏彇浜ら泦
let staBatchSelectVal = [];
- for(let i = 0; i<stoPreTabData.length; i++) {
+ for (let i = 0; i < stoPreTabData.length; i++) {
let staNos = stoPreTabData[i].staNos;
if (staNos !== null) {
if (staBatchSelectVal.length === 0) {
staBatchSelectVal = staNos;
} else {
- staBatchSelectVal = staBatchSelectVal.filter(val =>
- {
+ staBatchSelectVal = staBatchSelectVal.filter(val => {
return new Set(staNos).has(val)
}
)
@@ -231,8 +255,8 @@
let loadIdx = layer.load(2);
let batchSta = Number(obj.field.batchSta);
let arr = [];
- for (let j = 0; j<stoPreTabData.length; j++) {
- for (let i = 0; i<tableCache.length; i++) {
+ for (let j = 0; j < stoPreTabData.length; j++) {
+ for (let i = 0; i < tableCache.length; i++) {
if (tableCache[i].orderNo === stoPreTabData[j].orderNo
&& tableCache[i].matnr === stoPreTabData[j].matnr
&& tableCache[i].locNo === stoPreTabData[j].locNo) {
@@ -249,7 +273,8 @@
arr.forEach(item => {
$('div[lay-id=stoPreTab] tr[data-index="' + item + '"] .layui-select-title').find("input").css("color", "blue");
});
- layer.close(loadIdx); layer.close(ddIndex);
+ layer.close(loadIdx);
+ layer.close(ddIndex);
return false;
});
// 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯
@@ -260,18 +285,18 @@
}
}
- ,yes: function(index, layero){
+ , yes: function (index, layero) {
//鎸夐挳銆愮珛鍗冲嚭搴撱�戠殑鍥炶皟
pakout(tableCache, index);
}
- ,btn2: function(index, layero){
+ , btn2: function (index, layero) {
//鎸夐挳銆愮◢鍚庡鐞嗐�戠殑鍥炶皟
layer.close(index)
//return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
}
});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
} else {
layer.msg(res.msg, {icon: 2})
}
@@ -305,7 +330,6 @@
}
-
/* 鍒犻櫎璁㈠崟 */
function doDelSensor(obj) {
layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
@@ -315,18 +339,18 @@
layer.close(i);
var loadIndex = layer.load(2);
$.ajax({
- url: baseUrl+"/sensor/delete/auth",
+ url: baseUrl + "/sensor/delete/auth",
headers: {'token': localStorage.getItem('token')},
data: {ids: obj.ids},
method: 'POST',
success: function (res) {
layer.close(loadIndex);
- if (res.code === 200){
+ if (res.code === 200) {
layer.msg(res.msg, {icon: 1});
$(".layui-laypage-btn")[0].click();
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2});
}
}
@@ -337,10 +361,10 @@
// 淇敼鐘舵��
form.on('switch(statusSwitch)', function (obj) {
- var index = obj.othis.parents('tr').attr("data-index");
+ var index = obj.othis.parents('tr').attr("data-index");
var data = tableData[index];
- data[this.name] = obj.elem.checked?1:0;
- http.post(baseUrl+"/sensor/edit/auth", {id: data.id, status: data[this.name]}, function (res) {
+ data[this.name] = obj.elem.checked ? 1 : 0;
+ http.post(baseUrl + "/sensor/edit/auth", {id: data.id, status: data[this.name]}, function (res) {
layer.msg(res.msg, {icon: 1});
})
})
@@ -351,7 +375,7 @@
function tableReload(child) {
var searchData = {};
- $.each($('#search-box [name]').serializeArray(), function() {
+ $.each($('#search-box [name]').serializeArray(), function () {
searchData[this.name] = this.value;
});
(child ? parent.tableIns : tableIns).reload({
@@ -370,14 +394,14 @@
$.ajax({
url: baseUrl + "/out/pakout/orderDetlIds/auth",
headers: {'token': localStorage.getItem('token')},
- data: { orderId : orderId },
+ data: {orderId: orderId},
method: 'POST',
success: function (res) {
layer.close(loadIndex);
- if (res.code === 200){
+ if (res.code === 200) {
pakoutPreview(res.data);
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
} else {
layer.msg(res.msg, {icon: 2});
}
--
Gitblit v1.9.1