From cced51fc5f94a6684cade60d650c578c541de2f6 Mon Sep 17 00:00:00 2001 From: zhangzhen <525765282@qq.com> Date: Sun, 6 Jul 2025 20:40:48 +0800 Subject: [PATCH] 处理默认值不能置空问题; --- src/components/QuickQuote/index.jsx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 55eba5c..a58940b 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -174,13 +174,16 @@ const QuickQuoteEvent = props => { if (downAbleConfigsNew.length) { const slaveDataNew = slaveData.map(item => { let sBackProcessData = []; - downAbleConfigsNew.forEach(({ sChineseDropDown: sChineseDropDownStr, sDefaultProcessId, sName }) => { + downAbleConfigsNew.forEach(({ sChineseDropDown: sChineseDropDownStr, sDefaultProcessId, sName, sId }) => { const sChineseDropDown = commonUtils.convertStrToObj(sChineseDropDownStr, []); const defaultProcess = sChineseDropDown.find(item => item.sId === sDefaultProcessId); const name = `slaveDown${item.sBoxModel}`; const sFieldName = sName; const changeValue = { [sFieldName]: defaultProcess.sId }; - const dropDownData = sChineseDropDown; + const dropDownData = sChineseDropDown.map(item => ({ + ...item, + sProductClassifyId: sId, + })); const slaveDataReturn = onDataChange(name, sFieldName, changeValue, item.sId, dropDownData, true); sBackProcessData = [...sBackProcessData, ...slaveDataReturn.sBackProcessData]; }); @@ -2105,14 +2108,14 @@ const BoxComponent = props => { if ( (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || - slaveRowData.sName ==='卡牌' + slaveRowData.sName === "卡牌" ) { const slaveNewData = slaveRowData.upAbleConfigsExtra || JSON.parse(slaveRowData.sColumnNameConfig); const tables = [ { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, - { name: "盒长", value:slaveRowData.dL ? slaveRowData.dL : masterData.dLength ? Number(masterData.dLength) : 0, type: null }, - { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW :masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, + { name: "盒长", value: slaveRowData.dL ? slaveRowData.dL : masterData.dLength ? Number(masterData.dLength) : 0, type: null }, + { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null }, ]; const titleList1 = [ @@ -2146,7 +2149,7 @@ const BoxComponent = props => { }; // 确认是竖向排列还是横向排列 - const L = masterData?.dLength || 0; + const L = masterData?.dLength || 0; const W = masterData?.dWidth || 0; const H = masterData?.dWidth || 0; const D = masterData?.dHeight || 0; @@ -2202,8 +2205,8 @@ const BoxComponent = props => { dSvgBoxHeight: 200, showNew: 1, }; - console.log(boxList,'boxList'); - + console.log(boxList, "boxList"); + // upViewProps.viewRow = const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; @@ -2218,8 +2221,8 @@ const BoxComponent = props => { { src: slaveRowData.sPackDetailPathUpLoad, alt: "展开图" }, { src: slaveRowData.sPackPath, alt: "立体图" }, ]; - console.log(state,'activeKey'); - const {activeKey = 0} = state + console.log(state, "activeKey"); + const { activeKey = 0 } = state; return ( { props.setState(pre => ({ ...pre, slaveData: [...slaveData], - activeKey:1 + activeKey: 1, })); }} value={radioValue} -- libgit2 0.22.2