YonBIP_2312_PU_请购单支持批次号批量粘贴

This commit is contained in:
mzr 2025-12-16 16:38:22 +08:00
parent 956d4520be
commit 98427962a0
1 changed files with 76 additions and 3 deletions

View File

@ -1,4 +1,3 @@
/*8nIjANkSB9VpkQdmnMi+FHfYOgBuQU7hJA/ae0lDy6s=*/
/*
* @Author: zhangshqb
* @PageInfo: 表体编辑后事件 批量
@ -193,6 +192,82 @@ export default async function batchEvents(obj) {
queryValue[queryValue.length - 1].queryCondition = { cmaterialvid: newValue[i].values.pk_material.value };
}
isManyCondition = true;
}else if (attrcode == 'vbatchcode') {
let pk_org = this.props.form.getFormItemsValue(BUYINGREQ_CARD.formId, ATTRCODE.pk_org).value;
let constance = {};
let querys = [];
let querysindex = 0;
constance.key = 'vbatchcode';
for (let i = 0; i < newValue.length; i++) {
if (!(newValue[i].values.pk_material && newValue[i].values.pk_material.value)) {
continue;
}
let materialvid = newValue[i].values.pk_material.value;
constance.params = {
key: "vbatchcode",
pk_org: pk_org,
materialvid: materialvid,
cmaterialvid: materialvid
};
let flag =true;
if (flag) {
querys[querysindex] = {
index: currentIndex + i,
cmaterialvid: newValue[i].values.pk_material.value,
vbatchcode: newValue[i].values.vbatchcode.value
};
querysindex = querysindex + 1;
queryValue.push(newValue[i]);
indexs[i] = currentIndex + i;
rows[i] = [ i ];
}
}
ajax({
url: '/nccloud/ic/onhand/querybatchcode.do',
data: querys,
async: false,
success: (res) => {
if (res.data === null) {
return;
}
let j = 0;
let k = 0;
for (let i = 0; i < newValue.length; i++) {
if (res.data.length == k) {
break;
}
if (res.data[j] && res.data[j].index == i) {
if (res.data[j].flag == true) {
indexs[k] = i;
//console.log('123', newValue[i].values.vbatchcode.value);
this.props.cardTable.setValByKeyAndIndex(BUYINGREQ_CARD.tableId, i, 'vbatchcode', {
value: newValue[i].values.vbatchcode.value,
display: newValue[i].values.vbatchcode.value
});
this.props.cardTable.setValByKeyAndIndex(BUYINGREQ_CARD.tableId, i, 'pk_batchcode', {
value: res.data[j].pk,
display: res.data[j].pk
});
j = j + 1;
k = k + 1;
} else {
this.props.cardTable.setValByKeyAndIndex(BUYINGREQ_CARD.tableId, i, 'vbatchcode', {
value: newValue[i].values.vbatchcode.value,
display: newValue[i].values.vbatchcode.value
});
this.props.cardTable.setValByKeyAndIndex(BUYINGREQ_CARD.tableId, i, 'pk_batchcode', {
value: '',
display: ''
});
j = j + 1;
}
}
}
}
});
return;
} else {
return;
}
@ -244,5 +319,3 @@ export default async function batchEvents(obj) {
});
});
}
/*8nIjANkSB9VpkQdmnMi+FHfYOgBuQU7hJA/ae0lDy6s=*/