Commit 3bea7e769946b5eda88de5bb3f515bee7477860b
1 parent
35f62cd8
弹窗保存
Showing
5 changed files
with
27 additions
and
21 deletions
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -1517,7 +1517,7 @@ export default class CommonComponent extends Component { |
| 1517 | 1517 | }, /* 数据改变回带到父组件 */ |
| 1518 | 1518 | parser: (oldValue) => { |
| 1519 | 1519 | const value = this.handleCheckNumberInnerInput(oldValue); |
| 1520 | - return value.replace(/\$\s?|(,*)/g, ''); | |
| 1520 | + return value?.replace(/\$\s?|(,*)/g, ''); | |
| 1521 | 1521 | }, |
| 1522 | 1522 | formatter: (value) => { |
| 1523 | 1523 | if (value === '' || value === undefined || value === null || location.pathname.includes("indexPad")) { | ... | ... |
src/components/Common/CommonHooks/useCommonBase.js
| ... | ... | @@ -251,7 +251,6 @@ const useCommonBase = props => { |
| 251 | 251 | item.sName = configReturnModelData?.sName |
| 252 | 252 | }) |
| 253 | 253 | } |
| 254 | - | |
| 255 | 254 | return formData; |
| 256 | 255 | }; |
| 257 | 256 | |
| ... | ... | @@ -346,7 +345,7 @@ const useCommonBase = props => { |
| 346 | 345 | } |
| 347 | 346 | |
| 348 | 347 | const configDataId = configData?.sId; |
| 349 | - const sId = JSON.parse(JSON.stringify(configDataId|| '')) | |
| 348 | + const sId = JSON.parse(JSON.stringify(condition?.sId || '')) // 主表id | |
| 350 | 349 | let pageRoute = props.sModelType; |
| 351 | 350 | // 如果是弹窗且没有pageLayout,则认为是commonBill |
| 352 | 351 | if (commonUtils.isNotEmptyObject(props.parentProps)) { |
| ... | ... | @@ -358,16 +357,15 @@ const useCommonBase = props => { |
| 358 | 357 | condition.pageSize = '' |
| 359 | 358 | delete condition.sSqlCondition |
| 360 | 359 | } |
| 361 | - if (name.includes('slave') && pageRoute.includes('indexPage/commonBill')) { | |
| 360 | + if (name.includes('slave') && pageRoute.includes('indexPage/commonBill') ) { | |
| 362 | 361 | delete condition.sSqlCondition |
| 363 | 362 | delete condition.sId |
| 364 | 363 | condition.sSqlCondition = { |
| 365 | 364 | sParentId: sId |
| 366 | 365 | } |
| 367 | 366 | } |
| 368 | - if (name === 'master' && sId === '') { | |
| 369 | - return | |
| 370 | - } | |
| 367 | + // 只有弹窗没有不查询 | |
| 368 | + if (name === 'master' && sId === '' && props.parentProps && pageRoute.includes('indexPage/commonBill') ) return | |
| 371 | 369 | const dataUrl = `${commonConfig.server_host |
| 372 | 370 | }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; |
| 373 | 371 | const dataReturn = (await commonServices.postValueService( |
| ... | ... | @@ -2977,6 +2975,7 @@ const useCommonBase = props => { |
| 2977 | 2975 | } |
| 2978 | 2976 | |
| 2979 | 2977 | const newData = bAddFirst ? [addRowData, ...data] : [...data, addRowData]; |
| 2978 | + console.log("🚀 ~ handleMesTableLineAdd ~ newData:", newData,masterData,state,props) | |
| 2980 | 2979 | const selectedRowKeys = [newSid]; |
| 2981 | 2980 | const addState = {}; |
| 2982 | 2981 | if (location.pathname.includes("indexPad")) { | ... | ... |
src/mes/common/commonModelComponent/index.js
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | import React, { useEffect, useRef, useState } from "react"; |
| 3 | 3 | import moment from "moment"; |
| 4 | 4 | import { cloneDeep } from "lodash"; |
| 5 | -import { Tabs, Modal, Space, Button, DatePicker, Radio, message , Avatar} from "antd"; | |
| 5 | +import { Tabs, Modal, Space, Button, DatePicker, Radio, message, Avatar } from "antd"; | |
| 6 | 6 | import * as commonUtils from "@/utils/utils"; |
| 7 | 7 | import * as commonConfig from "@/utils/config"; |
| 8 | 8 | import * as commonServices from "@/services/services"; |
| ... | ... | @@ -1587,7 +1587,7 @@ const CommonModel = baseProps => { |
| 1587 | 1587 | }; |
| 1588 | 1588 | |
| 1589 | 1589 | const CommonModelComponent = props => { |
| 1590 | - const { tabConfig = [], level, modelStyle, app, bMesBill, enabled ,masterData, sModelsType} = props; | |
| 1590 | + const { tabConfig = [], level, modelStyle, app, bMesBill, enabled, masterData, sModelsType } = props; | |
| 1591 | 1591 | const { userinfo } = app; |
| 1592 | 1592 | const sLanguage = userinfo.sLanguage; |
| 1593 | 1593 | const getComponent = (config, index = 0) => { |
| ... | ... | @@ -1605,7 +1605,7 @@ const CommonModelComponent = props => { |
| 1605 | 1605 | if (!children.length) return ""; |
| 1606 | 1606 | const footerComponent = useFooterComponent({ ...props, sTabName }); |
| 1607 | 1607 | const modelStyle = footerComponent ? { height: "calc(100% - 50px)" } : {}; |
| 1608 | - | |
| 1608 | + | |
| 1609 | 1609 | |
| 1610 | 1610 | return ( |
| 1611 | 1611 | <> |
| ... | ... | @@ -1940,8 +1940,8 @@ const CommonViewTableComponent = props => { |
| 1940 | 1940 | sName, |
| 1941 | 1941 | belongsToForm: true, |
| 1942 | 1942 | }; |
| 1943 | - const {masterData, sModelsType, app} = props | |
| 1944 | - const {bCheck = false} = masterData || {} | |
| 1943 | + const { masterData, sModelsType, app } = props | |
| 1944 | + const { bCheck = false } = masterData || {} | |
| 1945 | 1945 | const imgSrc = commonBusiness.handleAddIcon(masterData, sModelsType, app); |
| 1946 | 1946 | return ( |
| 1947 | 1947 | <> |
| ... | ... | @@ -2204,14 +2204,18 @@ const CommonTableComponent = props => { |
| 2204 | 2204 | ...props, |
| 2205 | 2205 | sName |
| 2206 | 2206 | }; |
| 2207 | - if (tableProps.data && tableProps.data.length === 0) { | |
| 2208 | - const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine')) | |
| 2209 | - if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) { | |
| 2210 | - props.onMesTableLineAdd({ | |
| 2211 | - tableName: tableProps.name, | |
| 2212 | - }) | |
| 2207 | + | |
| 2208 | + useEffect(() => { | |
| 2209 | + if (commonUtils.isEmptyObject(props.masterData)) return; | |
| 2210 | + if (tableProps.data && tableProps.data.length === 0) { | |
| 2211 | + const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine')) | |
| 2212 | + if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) { | |
| 2213 | + props.onMesTableLineAdd({ | |
| 2214 | + tableName: tableProps.name, | |
| 2215 | + }) | |
| 2216 | + } | |
| 2213 | 2217 | } |
| 2214 | - } | |
| 2218 | + }, [props.masterData]) | |
| 2215 | 2219 | |
| 2216 | 2220 | return ( |
| 2217 | 2221 | <> | ... | ... |
src/mes/common/commonOperationBarComponent/index.js
| ... | ... | @@ -1006,6 +1006,7 @@ const CommonOperationBarComponent = basProps => { |
| 1006 | 1006 | if (searchField.sName.substring(0, 1) == "t") { |
| 1007 | 1007 | searchField.sDateFormat = "YYYY-MM-DD"; |
| 1008 | 1008 | } |
| 1009 | + | |
| 1009 | 1010 | showTypeProps = { |
| 1010 | 1011 | app, |
| 1011 | 1012 | record: {}, |
| ... | ... | @@ -1034,7 +1035,8 @@ const CommonOperationBarComponent = basProps => { |
| 1034 | 1035 | showTypeProps.componentStyle = { width: 180 }; |
| 1035 | 1036 | } |
| 1036 | 1037 | } |
| 1037 | - | |
| 1038 | + console.log(showTypeProps, 'showTypeProps'); | |
| 1039 | + | |
| 1038 | 1040 | let searchProductProps = {}; |
| 1039 | 1041 | const searchProductConfig = gdsconfigformslave.filter( |
| 1040 | 1042 | item => item.sName === "sSearchProductName" |
| ... | ... | @@ -1131,6 +1133,7 @@ const CommonOperationBarComponent = basProps => { |
| 1131 | 1133 | searchProductProps.componentStyle = { width: 230 }; |
| 1132 | 1134 | } |
| 1133 | 1135 | } |
| 1136 | +console.log(searchProductProps, 'searchProductProps'); | |
| 1134 | 1137 | |
| 1135 | 1138 | const handleBtnSearch = () => { |
| 1136 | 1139 | const { sModelsId } = props; | ... | ... |
src/utils/config.js
| ... | ... | @@ -6,7 +6,7 @@ export const webSite = { |
| 6 | 6 | // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', |
| 7 | 7 | fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 |
| 8 | 8 | faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace', |
| 9 | - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:43920/xlyEntry/' : '//' + location.host + '/xlyEntry/', | |
| 9 | + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:47400/xlyEntry/' : '//' + location.host + '/xlyEntry/', | |
| 10 | 10 | interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 |
| 11 | 11 | // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', |
| 12 | 12 | // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 | ... | ... |