Commit 732ceda838a8434ec7a5cb78b0773d0d9081940a

Authored by Min
1 parent 6d54586f

1.subbill 导入数据后,没有把子从表数量汇总到从表

src/components/Common/CommonSubBill.js
@@ -243,7 +243,16 @@ class CommonSubBill extends Component { @@ -243,7 +243,16 @@ class CommonSubBill extends Component {
243 // tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'dProductQty', masterData, tableDataRow); 243 // tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'dProductQty', masterData, tableDataRow);
244 // } 244 // }
245 }; 245 };
246 - this.props.onSaveState({ [`${temp}Data`]: returnData, [`${temp}DelData`]: tempDelData }); 246 + this.props.onSaveState({ [`${temp}Data`]: returnData, [`${temp}DelData`]: tempDelData },() => {
  247 + if(temp === 'slaveChild' && commonUtils.isNotEmptyArr(returnData)) {
  248 + const params = {
  249 + sFieldName: 'dAuxiliaryQty',
  250 + tableDataRow: returnData[0],
  251 + }
  252 + // 汇总到从表方法
  253 + this.props.onWriteBack(params);
  254 + }
  255 + });
247 } else { /* 失败s */ 256 } else { /* 失败s */
248 this.props.getServiceError(file.response); 257 this.props.getServiceError(file.response);
249 } 258 }
src/components/Common/CommonSubBillEvent.js
@@ -4404,22 +4404,22 @@ export default (ChildComponent) => { @@ -4404,22 +4404,22 @@ export default (ChildComponent) => {
4404 const dataRow = item.sId === params.tableDataRow.sId ? params.tableDataRow : item; 4404 const dataRow = item.sId === params.tableDataRow.sId ? params.tableDataRow : item;
4405 const { itype, iType } = dataRow; 4405 const { itype, iType } = dataRow;
4406 const type = itype !== undefined ? itype : iType !== undefined ? iType : 11; 4406 const type = itype !== undefined ? itype : iType !== undefined ? iType : 11;
4407 - console.log('s', dataRow.sId, type);  
4408 - if (type === 1) {  
4409 - dAuxiliaryQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0);  
4410 - } else if (type === 2) {  
4411 - dEscrowAuxiliaryQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0);  
4412 - } else if (type === 3) {  
4413 - dGiveAuxiliaryQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0);  
4414 - } else if (type === 10) {  
4415 - dAuxiliaryQty += commonUtils.isNull(dataRow.dProductQty, 0);  
4416 - } else if (type === 11) {  
4417 - dProductQty += commonUtils.isNull(dataRow.dAuxiliaryQty, 0);  
4418 - } else if (type === 12) {  
4419 - dProductQty += commonUtils.isNull(dataRow.dProductQty, 0); 4407 +
  4408 + if (type === 1 || type === '1') {
  4409 + dAuxiliaryQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0);
  4410 + } else if (type === 2 || type === '2') {
  4411 + dEscrowAuxiliaryQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0);
  4412 + } else if (type === 3 || type === '3') {
  4413 + dGiveAuxiliaryQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0);
  4414 + } else if (type === 10 || type === '10') {
  4415 + dAuxiliaryQty += commonUtils.isNull(Number(dataRow.dProductQty), 0);
  4416 + } else if (type === 11 || type === '11') {
  4417 + dProductQty += commonUtils.isNull(Number(dataRow.dAuxiliaryQty), 0);
  4418 + } else if (type === 12 || type === '12') {
  4419 + dProductQty += commonUtils.isNull(Number(dataRow.dProductQty), 0);
4420 } 4420 }
4421 }); 4421 });
4422 - 4422 + console.log('dAuxiliaryQty', dAuxiliaryQty);
4423 const iIndex = slaveData.findIndex(item => item.sId === sId); 4423 const iIndex = slaveData.findIndex(item => item.sId === sId);
4424 let tableDataRow = {}; 4424 let tableDataRow = {};
4425 tableDataRow = await this.handleTableChange('slave', 'dEscrowAuxiliaryQty', { dEscrowAuxiliaryQty }, sId, [], true); 4425 tableDataRow = await this.handleTableChange('slave', 'dEscrowAuxiliaryQty', { dEscrowAuxiliaryQty }, sId, [], true);
@@ -6891,6 +6891,7 @@ export default (ChildComponent) => { @@ -6891,6 +6891,7 @@ export default (ChildComponent) => {
6891 onContextMenuOk={this.handleContextMenuOk} 6891 onContextMenuOk={this.handleContextMenuOk}
6892 orderNum={this.orderNum} 6892 orderNum={this.orderNum}
6893 onSelectCommonPopup={this.handleSelectCommonPopup} /* 送货单个性化放大镜弹窗 */ 6893 onSelectCommonPopup={this.handleSelectCommonPopup} /* 送货单个性化放大镜弹窗 */
  6894 + onWriteBack = {this.handleWriteBack}
6894 /> 6895 />
6895 ); 6896 );
6896 } 6897 }