From 2bcb34178087dc00a22c7f7694018c5bedee86a3 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Fri, 27 Jun 2025 10:19:02 +0800 Subject: [PATCH] 画册默认p数展示 --- src/components/QuickQuote/index.jsx | 17 ++++++++++++++--- src/mobile/quotation/detailNew.jsx | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 131 insertions(+), 20 deletions(-) diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 302b8df..8db84b4 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -1457,6 +1457,18 @@ const BoxComponent = props => { item.showName = mappings[item.sName]; } }); + }else { + const mappings = { + dZBLB: "左边留白", + dXBJJ: "上下刀位", + dYBJJ: "左右刀位", + }; + + boxConfigList.forEach(item => { + if (mappings[item.sName]) { + item.showName = mappings[item.sName]; + } + }); } } const newConfig = [...boxConfigList, ...config]; @@ -1483,8 +1495,9 @@ const BoxComponent = props => { x.sName === "dRowGap" || x.sName === "dColGap" || x.sName === "sPaperDirection", - default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth", + default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" || x.sName === "dSumPQty", }; +console.log(upViewProps12.viewConfigs,'upViewProps12.viewConfigs'); if (selectedNode.sTypeKey === "juantong") { upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.juantong); @@ -1765,8 +1778,6 @@ const BoxComponent = props => { let juantongConfig = {}; if (selectedNode.sTypeKey === "juantong") { - console.log(selectedNode.sTypeKey, "sTypeKey"); - const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; juantongConfig = { dColGap: dYBJJ, diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index 9ec2583..dc3b507 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -1040,6 +1040,11 @@ const QuotationAllprogressDetail = baseProps => { }; }); }; + if (selectedNode.sTypeKey === "juantong") { + props.onSaveState({ + masterData: { ...props.masterData, sFormId: "101251240115016002356125200" }, + }); + } getDropDownData(props); }, [props.state.slaveConfig]); const getSqlDropDownData = async ({ sId }) => { @@ -1069,7 +1074,10 @@ const QuotationDetail = props => { if (!masterConfig) return ""; const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); // 处理长宽样式 - const viewConfigs = selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); + const viewConfigs = + selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sTypeKey !== "juantong" + ? ableConfigs + : ableConfigs.filter(x => x.sName !== "dHeight"); if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") { viewConfigs.forEach(item => { if (item.sName === "dLength" || item.sName === "dWidth") { @@ -1081,6 +1089,20 @@ const QuotationDetail = props => { item.iColValue = viewConfigs[0].iColValue; }); } + const lengthData = viewConfigs.find(x => x.sName === "dLength"); + if (selectedNode.sTypeKey !== "danye") { + if (lengthData) { + lengthData.showName = "高(D)"; + lengthData.sChinese = "高(D)"; + lengthData.sEnglish = "Height (D)"; + } + } else { + if (lengthData) { + lengthData.showName = "长(L)"; + lengthData.sChinese = "长(L)"; + lengthData.sEnglish = "Length (L)"; + } + } const viewProps = { ...props, viewConfigs: viewConfigs, @@ -1147,9 +1169,7 @@ const MasterComponent = props => { ...props, itemDetail: sDeliverName, }; - const baseProps = { - ...props, - }; + return (
@@ -1161,7 +1181,9 @@ const MasterComponent = props => {
-
尺寸(长*宽*高)
+
+ 尺寸 {dLength?.showName} * {dWidth?.showName} {dHeight?.showName ? "*" : ""} {dHeight?.showName}{" "} +
@@ -1409,8 +1431,9 @@ const BoxComponent = props => { // if(!masterData) return if ( (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) || - (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) - ) { + (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || + (selectedNode.sTypeKey === "juantong" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth)) + { const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); const tables = [ { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, @@ -1531,8 +1554,36 @@ const BoxComponent = props => { }); let boxConfigList = []; if (iTag === 20) { - const showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; + let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; + if (selectedNode.sTypeKey === "juantong") { + showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; + } boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; + if (selectedNode.sTypeKey === "juantong") { + const mappings = { + dZBLB: "留边", + dXBJJ: "跳距", + dYBJJ: "间距", + }; + + boxConfigList.forEach(item => { + if (mappings[item.sName]) { + item.showName = mappings[item.sName]; + } + }); + } else { + const mappings = { + dZBLB: "左边留白", + dXBJJ: "上下刀位", + dYBJJ: "左右刀位", + }; + + boxConfigList.forEach(item => { + if (mappings[item.sName]) { + item.showName = mappings[item.sName]; + } + }); + } } const newConfig = [...boxConfigList, ...config]; return { @@ -1547,10 +1598,22 @@ const BoxComponent = props => { // 印刷参数表单 let upViewProps12 = getUpViewPropsByITag(12); - if (upViewProps12 && upViewProps12.viewConfigs && !(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) { - upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter( - x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" - ); + + const filterConditions = { + juantong: x => + x.sName === "sMagnification" || + x.sName === "dPartsLength" || + x.sName === "dPartsWidth" || + x.sName === "dRowGap" || + x.sName === "dColGap" || + x.sName === "sPaperDirection", + default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth", + }; + + if (selectedNode.sTypeKey === "juantong") { + upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.juantong); + } else if (!(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) { + upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.default); } // 拼板信息表单 const upViewProps20 = getUpViewPropsByITag(20); @@ -1638,8 +1701,25 @@ const BoxComponent = props => { const [materialLength, setMaterialLength] = useState(0); const [materialWidth, setMaterialWidth] = useState(0); // 使用 useCallback 确保回调函数的稳定性 - const handleSaveState = useCallback( - (length, width, slaveData, masterData, dSinglePQty, dMaterialsKQty, dProductQty, scale, dWlcd, dWlkd, innerWidth, innerHeight) => { + const handleSaveState = ( + ( + length, + width, + slaveData, + masterData, + dSinglePQty, + dMaterialsKQty, + dProductQty, + scale, + dWlcd, + dWlkd, + innerWidth, + innerHeight, + dHorizontal, + dPortrait, + dHorizontalType, + dPortraitType + ) => { // 查找符合条件的索引 const { selectedNode } = props.state; @@ -1678,11 +1758,31 @@ const BoxComponent = props => { scale: scale, dPartsLength: innerWidth, dPartsWidth: innerHeight, + dHorizontal: dHorizontalType, + dPortrait: dPortraitType, + dHorizontalType: dHorizontalType, // 判断 + dPortraitType: dPortraitType, + }; + let juantongConfig = {}; + + if (selectedNode.sTypeKey === "juantong") { + const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; + juantongConfig = { + dColGap: dYBJJ, + dRowGap: dXBJJ, + iCol: dPortraitType, + iRow: dHorizontalType, + dCutEdge: dZBLB, }; + } + const newSlaveData = { + ...updatedProduct, + ...juantongConfig, + }; // 更新状态 props.setState(prevState => ({ ...prevState, - slaveData: slaveData.map((item, i) => (i === index ? updatedProduct : item)), + slaveData: slaveData.map((item, i) => (i === index ? newSlaveData : item)), })); } @@ -1844,7 +1944,7 @@ const BoxComponent = props => { }; useEffect(() => { - if (selectedNode.sTypeKey === "kapai") { + if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { const data = selectList.find(x => x.sTypes === "6"); if (!data) return; const currentBoxModel = "slaveUp" + props.boxModel; @@ -2501,7 +2601,7 @@ const ManyComponent = props => { // props.slaveData?.forEach(slaveRowData => { // props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props); // }); - + props.setState(pre => ({ ...pre, manySelectedRowKeys: selectedRowKeys.sId, -- libgit2 0.22.2