Commit e8b62d4a88b185a3fc7f4a7e2c5977ce03570bc5

Authored by 陈鑫涛
1 parent 7d69b2ad

app后道工序

src/components/Common/Typesetting/typesetting.js
... ... @@ -220,13 +220,11 @@ const Typesetting = props => {
220 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 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 229 const style = {
232 230 width: `${outerWidth}px`,
... ... @@ -269,8 +267,9 @@ const Typesetting = props => {
269 267 const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ;
270 268 const isCustomized = bAdvancedSetting;
271 269 let remaining = isVertical ? commonHeightCheck : commonWidthCheck;
272   - console.log(dSLengthOffset,'次盒横向偏移量');
273   -
  270 + console.log(dSLengthOffset, "次盒横向偏移量");
  271 + console.log(dSWidthOffset, "次盒纵向偏移量");
  272 +
274 273 // 判断
275 274 // const remaining = false;
276 275 const isOdd = num => {
... ... @@ -336,7 +335,7 @@ const Typesetting = props => {
336 335 <div
337 336 key={`${col}-${row}-${index}`}
338 337 style={{
339   - width: `${ innerWidthCombined }px`,
  338 + width: `${innerWidthCombined}px`,
340 339 height: `${innerHeightCombined}px`,
341 340 display: "flex",
342 341 justifyContent: "center",
... ... @@ -380,7 +379,7 @@ const Typesetting = props =&gt; {
380 379 <div
381 380 key={`${col}-${row}-${index}-1`}
382 381 style={{
383   - width: `${(iSAngle === 90 || iSAngle === 270 ? jInnerWidth : innerWidth)}px`,
  382 + width: `${iSAngle === 90 || iSAngle === 270 ? jInnerWidth : innerWidth}px`,
384 383 height: `${iSAngle === 90 || iSAngle === 270 ? jInnerHeight : innerHeight}px`,
385 384 display: "flex",
386 385 justifyContent: "center",
... ... @@ -505,14 +504,14 @@ const Typesetting = props =&gt; {
505 504 if (cols > 0) {
506 505 for (let col = 0; col < cols; col++) {
507 506 const leftPosition = col * innerWidthCombined;
508   - const topPosition = 0 * (innerHeightCombined );
  507 + const topPosition = 0 * innerHeightCombined;
509 508 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
510 509 }
511 510 }
512 511 if (rows > 0) {
513 512 for (let row = 0; row < rows; row++) {
514 513 const leftPosition = 0 * innerWidthCombined;
515   - const topPosition = row * (innerHeightCombined);
  514 + const topPosition = row * innerHeightCombined;
516 515 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
517 516 }
518 517 }
... ... @@ -521,40 +520,40 @@ const Typesetting = props =&gt; {
521 520 for (let col = 0; col < cols; col++) {
522 521 for (let row = 0; row < rows; row++) {
523 522 const leftPosition = col * innerWidthCombined;
524   - const topPosition = row * (innerHeightCombined);
  523 + const topPosition = row * innerHeightCombined;
525 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 528 let leftPosition = 0;
532 529 let topPosition = 0;
533 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 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 574 const propsDataHeight = Number(propsData.props.style.height.slice(0, -2));
576 575 const propsDataTop = Number(propsData.props.style.top.slice(0, -2));
577 576 // 判断列是否是单独的
578   - console.log(cols,rows,'rows');
579   -
  577 +
580 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 582 let dSinglePQty = isVertical
... ...
src/mobile/quotation/detailNew.jsx
... ... @@ -245,8 +245,8 @@ const QuickQuoteEvent = props =&gt; {
245 245 value: sParamDefault,
246 246 sParam: sParam,
247 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 252 .filter(item => item !== "");
... ...