Commit 691cc11f85b2017b8735b4188615880313bc1a7d

Authored by 陈鑫涛
1 parent b0087800

门幅卷筒展示

src/components/Common/BoxShowImgMaterial/indexNew.js
1 /* eslint-disable */ 1 /* eslint-disable */
2 import React, { useEffect, useState, useRef } from "react"; 2 import React, { useEffect, useState, useRef } from "react";
3 -import { VerticalLeftOutlined, VerticalRightOutlined } from "@ant-design/icons"; 3 +import { VerticalLeftOutlined, VerticalRightOutlined, ArrowRightOutlined } from "@ant-design/icons";
4 import styles from "./index.less"; 4 import styles from "./index.less";
5 import { bottom } from "react-grid-layout/build/utils"; 5 import { bottom } from "react-grid-layout/build/utils";
6 import { transform } from "@antv/g2/lib/util/transform"; 6 import { transform } from "@antv/g2/lib/util/transform";
@@ -23,6 +23,7 @@ const BoxShowImgMaterial = props => { @@ -23,6 +23,7 @@ const BoxShowImgMaterial = props => {
23 var { dMaxLength, dMaxWidth, dMachineLength, dMachineWidth, dWlcd, dWlkd, dSBLB, dXBLB, dZBLB, dYBLB, scale } = slaveDataDetail; 23 var { dMaxLength, dMaxWidth, dMachineLength, dMachineWidth, dWlcd, dWlkd, dSBLB, dXBLB, dZBLB, dYBLB, scale } = slaveDataDetail;
24 } 24 }
25 // 计算可以放置的盒子数量 25 // 计算可以放置的盒子数量
  26 + const isJuantong = selectedNode.sTypeKey === "juantong";
26 const horizontalBoxes = Math.floor(dWlcd / dMachineLength); 27 const horizontalBoxes = Math.floor(dWlcd / dMachineLength);
27 const verticalBoxes = Math.floor(dWlkd / dMachineWidth); 28 const verticalBoxes = Math.floor(dWlkd / dMachineWidth);
28 const scaleX = (clientWidth - 100) / Number(dWlcd); 29 const scaleX = (clientWidth - 100) / Number(dWlcd);
@@ -136,10 +137,14 @@ const BoxShowImgMaterial = props => { @@ -136,10 +137,14 @@ const BoxShowImgMaterial = props => {
136 <span 137 <span
137 style={{ 138 style={{
138 color: "red", 139 color: "red",
  140 + position: "relative",
  141 + display: "inline-block",
139 }} 142 }}
140 > 143 >
141 {dMachineWidth} 144 {dMachineWidth}
142 </span> 145 </span>
  146 +
  147 +
143 <VerticalLeftOutlined 148 <VerticalLeftOutlined
144 style={{ 149 style={{
145 position: "absolute", 150 position: "absolute",
@@ -159,6 +164,31 @@ const BoxShowImgMaterial = props =&gt; { @@ -159,6 +164,31 @@ const BoxShowImgMaterial = props =&gt; {
159 }} 164 }}
160 /> 165 />
161 </div> 166 </div>
  167 + {/* <div
  168 + style={{
  169 + position: "absolute",
  170 + top: "120px",
  171 + right: "-0px",
  172 + height: `${dMachineWidth * scaleY}px`,
  173 + lineHeight: `${dMachineWidth * scaleY}px`,
  174 + fontSize: `${size || 11}px`,
  175 + textAlign: "center",
  176 + width: "30px",
  177 + transform: `scale(${1 / scaleX}, ${1 / scaleY})`,
  178 + transformOrigin: "top left",
  179 + writingMode:'vertical-rl',
  180 + color:'red',
  181 + display:'flex',
  182 + alignItems:'center',
  183 + justifyContent: 'center',
  184 + textOrientation: 'upright'
  185 + }}
  186 + >
  187 + {isJuantong ? "门幅方向" : ""}
  188 + </div>
  189 + <div>
  190 + <ArrowRightOutlined />
  191 + </div> */}
162 </div> 192 </div>
163 ); 193 );
164 } 194 }
@@ -185,14 +215,14 @@ const BoxShowImgMaterial = props =&gt; { @@ -185,14 +215,14 @@ const BoxShowImgMaterial = props =&gt; {
185 textRefs.current.style.transformOrigin = "top left"; 215 textRefs.current.style.transformOrigin = "top left";
186 } 216 }
187 }, 10); 217 }, 10);
188 - }, [scaleX,scaleY]); 218 + }, [scaleX, scaleY]);
189 const isMax = slaveDataDetail?.dMaxWidth * slaveDataDetail?.dMaxLength > slaveDataDetail?.dMachineLength * slaveDataDetail?.dMachineWidth; 219 const isMax = slaveDataDetail?.dMaxWidth * slaveDataDetail?.dMaxLength > slaveDataDetail?.dMachineLength * slaveDataDetail?.dMachineWidth;
190 const isDPartsLength = slaveDataDetail?.dPartsLength < slaveDataDetail?.dMaxLength && slaveDataDetail?.dPartsWidth < slaveDataDetail?.dMaxWidth; 220 const isDPartsLength = slaveDataDetail?.dPartsLength < slaveDataDetail?.dMaxLength && slaveDataDetail?.dPartsWidth < slaveDataDetail?.dMaxWidth;
191 221
192 const isShow = 222 const isShow =
193 isDPartsLength && slaveDataDetail && slaveDataDetail.dMachineLength && slaveDataDetail.dMaxWidth && slaveDataDetail.dMaxLength && isMax; 223 isDPartsLength && slaveDataDetail && slaveDataDetail.dMachineLength && slaveDataDetail.dMaxWidth && slaveDataDetail.dMaxLength && isMax;
194 -  
195 - return ( 224 +
  225 + return (
196 <> 226 <>
197 {isShow ? ( 227 {isShow ? (
198 <div 228 <div
@@ -215,7 +245,7 @@ const BoxShowImgMaterial = props =&gt; { @@ -215,7 +245,7 @@ const BoxShowImgMaterial = props =&gt; {
215 style={{ 245 style={{
216 position: "absolute", 246 position: "absolute",
217 left: "0px", 247 left: "0px",
218 - width: `${(dWlcd * (clientWidth - 100)) / (dWlcd)}px`, 248 + width: `${(dWlcd * (clientWidth - 100)) / dWlcd}px`,
219 fontSize: `${size || 11}px`, 249 fontSize: `${size || 11}px`,
220 textAlign: "center", 250 textAlign: "center",
221 height: "30px", 251 height: "30px",
src/components/Common/Typesetting/typesetting.js
1 /* eslint-disable */ 1 /* eslint-disable */
2 -import * as commonFunc from '@/components/Common/commonFunc';  
3 -import {  
4 - DownOutlined,  
5 - LeftOutlined,  
6 - RightOutlined,  
7 - UpOutlined,  
8 - VerticalLeftOutlined,  
9 - VerticalRightOutlined,  
10 -} from '@ant-design/icons';  
11 -import { message, Modal } from 'antd-v4';  
12 -import React, { useEffect, useRef, useState } from 'react';  
13 -  
14 -import DynamicSVG from '../../Common/BoxDesignCompontent/svg';  
15 -import styles from './index.less'; 2 +import * as commonFunc from "@/components/Common/commonFunc";
  3 +import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined, VerticalLeftOutlined, VerticalRightOutlined } from "@ant-design/icons";
  4 +import { message, Modal } from "antd-v4";
  5 +import React, { useEffect, useRef, useState } from "react";
  6 +import { ArrowRightOutlined } from "@ant-design/icons";
  7 +import DynamicSVG from "../../Common/BoxDesignCompontent/svg";
  8 +import styles from "./index.less";
16 9
17 const Typesetting = props => { 10 const Typesetting = props => {
18 const { 11 const {
@@ -47,7 +40,7 @@ const Typesetting = props =&gt; { @@ -47,7 +40,7 @@ const Typesetting = props =&gt; {
47 } = slaveRowData; 40 } = slaveRowData;
48 41
49 const { masterData, selectedNode, slaveData } = state; 42 const { masterData, selectedNode, slaveData } = state;
50 - if (!masterData) return 43 + if (!masterData) return;
51 // 如果是卷筒类 那么上下左右留白等于左留白 44 // 如果是卷筒类 那么上下左右留白等于左留白
52 if (selectedNode && selectedNode.sTypeKey === "juantong") { 45 if (selectedNode && selectedNode.sTypeKey === "juantong") {
53 dSBLB = dZBLB; 46 dSBLB = dZBLB;
@@ -70,7 +63,7 @@ const Typesetting = props =&gt; { @@ -70,7 +63,7 @@ const Typesetting = props =&gt; {
70 const [dPartsLength, setDPartsLength] = useState(0); 63 const [dPartsLength, setDPartsLength] = useState(0);
71 const [newDHorizontalType, setNewDHorizontalType] = useState(0); 64 const [newDHorizontalType, setNewDHorizontalType] = useState(0);
72 const [newDPortraitType, setNewDPortraitType] = useState(0); 65 const [newDPortraitType, setNewDPortraitType] = useState(0);
73 - const [oldVariables, setOldVariables] = useState('') 66 + const [oldVariables, setOldVariables] = useState("");
74 // 横板 67 // 横板
75 let { dHorizontal, dPortrait, dHorizontalType, dPortraitType } = slaveRowData; 68 let { dHorizontal, dPortrait, dHorizontalType, dPortraitType } = slaveRowData;
76 // 使用 useRef 获取 DOM 元素 69 // 使用 useRef 获取 DOM 元素
@@ -116,7 +109,6 @@ const Typesetting = props =&gt; { @@ -116,7 +109,6 @@ const Typesetting = props =&gt; {
116 // 执行函数并返回结果 109 // 执行函数并返回结果
117 return func(...args, Math); 110 return func(...args, Math);
118 } catch (error) { 111 } catch (error) {
119 - console.error("公式执行错误:", error);  
120 return 0; 112 return 0;
121 } 113 }
122 }; 114 };
@@ -192,10 +184,10 @@ const Typesetting = props =&gt; { @@ -192,10 +184,10 @@ const Typesetting = props =&gt; {
192 184
193 // 计算表达式结果 185 // 计算表达式结果
194 const variabless = { 186 const variabless = {
195 - ...variables, 187 + ...variables,
196 ...result, 188 ...result,
197 }; 189 };
198 - 190 +
199 let DisableMateriallIcon = L ? sPackDetailPath : null; 191 let DisableMateriallIcon = L ? sPackDetailPath : null;
200 // 盒子展长展开公式计算 192 // 盒子展长展开公式计算
201 const innerWidth = slaveRowData.sTypes === "6" ? evaluateFormula(sWidthFormula, variabless) : evaluateFormula(sLengthFormula, variabless); 193 const innerWidth = slaveRowData.sTypes === "6" ? evaluateFormula(sWidthFormula, variabless) : evaluateFormula(sLengthFormula, variabless);
@@ -220,17 +212,17 @@ const Typesetting = props =&gt; { @@ -220,17 +212,17 @@ const Typesetting = props =&gt; {
220 jInnerHeight = innerWidth; 212 jInnerHeight = innerWidth;
221 jInnerWidth = innerHeight; 213 jInnerWidth = innerHeight;
222 } 214 }
223 - if (state.selectedNode.sTypeKey === 'kapai' || state.selectedNode.sTypeKey === "juantong") { 215 + if (state.selectedNode.sTypeKey === "kapai" || state.selectedNode.sTypeKey === "juantong") {
224 jInnerHeight = innerHeight; 216 jInnerHeight = innerHeight;
225 jInnerWidth = innerWidth; 217 jInnerWidth = innerWidth;
226 } 218 }
227 - 219 +
228 const innerHeightCombined = isVertical 220 const innerHeightCombined = isVertical
229 ? jInnerHeight * 2 + dSWidthOffset + dFWidthOffset + dXBJJ 221 ? jInnerHeight * 2 + dSWidthOffset + dFWidthOffset + dXBJJ
230 : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 222 : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量
231 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 223 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量
232 const innerWidthCombined = isVertical 224 const innerWidthCombined = isVertical
233 -? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) + dYBJJ 225 + ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) + dYBJJ
234 : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset + dYBJJ; 226 : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset + dYBJJ;
235 const style = { 227 const style = {
236 width: `${outerWidth}px`, 228 width: `${outerWidth}px`,
@@ -244,25 +236,27 @@ const Typesetting = props =&gt; { @@ -244,25 +236,27 @@ const Typesetting = props =&gt; {
244 let cols = dSWidthOffsetCombined === 0 ? 0 : Math.floor(outerWidth / dSWidthOffsetCombined); 236 let cols = dSWidthOffsetCombined === 0 ? 0 : Math.floor(outerWidth / dSWidthOffsetCombined);
245 const rowsCombined = innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset); 237 const rowsCombined = innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset);
246 let rows = rowsCombined === 0 ? 0 : Math.floor(outerHeight / rowsCombined); 238 let rows = rowsCombined === 0 ? 0 : Math.floor(outerHeight / rowsCombined);
247 - let colsMaxLength = (cols) * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ) + dZBLB + dYBLB - (reference ? 0 : dSLengthOffset); 239 + let colsMaxLength =
  240 + cols * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ) + dZBLB + dYBLB - (reference ? 0 : dSLengthOffset);
248 241
249 - let rowsMaxLength = rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset) + dXBJJ) + dSBLB + dXBLB - (reference ? 0 : dSWidthOffset) ;  
250 - while (colsMaxLength >= outerWidth && cols > 0) { 242 + let rowsMaxLength =
  243 + rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset) + dXBJJ) + dSBLB + dXBLB - (reference ? 0 : dSWidthOffset);
  244 + while (colsMaxLength >= outerWidth && cols > 0) {
251 cols = cols - 1; 245 cols = cols - 1;
252 - colsMaxLength = (cols) * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ); 246 + colsMaxLength = cols * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ);
253 } 247 }
254 248
255 - while (rowsMaxLength>= outerHeight && rows > 0) { 249 + while (rowsMaxLength >= outerHeight && rows > 0) {
256 rows = rows - 1; 250 rows = rows - 1;
257 - rowsMaxLength = rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset) + dXBJJ) ; 251 + rowsMaxLength = rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset) + dXBJJ);
258 } 252 }
259 253
260 // console.log(cols, rows, outerWidth, outerHeight, colsMaxLength,rowsMaxLength,"cols rows outerWidth outerHeight"); 254 // console.log(cols, rows, outerWidth, outerHeight, colsMaxLength,rowsMaxLength,"cols rows outerWidth outerHeight");
261 255
262 // 最大上机长 上机宽 开料尺寸 256 // 最大上机长 上机宽 开料尺寸
263 // 计算剩余空间 每组都算上偏移量 那么剩余需要加上后面偏移的总量 257 // 计算剩余空间 每组都算上偏移量 那么剩余需要加上后面偏移的总量
264 - const remainingWidth = outerWidth - colsMaxLength  
265 - const remainingHeight = outerHeight - rowsMaxLength 258 + const remainingWidth = outerWidth - colsMaxLength;
  259 + const remainingHeight = outerHeight - rowsMaxLength;
266 // const remainingWidth = 260 // const remainingWidth =
267 // outerWidth - 261 // outerWidth -
268 // (cols * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset)) - boxLengthOffset - (reference ? 0 : dSLengthOffset)); 262 // (cols * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset)) - boxLengthOffset - (reference ? 0 : dSLengthOffset));
@@ -270,15 +264,12 @@ const Typesetting = props =&gt; { @@ -270,15 +264,12 @@ const Typesetting = props =&gt; {
270 // outerHeight - 264 // outerHeight -
271 // (rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset)) - boxWidthOffset - (reference ? 0 : dSWidthOffset)); 265 // (rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset)) - boxWidthOffset - (reference ? 0 : dSWidthOffset));
272 //剩余量能不能放一下单独一个 266 //剩余量能不能放一下单独一个
273 - const commonHeightCheck = remainingHeight > jInnerHeight + dXBJJ;  
274 - const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ ; 267 + const commonHeightCheck = remainingHeight > jInnerHeight + dXBJJ;
  268 + const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ;
275 const isCustomized = bAdvancedSetting; 269 const isCustomized = bAdvancedSetting;
276 270
277 let remaining = isVertical ? commonHeightCheck : commonWidthCheck; 271 let remaining = isVertical ? commonHeightCheck : commonWidthCheck;
278 272
279 -  
280 -  
281 -  
282 // const remaining = false; 273 // const remaining = false;
283 const isOdd = num => { 274 const isOdd = num => {
284 return num % 2 !== 0; 275 return num % 2 !== 0;
@@ -511,14 +502,14 @@ const Typesetting = props =&gt; { @@ -511,14 +502,14 @@ const Typesetting = props =&gt; {
511 if (cols === 0 || rows === 0) { 502 if (cols === 0 || rows === 0) {
512 if (cols > 0) { 503 if (cols > 0) {
513 for (let col = 0; col < cols; col++) { 504 for (let col = 0; col < cols; col++) {
514 - const leftPosition = col * (innerWidthCombined); 505 + const leftPosition = col * innerWidthCombined;
515 const topPosition = 0 * (innerHeightCombined + dXBJJ); 506 const topPosition = 0 * (innerHeightCombined + dXBJJ);
516 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 507 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
517 } 508 }
518 } 509 }
519 if (rows > 0) { 510 if (rows > 0) {
520 for (let row = 0; row < rows; row++) { 511 for (let row = 0; row < rows; row++) {
521 - const leftPosition = 0 * (innerWidthCombined); 512 + const leftPosition = 0 * innerWidthCombined;
522 const topPosition = row * (innerHeightCombined + dXBJJ); 513 const topPosition = row * (innerHeightCombined + dXBJJ);
523 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 514 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
524 } 515 }
@@ -526,8 +517,8 @@ const Typesetting = props =&gt; { @@ -526,8 +517,8 @@ const Typesetting = props =&gt; {
526 } else { 517 } else {
527 for (let col = 0; col < cols; col++) { 518 for (let col = 0; col < cols; col++) {
528 for (let row = 0; row < rows; row++) { 519 for (let row = 0; row < rows; row++) {
529 - const leftPosition = col * (innerWidthCombined);  
530 - const topPosition = row * (innerHeightCombined + dXBJJ) ; 520 + const leftPosition = col * innerWidthCombined;
  521 + const topPosition = row * (innerHeightCombined + dXBJJ);
531 innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 522 innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
532 } 523 }
533 // 如果可以放下首盒 524 // 如果可以放下首盒
@@ -538,10 +529,10 @@ const Typesetting = props =&gt; { @@ -538,10 +529,10 @@ const Typesetting = props =&gt; {
538 if (reference) { 529 if (reference) {
539 // 是否首盒 530 // 是否首盒
540 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距 531 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距
541 - leftPosition = col * (innerWidthCombined) + dFLengthOffset; 532 + leftPosition = col * innerWidthCombined + dFLengthOffset;
542 topPosition = rows * (innerHeightCombined + dXBJJ) + dFWidthOffset; 533 topPosition = rows * (innerHeightCombined + dXBJJ) + dFWidthOffset;
543 } else { 534 } else {
544 - leftPosition = col * (innerWidthCombined); 535 + leftPosition = col * innerWidthCombined;
545 topPosition = rows * (innerHeightCombined + dXBJJ); 536 topPosition = rows * (innerHeightCombined + dXBJJ);
546 } 537 }
547 innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 538 innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
@@ -564,7 +555,6 @@ const Typesetting = props =&gt; { @@ -564,7 +555,6 @@ const Typesetting = props =&gt; {
564 } 555 }
565 } 556 }
566 557
567 -  
568 // 判断展开长展开宽是否变化 558 // 判断展开长展开宽是否变化
569 if (dPartsLength !== innerWidth && !innerDivs.length) { 559 if (dPartsLength !== innerWidth && !innerDivs.length) {
570 setDPartsLength(innerWidth); 560 setDPartsLength(innerWidth);
@@ -573,8 +563,8 @@ const Typesetting = props =&gt; { @@ -573,8 +563,8 @@ const Typesetting = props =&gt; {
573 const propsData = innerDivs[innerDivs.length - 1]; 563 const propsData = innerDivs[innerDivs.length - 1];
574 let openEdition = 0; 564 let openEdition = 0;
575 if (propsData && L) { 565 if (propsData && L) {
576 - const {dWlcd,sBillNo} = slaveRowData  
577 - 566 + const { dWlcd, sBillNo } = slaveRowData;
  567 +
578 const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName; 568 const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName;
579 const propsDataLeft = Number(propsData.props.style.left.slice(0, -2)); 569 const propsDataLeft = Number(propsData.props.style.left.slice(0, -2));
580 // 长需要找出最大的 570 // 长需要找出最大的
@@ -582,8 +572,8 @@ const Typesetting = props =&gt; { @@ -582,8 +572,8 @@ const Typesetting = props =&gt; {
582 const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); 572 const propsDataHeight = Number(propsData.props.style.height.slice(0, -2));
583 const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); 573 const propsDataTop = Number(propsData.props.style.top.slice(0, -2));
584 // 判断列是否是单独的 574 // 判断列是否是单独的
585 -  
586 - const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长 575 +
  576 + const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长
587 const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB).toFixed(2); 577 const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB).toFixed(2);
588 578
589 // 计算开数 579 // 计算开数
@@ -613,7 +603,6 @@ const Typesetting = props =&gt; { @@ -613,7 +603,6 @@ const Typesetting = props =&gt; {
613 const newDProductQty = masterData.dProductQty; 603 const newDProductQty = masterData.dProductQty;
614 const dMaterialsKQty = slaveDataDetail.dMaterialsKQty || 1; 604 const dMaterialsKQty = slaveDataDetail.dMaterialsKQty || 1;
615 605
616 -  
617 if ( 606 if (
618 dPartsLength !== innerWidth || 607 dPartsLength !== innerWidth ||
619 newMaterialLength !== materialLength || 608 newMaterialLength !== materialLength ||
@@ -623,8 +612,6 @@ const Typesetting = props =&gt; { @@ -623,8 +612,6 @@ const Typesetting = props =&gt; {
623 newDPortraitType !== dPortraitType || 612 newDPortraitType !== dPortraitType ||
624 (!dWlcd && sBillNo) 613 (!dWlcd && sBillNo)
625 ) { 614 ) {
626 - console.log(slaveRowData.dMachineLength,'slaveRowData.dMachineLengthss');  
627 -  
628 setMaterialLength(newMaterialLength); 615 setMaterialLength(newMaterialLength);
629 setMaterialWidth(newMaterialWidth); 616 setMaterialWidth(newMaterialWidth);
630 setMaterialName(sMaterialsName); 617 setMaterialName(sMaterialsName);
@@ -632,7 +619,7 @@ const Typesetting = props =&gt; { @@ -632,7 +619,7 @@ const Typesetting = props =&gt; {
632 setDPartsLength(innerWidth); 619 setDPartsLength(innerWidth);
633 setNewDHorizontalType(dHorizontalType); 620 setNewDHorizontalType(dHorizontalType);
634 setNewDPortraitType(dPortraitType); 621 setNewDPortraitType(dPortraitType);
635 - setOldVariables(selectedNode.sTypeKey) 622 + setOldVariables(selectedNode.sTypeKey);
636 const scaleX = (clientWidth - 50) / (outerWidth + 110); 623 const scaleX = (clientWidth - 50) / (outerWidth + 110);
637 const scaleY = (clientHeight - 5) / (outerHeight + 90); 624 const scaleY = (clientHeight - 5) / (outerHeight + 90);
638 const newScale = Math.min(scaleX, scaleY); 625 const newScale = Math.min(scaleX, scaleY);
@@ -675,7 +662,7 @@ const Typesetting = props =&gt; { @@ -675,7 +662,7 @@ const Typesetting = props =&gt; {
675 dHorizontalType, 662 dHorizontalType,
676 dPortraitType 663 dPortraitType
677 ); 664 );
678 - } 665 + }
679 openEdition = (((newMaterialLength * newMaterialWidth) / (maxWidth * maxHeight)) * 100).toFixed(2); 666 openEdition = (((newMaterialLength * newMaterialWidth) / (maxWidth * maxHeight)) * 100).toFixed(2);
680 667
681 setTimeout(() => { 668 setTimeout(() => {
@@ -708,10 +695,10 @@ const Typesetting = props =&gt; { @@ -708,10 +695,10 @@ const Typesetting = props =&gt; {
708 Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength) && 695 Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength) &&
709 Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); 696 Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth);
710 697
711 - const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length > 0; 698 + const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length > 0;
712 699
713 const confirmParam = commonFunc.showLocalMessage(props, "confirmParam", "排版尺寸大于上机尺寸,请确认参数!"); 700 const confirmParam = commonFunc.showLocalMessage(props, "confirmParam", "排版尺寸大于上机尺寸,请确认参数!");
714 - 701 + const isJuantong = selectedNode.sTypeKey === "juantong";
715 if (isCustomized && !isShow) { 702 if (isCustomized && !isShow) {
716 if (isMobile) return; 703 if (isMobile) return;
717 message.error(confirmParam); 704 message.error(confirmParam);
@@ -840,6 +827,33 @@ const Typesetting = props =&gt; { @@ -840,6 +827,33 @@ const Typesetting = props =&gt; {
840 }} 827 }}
841 > 828 >
842 <span style={{ color: "red", display: "inline-block", width: "30px", textAlign: "center" }}>{materialWidth}</span> 829 <span style={{ color: "red", display: "inline-block", width: "30px", textAlign: "center" }}>{materialWidth}</span>
  830 + {isJuantong ? (
  831 + <span
  832 + style={{
  833 + position: "absolute",
  834 + top: `${(materialWidth * scaleYD) / 2 + 10}px`,
  835 + textAlign: "center",
  836 + width: "30px",
  837 + writingMode: "vertical-rl",
  838 + color: "red",
  839 + display: "flex",
  840 + alignItems: "center",
  841 + justifyContent: "center",
  842 + textOrientation: "upright",
  843 + }}
  844 + >
  845 + {"门幅方向"}
  846 + </span>
  847 + ) : (
  848 + ""
  849 + )}
  850 + {isJuantong ? (
  851 + <ArrowRightOutlined
  852 + style={{ position: "absolute", fontSize: "30px", top: `${(materialWidth * scaleYD) / 2}px`, left: "-30px" }}
  853 + />
  854 + ) : (
  855 + ""
  856 + )}
843 <div 857 <div
844 style={{ 858 style={{
845 position: "absolute", 859 position: "absolute",
src/components/QuickQuote/index.jsx
@@ -274,7 +274,7 @@ const QuickQuoteEvent = props =&gt; { @@ -274,7 +274,7 @@ const QuickQuoteEvent = props =&gt; {
274 dProductQty: changeValue.dProductQty, 274 dProductQty: changeValue.dProductQty,
275 })); 275 }));
276 } 276 }
277 - 277 +
278 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { 278 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") {
279 if (props.currentBoxModel) { 279 if (props.currentBoxModel) {
280 const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); 280 const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", "");
@@ -1146,7 +1146,6 @@ const QuickQuoteEvent = props =&gt; { @@ -1146,7 +1146,6 @@ const QuickQuoteEvent = props =&gt; {
1146 // 入口 1146 // 入口
1147 const QuickQuote = baseProps => { 1147 const QuickQuote = baseProps => {
1148 const props = QuickQuoteEvent(baseProps); 1148 const props = QuickQuoteEvent(baseProps);
1149 - console.log("🚀 ~ QuickQuote:", props);  
1150 const [treeClassName, setTreeClassName] = useState(""); 1149 const [treeClassName, setTreeClassName] = useState("");
1151 1150
1152 // 监听页面滚动事件 1151 // 监听页面滚动事件
@@ -1501,7 +1500,7 @@ const MasterComponent = props =&gt; { @@ -1501,7 +1500,7 @@ const MasterComponent = props =&gt; {
1501 item.iColValue = 4; 1500 item.iColValue = 4;
1502 } 1501 }
1503 }); 1502 });
1504 - } 1503 + }
1505 const lengthData = viewConfigs.find(x => x.sName === "dLength"); 1504 const lengthData = viewConfigs.find(x => x.sName === "dLength");
1506 1505
1507 if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { 1506 if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") {
@@ -1557,13 +1556,12 @@ const BoxComponent = props =&gt; { @@ -1557,13 +1556,12 @@ const BoxComponent = props =&gt; {
1557 const { bBox } = selectedNode; 1556 const { bBox } = selectedNode;
1558 const [boxTypeList, setBoxTypeList] = useState([]); 1557 const [boxTypeList, setBoxTypeList] = useState([]);
1559 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 1558 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值
1560 - console.log(props, "asdadasd");  
1561 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; 1559 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
1562 const { sBillNo } = slaveRowData; 1560 const { sBillNo } = slaveRowData;
1563 useEffect(() => { 1561 useEffect(() => {
1564 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { 1562 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
1565 - const {sBillNo} = slaveRowData  
1566 - if(sBillNo) return 1563 + const { sBillNo } = slaveRowData;
  1564 + if (sBillNo) return;
1567 let dropDownData = []; 1565 let dropDownData = [];
1568 dropDownData.push(KapaiJson); 1566 dropDownData.push(KapaiJson);
1569 const boxData = (dropDownData || []).map((item, index) => ({ 1567 const boxData = (dropDownData || []).map((item, index) => ({
@@ -1574,21 +1572,6 @@ const BoxComponent = props =&gt; { @@ -1574,21 +1572,6 @@ const BoxComponent = props =&gt; {
1574 } 1572 }
1575 }, [boxModel]); 1573 }, [boxModel]);
1576 1574
1577 - // useEffect(() => {  
1578 - // if (sBillNo) {  
1579 - // setTimeout(() => {  
1580 - // if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {  
1581 - // let dropDownData = [];  
1582 - // dropDownData.push(KapaiJson);  
1583 - // const boxData = (dropDownData || []).map((item, index) => ({  
1584 - // ...item,  
1585 - // iOrder: index + 1,  
1586 - // }));  
1587 - // props.onDataChange("slaveUp" + boxModel, "sName", { sName: KapaiJson.sName }, KapaiJson.sId, boxData);  
1588 - // }  
1589 - // }, 500);  
1590 - // }  
1591 - // }, [masterData.dLength]);  
1592 const { upAbleConfigsExtra = [], calcMethodData = [], boxPicData = [], radioValue = calcMethodData[0]?.sCode } = slaveRowData; 1575 const { upAbleConfigsExtra = [], calcMethodData = [], boxPicData = [], radioValue = calcMethodData[0]?.sCode } = slaveRowData;
1593 const calcMethod = calcMethodData.map(item => ({ 1576 const calcMethod = calcMethodData.map(item => ({
1594 value: item.sCode, 1577 value: item.sCode,
@@ -1638,6 +1621,20 @@ const BoxComponent = props =&gt; { @@ -1638,6 +1621,20 @@ const BoxComponent = props =&gt; {
1638 item.showName = rateList.find(rate => rate.id === Number(selectedNode.iRateType))?.name || "倍率"; 1621 item.showName = rateList.find(rate => rate.id === Number(selectedNode.iRateType))?.name || "倍率";
1639 } 1622 }
1640 } 1623 }
  1624 +
  1625 + if (item.sName === "dWlcd" && selectedNode.sTypeKey === "juantong") {
  1626 + return false
  1627 + }
  1628 + if (item.sName === "dAuxiliaryQty" && selectedNode.sTypeKey !== "juantong") {
  1629 + return false
  1630 + }
  1631 + if (item.sName === "dWlkd") {
  1632 + if (selectedNode.sTypeKey === "juantong") {
  1633 + item.showName = "门幅";
  1634 + } else {
  1635 + item.showName = "材料宽";
  1636 + }
  1637 + }
1641 if (item.sName === "sPaperDirection" && selectedNode.sTypeKey === "huace") { 1638 if (item.sName === "sPaperDirection" && selectedNode.sTypeKey === "huace") {
1642 return false; 1639 return false;
1643 } 1640 }
@@ -1654,6 +1651,7 @@ const BoxComponent = props =&gt; { @@ -1654,6 +1651,7 @@ const BoxComponent = props =&gt; {
1654 if (selectedNode.sTypeKey !== "juantong" && item.sName === "sPaperDirection") { 1651 if (selectedNode.sTypeKey !== "juantong" && item.sName === "sPaperDirection") {
1655 return false; 1652 return false;
1656 } 1653 }
  1654 +
1657 return item.iTag === iTag; 1655 return item.iTag === iTag;
1658 }); 1656 });
1659 1657
@@ -1966,10 +1964,9 @@ const BoxComponent = props =&gt; { @@ -1966,10 +1964,9 @@ const BoxComponent = props =&gt; {
1966 // 判断展长展宽是否可以放下原纸 1964 // 判断展长展宽是否可以放下原纸
1967 const isDPartsLength = 1965 const isDPartsLength =
1968 slaveData[index]?.dPartsLength < slaveData[index]?.dMaxLength && slaveData[index]?.dPartsWidth < slaveData[index]?.dMaxWidth; 1966 slaveData[index]?.dPartsLength < slaveData[index]?.dMaxLength && slaveData[index]?.dPartsWidth < slaveData[index]?.dMaxWidth;
1969 - 1967 + const dProductQtys = props.state.masterData.dProductQty || 0
1970 if (index !== undefined && index !== -1) { 1968 if (index !== undefined && index !== -1) {
1971 // 计算开数 1969 // 计算开数
1972 -  
1973 // 获取原始对象并创建一个新的对象进行更新 1970 // 获取原始对象并创建一个新的对象进行更新
1974 const updatedProduct = { 1971 const updatedProduct = {
1975 ...slaveData[index], 1972 ...slaveData[index],
@@ -1989,8 +1986,10 @@ const BoxComponent = props =&gt; { @@ -1989,8 +1986,10 @@ const BoxComponent = props =&gt; {
1989 100 1986 100
1990 ).toFixed(2) 1987 ).toFixed(2)
1991 ), 1988 ),
  1989 + // dWlcd: selectedNode.sTypeKey === 'juantong' ? Math.floor(dProductQty / dSinglePQty * ( length/ 1000)) : dWlcd,
1992 dWlcd: dWlcd, 1990 dWlcd: dWlcd,
1993 dWlkd: dWlkd, 1991 dWlkd: dWlkd,
  1992 + dAuxiliaryQty: Math.floor(dProductQty / dSinglePQty * ( length/ 1000)),
1994 dMachineQty: Math.floor(dProductQty / dSinglePQty), 1993 dMachineQty: Math.floor(dProductQty / dSinglePQty),
1995 dSinglePQty: dSinglePQty, 1994 dSinglePQty: dSinglePQty,
1996 dMaterialsKQty: dMaterialsKQty, 1995 dMaterialsKQty: dMaterialsKQty,