diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 19a2953..c0c4de9 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -1002,8 +1002,6 @@ const TreeComponent = props => { const downAbleConfigs = await getSqlDropDownData({ ...showDownConfig }); props.setState(pre => { - console.log(pre,'pre'); - const { slaveData = [], slaveConfig } = pre; const addState = {}; const defaultData = commonFunc.getDefaultData(slaveConfig); @@ -1327,7 +1325,6 @@ const BoxComponent = props => { return props.getSqlDropDownData(...args); }, extraContent: child => { - console.log(child,'child'); const value = sBackProcessData.find(item => item[child.sName]) || {}; const { bSetArea, bSetQty, sName, sSetQtyUnt } = value; @@ -1429,7 +1426,6 @@ const BoxComponent = props => { ); }, }; - console.log(downViewProps,'downViewProps'); // 获取sType为3的 const { productProcessInfo = [] } = masterData; diff --git a/src/mobile/components/SelectInput.jsx b/src/mobile/components/SelectInput.jsx index 2b9c32b..c34faa1 100644 --- a/src/mobile/components/SelectInput.jsx +++ b/src/mobile/components/SelectInput.jsx @@ -57,7 +57,7 @@ const SelectInput = props => { const handleConfirm = () => { const index = columns.findIndex(item => item.value === values[0]); const data = coplyColumns[index]; - data[itemDetail.sName] = data.sName + data[itemDetail.sName] = data.sName; setValue(columns[index]?.label || ""); props.onDataChange(tableName, itemDetail.sName, data, null, coplyColumns); setVisible(false); diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index 33e214c..13c4434 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -1152,8 +1152,9 @@ const QuotationTabs = props => { // 内容 const BoxComponent = props => { const { state, boxModel } = props; - console.log("🚀 ~ BoxComponent:", props, JsonData); const { activeKey, slaveConfig, masterData, selectedNode, boxConfig, downAbleConfigs = [], slaveData } = state || {}; + const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; + const { sModelsId } = props; const [selectList, setSelectList] = useState([]); const [boxTypeList, setBoxTypeList] = useState([]); @@ -1161,10 +1162,6 @@ const BoxComponent = props => { const [boxPopup, setBoxPopup] = useState(false); const [boxsList, setBoxsList] = useState([]); const [selected, setSelected] = useState(null); - const slaveRowDatas = slaveData?.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; - console.log("🚀 ~ slaveRowDatas:", slaveRowDatas) - const [slaveRowData, setSlaveRowData] = useState(slaveRowDatas); - // 获取盒型信息 useEffect(() => { const sId = "17428091410008594700322758474000"; @@ -1205,13 +1202,6 @@ const BoxComponent = props => { // 获取盒型 }, []); - useEffect(() => { - props.setState(prevState => ({ - ...prevState, - slaveRowData, - })); - }, [slaveRowData]); - const { sColumnNameConfig } = slaveRowData || {}; const upAbleConfigsExtra = commonUtils.convertStrToObj(sColumnNameConfig, []).map(item => ({ ...item, @@ -1220,7 +1210,8 @@ const BoxComponent = props => { })); const showUpAbleConfigsExtra = upAbleConfigsExtra.filter(x => x.bVisible === 1); let boxList = []; - if (slaveRowData && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) { + // if(!masterData) return + if (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) { const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); const tables = [ { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, @@ -1316,7 +1307,6 @@ const BoxComponent = props => { isMobile: true, }; // 印刷参数 - // if (!slaveConfig) return; const getUpViewPropsByITag = iTag => { if (!slaveConfig) return; const config = slaveConfig.gdsconfigformslave.filter(item => { @@ -1346,6 +1336,21 @@ const BoxComponent = props => { const upViewProps12 = getUpViewPropsByITag(12); // 拼板信息表单 const upViewProps20 = getUpViewPropsByITag(20); + const { bBox } = selectedNode; + + const upAbleConfig = + slaveConfig?.gdsconfigformslave?.filter(item => item.iTag === 10)?.filter(item => (bBox ? true : item.sName !== "sName")) || []; + const upViewProps = { + ...props, + viewConfigs: [...(Array.isArray(showUpAbleConfigsExtra) ? showUpAbleConfigsExtra : [])], + tableConfig: { + ...slaveConfig, + gdsconfigformslave: [...(Array.isArray(showUpAbleConfigsExtra) ? showUpAbleConfigsExtra : [])], + }, + iColValueView: 24, + viewRow: slaveRowData, + tableName: `slaveUp${boxModel}`, + }; // 后道参数 const { sBackProcessData } = slaveRowData || []; @@ -1595,14 +1600,16 @@ const BoxComponent = props => { />
- {showUpAbleConfigsExtra.map(x => ( - -
-
{x.sBig5}
- -
-
- ))} + {upViewProps + ? upViewProps.viewConfigs.map(x => ( + +
+
{x.sBig5}
+ +
+
+ )) + : ""}
@@ -1698,24 +1705,8 @@ const BoxComponent = props => { fill="outline" size="small" onClick={val => { - const data = selectList.find(x => x.sId === item.sId); - if (!data) return; - const slaveNewData = JSON.parse(data.sColumnNameConfig).map(x => { - return { - [x.sName]: x.sDefault, - }; - }); - const slaveDataDetail = - slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; - const rowData = { - ...slaveDataDetail, - ...data, - ...Object.assign({}, ...slaveNewData), - }; - console.log("🚀 ~ rowData:", rowData); - - // setSlaveRowData(rowData); - props.setState(pre => ({ ...pre, slaveRowData: rowData })); + const currentBoxModel = 'slaveUp' + props.boxModel + props.onDataChange(currentBoxModel, "sName", { sName: item.sName }, item.sId, boxsList); setBoxPopup(false); }} >