From 7eec33a887ebc11a51a3ccd3c5f7a4c9ab20e917 Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Thu, 18 Dec 2025 10:21:51 +0800 Subject: [PATCH] commonbill查询条件 --- src/components/Common/CommonHooks/useCommonBase.js | 31 +++++++++++++++++++------------ src/components/Common/CommonTable/index.js | 2 ++ src/index.less | 5 ++++- src/mes/common/commonModelComponent/index.js | 22 ++++++++++++---------- src/mes/common/commonOperationBarComponent/MesToolbar.js | 6 +++++- src/mes/common/commonOperationBarComponent/index.js | 4 +++- src/mes/indexMes/index.less | 7 +++++-- 7 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index 6cf2d46..4ad68cd 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -245,7 +245,7 @@ const useCommonBase = props => { flag, isWait, configData, - clearSelectData + clearSelectData, } = params; const { token, @@ -326,23 +326,29 @@ const useCommonBase = props => { ...sParentConditions }; } - + const configDataId = configData?.sId; const sId = JSON.parse(JSON.stringify(condition?.sId || '')) - console.log(configData, 'configData'); - - if (name === 'master') { + let pageRoute = props.sModelType; + // 如果是弹窗且没有pageLayout,则认为是commonBill + if (commonUtils.isNotEmptyObject(props.parentProps)) { + pageRoute = '/indexPage/commonBill'; + } + if (name === 'master' && pageRoute.includes('indexPage/commonBill')) { // condition.sId = configDataId condition.pageNum = '' condition.pageSize = '' delete condition.sSqlCondition } - if (name.includes('slave')) { - delete condition.sSqlCondition - delete condition.sId - condition.sSqlCondition = { - sParentId: sId - } + if (name.includes('slave') && pageRoute.includes('indexPage/commonBill')) { + delete condition.sSqlCondition + delete condition.sId + condition.sSqlCondition = { + sParentId: sId + } + } + if (name === 'master' && sId === '') { + return } const dataUrl = `${commonConfig.server_host }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; @@ -548,7 +554,7 @@ const useCommonBase = props => { const conditonValues = {}; if (commonUtils.isNotEmptyStr(showConfig.sSqlCondition)) { const conditon = showConfig.sSqlCondition.split(","); - + conditon.forEach(item => { // 特殊处理 if (item === "sBoardNo.sBoardNo") { @@ -2337,6 +2343,7 @@ const useCommonBase = props => { sActiveId, title: sActiveName, sParentConditions, + sModelType: '/indexPage/commonBill', parentProps: { ...returnProps, record diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js index ac90c7d..4473992 100644 --- a/src/components/Common/CommonTable/index.js +++ b/src/components/Common/CommonTable/index.js @@ -8234,6 +8234,8 @@ class CommonTableRc extends React.Component { controlConfig[0].sDropDownType === "popup" ) { btnPupopConfig = controlConfig[0]; + console.log(btnPupopConfig, 'btnPupopConfig'); + this.setState({ commonPopupVisible: true, commonPopupTbName: name, diff --git a/src/index.less b/src/index.less index a4d328e..ee0f595 100644 --- a/src/index.less +++ b/src/index.less @@ -4094,7 +4094,10 @@ ton:focus { } } } - +:global .ant-select.ant-select-in-form-item{ + border: 1px solid #d9d9d9; + border-radius: 4px; +} :global { #root { diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 402e08d..7a17207 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -399,8 +399,8 @@ const useCommonModelEvent = props => { if (!props.bFinish) return; if (commonUtils.isEmptyObject(copyTo)) return; - const { masterConfig, sModelsId } = props; - + const { masterConfig, sModelsId, masterData } = props; + if (masterData && masterData.sBillNo) return let masterDataCopyTo = {}; for (const key in copyTo) { const tableData = copyTo[key]; @@ -408,14 +408,15 @@ const useCommonModelEvent = props => { masterDataCopyTo = tableData; } } - // const masterDataNew = { - // ...commonFunc.getDefaultData(masterConfig), - // handleType: "add", - // sId: commonUtils.createSid(), - // sFormId: sModelsId, - // ...masterDataCopyTo - // }; - // props.onSaveState({ masterData: masterDataNew, enabled: true }); + + const masterDataNew = { + ...commonFunc.getDefaultData(masterConfig), + handleType: "add", + sId: commonUtils.createSid(), + sFormId: sModelsId, + ...masterDataCopyTo + }; + props.onSaveState({ masterData: masterDataNew, enabled: true }); }, [props.bFinish] ); @@ -595,6 +596,7 @@ const useCommonModelEvent = props => { sSqlCondition: { ...conditonValues, ...sFilterConditions, }, bFilter }, + sModelTypes: props.parentProps, isWait: true })) || {}; props.setTempRef(result); diff --git a/src/mes/common/commonOperationBarComponent/MesToolbar.js b/src/mes/common/commonOperationBarComponent/MesToolbar.js index 13143c7..40c99a6 100644 --- a/src/mes/common/commonOperationBarComponent/MesToolbar.js +++ b/src/mes/common/commonOperationBarComponent/MesToolbar.js @@ -12,6 +12,7 @@ const ToolbarFun = (props) => { const { sControlName } = btnConfig; const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase(); + if (btnName === 'btnadd') { handleAdd(props); } else if (btnName === 'btnsave') { @@ -20,6 +21,8 @@ const ToolbarFun = (props) => { props.onSaveState({ enabled: true }); } else if (btnName === 'btnscanface') { handleScanFace(props); + } else if (btnName === 'btncancel') { + } @@ -43,7 +46,8 @@ const handleAdd = (props) => { const { app } = props; const { managementData } = app; const menuList = managementData.reduce((result, item) => { - result = [...result, ...item.children]; + // ✅ 安全展开:确保children是数组,否则使用空数组 + result = [...result, ...(Array.isArray(item?.children) ? item.children : [])]; return result; }, []); diff --git a/src/mes/common/commonOperationBarComponent/index.js b/src/mes/common/commonOperationBarComponent/index.js index bcc5c0f..5c818d9 100644 --- a/src/mes/common/commonOperationBarComponent/index.js +++ b/src/mes/common/commonOperationBarComponent/index.js @@ -424,6 +424,7 @@ const useCommonOperationBarComponentEvent = props => { sActiveId, title: sActiveName, copyTo, + sModelType:'/indexPage/commonBill', sParentConditions, parentProps: props, onOk: data => { @@ -781,7 +782,8 @@ const CommonOperationBarComponent = basProps => { const btnLeftConfig = gdsconfigformslave.filter( item => item.bVisible && item.sControlName.includes("BtnLeft.") ); - + console.log(btnLeftConfig,gdsconfigformslave, 'btnLeftConfig'); + // 将扫码上料放到最后 const scanCodeToLoadMaterialsIndex = btnLeftConfig.findIndex( item => item.showName === "扫码上料" diff --git a/src/mes/indexMes/index.less b/src/mes/indexMes/index.less index 71ccd7d..d1e9643 100644 --- a/src/mes/indexMes/index.less +++ b/src/mes/indexMes/index.less @@ -3,12 +3,15 @@ @header-height: 60px; @sider-width: 110px; @base-color: #FFF; - + :global .ant-select-in-form-item { + border-radius: 4px; + border: 1px solid #d9d9d9; + } .indexMes { .size(); background: #DCE2E8; overflow: hidden; - + :global { .header { .flex(); -- libgit2 0.22.2