Compare commits
3 Commits
736d29b2f3
...
88372b072f
Author | SHA1 | Date |
---|---|---|
|
88372b072f | |
|
250ed61b05 | |
|
8569f6e1a7 |
|
@ -284,7 +284,7 @@ class PickmCard extends Component {
|
||||||
let rowids = [];
|
let rowids = [];
|
||||||
let hids = [];
|
let hids = [];
|
||||||
let hid;
|
let hid;
|
||||||
let rows =this.props.table.getCheckedRows(AREA.borrowMaterialDialog);
|
let rows = this.props.table.getCheckedRows(AREA.borrowMaterialDialog);
|
||||||
hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
|
hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
|
||||||
hids.push(hid);
|
hids.push(hid);
|
||||||
// 如果没有选中行,则提示并返回,不进行任何操作
|
// 如果没有选中行,则提示并返回,不进行任何操作
|
||||||
|
@ -293,7 +293,7 @@ class PickmCard extends Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < rows.length; i++){
|
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 = {
|
let data = {
|
||||||
cpickmids: hids,
|
cpickmids: hids,
|
||||||
|
|
|
@ -130,13 +130,26 @@ function processResultBatchByCard(props, moduleId, rows, indexs) {
|
||||||
let updateArray = [];
|
let updateArray = [];
|
||||||
let allRows = props.editTable.getAllRows(moduleId);
|
let allRows = props.editTable.getAllRows(moduleId);
|
||||||
let i = allRows.length;
|
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++) {
|
for (let j = 0; j < rows.length; j++) {
|
||||||
let row = rows[j];
|
let row = rows[j];
|
||||||
let obj = {index: indexs[j], data: row};
|
let obj = { index: indexs[j], data: row };
|
||||||
if (indexs[j] < i) {
|
// 判断当前行的rowid是否已存在于allRows中
|
||||||
updateArray.push(obj);
|
if (existingRowIds.includes(row.rowid)) {
|
||||||
|
updateArray.push(obj); // 存在则更新
|
||||||
} else {
|
} else {
|
||||||
insertArray.push(obj);
|
insertArray.push(obj); // 不存在则插入
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (updateArray.length > 0) {
|
if (updateArray.length > 0) {
|
||||||
|
|
Loading…
Reference in New Issue