diff --git a/src/components/Common/CommonSubBill.js b/src/components/Common/CommonSubBill.js index 9e40fdd..737275e 100644 --- a/src/components/Common/CommonSubBill.js +++ b/src/components/Common/CommonSubBill.js @@ -243,7 +243,16 @@ class CommonSubBill extends Component { // tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'dProductQty', masterData, tableDataRow); // } }; - this.props.onSaveState({ [`${temp}Data`]: returnData, [`${temp}DelData`]: tempDelData }); + this.props.onSaveState({ [`${temp}Data`]: returnData, [`${temp}DelData`]: tempDelData },() => { + if(temp === 'slaveChild' && commonUtils.isNotEmptyArr(returnData)) { + const params = { + sFieldName: 'dAuxiliaryQty', + tableDataRow: returnData[0], + } + // 汇总到从表方法 + this.props.onWriteBack(params); + } + }); } else { /* 失败s */ this.props.getServiceError(file.response); } diff --git a/src/components/Common/CommonSubBillEvent.js b/src/components/Common/CommonSubBillEvent.js index 80fc478..c698131 100644 --- a/src/components/Common/CommonSubBillEvent.js +++ b/src/components/Common/CommonSubBillEvent.js @@ -4404,22 +4404,22 @@ export default (ChildComponent) => { const dataRow = item.sId === params.tableDataRow.sId ? params.tableDataRow : item; const { itype, iType } = dataRow; const type = itype !== undefined ? itype : iType !== undefined ? iType : 11; - console.log('s', dataRow.sId, type); - if (type === 1) { - dAuxiliaryQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0); - } else if (type === 2) { - dEscrowAuxiliaryQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0); - } else if (type === 3) { - dGiveAuxiliaryQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0); - } else if (type === 10) { - dAuxiliaryQty += commonUtils.isNull(dataRow.dProductQty, 0); - } else if (type === 11) { - dProductQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0); - } else if (type === 12) { - dProductQty += commonUtils.isNull(dataRow.dProductQty, 0); + + if (type === 1 || type === '1') { + dAuxiliaryQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0); + } else if (type === 2 || type === '2') { + dEscrowAuxiliaryQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0); + } else if (type === 3 || type === '3') { + dGiveAuxiliaryQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0); + } else if (type === 10 || type === '10') { + dAuxiliaryQty += commonUtils.isNull(Number(dataRow.dProductQty), 0); + } else if (type === 11 || type === '11') { + dProductQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0); + } else if (type === 12 || type === '12') { + dProductQty += commonUtils.isNull(Number(dataRow.dProductQty), 0); } }); - + console.log('dAuxiliaryQty', dAuxiliaryQty); const iIndex = slaveData.findIndex(item => item.sId === sId); let tableDataRow = {}; tableDataRow = await this.handleTableChange('slave', 'dEscrowAuxiliaryQty', { dEscrowAuxiliaryQty }, sId, [], true); @@ -6891,6 +6891,7 @@ export default (ChildComponent) => { onContextMenuOk={this.handleContextMenuOk} orderNum={this.orderNum} onSelectCommonPopup={this.handleSelectCommonPopup} /* 送货单个性化放大镜弹窗 */ + onWriteBack = {this.handleWriteBack} /> ); }