From 985d1a7428454203b12d084536e3c1f6180e2186 Mon Sep 17 00:00:00 2001 From: zhangzhen <525765282@qq.com> Date: Wed, 18 Jun 2025 14:01:21 +0800 Subject: [PATCH] 优化快速报价版长版款功能; --- src/components/QuickQuote/index.jsx | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 80f5d7a..6f5ebae 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -2423,9 +2423,9 @@ const BackendParamsExtraComponent = props => { const viewConfigs = backendParamsConfig.map((item, index) => ({ ...item, - sName: `sParams${index}`, + sName: item.sFieldName || `sParams${index}`, showName: item.sParam, - sDropDownType: "sql", + sDropDownType: item.sParamDropDown ? "sql" : "", iColValue: 4, })); @@ -2464,7 +2464,15 @@ const BackendParamsExtraComponent = props => { onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); - const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]); + const showConfig = viewConfigs.find(item => item.sName === sFieldName); + const dropDownDataSelected = dropDownData?.length + ? dropDownData.find(item => item.sId === changeValue[sFieldName]) + : { + sId: commonUtils.createSid(), + value: changeValue[sFieldName], + sParam: showConfig.sParam, + [sFieldName]: changeValue[sFieldName], + }; const { sParam } = dropDownDataSelected; const { sBackendParams = [] } = slaveData[iIndex].sBackProcessData[iIndex1]; const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam); @@ -2474,6 +2482,13 @@ const BackendParamsExtraComponent = props => { sBackendParams.push(dropDownDataSelected); } slaveData[iIndex].sBackProcessData[iIndex1].sBackendParams = sBackendParams; + if (!showConfig.sName?.startsWith("sParams")) { + slaveData[iIndex].sBackProcessData[iIndex1][showConfig.sName] = dropDownDataSelected[showConfig.sName]; + const { dManualLength, dManualWidth } = slaveData[iIndex].sBackProcessData[iIndex1]; + if (dManualLength !== undefined && dManualWidth !== undefined) { + slaveData[iIndex].sBackProcessData[iIndex1].dManualValue = dManualLength * dManualWidth; + } + } props.setState(pre => ({ ...pre, slaveData })); }, }; -- libgit2 0.22.2