diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 792096c..ad13037 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -300,7 +300,7 @@ export default class CommonComponent extends Component { } /* 若下拉配置了movesql 则离开时 调用下拉sql数据 */ if (this.props.showConfig && (this.props.showConfig.sDropDownType === 'movesql' || commonUtils.isNotEmptyObject(this.props.showConfig.sButtonParam))) { - this.props.onDropDownBlur(this.props.name, this.props.showConfig.sName, this.props.record, this.props.showConfig); + this.props.onDropDownBlur(this.props.name, this.props.showConfig.sName, this.props.record, this.props.showConfig); } this.onCheckFields(500); diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index 6258e1d..f4d3d77 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -2503,11 +2503,12 @@ const useCommonBase = props => { const handleTableBlur = async (name, sFileName, record, tableConfig, other) => { const { sModelsId, app } = props; const { controlData, slaveConfig, [`${name}Data`]: tableData, [`${name}Config`]: tempConfig } = state; - let { slaveData: slaveDataOld, masterData, slaveDelData, } = state; + let { slaveData: slaveDataOld, masterData, slaveDelData,slaveSelectedData = []} = state; const addState = {}; if (commonUtils.isEmptyArr(slaveDelData)) { slaveDelData = []; } + if (sFileName === 'sPartsNameNew') { if (commonUtils.isNotEmptyArr(controlData)) { /* 离开时 把sPartsNameNewId数据挂载到sControlParentId */ @@ -2569,7 +2570,7 @@ const useCommonBase = props => { newCopyTo.master = masterData; // newCopyTo.slave = commonUtils.isEmpty(slaveData) ? [] : slaveData[0]; // const sRowData = copyTo.slaveData; - const sRowData = masterData; + const sRowData = masterData ? masterData : slaveDataOld[0]; const value = { sProName, sProInParam: JSON.stringify({ params: sRowData }) }; if (other?.iFlag === 1) { value.iFlag = 1; diff --git a/src/mes/common/commonOperationBarComponent/index.js b/src/mes/common/commonOperationBarComponent/index.js index 9e54a4e..c8184b8 100644 --- a/src/mes/common/commonOperationBarComponent/index.js +++ b/src/mes/common/commonOperationBarComponent/index.js @@ -936,7 +936,8 @@ const CommonOperationBarComponent = basProps => { searchField = { sId: commonUtils.createSid(), showName: searchFieldList.map(item => item.showName).join("/"), - sName: searchFieldList[0].sName + sName: searchFieldList[0].sName, + sRelation: searchFieldList[0].sRelation }; } @@ -1176,7 +1177,6 @@ const CommonOperationBarComponent = basProps => { ] : undefined; } - props.onSaveState({ [`${sName}SelectedBtn`]: undefined, [`${sName}Filter`]: bFilter, @@ -1194,6 +1194,35 @@ const CommonOperationBarComponent = basProps => { } const btnSearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); + const letfSearchField = btnLeftConfig.find(x => x.sControlName.includes('ScanLoadMaterial') && x.sButtonParam) + let leftShowTypeProps = { + app, + record: {}, + sId: letfSearchField.sId /* 修改当前编号(数据格式:字符串) */, + name: "slave", + form, + formId: sModelsId, + getFloatNum: props.getFloatNum, + onChange: props.onSearchValueChange, + showConfig: { + ...letfSearchField, + placeholder: '请输入' + }, + formItemLayout: {}, + textArea: false, + enabled: true, + dataValue: searchValue, + bTable: true, + getSqlDropDownData: props.getSqlDropDownData, + getSqlCondition: props.getSqlCondition, + handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord, + // getFloatNum: props.getFloatNum, + formRoute: props.formRoute, + getDateFormat: props.getDateFormat, + bNoMesBlue: true, + record: props.slaveData[0], + onDropDownBlur: props.onDropDownBlur + } return (
@@ -1236,6 +1265,13 @@ const CommonOperationBarComponent = basProps => {
···
); + } else if (item.sButtonParam) { + return
+ + {/* */} +
} return (