Commit 939084cca9e9981e73aac57ab16f3452457bde6b
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi
Showing
3 changed files
with
136 additions
and
102 deletions
src/components/QuickQuote/index.jsx
| @@ -436,7 +436,7 @@ const QuickQuoteEvent = props => { | @@ -436,7 +436,7 @@ const QuickQuoteEvent = props => { | ||
| 436 | loading: true, | 436 | loading: true, |
| 437 | }, | 437 | }, |
| 438 | () => { | 438 | () => { |
| 439 | - props.onButtonClick("BtnDraft", true); | 439 | + props.onButtonClick("BtnDraft"); |
| 440 | } | 440 | } |
| 441 | ); | 441 | ); |
| 442 | }; | 442 | }; |
| @@ -763,17 +763,6 @@ const QuickQuoteEvent = props => { | @@ -763,17 +763,6 @@ const QuickQuoteEvent = props => { | ||
| 763 | processAfterDataRow.sId = commonUtils.createSid(); | 763 | processAfterDataRow.sId = commonUtils.createSid(); |
| 764 | processAfterDataRow.sParentId = masterData.sId; | 764 | processAfterDataRow.sParentId = masterData.sId; |
| 765 | processAfterDataRow.sControlId = partsDataRow.sId; | 765 | processAfterDataRow.sControlId = partsDataRow.sId; |
| 766 | - | ||
| 767 | - const sBackendParams = process.sBackendParams || []; | ||
| 768 | - if (sBackendParams.length) { | ||
| 769 | - const sQuoParams = sBackendParams.map(item => ({ | ||
| 770 | - sParamName: item.sParam, | ||
| 771 | - sParamValue: item.value !== undefined ? item.value : "", | ||
| 772 | - bSelfCbx: !(item.value === "" || item.value === undefined), | ||
| 773 | - })); | ||
| 774 | - processAfterDataRow.sQuoParams = JSON.stringify(sQuoParams); | ||
| 775 | - } | ||
| 776 | - | ||
| 777 | // processAfterDataRow.sSlaveId = ' '; | 766 | // processAfterDataRow.sSlaveId = ' '; |
| 778 | processData.push(processAfterDataRow); | 767 | processData.push(processAfterDataRow); |
| 779 | // 配套工序 | 768 | // 配套工序 |
src/mobile/quotation/detailNew.jsx
| @@ -858,7 +858,16 @@ const QuickQuoteEvent = props => { | @@ -858,7 +858,16 @@ const QuickQuoteEvent = props => { | ||
| 858 | const masterProps = { | 858 | const masterProps = { |
| 859 | ...props, | 859 | ...props, |
| 860 | }; | 860 | }; |
| 861 | - setState(pre => ({ ...pre, newNextProps: { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData } })); | 861 | + setState(pre => ({ |
| 862 | + ...pre, | ||
| 863 | + newNextProps: { | ||
| 864 | + dQuickQuoteProductQty: state.dQuickQuoteProductQty, | ||
| 865 | + ...masterProps, | ||
| 866 | + ...newState, | ||
| 867 | + manyqtysConfig: state.manyConfig, | ||
| 868 | + manyqtysData: state.manyData, | ||
| 869 | + }, | ||
| 870 | + })); | ||
| 862 | const result = await props.handleCalculation( | 871 | const result = await props.handleCalculation( |
| 863 | false, | 872 | false, |
| 864 | { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData }, | 873 | { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData }, |
| @@ -938,6 +947,8 @@ const QuotationAllprogressDetail = baseProps => { | @@ -938,6 +947,8 @@ const QuotationAllprogressDetail = baseProps => { | ||
| 938 | 947 | ||
| 939 | useEffect(() => { | 948 | useEffect(() => { |
| 940 | const getDropDownData = async props => { | 949 | const getDropDownData = async props => { |
| 950 | + const showDownConfig = props.state.slaveConfig?.gdsconfigformslave.find(item => item.sControlName === "BtnDownConfig"); | ||
| 951 | + const downAbleConfigs = await getSqlDropDownData({ ...showDownConfig }); | ||
| 941 | props.setState(pre => { | 952 | props.setState(pre => { |
| 942 | const { slaveData = [], slaveConfig } = pre; | 953 | const { slaveData = [], slaveConfig } = pre; |
| 943 | const addState = {}; | 954 | const addState = {}; |
| @@ -972,27 +983,27 @@ const QuotationAllprogressDetail = baseProps => { | @@ -972,27 +983,27 @@ const QuotationAllprogressDetail = baseProps => { | ||
| 972 | ...pre, | 983 | ...pre, |
| 973 | ...addState, | 984 | ...addState, |
| 974 | masterData: { sProductName: showName, sProductUnit: sUnit, ...masterData }, | 985 | masterData: { sProductName: showName, sProductUnit: sUnit, ...masterData }, |
| 975 | - // downAbleConfigs: downAbleConfigs | ||
| 976 | - // .filter(item => item.sType === "2") | ||
| 977 | - // .map((item, index) => ({ | ||
| 978 | - // ...item, | ||
| 979 | - // sName: `sParams${index}`, | ||
| 980 | - // iColValue: item.iColValue || 4, | ||
| 981 | - // sVisColumnName: "sProcessName", | ||
| 982 | - // })), | ||
| 983 | - // finishedConfigs: downAbleConfigs | ||
| 984 | - // .filter(item => item.sType === "3") | ||
| 985 | - // .map((item, index) => ({ | ||
| 986 | - // ...item, | ||
| 987 | - // sName: `sParams${index}`, | ||
| 988 | - // iColValue: item.iColValue || 4, | ||
| 989 | - // sVisColumnName: "sProcessName", | ||
| 990 | - // })), | 986 | + downAbleConfigs: downAbleConfigs |
| 987 | + .filter(item => item.sType === "2") | ||
| 988 | + .map((item, index) => ({ | ||
| 989 | + ...item, | ||
| 990 | + sName: `sParams${index}`, | ||
| 991 | + iColValue: item.iColValue || 4, | ||
| 992 | + sVisColumnName: "sProcessName", | ||
| 993 | + })), | ||
| 994 | + finishedConfigs: downAbleConfigs | ||
| 995 | + .filter(item => item.sType === "3") | ||
| 996 | + .map((item, index) => ({ | ||
| 997 | + ...item, | ||
| 998 | + sName: `sParams${index}`, | ||
| 999 | + iColValue: item.iColValue || 4, | ||
| 1000 | + sVisColumnName: "sProcessName", | ||
| 1001 | + })), | ||
| 991 | }; | 1002 | }; |
| 992 | }); | 1003 | }); |
| 993 | }; | 1004 | }; |
| 994 | getDropDownData(props); | 1005 | getDropDownData(props); |
| 995 | - }, []); | 1006 | + }, [props.state.slaveConfig]); |
| 996 | const getSqlDropDownData = async ({ sId }) => { | 1007 | const getSqlDropDownData = async ({ sId }) => { |
| 997 | const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; | 1008 | const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; |
| 998 | const body = { | 1009 | const body = { |
| @@ -1008,20 +1019,7 @@ const QuotationAllprogressDetail = baseProps => { | @@ -1008,20 +1019,7 @@ const QuotationAllprogressDetail = baseProps => { | ||
| 1008 | // 取上机尺寸 | 1019 | // 取上机尺寸 |
| 1009 | return commonUtils.convertStrToObj(sColumnNameConfigStr, []); | 1020 | return commonUtils.convertStrToObj(sColumnNameConfigStr, []); |
| 1010 | }; | 1021 | }; |
| 1011 | - useEffect(() => { | ||
| 1012 | - const getData = async props => { | ||
| 1013 | - const showDownConfig = props.state.slaveConfig?.gdsconfigformslave.find(item => item.sControlName === "BtnDownConfig"); | ||
| 1014 | - const downAbleConfigs = await getSqlDropDownData({ ...showDownConfig }); | ||
| 1015 | - // downAbleConfigs.forEach((x, i) => { | ||
| 1016 | - // x.sName = "sParams" + i; | ||
| 1017 | - // }); | ||
| 1018 | - props.setState(pre => ({ | ||
| 1019 | - ...pre, | ||
| 1020 | - downAbleConfigs, | ||
| 1021 | - })); | ||
| 1022 | - }; | ||
| 1023 | - getData(props); | ||
| 1024 | - }, [props.state.slaveConfig]); | 1022 | + |
| 1025 | return ( | 1023 | return ( |
| 1026 | <div className={styles.quotationDetailBox}> | 1024 | <div className={styles.quotationDetailBox}> |
| 1027 | <QuotationDetail {...props} /> | 1025 | <QuotationDetail {...props} /> |
| @@ -1180,27 +1178,41 @@ const QuotationTabs = props => { | @@ -1180,27 +1178,41 @@ const QuotationTabs = props => { | ||
| 1180 | boxModel: activeKey, | 1178 | boxModel: activeKey, |
| 1181 | }; | 1179 | }; |
| 1182 | return ( | 1180 | return ( |
| 1183 | - <Tabs | ||
| 1184 | - activeKey={activeKey} | ||
| 1185 | - onChange={key => { | ||
| 1186 | - setActiveKey(key); | ||
| 1187 | - }} | ||
| 1188 | - > | ||
| 1189 | - {sAllPartsNameList && sAllPartsNameList.length | ||
| 1190 | - ? sAllPartsNameList.map((pane, index) => ( | ||
| 1191 | - <Tabs.Tab key={pane} title={pane}> | ||
| 1192 | - <BoxComponent {...tabsProps} paneKey={pane} /> | ||
| 1193 | - </Tabs.Tab> | ||
| 1194 | - )) | ||
| 1195 | - : ""} | ||
| 1196 | - </Tabs> | 1181 | + <div> |
| 1182 | + <div> | ||
| 1183 | + <Tabs | ||
| 1184 | + activeKey={activeKey} | ||
| 1185 | + onChange={key => { | ||
| 1186 | + setActiveKey(key); | ||
| 1187 | + }} | ||
| 1188 | + > | ||
| 1189 | + {sAllPartsNameList && sAllPartsNameList.length | ||
| 1190 | + ? sAllPartsNameList.map((pane, index) => ( | ||
| 1191 | + <Tabs.Tab key={pane} title={pane}> | ||
| 1192 | + <BoxComponent {...tabsProps} paneKey={pane} /> | ||
| 1193 | + </Tabs.Tab> | ||
| 1194 | + )) | ||
| 1195 | + : ""} | ||
| 1196 | + </Tabs> | ||
| 1197 | + </div> | ||
| 1198 | + </div> | ||
| 1197 | ); | 1199 | ); |
| 1198 | }; | 1200 | }; |
| 1199 | 1201 | ||
| 1200 | // 内容 | 1202 | // 内容 |
| 1201 | const BoxComponent = props => { | 1203 | const BoxComponent = props => { |
| 1202 | const { state, boxModel } = props; | 1204 | const { state, boxModel } = props; |
| 1203 | - const { activeKey, slaveConfig, masterData, selectedNode, boxConfig, downAbleConfigs = [], slaveData } = state || {}; | 1205 | + const { |
| 1206 | + activeKey, | ||
| 1207 | + slaveConfig, | ||
| 1208 | + masterData, | ||
| 1209 | + selectedNode, | ||
| 1210 | + boxConfig, | ||
| 1211 | + downAbleConfigs = [], | ||
| 1212 | + downAbleExtraConfigs = [], | ||
| 1213 | + finishedConfigs = [], | ||
| 1214 | + slaveData, | ||
| 1215 | + } = state || {}; | ||
| 1204 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; | 1216 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; |
| 1205 | const { sModelsId } = props; | 1217 | const { sModelsId } = props; |
| 1206 | const [selectList, setSelectList] = useState([]); | 1218 | const [selectList, setSelectList] = useState([]); |
| @@ -1401,29 +1413,22 @@ const BoxComponent = props => { | @@ -1401,29 +1413,22 @@ const BoxComponent = props => { | ||
| 1401 | 1413 | ||
| 1402 | // 后道参数 | 1414 | // 后道参数 |
| 1403 | const { sBackProcessData } = slaveRowData || []; | 1415 | const { sBackProcessData } = slaveRowData || []; |
| 1404 | - const [downAbleConfigsNew, setDownAbleConfigsNew] = useState([]); | ||
| 1405 | - useEffect(() => { | ||
| 1406 | - setDownAbleConfigsNew(downAbleConfigs); | ||
| 1407 | - }, [downAbleConfigs]); | 1416 | + const downAbleConfigsNew = downAbleConfigs.reduce((pre, cur) => { |
| 1417 | + const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName); | ||
| 1418 | + pre.push(cur, ...childConfigs); | ||
| 1419 | + return pre; | ||
| 1420 | + }, []); | ||
| 1408 | // 初始化状态,存储每个 Switch 的状态 | 1421 | // 初始化状态,存储每个 Switch 的状态 |
| 1409 | const [switchStates, setSwitchStates] = useState(null); | 1422 | const [switchStates, setSwitchStates] = useState(null); |
| 1410 | useEffect(() => { | 1423 | useEffect(() => { |
| 1411 | if (!sBackProcessData) return; | 1424 | if (!sBackProcessData) return; |
| 1412 | - const newSwitchStates = downAbleConfigsNew | ||
| 1413 | - .filter(item => item.sPartsName === boxModel || !item.sPartsName) | ||
| 1414 | - .reduce((acc, item, index) => { | ||
| 1415 | - acc[item.sName] = sBackProcessData ? sBackProcessData[index][item.sName] !== "" : false; | ||
| 1416 | - return acc; | ||
| 1417 | - }, {}); | 1425 | + const newSwitchStates = downAbleConfigsNew; |
| 1418 | 1426 | ||
| 1419 | setSwitchStates(newSwitchStates); | 1427 | setSwitchStates(newSwitchStates); |
| 1420 | }, [downAbleConfigsNew, boxModel]); // 依赖数组 | 1428 | }, [downAbleConfigsNew, boxModel]); // 依赖数组 |
| 1421 | 1429 | ||
| 1422 | // 处理 Switch 变化的函数 | 1430 | // 处理 Switch 变化的函数 |
| 1423 | const handleSwitchChange = (item, val) => { | 1431 | const handleSwitchChange = (item, val) => { |
| 1424 | - // const dropDownData = JSON.parse(item.sChineseDropDown) | ||
| 1425 | - // console.log("🚀 ~ handleSwitchChange ~ dropDownData:", dropDownData) | ||
| 1426 | - // const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]); | ||
| 1427 | setSwitchStates({ | 1432 | setSwitchStates({ |
| 1428 | ...switchStates, | 1433 | ...switchStates, |
| 1429 | [item.sName]: val, | 1434 | [item.sName]: val, |
| @@ -1435,10 +1440,9 @@ const BoxComponent = props => { | @@ -1435,10 +1440,9 @@ const BoxComponent = props => { | ||
| 1435 | .map((item, i) => ({ | 1440 | .map((item, i) => ({ |
| 1436 | ...item, | 1441 | ...item, |
| 1437 | isSelect: switchStates ? switchStates[item.sName] : false, | 1442 | isSelect: switchStates ? switchStates[item.sName] : false, |
| 1438 | - sName: "sParams" + i, | 1443 | + // sName: "sParams" + i, |
| 1439 | sProductClassifyId: item.sId, | 1444 | sProductClassifyId: item.sId, |
| 1440 | })); | 1445 | })); |
| 1441 | - | ||
| 1442 | const downViewProps = { | 1446 | const downViewProps = { |
| 1443 | ...props, | 1447 | ...props, |
| 1444 | viewConfigs: downViewConfigs, | 1448 | viewConfigs: downViewConfigs, |
| @@ -1447,7 +1451,23 @@ const BoxComponent = props => { | @@ -1447,7 +1451,23 @@ const BoxComponent = props => { | ||
| 1447 | viewRow: slaveRowData, | 1451 | viewRow: slaveRowData, |
| 1448 | tableName: `slaveDown${boxModel}`, | 1452 | tableName: `slaveDown${boxModel}`, |
| 1449 | }; | 1453 | }; |
| 1450 | - | 1454 | + // 获取sType为3的 |
| 1455 | + const { productProcessInfo = [] } = masterData; | ||
| 1456 | + const finishedViewProps = { | ||
| 1457 | + ...props, | ||
| 1458 | + viewConfigs: finishedConfigs | ||
| 1459 | + .filter(item => item.sPartsName === boxModel || !item.sPartsName) | ||
| 1460 | + .map((item, i) => ({ | ||
| 1461 | + ...item, | ||
| 1462 | + isSelect: switchStates ? switchStates[item.sName] : false, | ||
| 1463 | + // sName: "sParams" + i, | ||
| 1464 | + sProductClassifyId: item.sId, | ||
| 1465 | + })), | ||
| 1466 | + tableConfig: { ...slaveConfig, gdsconfigformslave: finishedConfigs }, | ||
| 1467 | + iColValueView: 24, | ||
| 1468 | + viewRow: masterData, | ||
| 1469 | + tableName: "finished", | ||
| 1470 | + }; | ||
| 1451 | const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []); | 1471 | const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []); |
| 1452 | const radioValue = calcMethodData[0]?.sCode; | 1472 | const radioValue = calcMethodData[0]?.sCode; |
| 1453 | const [materialLength, setMaterialLength] = useState(0); | 1473 | const [materialLength, setMaterialLength] = useState(0); |
| @@ -1729,22 +1749,42 @@ const BoxComponent = props => { | @@ -1729,22 +1749,42 @@ const BoxComponent = props => { | ||
| 1729 | <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} /> | 1749 | <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} /> |
| 1730 | </div> | 1750 | </div> |
| 1731 | 1751 | ||
| 1732 | - {downViewProps.viewConfigs.map((x, i) => ( | ||
| 1733 | - <div> | ||
| 1734 | - <div className={styles.backBox}> | ||
| 1735 | - <div className={styles.backEnd}>{x.showName}</div> | ||
| 1736 | - <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} /> | ||
| 1737 | - <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}> | ||
| 1738 | - {switchStates && switchStates[x.sName] ? ( | ||
| 1739 | - <SelectInput {...downViewProps} itemDetail={{ ...x, sVisColumnName: "sProcessName", sDropDownType: "sql" }} downIndex={i} /> | ||
| 1740 | - ) : ( | ||
| 1741 | - "" | ||
| 1742 | - )} | 1752 | + {downViewProps && downViewProps.viewConfigs && downViewProps.viewConfigs.length |
| 1753 | + ? downViewProps.viewConfigs.map((x, i) => ( | ||
| 1754 | + <div> | ||
| 1755 | + <div className={styles.backBox}> | ||
| 1756 | + <div className={styles.backEnd}>{x.showName}</div> | ||
| 1757 | + <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} /> | ||
| 1758 | + <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}> | ||
| 1759 | + {switchStates && switchStates[x.sName] ? ( | ||
| 1760 | + <SelectInput {...downViewProps} itemDetail={{ ...x, sVisColumnName: "sProcessName", sDropDownType: "sql" }} downIndex={i} /> | ||
| 1761 | + ) : ( | ||
| 1762 | + "" | ||
| 1763 | + )} | ||
| 1764 | + </div> | ||
| 1765 | + </div> | ||
| 1766 | + {getTableCloum(i, x)} | ||
| 1743 | </div> | 1767 | </div> |
| 1744 | - </div> | ||
| 1745 | - {getTableCloum(i, x)} | ||
| 1746 | - </div> | ||
| 1747 | - ))} | 1768 | + )) |
| 1769 | + : ""} | ||
| 1770 | + {finishedConfigs && finishedConfigs.viewConfigs && finishedConfigs.viewConfigs.length | ||
| 1771 | + ? finishedConfigs.viewConfigs.map((x, i) => ( | ||
| 1772 | + <div> | ||
| 1773 | + <div className={styles.backBox}> | ||
| 1774 | + <div className={styles.backEnd}>{x.showName}</div> | ||
| 1775 | + <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} /> | ||
| 1776 | + <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}> | ||
| 1777 | + {switchStates && switchStates[x.sName] ? ( | ||
| 1778 | + <SelectInput {...downViewProps} itemDetail={{ ...x, sVisColumnName: "sProcessName", sDropDownType: "sql" }} downIndex={i} /> | ||
| 1779 | + ) : ( | ||
| 1780 | + "" | ||
| 1781 | + )} | ||
| 1782 | + </div> | ||
| 1783 | + </div> | ||
| 1784 | + {getTableCloum(i, x)} | ||
| 1785 | + </div> | ||
| 1786 | + )) | ||
| 1787 | + : ""} | ||
| 1748 | </div> | 1788 | </div> |
| 1749 | <div> | 1789 | <div> |
| 1750 | <div className={styles.projectBtn}> | 1790 | <div className={styles.projectBtn}> |
| @@ -1959,7 +1999,7 @@ const MaterialsComponent = props => { | @@ -1959,7 +1999,7 @@ const MaterialsComponent = props => { | ||
| 1959 | // 多数量组件 | 1999 | // 多数量组件 |
| 1960 | const ManyComponent = props => { | 2000 | const ManyComponent = props => { |
| 1961 | const { state, setState, enabled, loading } = props; | 2001 | const { state, setState, enabled, loading } = props; |
| 1962 | - const { masterData = {}, calcPriceLoading, calcPriceFinished, manyData = [] } = state; | 2002 | + const { masterData = {}, calcPriceLoading, calcPriceFinished, manyData = [], dQuickQuoteProductQty } = state; |
| 1963 | const [submitLoading, setSubmitLoading] = useState(false); | 2003 | const [submitLoading, setSubmitLoading] = useState(false); |
| 1964 | const [processPercent, setProcessPercent] = useState(0); | 2004 | const [processPercent, setProcessPercent] = useState(0); |
| 1965 | const [selectedRadio, setSelectedRadio] = useState(null); | 2005 | const [selectedRadio, setSelectedRadio] = useState(null); |
| @@ -2013,10 +2053,11 @@ const ManyComponent = props => { | @@ -2013,10 +2053,11 @@ const ManyComponent = props => { | ||
| 2013 | enabled: false, | 2053 | enabled: false, |
| 2014 | }; | 2054 | }; |
| 2015 | const { headerColumn, data } = tableProps; | 2055 | const { headerColumn, data } = tableProps; |
| 2056 | + // 监听父组件状态变化 | ||
| 2016 | useEffect(() => { | 2057 | useEffect(() => { |
| 2017 | - if(!data.length) return | ||
| 2018 | - setSelectedRadio(data[0].dManyQty); | ||
| 2019 | - }, [data]); | 2058 | + if (!data.length) return; |
| 2059 | + setSelectedRadio(Number(props.state.dQuickQuoteProductQty) || data[0].dProductQty); | ||
| 2060 | + }, [props.state.dQuickQuoteProductQty]); // 直接监听父组件的 | ||
| 2020 | // 核价事件 | 2061 | // 核价事件 |
| 2021 | const onCalcPrice = () => { | 2062 | const onCalcPrice = () => { |
| 2022 | const addState = { | 2063 | const addState = { |
| @@ -2034,20 +2075,21 @@ const ManyComponent = props => { | @@ -2034,20 +2075,21 @@ const ManyComponent = props => { | ||
| 2034 | ); | 2075 | ); |
| 2035 | }; | 2076 | }; |
| 2036 | const handleRadioChange = selectedRowKeys => { | 2077 | const handleRadioChange = selectedRowKeys => { |
| 2037 | - setSelectedRadio(selectedRowKeys.dManyQty); | ||
| 2038 | const dProductQty = manyData.find(item => item.sId === selectedRowKeys.sId).dManyQty; | 2078 | const dProductQty = manyData.find(item => item.sId === selectedRowKeys.sId).dManyQty; |
| 2039 | - props.slaveData?.forEach(slaveRowData => { | ||
| 2040 | - props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props); | ||
| 2041 | - }); | 2079 | + // 这一步导致了点击数量没有变化 |
| 2080 | + // props.slaveData?.forEach(slaveRowData => { | ||
| 2081 | + // props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props); | ||
| 2082 | + // }); | ||
| 2042 | setState(pre => ({ | 2083 | setState(pre => ({ |
| 2043 | ...pre, | 2084 | ...pre, |
| 2044 | - manySelectedRowKeys: selectedRowKeys, | 2085 | + manySelectedRowKeys: selectedRowKeys.sId, |
| 2045 | dQuickQuoteProductQty: dProductQty, | 2086 | dQuickQuoteProductQty: dProductQty, |
| 2046 | })); | 2087 | })); |
| 2088 | + setSelectedRadio(dProductQty); | ||
| 2047 | }; | 2089 | }; |
| 2048 | return ( | 2090 | return ( |
| 2049 | <div> | 2091 | <div> |
| 2050 | - <div style={{marginBottom:'1rem',textAlign:'right'}}> | 2092 | + <div style={{ marginBottom: "1rem", textAlign: "right" }}> |
| 2051 | <Button | 2093 | <Button |
| 2052 | color="primary" | 2094 | color="primary" |
| 2053 | fill="solid" | 2095 | fill="solid" |
src/mobile/quotation/master.jsx
| @@ -408,7 +408,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | @@ -408,7 +408,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | ||
| 408 | masterData.sFormId = nextProps.masterData.sFormId; | 408 | masterData.sFormId = nextProps.masterData.sFormId; |
| 409 | masterData.sBillNo = nextProps.masterData.sBillNo; | 409 | masterData.sBillNo = nextProps.masterData.sBillNo; |
| 410 | } | 410 | } |
| 411 | - masterData.handleType = masterData.sBillNo ? "update" : "add"; | 411 | + masterData.handleType = nextProps.handleType && nextProps.handleType === 'update' ? "update" : "add"; |
| 412 | if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) { | 412 | if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) { |
| 413 | masterData.sMakePerson = sMakePerson; | 413 | masterData.sMakePerson = sMakePerson; |
| 414 | } | 414 | } |
| @@ -535,6 +535,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | @@ -535,6 +535,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | ||
| 535 | ...addState, | 535 | ...addState, |
| 536 | }); | 536 | }); |
| 537 | } else { | 537 | } else { |
| 538 | + masterData.handleType = 'update' | ||
| 538 | if (isWait) { | 539 | if (isWait) { |
| 539 | return { | 540 | return { |
| 540 | slaveData, | 541 | slaveData, |
| @@ -545,6 +546,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | @@ -545,6 +546,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | ||
| 545 | manyqtysData, | 546 | manyqtysData, |
| 546 | loading: false, | 547 | loading: false, |
| 547 | packData, | 548 | packData, |
| 549 | + handleType:'update', | ||
| 548 | ...addState, | 550 | ...addState, |
| 549 | }; | 551 | }; |
| 550 | } else { | 552 | } else { |
| @@ -558,6 +560,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | @@ -558,6 +560,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { | ||
| 558 | loading: false, | 560 | loading: false, |
| 559 | packData, | 561 | packData, |
| 560 | ...addState, | 562 | ...addState, |
| 563 | + handleType:'update' | ||
| 561 | }); | 564 | }); |
| 562 | } | 565 | } |
| 563 | // message.success(commonFunc.getConfigShowName(masterConfig, "BtnCalculation") + commonFunc.showMessage(app.commonConst, "handleSuccess")); | 566 | // message.success(commonFunc.getConfigShowName(masterConfig, "BtnCalculation") + commonFunc.showMessage(app.commonConst, "handleSuccess")); |
| @@ -908,7 +911,7 @@ const handleSave = async (skipCalculation, props) => { | @@ -908,7 +911,7 @@ const handleSave = async (skipCalculation, props) => { | ||
| 908 | } | 911 | } |
| 909 | } | 912 | } |
| 910 | if ((skipFlag === 0 || masterData.bNoVerify) && !skipCalculation) { | 913 | if ((skipFlag === 0 || masterData.bNoVerify) && !skipCalculation) { |
| 911 | - handleCalculation(true, props.state.newNextProps, false, props); | 914 | + handleCalculation(true, props, false, props); |
| 912 | } else { | 915 | } else { |
| 913 | props.onSaveData({ | 916 | props.onSaveData({ |
| 914 | data, | 917 | data, |