Commit 9ef9a5243a17329df7079f663d9de61b573a272d

Authored by 陈鑫涛
1 parent b4f3409a

快速报价材料费展示

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