Commit 985d1a7428454203b12d084536e3c1f6180e2186
1 parent
e6aa9602
优化快速报价版长版款功能;
Showing
1 changed file
with
18 additions
and
3 deletions
src/components/QuickQuote/index.jsx
| @@ -2423,9 +2423,9 @@ const BackendParamsExtraComponent = props => { | @@ -2423,9 +2423,9 @@ const BackendParamsExtraComponent = props => { | ||
| 2423 | 2423 | ||
| 2424 | const viewConfigs = backendParamsConfig.map((item, index) => ({ | 2424 | const viewConfigs = backendParamsConfig.map((item, index) => ({ |
| 2425 | ...item, | 2425 | ...item, |
| 2426 | - sName: `sParams${index}`, | 2426 | + sName: item.sFieldName || `sParams${index}`, |
| 2427 | showName: item.sParam, | 2427 | showName: item.sParam, |
| 2428 | - sDropDownType: "sql", | 2428 | + sDropDownType: item.sParamDropDown ? "sql" : "", |
| 2429 | iColValue: 4, | 2429 | iColValue: 4, |
| 2430 | })); | 2430 | })); |
| 2431 | 2431 | ||
| @@ -2464,7 +2464,15 @@ const BackendParamsExtraComponent = props => { | @@ -2464,7 +2464,15 @@ const BackendParamsExtraComponent = props => { | ||
| 2464 | onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { | 2464 | onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { |
| 2465 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); | 2465 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); |
| 2466 | const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); | 2466 | const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); |
| 2467 | - const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]); | 2467 | + const showConfig = viewConfigs.find(item => item.sName === sFieldName); |
| 2468 | + const dropDownDataSelected = dropDownData?.length | ||
| 2469 | + ? dropDownData.find(item => item.sId === changeValue[sFieldName]) | ||
| 2470 | + : { | ||
| 2471 | + sId: commonUtils.createSid(), | ||
| 2472 | + value: changeValue[sFieldName], | ||
| 2473 | + sParam: showConfig.sParam, | ||
| 2474 | + [sFieldName]: changeValue[sFieldName], | ||
| 2475 | + }; | ||
| 2468 | const { sParam } = dropDownDataSelected; | 2476 | const { sParam } = dropDownDataSelected; |
| 2469 | const { sBackendParams = [] } = slaveData[iIndex].sBackProcessData[iIndex1]; | 2477 | const { sBackendParams = [] } = slaveData[iIndex].sBackProcessData[iIndex1]; |
| 2470 | const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam); | 2478 | const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam); |
| @@ -2474,6 +2482,13 @@ const BackendParamsExtraComponent = props => { | @@ -2474,6 +2482,13 @@ const BackendParamsExtraComponent = props => { | ||
| 2474 | sBackendParams.push(dropDownDataSelected); | 2482 | sBackendParams.push(dropDownDataSelected); |
| 2475 | } | 2483 | } |
| 2476 | slaveData[iIndex].sBackProcessData[iIndex1].sBackendParams = sBackendParams; | 2484 | slaveData[iIndex].sBackProcessData[iIndex1].sBackendParams = sBackendParams; |
| 2485 | + if (!showConfig.sName?.startsWith("sParams")) { | ||
| 2486 | + slaveData[iIndex].sBackProcessData[iIndex1][showConfig.sName] = dropDownDataSelected[showConfig.sName]; | ||
| 2487 | + const { dManualLength, dManualWidth } = slaveData[iIndex].sBackProcessData[iIndex1]; | ||
| 2488 | + if (dManualLength !== undefined && dManualWidth !== undefined) { | ||
| 2489 | + slaveData[iIndex].sBackProcessData[iIndex1].dManualValue = dManualLength * dManualWidth; | ||
| 2490 | + } | ||
| 2491 | + } | ||
| 2477 | props.setState(pre => ({ ...pre, slaveData })); | 2492 | props.setState(pre => ({ ...pre, slaveData })); |
| 2478 | }, | 2493 | }, |
| 2479 | }; | 2494 | }; |