Commit 985d1a7428454203b12d084536e3c1f6180e2186

Authored by zhangzzzz
1 parent e6aa9602

优化快速报价版长版款功能;

src/components/QuickQuote/index.jsx
... ... @@ -2423,9 +2423,9 @@ const BackendParamsExtraComponent = props => {
2423 2423  
2424 2424 const viewConfigs = backendParamsConfig.map((item, index) => ({
2425 2425 ...item,
2426   - sName: `sParams${index}`,
  2426 + sName: item.sFieldName || `sParams${index}`,
2427 2427 showName: item.sParam,
2428   - sDropDownType: "sql",
  2428 + sDropDownType: item.sParamDropDown ? "sql" : "",
2429 2429 iColValue: 4,
2430 2430 }));
2431 2431  
... ... @@ -2464,7 +2464,15 @@ const BackendParamsExtraComponent = props => {
2464 2464 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
2465 2465 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
2466 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 2476 const { sParam } = dropDownDataSelected;
2469 2477 const { sBackendParams = [] } = slaveData[iIndex].sBackProcessData[iIndex1];
2470 2478 const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam);
... ... @@ -2474,6 +2482,13 @@ const BackendParamsExtraComponent = props => {
2474 2482 sBackendParams.push(dropDownDataSelected);
2475 2483 }
2476 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 2492 props.setState(pre => ({ ...pre, slaveData }));
2478 2493 },
2479 2494 };
... ...