Compare commits

...

3 Commits

Author SHA1 Message Date
lihao 88372b072f 优化粘贴 2025-08-14 18:01:44 +08:00
lihao 250ed61b05 Merge branch 'main' of http://121.37.179.211:3000/yonyou/tk2312-web 2025-08-11 18:26:10 +08:00
lihao 8569f6e1a7 前端调整 2025-08-11 18:24:28 +08:00
2 changed files with 19 additions and 6 deletions

View File

@ -293,7 +293,7 @@ class PickmCard extends Component {
return;
}
for (let i = 0; i < rows.length; i++){
rowids.push(rows[0].data.values.cpickm_bid.value);
rowids.push(rows[i].data.values.cpickm_bid.value);
}
let data = {
cpickmids: hids,

View File

@ -130,13 +130,26 @@ function processResultBatchByCard(props, moduleId, rows, indexs) {
let updateArray = [];
let allRows = props.editTable.getAllRows(moduleId);
let i = allRows.length;
// for (let j = 0; j < rows.length; j++) {
// let row = rows[j];
// let obj = {index: indexs[j], data: row};
// if (indexs[j] < i) {
// updateArray.push(obj);
// } else {
// insertArray.push(obj);
// }
// }
// 提取所有现有行的rowid用于快速判断
const existingRowIds = allRows.map(row => row.rowid);
for (let j = 0; j < rows.length; j++) {
let row = rows[j];
let obj = { index: indexs[j], data: row };
if (indexs[j] < i) {
updateArray.push(obj);
// 判断当前行的rowid是否已存在于allRows中
if (existingRowIds.includes(row.rowid)) {
updateArray.push(obj); // 存在则更新
} else {
insertArray.push(obj);
insertArray.push(obj); // 不存在则插入
}
}
if (updateArray.length > 0) {