Commit 9c88cf55a0d053bc280cda5389c0333408b258a1
1 parent
f550ba14
获取默认2d、3d图;
骑马 锁线提示P数要为4的倍数;
Showing
1 changed file
with
56 additions
and
54 deletions
src/components/QuickQuote/index.jsx
| ... | ... | @@ -252,6 +252,15 @@ const QuickQuoteEvent = props => { |
| 252 | 252 | |
| 253 | 253 | const { selectedNode = {}, slaveConfig } = state; |
| 254 | 254 | const { showName: sTreeNodeName } = selectedNode; |
| 255 | + | |
| 256 | + if (sFieldName === "dSumPQty" && (sTreeNodeName.includes("骑马") || sTreeNodeName.includes("锁线"))) { | |
| 257 | + if (!changeValue.dSumPQty || changeValue.dSumPQty % 4 !== 0) { | |
| 258 | + message.info("P数要为4的倍数!"); | |
| 259 | + changeValue.dSumPQty = 4; | |
| 260 | + extraState.slaveUpKey = `key_${commonUtils.createSid()}`; | |
| 261 | + } | |
| 262 | + } | |
| 263 | + | |
| 255 | 264 | const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); |
| 256 | 265 | if (name.includes("slaveDown")) { |
| 257 | 266 | const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]); |
| ... | ... | @@ -1187,7 +1196,14 @@ const TreeComponent = props => { |
| 1187 | 1196 | } |
| 1188 | 1197 | |
| 1189 | 1198 | if (timeRef.current > 1) { |
| 1190 | - addState.slaveData = slaveDataNew; | |
| 1199 | + addState.slaveData = slaveDataNew.map(item => { | |
| 1200 | + const { sPackDetailPathUpLoad, sPackPath } = selectedNode; | |
| 1201 | + return { | |
| 1202 | + ...item, | |
| 1203 | + ...(sPackDetailPathUpLoad ? { sPackDetailPathUpLoad } : {}), | |
| 1204 | + ...(sPackPath ? { sPackPath } : {}), | |
| 1205 | + }; | |
| 1206 | + }); | |
| 1191 | 1207 | addState.extraParts = {}; |
| 1192 | 1208 | addState.calcPriceFinished = false; |
| 1193 | 1209 | if (manyData.some(item => Object.keys(item).length > 4)) { |
| ... | ... | @@ -1464,7 +1480,6 @@ const BoxComponent = props => { |
| 1464 | 1480 | }; |
| 1465 | 1481 | const retrunData = await commonServices.postValueService(props.app.token, body, url); |
| 1466 | 1482 | const dropDownData = retrunData.data?.dataset?.rows; |
| 1467 | - console.log("🚀 ~ getSqlDropDownData ~ dropDownData:", dropDownData) | |
| 1468 | 1483 | cb(dropDownData); |
| 1469 | 1484 | }; |
| 1470 | 1485 | |
| ... | ... | @@ -1506,12 +1521,6 @@ const BoxComponent = props => { |
| 1506 | 1521 | viewRow: slaveRowData, |
| 1507 | 1522 | tableName: `slaveUp${boxModel}`, |
| 1508 | 1523 | }; |
| 1509 | - console.log( | |
| 1510 | - slaveConfig.gdsconfigformslave.filter(item => { | |
| 1511 | - return item.iTag === 12; | |
| 1512 | - }), | |
| 1513 | - "slaveConfig.gdsconfigformslave" | |
| 1514 | - ); | |
| 1515 | 1524 | |
| 1516 | 1525 | const getUpViewPropsByITag = iTag => { |
| 1517 | 1526 | const config = slaveConfig.gdsconfigformslave |
| ... | ... | @@ -1557,7 +1566,7 @@ const BoxComponent = props => { |
| 1557 | 1566 | } |
| 1558 | 1567 | if (selectedNode.sTypeKey !== "juantong" && item.sName === "sPaperDirection") { |
| 1559 | 1568 | return false; |
| 1560 | - } | |
| 1569 | + } | |
| 1561 | 1570 | return item.iTag === iTag; |
| 1562 | 1571 | }); |
| 1563 | 1572 | |
| ... | ... | @@ -1598,7 +1607,6 @@ const BoxComponent = props => { |
| 1598 | 1607 | } |
| 1599 | 1608 | } |
| 1600 | 1609 | const newConfig = [...boxConfigList, ...config]; |
| 1601 | - console.log(newConfig, "newConfig"); | |
| 1602 | 1610 | |
| 1603 | 1611 | return { |
| 1604 | 1612 | ...props, |
| ... | ... | @@ -1614,7 +1622,6 @@ const BoxComponent = props => { |
| 1614 | 1622 | // const upViewProps11 = getUpViewPropsByITag(11); |
| 1615 | 1623 | // 印刷参数表单 |
| 1616 | 1624 | let upViewProps12 = getUpViewPropsByITag(12); |
| 1617 | - console.log("🚀 ~ upViewProps12:", upViewProps12); | |
| 1618 | 1625 | |
| 1619 | 1626 | const filterConditions = { |
| 1620 | 1627 | juantong: x => |
| ... | ... | @@ -2109,7 +2116,7 @@ const BoxComponent = props => { |
| 2109 | 2116 | <div className={styles.viewTable1}> |
| 2110 | 2117 | <PrintParamsComponent {...props} /> |
| 2111 | 2118 | <div className={styles.materialsLine}> |
| 2112 | - <div className={styles.materialsViewTable}> | |
| 2119 | + <div className={styles.materialsViewTable} key={state.slaveUpKey}> | |
| 2113 | 2120 | <CommonViewTable {...upViewProps12} /> |
| 2114 | 2121 | </div> |
| 2115 | 2122 | <div className={styles.materialsBtns} style={{ width: "10%", height: "30px" }}></div> |
| ... | ... | @@ -2158,44 +2165,39 @@ const BoxComponent = props => { |
| 2158 | 2165 | </div> |
| 2159 | 2166 | {cailiaoyinshuaDiv} |
| 2160 | 2167 | </div> |
| 2161 | - {bBox && ( | |
| 2162 | - <div className={styles.boxPart1Right}> | |
| 2163 | - <div className={styles.boxRreview}> | |
| 2164 | - <Image.PreviewGroup> | |
| 2165 | - {svgProps.boxList.length ? ( | |
| 2166 | - <div style={{ width: " 300px", height: "290px", backgroundColor: "#fff", borderRight: "1px solid #ccc" }}> | |
| 2167 | - <DynamicSVG {...svgProps} /> | |
| 2168 | - </div> | |
| 2169 | - ) : ( | |
| 2170 | - <div className={styles.noImg}>{noImage}</div> | |
| 2171 | - )} | |
| 2172 | - | |
| 2173 | - {/* <div className={styles.boxRreviewTitile}>展开图</div> */} | |
| 2174 | - {slaveRowData.sPackPath ? ( | |
| 2175 | - // <Image width={300} src={slaveRowData.sPackPath} /> | |
| 2176 | - | |
| 2177 | - <div style={{ width: "300px", height: "300px" }}> | |
| 2178 | - <Carousel dots style={{ width: "300px", height: "300px" }}> | |
| 2179 | - {imagesData.map((image, index) => ( | |
| 2180 | - <div key={index} className="carousel-item"> | |
| 2181 | - <Image src={image.src} alt={image.alt} style={{ width: "300px", height: "290px" }}/> | |
| 2182 | - </div> | |
| 2183 | - ))} | |
| 2184 | - </Carousel> | |
| 2185 | - </div> | |
| 2186 | - ) : ( | |
| 2187 | - <div className={styles.noImg}>{noImage}</div> | |
| 2188 | - )} | |
| 2189 | - {/* <div className={styles.boxRreviewTitile}>立体图</div> */} | |
| 2190 | - </Image.PreviewGroup> | |
| 2191 | - </div> | |
| 2192 | - {calcMethodDiv} | |
| 2168 | + <div className={styles.boxPart1Right}> | |
| 2169 | + <div className={styles.boxRreview}> | |
| 2170 | + <Image.PreviewGroup> | |
| 2171 | + {bBox ? ( | |
| 2172 | + <> | |
| 2173 | + {svgProps.boxList.length ? ( | |
| 2174 | + <div style={{ width: " 300px", height: "290px", backgroundColor: "#fff", borderRight: "1px solid #ccc" }}> | |
| 2175 | + <DynamicSVG {...svgProps} /> | |
| 2176 | + </div> | |
| 2177 | + ) : ( | |
| 2178 | + <div className={styles.noImg}>{noImage}</div> | |
| 2179 | + )} | |
| 2180 | + </> | |
| 2181 | + ) : ( | |
| 2182 | + "" | |
| 2183 | + )} | |
| 2184 | + {slaveRowData.sPackPath ? ( | |
| 2185 | + <div style={{ width: "300px", height: "300px" }}> | |
| 2186 | + <Carousel dots style={{ width: "300px", height: "300px" }}> | |
| 2187 | + {imagesData.map((image, index) => ( | |
| 2188 | + <div key={index} className="carousel-item"> | |
| 2189 | + <Image src={image.src} alt={image.alt} style={{ width: "300px", height: "290px" }} /> | |
| 2190 | + </div> | |
| 2191 | + ))} | |
| 2192 | + </Carousel> | |
| 2193 | + </div> | |
| 2194 | + ) : ( | |
| 2195 | + <div className={styles.noImg}>{noImage}</div> | |
| 2196 | + )} | |
| 2197 | + </Image.PreviewGroup> | |
| 2193 | 2198 | </div> |
| 2194 | - )} | |
| 2195 | - {/* <div style={{display:'block'}}> | |
| 2196 | - <Typesetting {...boxProps} onSaveStates={handleSaveState} onSaveDPartsLength={onSaveDPartsLength}/> | |
| 2197 | - | |
| 2198 | - </div> */} | |
| 2199 | + {calcMethodDiv} | |
| 2200 | + </div> | |
| 2199 | 2201 | </div> |
| 2200 | 2202 | </> |
| 2201 | 2203 | ); |
| ... | ... | @@ -2819,8 +2821,8 @@ const BoxModelSelectedModal = props => { |
| 2819 | 2821 | const svgProps = { |
| 2820 | 2822 | ...props, |
| 2821 | 2823 | boxList, |
| 2822 | - dSvgBoxWidth: 150, | |
| 2823 | - dSvgBoxHeight: 150, | |
| 2824 | + dSvgBoxWidth: 100, | |
| 2825 | + dSvgBoxHeight: 100, | |
| 2824 | 2826 | showNew: 1, |
| 2825 | 2827 | }; |
| 2826 | 2828 | return svgProps; |
| ... | ... | @@ -2845,14 +2847,14 @@ const BoxModelSelectedModal = props => { |
| 2845 | 2847 | column.render = (value, record, index) => |
| 2846 | 2848 | column.dataIndex === "sPackDetailPathUpLoad" ? ( |
| 2847 | 2849 | !value ? ( |
| 2848 | - <div style={{ width: "auto", height: 150 }}> | |
| 2850 | + <div style={{ width: "auto", height: 100 }}> | |
| 2849 | 2851 | <DynamicSVG {...getSvgProps(selectBoxList[index])} /> |
| 2850 | 2852 | </div> |
| 2851 | 2853 | ) : ( |
| 2852 | - <img src={value} alt="" width={150} height={150} /> | |
| 2854 | + <img src={value} alt="" width={100} height={100} /> | |
| 2853 | 2855 | ) |
| 2854 | 2856 | ) : value ? ( |
| 2855 | - <img src={value} alt="" width={150} height={150} /> | |
| 2857 | + <img src={value} alt="" width={100} height={100} /> | |
| 2856 | 2858 | ) : ( |
| 2857 | 2859 | noImage |
| 2858 | 2860 | ); | ... | ... |