Commit 9ef9a5243a17329df7079f663d9de61b573a272d
1 parent
b4f3409a
快速报价材料费展示
Showing
3 changed files
with
24 additions
and
18 deletions
src/components/Common/BoxShowImgMaterial/indexNew.js
| ... | ... | @@ -25,6 +25,9 @@ const BoxShowImgMaterial = props => { |
| 25 | 25 | const verticalBoxes = Math.floor(dWlkd / dMachineWidth); |
| 26 | 26 | const scaleX = (clientWidth - 70) / (dWlcd); |
| 27 | 27 | const scaleY = (clientHeight - 70) / (dWlkd); |
| 28 | + const getNum =(num)=>{ | |
| 29 | + return Number(num).toFixed(0); | |
| 30 | + } | |
| 28 | 31 | // 动态生成多个 materialBox |
| 29 | 32 | const generateMaterialBoxes = () => { |
| 30 | 33 | const boxes = []; |
| ... | ... | @@ -78,7 +81,7 @@ const BoxShowImgMaterial = props => { |
| 78 | 81 | color: "red", |
| 79 | 82 | }} |
| 80 | 83 | > |
| 81 | - {dMachineLength} | |
| 84 | + {getNum(dMachineLength)} | |
| 82 | 85 | </span> |
| 83 | 86 | <VerticalLeftOutlined |
| 84 | 87 | style={{ |
| ... | ... | @@ -136,7 +139,7 @@ const BoxShowImgMaterial = props => { |
| 136 | 139 | color: "red", |
| 137 | 140 | }} |
| 138 | 141 | > |
| 139 | - {dMachineWidth} | |
| 142 | + {getNum(dMachineWidth)} | |
| 140 | 143 | </span> |
| 141 | 144 | <VerticalLeftOutlined |
| 142 | 145 | style={{ |
| ... | ... | @@ -183,7 +186,7 @@ const BoxShowImgMaterial = props => { |
| 183 | 186 | textRefs.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; |
| 184 | 187 | textRefs.current.style.transformOrigin = "top left"; |
| 185 | 188 | } |
| 186 | - }, 0); | |
| 189 | + }, 1); // umijs 需要延时处理 | |
| 187 | 190 | }, |
| 188 | 191 | [slaveDataDetail] |
| 189 | 192 | ); |
| ... | ... | @@ -192,7 +195,6 @@ const BoxShowImgMaterial = props => { |
| 192 | 195 | const MaterialUtilizationRate = commonFunc.showLocalMessage(props, "MaterialUtilizationRate", "材料利用率"); |
| 193 | 196 | const isShow = |
| 194 | 197 | slaveDataDetail && slaveDataDetail.dMachineLength && slaveDataDetail.dMaxWidth && slaveDataDetail.dMaxLength && isMax; |
| 195 | - console.log("🚀 ~ isDPartsLength:", isDPartsLength,isMax) | |
| 196 | 198 | return ( |
| 197 | 199 | <> |
| 198 | 200 | {isShow ? ( |
| ... | ... | @@ -248,7 +250,7 @@ const BoxShowImgMaterial = props => { |
| 248 | 250 | color: "red", |
| 249 | 251 | }} |
| 250 | 252 | > |
| 251 | - {dWlcd} | |
| 253 | + {getNum(dWlcd)} | |
| 252 | 254 | </span> |
| 253 | 255 | <span |
| 254 | 256 | style={{ |
| ... | ... | @@ -318,9 +320,11 @@ const BoxShowImgMaterial = props => { |
| 318 | 320 | <span |
| 319 | 321 | style={{ |
| 320 | 322 | color: "red", |
| 323 | + position: "absolute", | |
| 324 | + top: "15px", | |
| 321 | 325 | }} |
| 322 | 326 | > |
| 323 | - {dWlkd} | |
| 327 | + {getNum(dWlkd)} | |
| 324 | 328 | </span> |
| 325 | 329 | <VerticalLeftOutlined |
| 326 | 330 | style={{ | ... | ... |
src/components/Common/Typesetting/typesetting.js
| ... | ... | @@ -631,7 +631,7 @@ const Typesetting = props => { |
| 631 | 631 | const newScale = Math.min(scaleX, scaleY); |
| 632 | 632 | setScale(newScale); |
| 633 | 633 | if (boxRef.current) { |
| 634 | - boxRef.current.style.transform = `scale(${scaleX}, ${scaleY})`; | |
| 634 | + boxRef.current.style.transform = `scale(${newScale}, ${newScale})`; | |
| 635 | 635 | boxRef.current.style.transformOrigin = "top left"; |
| 636 | 636 | } |
| 637 | 637 | }, 0); |
| ... | ... | @@ -871,7 +871,9 @@ const Typesetting = props => { |
| 871 | 871 | setIsModalOpen(false); |
| 872 | 872 | }; |
| 873 | 873 | |
| 874 | - | |
| 874 | + const getNum =(num)=>{ | |
| 875 | + return Number(num).toFixed(0); | |
| 876 | + } | |
| 875 | 877 | return ( |
| 876 | 878 | <> |
| 877 | 879 | {isShow ? ( |
| ... | ... | @@ -928,7 +930,7 @@ const Typesetting = props => { |
| 928 | 930 | transformOrigin: "top left", |
| 929 | 931 | }} |
| 930 | 932 | > |
| 931 | - <span style={{ color: "red", display: "inline-block", width: "100px" }}>{materialLength}</span> | |
| 933 | + <span style={{ color: "red", display: "inline-block", width: "100px" }}>{getNum(materialLength)}</span> | |
| 932 | 934 | <div className={styles.maxWidthLeft}> |
| 933 | 935 | <VerticalRightOutlined /> |
| 934 | 936 | <div |
| ... | ... | @@ -972,7 +974,7 @@ const Typesetting = props => { |
| 972 | 974 | transformOrigin: "top left", |
| 973 | 975 | }} |
| 974 | 976 | > |
| 975 | - <span style={{ color: "red", display: "inline-block", width: "30px", textAlign: "center" }}>{materialWidth}</span> | |
| 977 | + <span style={{ color: "red", display: "inline-block", width: "30px", textAlign: "center" }}>{getNum(materialWidth)}</span> | |
| 976 | 978 | {isJuantong ? ( |
| 977 | 979 | <span |
| 978 | 980 | style={{ |
| ... | ... | @@ -1116,7 +1118,7 @@ const Typesetting = props => { |
| 1116 | 1118 | <div |
| 1117 | 1119 | style={{ |
| 1118 | 1120 | position: "absolute", |
| 1119 | - right: "-10px", | |
| 1121 | + right: "-50px", | |
| 1120 | 1122 | top: 0, |
| 1121 | 1123 | textAlign: "center", |
| 1122 | 1124 | width: `${30}px`, |
| ... | ... | @@ -1132,7 +1134,7 @@ const Typesetting = props => { |
| 1132 | 1134 | color: "red", |
| 1133 | 1135 | }} |
| 1134 | 1136 | > |
| 1135 | - {maxHeight} | |
| 1137 | + {getNum(maxHeight)} | |
| 1136 | 1138 | </span> |
| 1137 | 1139 | <div |
| 1138 | 1140 | style={{ |
| ... | ... | @@ -1284,7 +1286,7 @@ const Typesetting = props => { |
| 1284 | 1286 | color: "#333", |
| 1285 | 1287 | }} |
| 1286 | 1288 | > |
| 1287 | - <span style={{ color: "red", display: "inline-block", width: "100px" }}>{materialLength}</span> | |
| 1289 | + <span style={{ color: "red", display: "inline-block", width: "100px" }}>{getNum(materialLength)}</span> | |
| 1288 | 1290 | <div className={styles.maxWidthLeft}> |
| 1289 | 1291 | <LeftOutlined style={{ fontSize: "20px" }} /> |
| 1290 | 1292 | <div |
| ... | ... | @@ -1454,7 +1456,7 @@ const Typesetting = props => { |
| 1454 | 1456 | overflow: "hide", |
| 1455 | 1457 | }} |
| 1456 | 1458 | > |
| 1457 | - <span style={{ color: "red" }}>{maxWidth}</span> | |
| 1459 | + <span style={{ color: "red" }}>{getNum(maxWidth)}</span> | |
| 1458 | 1460 | {openEdition ? ( |
| 1459 | 1461 | <span> |
| 1460 | 1462 | <span>{OpenVersion}:</span> |
| ... | ... | @@ -1524,7 +1526,7 @@ const Typesetting = props => { |
| 1524 | 1526 | color: "red", |
| 1525 | 1527 | }} |
| 1526 | 1528 | > |
| 1527 | - {maxHeight} | |
| 1529 | + {getNum(maxHeight)} | |
| 1528 | 1530 | </div> |
| 1529 | 1531 | <div |
| 1530 | 1532 | style={{ | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -997,7 +997,6 @@ const QuickQuoteEvent = props => { |
| 997 | 997 | newCopyTo.slave = commonUtils.isEmptyArr(slaveData) ? {} : slaveData[0]; |
| 998 | 998 | for (let i = 0; i < partsNewInfo.length; i++) { |
| 999 | 999 | const partInfo = partsNewInfo[i]; |
| 1000 | - console.log("🚀 ~ QuickQuoteEvent ~ partInfo:", partInfo) | |
| 1001 | 1000 | const iIndex = i; |
| 1002 | 1001 | const partsDataRow = {}; |
| 1003 | 1002 | for (const child of Object.keys(partInfo)) { |
| ... | ... | @@ -2381,9 +2380,9 @@ const BoxComponent = props => { |
| 2381 | 2380 | materialWidth: dWlkd, |
| 2382 | 2381 | dMachineLength: dWlcd, // 上机长 |
| 2383 | 2382 | dMachineWidth: dWlkd, // 上机宽 |
| 2384 | - sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸 | |
| 2383 | + sMaterialsStyle: `${slaveData[index]?.dWlcd || dWlcd}*${slaveData[index]?.dWlkd || dWlkd}`, // 原纸尺寸 | |
| 2385 | 2384 | sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸 |
| 2386 | - sMaterialRate: (((length * width) / (slaveData[index].dWlcd * slaveData[index].dWlkd)) * 100).toFixed(2), | |
| 2385 | + sMaterialRate: (((length * width) / ((slaveData[index].dWlcd || dWlcd) * (slaveData[index].dWlkd || dWlkd))) * 100).toFixed(2), | |
| 2387 | 2386 | newMaterialLength: dWlcd, |
| 2388 | 2387 | newMaterialWidth: dWlkd, |
| 2389 | 2388 | sLayoutRate: Number( |
| ... | ... | @@ -3248,6 +3247,7 @@ const ManyComponent = props => { |
| 3248 | 3247 | }, |
| 3249 | 3248 | fixedHeight: 145, |
| 3250 | 3249 | }; |
| 3250 | + | |
| 3251 | 3251 | const pricingInProgress = commonFunc.showLocalMessage(props, "sNuclearPricing", "核价中"); |
| 3252 | 3252 | const progress = commonFunc.showLocalMessage(props, "progress", "进度"); |
| 3253 | 3253 | return ( | ... | ... |