This commit is contained in:
cwchen 2024-11-16 17:39:27 +08:00
parent f5e9e5638b
commit a196825d36
2 changed files with 5 additions and 5 deletions

View File

@ -283,7 +283,7 @@ function addFitDatas(data, userId) {
if (jjDataArr.length > 0) { // 继续添加数据 if (jjDataArr.length > 0) { // 继续添加数据
let newJjDataArr = JSON.parse(data); let newJjDataArr = JSON.parse(data);
$.each(newJjDataArr, function (index, item) { $.each(newJjDataArr, function (index, item) {
updateOrAddObject(item.id, item); updateOrAddObject(item.partId, item);
}); });
setTableData(jjDataArr); setTableData(jjDataArr);
} else { // 第一次添加数据 } else { // 第一次添加数据
@ -297,7 +297,7 @@ function addFitDatas(data, userId) {
} }
function updateOrAddObject(id, newObject) { function updateOrAddObject(id, newObject) {
const index = jjDataArr.findIndex(obj => obj.id === id); const index = jjDataArr.findIndex(obj => obj.partId === id);
if (index !== -1) { if (index !== -1) {
// 如果对象存在,则替换它 // 如果对象存在,则替换它
jjDataArr[index] = newObject; jjDataArr[index] = newObject;
@ -417,7 +417,7 @@ function checkValue(that, type) {
if (!regex.test(value) && value) { if (!regex.test(value) && value) {
$(that).val(0); $(that).val(0);
return layer.msg('本次退回量输入不合法,请重新输入!', { icon: 5 }) return layer.msg('本次退回量输入不合法,请重新输入!', { icon: 5 })
} else if (value && value > lyNum) { } else if (value && parseInt(value) > parseInt(lyNum)) {
$(that).val(0); $(that).val(0);
return layer.msg('本次退回量不能超过累计领料数量,请重新输入!', { icon: 5 }) return layer.msg('本次退回量不能超过累计领料数量,请重新输入!', { icon: 5 })
} }

View File

@ -142,7 +142,7 @@ function initTable() {
unresize: true, unresize: true,
align: "center", align: "center",
edit: 'text', edit: 'text',
style: 'outline: 1px solpartId #e6e6e6;outline-offset: -5px;' style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
}, },
{ {
field: "remark", field: "remark",
@ -151,7 +151,7 @@ function initTable() {
unresize: true, unresize: true,
align: "center", align: "center",
edit: 'textarea', edit: 'textarea',
style: 'outline: 1px solpartId #e6e6e6;outline-offset: -5px;' style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
}, },
], ],