Commit e8b62d4a88b185a3fc7f4a7e2c5977ce03570bc5

Authored by 陈鑫涛
1 parent 7d69b2ad

app后道工序

src/components/Common/Typesetting/typesetting.js
@@ -220,13 +220,11 @@ const Typesetting = props => { @@ -220,13 +220,11 @@ const Typesetting = props => {
220 jInnerWidth = innerWidth; 220 jInnerWidth = innerWidth;
221 } 221 }
222 222
223 - const innerHeightCombined = (isVertical  
224 - ? jInnerHeight * 2 + dSWidthOffset + dFWidthOffset  
225 - : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset)) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 223 + const innerHeightCombined =
  224 + (isVertical ? jInnerHeight * 2 + dSWidthOffset + dFWidthOffset : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset)) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量
226 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 225 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量
227 - const innerWidthCombined = (isVertical  
228 - ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset)  
229 - : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset) + dYBJJ; 226 + const innerWidthCombined =
  227 + (isVertical ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset) + dYBJJ;
230 228
231 const style = { 229 const style = {
232 width: `${outerWidth}px`, 230 width: `${outerWidth}px`,
@@ -269,8 +267,9 @@ const Typesetting = props => { @@ -269,8 +267,9 @@ const Typesetting = props => {
269 const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ; 267 const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ;
270 const isCustomized = bAdvancedSetting; 268 const isCustomized = bAdvancedSetting;
271 let remaining = isVertical ? commonHeightCheck : commonWidthCheck; 269 let remaining = isVertical ? commonHeightCheck : commonWidthCheck;
272 - console.log(dSLengthOffset,'次盒横向偏移量');  
273 - 270 + console.log(dSLengthOffset, "次盒横向偏移量");
  271 + console.log(dSWidthOffset, "次盒纵向偏移量");
  272 +
274 // 判断 273 // 判断
275 // const remaining = false; 274 // const remaining = false;
276 const isOdd = num => { 275 const isOdd = num => {
@@ -336,7 +335,7 @@ const Typesetting = props => { @@ -336,7 +335,7 @@ const Typesetting = props => {
336 <div 335 <div
337 key={`${col}-${row}-${index}`} 336 key={`${col}-${row}-${index}`}
338 style={{ 337 style={{
339 - width: `${ innerWidthCombined }px`, 338 + width: `${innerWidthCombined}px`,
340 height: `${innerHeightCombined}px`, 339 height: `${innerHeightCombined}px`,
341 display: "flex", 340 display: "flex",
342 justifyContent: "center", 341 justifyContent: "center",
@@ -380,7 +379,7 @@ const Typesetting = props =&gt; { @@ -380,7 +379,7 @@ const Typesetting = props =&gt; {
380 <div 379 <div
381 key={`${col}-${row}-${index}-1`} 380 key={`${col}-${row}-${index}-1`}
382 style={{ 381 style={{
383 - width: `${(iSAngle === 90 || iSAngle === 270 ? jInnerWidth : innerWidth)}px`, 382 + width: `${iSAngle === 90 || iSAngle === 270 ? jInnerWidth : innerWidth}px`,
384 height: `${iSAngle === 90 || iSAngle === 270 ? jInnerHeight : innerHeight}px`, 383 height: `${iSAngle === 90 || iSAngle === 270 ? jInnerHeight : innerHeight}px`,
385 display: "flex", 384 display: "flex",
386 justifyContent: "center", 385 justifyContent: "center",
@@ -505,14 +504,14 @@ const Typesetting = props =&gt; { @@ -505,14 +504,14 @@ const Typesetting = props =&gt; {
505 if (cols > 0) { 504 if (cols > 0) {
506 for (let col = 0; col < cols; col++) { 505 for (let col = 0; col < cols; col++) {
507 const leftPosition = col * innerWidthCombined; 506 const leftPosition = col * innerWidthCombined;
508 - const topPosition = 0 * (innerHeightCombined ); 507 + const topPosition = 0 * innerHeightCombined;
509 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 508 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
510 } 509 }
511 } 510 }
512 if (rows > 0) { 511 if (rows > 0) {
513 for (let row = 0; row < rows; row++) { 512 for (let row = 0; row < rows; row++) {
514 const leftPosition = 0 * innerWidthCombined; 513 const leftPosition = 0 * innerWidthCombined;
515 - const topPosition = row * (innerHeightCombined); 514 + const topPosition = row * innerHeightCombined;
516 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 515 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
517 } 516 }
518 } 517 }
@@ -521,40 +520,40 @@ const Typesetting = props =&gt; { @@ -521,40 +520,40 @@ const Typesetting = props =&gt; {
521 for (let col = 0; col < cols; col++) { 520 for (let col = 0; col < cols; col++) {
522 for (let row = 0; row < rows; row++) { 521 for (let row = 0; row < rows; row++) {
523 const leftPosition = col * innerWidthCombined; 522 const leftPosition = col * innerWidthCombined;
524 - const topPosition = row * (innerHeightCombined); 523 + const topPosition = row * innerHeightCombined;
525 innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 524 innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
526 } 525 }
527 - // 如果可以放下首盒  
528 - }  
529 - if (remaining) {  
530 - if (isVertical) { 526 + // 如果可以放下首盒\
  527 + if (remaining && isVertical) {
531 let leftPosition = 0; 528 let leftPosition = 0;
532 let topPosition = 0; 529 let topPosition = 0;
533 if (reference) { 530 if (reference) {
534 // 是否首盒 531 // 是否首盒
535 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距 532 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距
536 - leftPosition = cols - 1 * innerWidthCombined + dFLengthOffset;  
537 - topPosition = rows * (innerHeightCombined ) + dFWidthOffset; 533 + leftPosition = col * innerWidthCombined + dFLengthOffset;
  534 + topPosition = rows * innerHeightCombined + dFWidthOffset;
538 } else { 535 } else {
539 - leftPosition = cols - 1 * innerWidthCombined;  
540 - topPosition = rows * (innerHeightCombined); 536 + leftPosition = col * innerWidthCombined;
  537 + topPosition = rows * innerHeightCombined;
541 } 538 }
542 - innerDivs.push(createBoxOne(cols - 1, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));  
543 - } else {  
544 - // 只会在横向排的时候  
545 - for (let index = 0; index < rows; index++) {  
546 - // 先默认为首盒参考  
547 - let topPosition = 0;  
548 - let leftPosition = 0;  
549 - if (reference) {  
550 - topPosition = index * (innerHeightCombined + boxWidthOffset) ;  
551 - leftPosition = cols * (innerWidthCombined + boxLengthOffset) ;  
552 - } else {  
553 - topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset) ;  
554 - leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset) + dYBJJ;  
555 - }  
556 - innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 539 + innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition + dXBJJ, iFAngle, DisableMateriallIcon));
  540 + }
  541 + }
  542 + if (remaining && !isVertical) {
  543 + for (let index = 0; index < rows; index++) {
  544 + // 先默认为首盒参考
  545 + let topPosition = 0;
  546 + let leftPosition = 0;
  547 + if (reference) {
  548 + topPosition = index * (innerHeightCombined + boxWidthOffset);
  549 + leftPosition = cols * (innerWidthCombined + boxLengthOffset);
  550 + } else {
  551 + topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset);
  552 +
  553 + leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset+dYBJJ) ;
  554 +
557 } 555 }
  556 + innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
558 } 557 }
559 } 558 }
560 } 559 }
@@ -575,10 +574,9 @@ const Typesetting = props =&gt; { @@ -575,10 +574,9 @@ const Typesetting = props =&gt; {
575 const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); 574 const propsDataHeight = Number(propsData.props.style.height.slice(0, -2));
576 const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); 575 const propsDataTop = Number(propsData.props.style.top.slice(0, -2));
577 // 判断列是否是单独的 576 // 判断列是否是单独的
578 - console.log(cols,rows,'rows');  
579 - 577 +
580 const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长 578 const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长
581 - const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (rows >= 1 ? dXBJJ : 0)).toFixed(2); 579 + const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0)).toFixed(2);
582 580
583 // 计算开数 581 // 计算开数
584 let dSinglePQty = isVertical 582 let dSinglePQty = isVertical
src/mobile/quotation/detailNew.jsx
@@ -245,8 +245,8 @@ const QuickQuoteEvent = props =&gt; { @@ -245,8 +245,8 @@ const QuickQuoteEvent = props =&gt; {
245 value: sParamDefault, 245 value: sParamDefault,
246 sParam: sParam, 246 sParam: sParam,
247 [`sParams${index}`]: sParamDefault, 247 [`sParams${index}`]: sParamDefault,
248 - sParamKey: `sParam${iOrder}`,  
249 - sParamKeyNew: sFieldName || `sParam${iOrder}`, 248 + sParamKey: `sParam${index}`,
  249 + sParamKeyNew: sFieldName || `sParam${index}`,
250 }; 250 };
251 }) 251 })
252 .filter(item => item !== ""); 252 .filter(item => item !== "");