diff --git a/src/components/Common/SearchComponent/index.js b/src/components/Common/SearchComponent/index.js index 1c4b6c8..e24bede 100644 --- a/src/components/Common/SearchComponent/index.js +++ b/src/components/Common/SearchComponent/index.js @@ -593,7 +593,7 @@ export default class SearchComponent extends Component { /** 修改主表数据 */ handleMasterChange = async (name, sFieldName, changeValue, sId, dropDownData) => { // let { expand } = false; - if (sFieldName === 'sSearchSolutionId') { + if (sFieldName === 'sSearchSolutionId' && false && !location.pathname.toLowerCase().includes('productionmainplan')) { const { searchSolution, slaveConfig, slaveInfoConfig, setSearchSlaveInfo, } = this.props; @@ -639,6 +639,35 @@ export default class SearchComponent extends Component { // expand = true; // } // this.props.onSaveState({ expand }); + } else if (sFieldName === 'sSearchSolutionId' ) { + const { + searchSolution, slaveConfig, slaveInfoConfig, setSearchSlaveInfo, + } = this.props; + const iIndex = searchSolution.findIndex(item => item.sId === changeValue[sFieldName]); + const addState = await this.defaultSearchSolution(searchSolution[iIndex]); + const filterCondition = JSON.parse(searchSolution[iIndex].sCondition); + + this.props.onSaveState({ ...addState }, () => { + this.props.onGetData(slaveConfig, JSON.parse(searchSolution[iIndex].sCondition), '', '', '', '', addState.sGroupByList); + }); + /* 判断是否要加载过滤树数据 */ + const filterTreeConfigArr = slaveConfig.gdsconfigformslave.filter(item => item.bTree); + if (commonUtils.isNotEmptyArr(filterTreeConfigArr)) { + const filterTreeConfig = filterTreeConfigArr[0]; + this.props.onGetFilterTreeData(filterTreeConfig, filterCondition, 1); + let { treeSelectedKeys } = this.props; + if (commonUtils.isNotEmptyArr(treeSelectedKeys)) { /* 清除原来选中树节点 */ + treeSelectedKeys = []; + this.props.onSaveState({ + treeSelectedKeys, treeFilterCondition: [], + }); + } + } + if (setSearchSlaveInfo === 'Y') { + if (commonUtils.isNotEmptyObject(slaveInfoConfig)) { + this.props.onGetDataInfo(slaveInfoConfig, JSON.parse(searchSolution[iIndex].sCondition)); + } + } } else if (sFieldName.includes('sFirst-')) { const { slaveConfig } = this.props; const { masterData } = this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true);