From 7c225fe084f04bc7b9e65be6fb5a8c54c2b24a8d Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Fri, 27 Jun 2025 14:50:47 +0800 Subject: [PATCH] 主表长宽高根据字段展示 --- src/components/Common/BoxDesignCompontent/svg.js | 2 +- src/components/Common/CommonComponent/index.js | 4 +--- src/components/QuickQuote/index.jsx | 16 +++++++++------- src/mobile/quotation/detailNew.jsx | 49 +++++++++++++++++++++++++++++++++---------------- 4 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/components/Common/BoxDesignCompontent/svg.js b/src/components/Common/BoxDesignCompontent/svg.js index df010d4..b120d7c 100644 --- a/src/components/Common/BoxDesignCompontent/svg.js +++ b/src/components/Common/BoxDesignCompontent/svg.js @@ -76,7 +76,7 @@ const SvgBox = props => { const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); // 创建 svg.innerHTML = ""; - + if (!(boxList && boxList.length)) return // 获取盒型类型 const svgTypes = boxList.find(x => x.sName === "盒身")?.type || 1; setSvgType(svgTypes); diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 0791836..ffe6ca5 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -1143,10 +1143,8 @@ export default class CommonComponent extends Component { if (response && response.code === 1) { const imageUrlNew = `${commonConfig.server_host}file/downloadLogo?sLogoName=logo${sName}${this.props.record.sName}&date=${new Date().getTime()}`; if (sName === 'sPackPath') { - // this.setState({ sPackPath: imageUrlNew }); - this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []); + this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []); } else { - // this.setState({ sPackDetailPath: imageUrlNew }); this.props.onChange(this.props.name, sName, { sPackDetailPathUpLoad: imageUrlNew }, this.props.sId, []); } } else if (response && response.code === -1) { diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 5f8dfaf..162d62a 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -1299,11 +1299,13 @@ const MasterComponent = props => { const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); // 处理长宽样式 - const viewConfigs = - selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶" - ? ableConfigs - : ableConfigs.filter(x => x.sName !== "dHeight"); - if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶") { + // selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶" + // ? ableConfigs + // : ableConfigs.filter(x => x.sName !== "dHeight"); + const { sStripType = 0 } = selectedNode; + // {"0":"长宽高","1":"高宽"} ,0显示长宽高,1显示宽高 + const viewConfigs = Number(sStripType) === 0 ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); + if (Number(sStripType) === 0) { viewConfigs.forEach(item => { if (item.sName === "dLength" || item.sName === "dWidth") { item.iColValue = 4; @@ -1454,7 +1456,6 @@ const BoxComponent = props => { } return item.iTag === iTag; }); - console.log(selectedNode, "selectedNode"); let boxConfigList = []; if (iTag === 20) { @@ -2631,7 +2632,8 @@ const BoxModelSelectedModal = props => { const getSvgProps = svg => { if (!svg) return; const { sColumnNameConfig, sBoxType, sBoxBody, dBoxLength, dBoxWidth, dBoxHeight, sTypes } = svg; - const slaveData = JSON.parse(sColumnNameConfig); + const slaveData = sColumnNameConfig ? JSON.parse(sColumnNameConfig) : null; + if (!slaveData) return; const boxList = []; const tables = [ { name: "盒型类别", value: sBoxType, type: null }, diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index dc3b507..5d71934 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -1040,7 +1040,7 @@ const QuotationAllprogressDetail = baseProps => { }; }); }; - if (selectedNode.sTypeKey === "juantong") { + if (selectedNode.sProductType === "不干胶") { props.onSaveState({ masterData: { ...props.masterData, sFormId: "101251240115016002356125200" }, }); @@ -1075,10 +1075,10 @@ const QuotationDetail = props => { const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); // 处理长宽样式 const viewConfigs = - selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sTypeKey !== "juantong" + selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sTypeKey !== "不干胶" ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); - if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") { + if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶") { viewConfigs.forEach(item => { if (item.sName === "dLength" || item.sName === "dWidth") { item.iColValue = 4; @@ -1432,7 +1432,7 @@ const BoxComponent = props => { if ( (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) || (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || - (selectedNode.sTypeKey === "juantong" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth)) + (selectedNode.sProductType === "不干胶" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth)) { const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); const tables = [ @@ -1547,7 +1547,24 @@ const BoxComponent = props => { ) { return false; } - if (selectedNode.sTypeKey !== "kapai" && item.sName === "sMagnification") { + const rateList = [ + { id: 0, name: "不显示倍率" }, + { id: 1, name: "每本张数" }, + { id: 2, name: "片数" }, + ]; + if (Number(selectedNode.iRateType) === 0 && item.sName === "sMagnification") { + return false; + } else { + if (item.sName === "sMagnification") { + item.showName = rateList.find(rate => rate.id === Number(selectedNode.iRateType))?.name || "倍率"; + } + } + if (item.sName === "sPaperDirection" && selectedNode.sTypeKey === "huace") { + return false; + } + // 判断bPartsDimension 是否显示展长展宽,0不显示,1显示 + + if (selectedNode.bPartsDimension === false && (item.sName === "dPartsLength" || item.sName === "dPartsWidth")) { return false; } return item.iTag === iTag; @@ -1555,11 +1572,11 @@ const BoxComponent = props => { let boxConfigList = []; if (iTag === 20) { let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; - if (selectedNode.sTypeKey === "juantong") { + if (selectedNode.sProductType === "不干胶") { showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; } boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; - if (selectedNode.sTypeKey === "juantong") { + if (selectedNode.sProductType === "不干胶") { const mappings = { dZBLB: "留边", dXBJJ: "跳距", @@ -1599,7 +1616,7 @@ const BoxComponent = props => { // 印刷参数表单 let upViewProps12 = getUpViewPropsByITag(12); - const filterConditions = { +const filterConditions = { juantong: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || @@ -1607,13 +1624,13 @@ 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", }; - - 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); + if (upViewProps12 && selectedNode.sProductType === "不干胶") { + upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.juantong); + } + if (upViewProps12 && !(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) { + upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.default); } // 拼板信息表单 const upViewProps20 = getUpViewPropsByITag(20); @@ -1765,7 +1782,7 @@ const BoxComponent = props => { }; let juantongConfig = {}; - if (selectedNode.sTypeKey === "juantong") { + if (selectedNode.sProductType === "不干胶") { const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; juantongConfig = { dColGap: dYBJJ, @@ -1944,7 +1961,7 @@ const BoxComponent = props => { }; useEffect(() => { - if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { + if (selectedNode.sTypeKey === "kapai" || selectedNode.sProductType === "不干胶") { const data = selectList.find(x => x.sTypes === "6"); if (!data) return; const currentBoxModel = "slaveUp" + props.boxModel; -- libgit2 0.22.2