Commit 7eec33a887ebc11a51a3ccd3c5f7a4c9ab20e917
1 parent
45d17a73
commonbill查询条件
Showing
7 changed files
with
50 additions
and
27 deletions
src/components/Common/CommonHooks/useCommonBase.js
| @@ -245,7 +245,7 @@ const useCommonBase = props => { | @@ -245,7 +245,7 @@ const useCommonBase = props => { | ||
| 245 | flag, | 245 | flag, |
| 246 | isWait, | 246 | isWait, |
| 247 | configData, | 247 | configData, |
| 248 | - clearSelectData | 248 | + clearSelectData, |
| 249 | } = params; | 249 | } = params; |
| 250 | const { | 250 | const { |
| 251 | token, | 251 | token, |
| @@ -326,23 +326,29 @@ const useCommonBase = props => { | @@ -326,23 +326,29 @@ const useCommonBase = props => { | ||
| 326 | ...sParentConditions | 326 | ...sParentConditions |
| 327 | }; | 327 | }; |
| 328 | } | 328 | } |
| 329 | - | 329 | + |
| 330 | const configDataId = configData?.sId; | 330 | const configDataId = configData?.sId; |
| 331 | const sId = JSON.parse(JSON.stringify(condition?.sId || '')) | 331 | const sId = JSON.parse(JSON.stringify(condition?.sId || '')) |
| 332 | - console.log(configData, 'configData'); | ||
| 333 | - | ||
| 334 | - if (name === 'master') { | 332 | + let pageRoute = props.sModelType; |
| 333 | + // 如果是弹窗且没有pageLayout,则认为是commonBill | ||
| 334 | + if (commonUtils.isNotEmptyObject(props.parentProps)) { | ||
| 335 | + pageRoute = '/indexPage/commonBill'; | ||
| 336 | + } | ||
| 337 | + if (name === 'master' && pageRoute.includes('indexPage/commonBill')) { | ||
| 335 | // condition.sId = configDataId | 338 | // condition.sId = configDataId |
| 336 | condition.pageNum = '' | 339 | condition.pageNum = '' |
| 337 | condition.pageSize = '' | 340 | condition.pageSize = '' |
| 338 | delete condition.sSqlCondition | 341 | delete condition.sSqlCondition |
| 339 | } | 342 | } |
| 340 | - if (name.includes('slave')) { | ||
| 341 | - delete condition.sSqlCondition | ||
| 342 | - delete condition.sId | ||
| 343 | - condition.sSqlCondition = { | ||
| 344 | - sParentId: sId | ||
| 345 | - } | 343 | + if (name.includes('slave') && pageRoute.includes('indexPage/commonBill')) { |
| 344 | + delete condition.sSqlCondition | ||
| 345 | + delete condition.sId | ||
| 346 | + condition.sSqlCondition = { | ||
| 347 | + sParentId: sId | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + if (name === 'master' && sId === '') { | ||
| 351 | + return | ||
| 346 | } | 352 | } |
| 347 | const dataUrl = `${commonConfig.server_host | 353 | const dataUrl = `${commonConfig.server_host |
| 348 | }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; | 354 | }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; |
| @@ -548,7 +554,7 @@ const useCommonBase = props => { | @@ -548,7 +554,7 @@ const useCommonBase = props => { | ||
| 548 | const conditonValues = {}; | 554 | const conditonValues = {}; |
| 549 | if (commonUtils.isNotEmptyStr(showConfig.sSqlCondition)) { | 555 | if (commonUtils.isNotEmptyStr(showConfig.sSqlCondition)) { |
| 550 | const conditon = showConfig.sSqlCondition.split(","); | 556 | const conditon = showConfig.sSqlCondition.split(","); |
| 551 | - | 557 | + |
| 552 | conditon.forEach(item => { | 558 | conditon.forEach(item => { |
| 553 | // 特殊处理 | 559 | // 特殊处理 |
| 554 | if (item === "sBoardNo.sBoardNo") { | 560 | if (item === "sBoardNo.sBoardNo") { |
| @@ -2337,6 +2343,7 @@ const useCommonBase = props => { | @@ -2337,6 +2343,7 @@ const useCommonBase = props => { | ||
| 2337 | sActiveId, | 2343 | sActiveId, |
| 2338 | title: sActiveName, | 2344 | title: sActiveName, |
| 2339 | sParentConditions, | 2345 | sParentConditions, |
| 2346 | + sModelType: '/indexPage/commonBill', | ||
| 2340 | parentProps: { | 2347 | parentProps: { |
| 2341 | ...returnProps, | 2348 | ...returnProps, |
| 2342 | record | 2349 | record |
src/components/Common/CommonTable/index.js
| @@ -8234,6 +8234,8 @@ class CommonTableRc extends React.Component { | @@ -8234,6 +8234,8 @@ class CommonTableRc extends React.Component { | ||
| 8234 | controlConfig[0].sDropDownType === "popup" | 8234 | controlConfig[0].sDropDownType === "popup" |
| 8235 | ) { | 8235 | ) { |
| 8236 | btnPupopConfig = controlConfig[0]; | 8236 | btnPupopConfig = controlConfig[0]; |
| 8237 | + console.log(btnPupopConfig, 'btnPupopConfig'); | ||
| 8238 | + | ||
| 8237 | this.setState({ | 8239 | this.setState({ |
| 8238 | commonPopupVisible: true, | 8240 | commonPopupVisible: true, |
| 8239 | commonPopupTbName: name, | 8241 | commonPopupTbName: name, |
src/index.less
| @@ -4094,7 +4094,10 @@ ton:focus { | @@ -4094,7 +4094,10 @@ ton:focus { | ||
| 4094 | } | 4094 | } |
| 4095 | } | 4095 | } |
| 4096 | } | 4096 | } |
| 4097 | - | 4097 | +:global .ant-select.ant-select-in-form-item{ |
| 4098 | + border: 1px solid #d9d9d9; | ||
| 4099 | + border-radius: 4px; | ||
| 4100 | +} | ||
| 4098 | :global { | 4101 | :global { |
| 4099 | #root { | 4102 | #root { |
| 4100 | 4103 |
src/mes/common/commonModelComponent/index.js
| @@ -399,8 +399,8 @@ const useCommonModelEvent = props => { | @@ -399,8 +399,8 @@ const useCommonModelEvent = props => { | ||
| 399 | if (!props.bFinish) return; | 399 | if (!props.bFinish) return; |
| 400 | if (commonUtils.isEmptyObject(copyTo)) return; | 400 | if (commonUtils.isEmptyObject(copyTo)) return; |
| 401 | 401 | ||
| 402 | - const { masterConfig, sModelsId } = props; | ||
| 403 | - | 402 | + const { masterConfig, sModelsId, masterData } = props; |
| 403 | + if (masterData && masterData.sBillNo) return | ||
| 404 | let masterDataCopyTo = {}; | 404 | let masterDataCopyTo = {}; |
| 405 | for (const key in copyTo) { | 405 | for (const key in copyTo) { |
| 406 | const tableData = copyTo[key]; | 406 | const tableData = copyTo[key]; |
| @@ -408,14 +408,15 @@ const useCommonModelEvent = props => { | @@ -408,14 +408,15 @@ const useCommonModelEvent = props => { | ||
| 408 | masterDataCopyTo = tableData; | 408 | masterDataCopyTo = tableData; |
| 409 | } | 409 | } |
| 410 | } | 410 | } |
| 411 | - // const masterDataNew = { | ||
| 412 | - // ...commonFunc.getDefaultData(masterConfig), | ||
| 413 | - // handleType: "add", | ||
| 414 | - // sId: commonUtils.createSid(), | ||
| 415 | - // sFormId: sModelsId, | ||
| 416 | - // ...masterDataCopyTo | ||
| 417 | - // }; | ||
| 418 | - // props.onSaveState({ masterData: masterDataNew, enabled: true }); | 411 | + |
| 412 | + const masterDataNew = { | ||
| 413 | + ...commonFunc.getDefaultData(masterConfig), | ||
| 414 | + handleType: "add", | ||
| 415 | + sId: commonUtils.createSid(), | ||
| 416 | + sFormId: sModelsId, | ||
| 417 | + ...masterDataCopyTo | ||
| 418 | + }; | ||
| 419 | + props.onSaveState({ masterData: masterDataNew, enabled: true }); | ||
| 419 | }, | 420 | }, |
| 420 | [props.bFinish] | 421 | [props.bFinish] |
| 421 | ); | 422 | ); |
| @@ -595,6 +596,7 @@ const useCommonModelEvent = props => { | @@ -595,6 +596,7 @@ const useCommonModelEvent = props => { | ||
| 595 | sSqlCondition: { ...conditonValues, ...sFilterConditions, }, | 596 | sSqlCondition: { ...conditonValues, ...sFilterConditions, }, |
| 596 | bFilter | 597 | bFilter |
| 597 | }, | 598 | }, |
| 599 | + sModelTypes: props.parentProps, | ||
| 598 | isWait: true | 600 | isWait: true |
| 599 | })) || {}; | 601 | })) || {}; |
| 600 | props.setTempRef(result); | 602 | props.setTempRef(result); |
src/mes/common/commonOperationBarComponent/MesToolbar.js
| @@ -12,6 +12,7 @@ const ToolbarFun = (props) => { | @@ -12,6 +12,7 @@ const ToolbarFun = (props) => { | ||
| 12 | 12 | ||
| 13 | const { sControlName } = btnConfig; | 13 | const { sControlName } = btnConfig; |
| 14 | const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase(); | 14 | const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase(); |
| 15 | + | ||
| 15 | if (btnName === 'btnadd') { | 16 | if (btnName === 'btnadd') { |
| 16 | handleAdd(props); | 17 | handleAdd(props); |
| 17 | } else if (btnName === 'btnsave') { | 18 | } else if (btnName === 'btnsave') { |
| @@ -20,6 +21,8 @@ const ToolbarFun = (props) => { | @@ -20,6 +21,8 @@ const ToolbarFun = (props) => { | ||
| 20 | props.onSaveState({ enabled: true }); | 21 | props.onSaveState({ enabled: true }); |
| 21 | } else if (btnName === 'btnscanface') { | 22 | } else if (btnName === 'btnscanface') { |
| 22 | handleScanFace(props); | 23 | handleScanFace(props); |
| 24 | + } else if (btnName === 'btncancel') { | ||
| 25 | + | ||
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | 28 | ||
| @@ -43,7 +46,8 @@ const handleAdd = (props) => { | @@ -43,7 +46,8 @@ const handleAdd = (props) => { | ||
| 43 | const { app } = props; | 46 | const { app } = props; |
| 44 | const { managementData } = app; | 47 | const { managementData } = app; |
| 45 | const menuList = managementData.reduce((result, item) => { | 48 | const menuList = managementData.reduce((result, item) => { |
| 46 | - result = [...result, ...item.children]; | 49 | + // ✅ 安全展开:确保children是数组,否则使用空数组 |
| 50 | + result = [...result, ...(Array.isArray(item?.children) ? item.children : [])]; | ||
| 47 | return result; | 51 | return result; |
| 48 | }, []); | 52 | }, []); |
| 49 | 53 |
src/mes/common/commonOperationBarComponent/index.js
| @@ -424,6 +424,7 @@ const useCommonOperationBarComponentEvent = props => { | @@ -424,6 +424,7 @@ const useCommonOperationBarComponentEvent = props => { | ||
| 424 | sActiveId, | 424 | sActiveId, |
| 425 | title: sActiveName, | 425 | title: sActiveName, |
| 426 | copyTo, | 426 | copyTo, |
| 427 | + sModelType:'/indexPage/commonBill', | ||
| 427 | sParentConditions, | 428 | sParentConditions, |
| 428 | parentProps: props, | 429 | parentProps: props, |
| 429 | onOk: data => { | 430 | onOk: data => { |
| @@ -781,7 +782,8 @@ const CommonOperationBarComponent = basProps => { | @@ -781,7 +782,8 @@ const CommonOperationBarComponent = basProps => { | ||
| 781 | const btnLeftConfig = gdsconfigformslave.filter( | 782 | const btnLeftConfig = gdsconfigformslave.filter( |
| 782 | item => item.bVisible && item.sControlName.includes("BtnLeft.") | 783 | item => item.bVisible && item.sControlName.includes("BtnLeft.") |
| 783 | ); | 784 | ); |
| 784 | - | 785 | + console.log(btnLeftConfig,gdsconfigformslave, 'btnLeftConfig'); |
| 786 | + | ||
| 785 | // 将扫码上料放到最后 | 787 | // 将扫码上料放到最后 |
| 786 | const scanCodeToLoadMaterialsIndex = btnLeftConfig.findIndex( | 788 | const scanCodeToLoadMaterialsIndex = btnLeftConfig.findIndex( |
| 787 | item => item.showName === "扫码上料" | 789 | item => item.showName === "扫码上料" |
src/mes/indexMes/index.less
| @@ -3,12 +3,15 @@ | @@ -3,12 +3,15 @@ | ||
| 3 | @header-height: 60px; | 3 | @header-height: 60px; |
| 4 | @sider-width: 110px; | 4 | @sider-width: 110px; |
| 5 | @base-color: #FFF; | 5 | @base-color: #FFF; |
| 6 | - | 6 | + :global .ant-select-in-form-item { |
| 7 | + border-radius: 4px; | ||
| 8 | + border: 1px solid #d9d9d9; | ||
| 9 | + } | ||
| 7 | .indexMes { | 10 | .indexMes { |
| 8 | .size(); | 11 | .size(); |
| 9 | background: #DCE2E8; | 12 | background: #DCE2E8; |
| 10 | overflow: hidden; | 13 | overflow: hidden; |
| 11 | - | 14 | + |
| 12 | :global { | 15 | :global { |
| 13 | .header { | 16 | .header { |
| 14 | .flex(); | 17 | .flex(); |