|
|
@ -12,6 +12,40 @@ var confirmSubmitting = false; |
|
|
const COOKIE_ORDER = "prodBagRetPdaOrder"; |
|
|
const COOKIE_ORDER = "prodBagRetPdaOrder"; |
|
|
const COOKIE_TABLE = "prodBagRetPdaTable"; |
|
|
const COOKIE_TABLE = "prodBagRetPdaTable"; |
|
|
|
|
|
|
|
|
|
|
|
// 兼容清理历史 path Cookie,避免同名 Cookie 导致读取不稳定 - rqrq
|
|
|
|
|
|
function clearOrderCookie () { |
|
|
|
|
|
$.cookie(COOKIE_ORDER, "", { expires: -1, path: "/" }); |
|
|
|
|
|
$.cookie(COOKIE_ORDER, "", { expires: -1 }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 兼容清理历史 path Cookie,避免同名 Cookie 导致读取不稳定 - rqrq
|
|
|
|
|
|
function clearTableCookie () { |
|
|
|
|
|
$.cookie(COOKIE_TABLE, "", { expires: -1, path: "/" }); |
|
|
|
|
|
$.cookie(COOKIE_TABLE, "", { expires: -1 }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 退出菜单或异常场景统一清理缓存 - rqrq
|
|
|
|
|
|
function clearBagReturnCookies () { |
|
|
|
|
|
clearOrderCookie(); |
|
|
|
|
|
clearTableCookie(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 读取 JSON Cookie 并容错,坏数据自动清理 - rqrq
|
|
|
|
|
|
function readJsonCookieSafe (cookieName, clearFn) { |
|
|
|
|
|
var raw = $.cookie(cookieName); |
|
|
|
|
|
if (raw == null || raw === "") { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
|
|
|
return JSON.parse(raw); |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
if (clearFn) { |
|
|
|
|
|
clearFn(); |
|
|
|
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 与本单已录入行比对:seqNo_itemNo(与二维码第4、5段一致)- rqrq */ |
|
|
/** 与本单已录入行比对:seqNo_itemNo(与二维码第4、5段一致)- rqrq */ |
|
|
function bagLabelDupKey(seqNo, itemNo) { |
|
|
function bagLabelDupKey(seqNo, itemNo) { |
|
|
return String(seqNo) + "_" + String(itemNo); |
|
|
return String(seqNo) + "_" + String(itemNo); |
|
|
@ -23,19 +57,21 @@ $(function () { |
|
|
} else { |
|
|
} else { |
|
|
window.location.href = "/login"; |
|
|
window.location.href = "/login"; |
|
|
} |
|
|
} |
|
|
var orderCookie = $.cookie(COOKIE_ORDER); |
|
|
|
|
|
if (orderCookie != null && orderCookie !== "") { |
|
|
|
|
|
currentData = JSON.parse(orderCookie); |
|
|
|
|
|
|
|
|
var orderCookie = readJsonCookieSafe(COOKIE_ORDER, clearOrderCookie); |
|
|
|
|
|
if (orderCookie != null) { |
|
|
|
|
|
currentData = orderCookie; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
// 缺少订单上下文时清空残留缓存并返回步骤1 - rqrq
|
|
|
|
|
|
clearBagReturnCookies(); |
|
|
layer.msg("请先扫袋装标签选择订单"); |
|
|
layer.msg("请先扫袋装标签选择订单"); |
|
|
var menuId = $("#menuId").val(); |
|
|
var menuId = $("#menuId").val(); |
|
|
var superiorName = $("#current_titleName").val(); |
|
|
var superiorName = $("#current_titleName").val(); |
|
|
window.location.href = "/pdaOther/productionBagReturnStep1?menuId=" + encodeURIComponent(menuId || "") + "&titleName=" + encodeURIComponent(superiorName || ""); |
|
|
window.location.href = "/pdaOther/productionBagReturnStep1?menuId=" + encodeURIComponent(menuId || "") + "&titleName=" + encodeURIComponent(superiorName || ""); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
var list = $.cookie(COOKIE_TABLE); |
|
|
|
|
|
if (list != null && list !== "") { |
|
|
|
|
|
tableList = JSON.parse(list); |
|
|
|
|
|
|
|
|
var list = readJsonCookieSafe(COOKIE_TABLE, clearTableCookie); |
|
|
|
|
|
if (Array.isArray(list)) { |
|
|
|
|
|
tableList = list; |
|
|
changeTable(); |
|
|
changeTable(); |
|
|
} |
|
|
} |
|
|
$("#partNo_search").focus(); |
|
|
$("#partNo_search").focus(); |
|
|
@ -211,7 +247,7 @@ function confirmReturn () { |
|
|
success: function (data) { |
|
|
success: function (data) { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
layer.msg(data.msg || "操作成功!"); |
|
|
layer.msg(data.msg || "操作成功!"); |
|
|
$.cookie(COOKIE_TABLE, "", { expires: -1, path: "/" }); |
|
|
|
|
|
|
|
|
clearTableCookie(); |
|
|
tableList = []; |
|
|
tableList = []; |
|
|
changeTable(); |
|
|
changeTable(); |
|
|
$("#wareHouse").val(""); |
|
|
$("#wareHouse").val(""); |
|
|
@ -244,3 +280,9 @@ function superiorJump () { |
|
|
var superiorName = $("#current_titleName").val(); |
|
|
var superiorName = $("#current_titleName").val(); |
|
|
window.location.href = "/pdaOther/productionBagReturnStep1?menuId=" + encodeURIComponent(menuId || "") + "&titleName=" + encodeURIComponent(superiorName || ""); |
|
|
window.location.href = "/pdaOther/productionBagReturnStep1?menuId=" + encodeURIComponent(menuId || "") + "&titleName=" + encodeURIComponent(superiorName || ""); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function pdaBaseJump () { |
|
|
|
|
|
// 直接返回菜单时清理步骤缓存,避免下次进入串单 - rqrq
|
|
|
|
|
|
clearBagReturnCookies(); |
|
|
|
|
|
window.location.href = "/pda/pdaBase"; |
|
|
|
|
|
} |