From 98427962a062d7c59499aed2a01b92a8b89fc8fc Mon Sep 17 00:00:00 2001 From: mzr Date: Tue, 16 Dec 2025 16:38:22 +0800 Subject: [PATCH] =?UTF-8?q?YonBIP=5F2312=5FPU=5F=E8=AF=B7=E8=B4=AD?= =?UTF-8?q?=E5=8D=95=E6=94=AF=E6=8C=81=E6=89=B9=E6=AC=A1=E5=8F=B7=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E7=B2=98=E8=B4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../buyingreq/card/batchEvents/batchEvents.js | 79 ++++++++++++++++++- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/src/pu/pu/buyingreq/card/batchEvents/batchEvents.js b/src/pu/pu/buyingreq/card/batchEvents/batchEvents.js index d9221dc3..ca82ef64 100644 --- a/src/pu/pu/buyingreq/card/batchEvents/batchEvents.js +++ b/src/pu/pu/buyingreq/card/batchEvents/batchEvents.js @@ -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=*/ \ No newline at end of file