Commit 4f64fb859eccc38b075164a4b07271bad7b02000
1 parent
47cdfb32
快速报价
Showing
4 changed files
with
83 additions
and
97 deletions
src/components/Common/BoxDesignCompontent/index.js
| ... | ... | @@ -24,7 +24,6 @@ const BoxDesignEvent = props => { |
| 24 | 24 | setLoading(false); |
| 25 | 25 | if (!tableData?.length) return |
| 26 | 26 | const shape = tableData?.find(x => x.iTag === 70)?.showDropDown |
| 27 | - if (!shape) return | |
| 28 | 27 | const JsonShape = JSON.parse(shape) |
| 29 | 28 | const arr = Array.from(Object.values(JsonShape)); |
| 30 | 29 | setOptions([ |
| ... | ... | @@ -167,7 +166,6 @@ const BoxDesignCompontent = baseProps => { |
| 167 | 166 | setTableDataList(newList); |
| 168 | 167 | setTableDataLists(newList); |
| 169 | 168 | const shape = tableData.find(x => x.iTag === 70)?.showDropDown |
| 170 | - if (!shape) return | |
| 171 | 169 | const JsonShape = JSON.parse(shape) |
| 172 | 170 | const shapeLists = Array.from(Object.values(JsonShape)) |
| 173 | 171 | setShapeList(shapeLists) | ... | ... |
src/components/Common/BoxDesignCompontent/svg.js
| ... | ... | @@ -365,7 +365,6 @@ const SvgBox = props => { |
| 365 | 365 | bottom = bottomOffect(boxList, orderLength, orderWidth, props); |
| 366 | 366 | } |
| 367 | 367 | if (Number(svgType) === 4) { |
| 368 | - | |
| 369 | 368 | } else if (Number(svgType) === 8) { |
| 370 | 369 | ySvg = topOffect(boxList, headLength, headWidth, props) * scale; |
| 371 | 370 | } |
| ... | ... | @@ -439,7 +438,6 @@ const SvgBox = props => { |
| 439 | 438 | scale = 0.5; |
| 440 | 439 | let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight, props) * scale; |
| 441 | 440 | if (Number(svgType) === 4) { |
| 442 | - | |
| 443 | 441 | } else if (Number(svgType) === 8) { |
| 444 | 442 | ySvg = topOffect(boxList, headLength, headWidth, props) * scale; |
| 445 | 443 | } |
| ... | ... | @@ -602,6 +600,12 @@ const SvgBox = props => { |
| 602 | 600 | svgContainerRef.current.style.transform = `scale(${scaleX >= 1 ? 1 : scaleX}, ${scaleY >= 1 ? 1 : scaleY})`; |
| 603 | 601 | svgContainerRef.current.style.transformOrigin = "top left"; |
| 604 | 602 | svgContainerRef.current.style.paddingTop = dSvgBoxWidth ? "0" : "25px"; |
| 603 | + if (Number(svgType) !== 9) { | |
| 604 | + svgContainerRef.current.style.margin = `0 auto`; | |
| 605 | + } else { | |
| 606 | + svgContainerRef.current.style.margin = `0`; | |
| 607 | + | |
| 608 | + } | |
| 605 | 609 | svgContainerRef.current.style.backgroundColor = props.isMobile ? "#EDF4FF" : ""; |
| 606 | 610 | // svgContainerRef.current.style.position = 'absolute'; |
| 607 | 611 | // svgContainerRef.current.style.left = '50%'; |
| ... | ... | @@ -5202,13 +5206,13 @@ const SvgBox = props => { |
| 5202 | 5206 | } else if (Number(svgType) === 9) { |
| 5203 | 5207 | svg.appendChild(drawCup(boxLength, boxWidth, boxHeight, g)); |
| 5204 | 5208 | const result = calculateCupUnfoldDimensions(boxLength, boxWidth, boxHeight) |
| 5205 | - if (props.showNew !== 0) { | |
| 5209 | + // if (props.showNew !== 0) { | |
| 5206 | 5210 | const w = result.width |
| 5207 | 5211 | const h = result.height |
| 5208 | 5212 | svg.setAttribute('viewBox', `${result.points.outerLeft.x} ${result.points.topCenter.y} ${w} ${h}`); |
| 5209 | 5213 | svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`); |
| 5210 | 5214 | svg.setAttribute("height", `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`); |
| 5211 | - } | |
| 5215 | + // } | |
| 5212 | 5216 | |
| 5213 | 5217 | } |
| 5214 | 5218 | |
| ... | ... | @@ -5385,7 +5389,7 @@ const SvgBox = props => { |
| 5385 | 5389 | } |
| 5386 | 5390 | top = sfhs?.value || 0; |
| 5387 | 5391 | } |
| 5388 | - // if (svg === 4) top = Number(top) + Number(height); | |
| 5392 | + if (svg === 4) top = Number(top) + Number(height); | |
| 5389 | 5393 | return isNaN(top) ? 0 : Number(top); |
| 5390 | 5394 | }; |
| 5391 | 5395 | const bottomOffect = (list, length, width, height, props) => { |
| ... | ... | @@ -5484,7 +5488,7 @@ const SvgBox = props => { |
| 5484 | 5488 | top = sfhs?.value || 0; |
| 5485 | 5489 | } |
| 5486 | 5490 | |
| 5487 | - // if (svg === 4) top = Number(top) + Number(height); | |
| 5491 | + if (svg === 4) top = Number(top) + Number(height); | |
| 5488 | 5492 | return isNaN(top) ? 0 : top; |
| 5489 | 5493 | }; |
| 5490 | 5494 | // 将角度转换为弧度 | ... | ... |
src/components/Common/BoxShowImgMaterial/indexNew.js
| 1 | 1 | /* eslint-disable */ |
| 2 | 2 | import React, { useEffect, useState, useRef } from "react"; |
| 3 | -import { VerticalLeftOutlined, VerticalRightOutlined, ArrowRightOutlined } from "@ant-design/icons"; | |
| 3 | +import { VerticalLeftOutlined, VerticalRightOutlined } from "@ant-design/icons"; | |
| 4 | 4 | import styles from "./index.less"; |
| 5 | -import { bottom } from "react-grid-layout/build/utils"; | |
| 6 | -import { transform } from "@antv/g2/lib/util/transform"; | |
| 5 | +import * as commonFunc from "@/components/Common/commonFunc"; | |
| 7 | 6 | const BoxShowImgMaterial = props => { |
| 8 | 7 | const boxRef = useRef(null); |
| 9 | 8 | const textRef = useRef(null); |
| ... | ... | @@ -11,9 +10,8 @@ const BoxShowImgMaterial = props => { |
| 11 | 10 | const nTextRefs = useRef(null); |
| 12 | 11 | const nTextRef = useRef(null); |
| 13 | 12 | const [boxKey, setBoxKey] = useState(new Date().getTime()); |
| 14 | - const { width, height, size } = props; | |
| 15 | - const clientWidth = width || 300; | |
| 16 | - const clientHeight = height || 250; | |
| 13 | + const clientWidth = 300; | |
| 14 | + const clientHeight = 250; | |
| 17 | 15 | // 找出盒型信息 |
| 18 | 16 | const { slaveData, selectedNode } = props.state; |
| 19 | 17 | const { boxModel } = props; |
| ... | ... | @@ -23,11 +21,10 @@ const BoxShowImgMaterial = props => { |
| 23 | 21 | var { dMaxLength, dMaxWidth, dMachineLength, dMachineWidth, dWlcd, dWlkd, dSBLB, dXBLB, dZBLB, dYBLB, scale } = slaveDataDetail; |
| 24 | 22 | } |
| 25 | 23 | // 计算可以放置的盒子数量 |
| 26 | - const isJuantong = selectedNode.sTypeKey === "juantong"; | |
| 27 | 24 | const horizontalBoxes = Math.floor(dWlcd / dMachineLength); |
| 28 | 25 | const verticalBoxes = Math.floor(dWlkd / dMachineWidth); |
| 29 | - const scaleX = (clientWidth - 100) / Number(dWlcd); | |
| 30 | - const scaleY = (clientHeight - 70) / Number(dWlkd); | |
| 26 | + const scaleX = (clientWidth - 70) / (dWlcd); | |
| 27 | + const scaleY = (clientHeight - 70) / (dWlkd); | |
| 31 | 28 | // 动态生成多个 materialBox |
| 32 | 29 | const generateMaterialBoxes = () => { |
| 33 | 30 | const boxes = []; |
| ... | ... | @@ -49,8 +46,8 @@ const BoxShowImgMaterial = props => { |
| 49 | 46 | position: "absolute", |
| 50 | 47 | bottom: "-30px", |
| 51 | 48 | left: "0px", |
| 52 | - width: `${dMachineLength * scaleX}px`, | |
| 53 | - fontSize: `${size || 11}px`, | |
| 49 | + width: `${(dMachineLength * scaleX)}px`, | |
| 50 | + fontSize: "11px", | |
| 54 | 51 | textAlign: "center", |
| 55 | 52 | height: "30px", |
| 56 | 53 | lineHeight: "30px", |
| ... | ... | @@ -70,7 +67,7 @@ const BoxShowImgMaterial = props => { |
| 70 | 67 | position: "absolute", |
| 71 | 68 | top: "15px", |
| 72 | 69 | left: "5px", |
| 73 | - width: `${dMachineLength * scaleX * 0.2}px`, | |
| 70 | + width: `${((dMachineLength * scaleX)) * 0.2}px`, | |
| 74 | 71 | backgroundColor: "#333", |
| 75 | 72 | height: "1px", |
| 76 | 73 | }} |
| ... | ... | @@ -95,7 +92,7 @@ const BoxShowImgMaterial = props => { |
| 95 | 92 | position: "absolute", |
| 96 | 93 | top: "15px", |
| 97 | 94 | right: "5px", |
| 98 | - width: `${dMachineLength * scaleX * 0.2}px`, | |
| 95 | + width: `${((dMachineLength *scaleX)) * 0.2}px`, | |
| 99 | 96 | backgroundColor: "#333", |
| 100 | 97 | height: "1px", |
| 101 | 98 | }} |
| ... | ... | @@ -107,9 +104,9 @@ const BoxShowImgMaterial = props => { |
| 107 | 104 | position: "absolute", |
| 108 | 105 | top: "0", |
| 109 | 106 | right: "-30px", |
| 110 | - height: `${dMachineWidth * scaleY}px`, | |
| 111 | - lineHeight: `${dMachineWidth * scaleY}px`, | |
| 112 | - fontSize: `${size || 11}px`, | |
| 107 | + height: `${(dMachineWidth * scaleY)}px`, | |
| 108 | + lineHeight: `${(dMachineWidth * scaleY)}px`, | |
| 109 | + fontSize: "11px", | |
| 113 | 110 | textAlign: "center", |
| 114 | 111 | width: "30px", |
| 115 | 112 | transform: `scale(${1 / scaleX}, ${1 / scaleY})`, |
| ... | ... | @@ -129,7 +126,7 @@ const BoxShowImgMaterial = props => { |
| 129 | 126 | position: "absolute", |
| 130 | 127 | top: "5px", |
| 131 | 128 | left: "15px", |
| 132 | - height: `${dMachineWidth * scaleY * 0.3}px`, | |
| 129 | + height: `${((dMachineWidth * scaleY)) * 0.3}px`, | |
| 133 | 130 | backgroundColor: "#333", |
| 134 | 131 | width: "1px", |
| 135 | 132 | }} |
| ... | ... | @@ -137,14 +134,10 @@ const BoxShowImgMaterial = props => { |
| 137 | 134 | <span |
| 138 | 135 | style={{ |
| 139 | 136 | color: "red", |
| 140 | - position: "relative", | |
| 141 | - display: "inline-block", | |
| 142 | 137 | }} |
| 143 | 138 | > |
| 144 | 139 | {dMachineWidth} |
| 145 | 140 | </span> |
| 146 | - | |
| 147 | - | |
| 148 | 141 | <VerticalLeftOutlined |
| 149 | 142 | style={{ |
| 150 | 143 | position: "absolute", |
| ... | ... | @@ -158,37 +151,12 @@ const BoxShowImgMaterial = props => { |
| 158 | 151 | position: "absolute", |
| 159 | 152 | bottom: "5px", |
| 160 | 153 | left: "15px", |
| 161 | - height: `${dMachineWidth * scaleY * 0.3}px`, | |
| 154 | + height: `${((dMachineWidth * scaleY)) * 0.3}px`, | |
| 162 | 155 | backgroundColor: "#333", |
| 163 | 156 | width: "1px", |
| 164 | 157 | }} |
| 165 | 158 | /> |
| 166 | 159 | </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> */} | |
| 192 | 160 | </div> |
| 193 | 161 | ); |
| 194 | 162 | } |
| ... | ... | @@ -199,30 +167,33 @@ const BoxShowImgMaterial = props => { |
| 199 | 167 | ((horizontalBoxes * verticalBoxes * (Number(dMachineLength) * Number(dMachineWidth))) / (Number(dWlcd) * Number(dWlkd))) * |
| 200 | 168 | 100 |
| 201 | 169 | ).toFixed(2); |
| 202 | - useEffect(() => { | |
| 203 | - setBoxKey(new Date().getTime()); | |
| 204 | - setTimeout(() => { | |
| 205 | - // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) | |
| 206 | - if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) { | |
| 207 | - // 计算父元素的缩放因子 | |
| 208 | - // 对父元素应用缩放 | |
| 209 | - boxRef.current.style.transform = `scale(${scaleX}, ${scaleY})`; | |
| 210 | - boxRef.current.style.transformOrigin = "top left"; | |
| 211 | - // // 对子元素应用逆缩放 | |
| 212 | - textRef.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; | |
| 213 | - textRef.current.style.transformOrigin = "top left"; | |
| 214 | - textRefs.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; | |
| 215 | - textRefs.current.style.transformOrigin = "top left"; | |
| 216 | - } | |
| 217 | - }, 10); | |
| 218 | - }, [scaleX, scaleY]); | |
| 170 | + useEffect( | |
| 171 | + () => { | |
| 172 | + setBoxKey(new Date().getTime()); | |
| 173 | + setTimeout(() => { | |
| 174 | + // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) | |
| 175 | + if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) { | |
| 176 | + // 计算父元素的缩放因子 | |
| 177 | + // 对父元素应用缩放 | |
| 178 | + boxRef.current.style.transform = `scale(${scaleX}, ${scaleY})`; | |
| 179 | + boxRef.current.style.transformOrigin = "top left"; | |
| 180 | + // // 对子元素应用逆缩放 | |
| 181 | + textRef.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; | |
| 182 | + textRef.current.style.transformOrigin = "top left"; | |
| 183 | + textRefs.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; | |
| 184 | + textRefs.current.style.transformOrigin = "top left"; | |
| 185 | + } | |
| 186 | + }, 0); | |
| 187 | + }, | |
| 188 | + [slaveDataDetail] | |
| 189 | + ); | |
| 219 | 190 | const isMax = slaveDataDetail?.dMaxWidth * slaveDataDetail?.dMaxLength > slaveDataDetail?.dMachineLength * slaveDataDetail?.dMachineWidth; |
| 220 | - const isDPartsLength = slaveDataDetail?.dPartsLength < slaveDataDetail?.dMaxLength && slaveDataDetail?.dPartsWidth < slaveDataDetail?.dMaxWidth; | |
| 221 | - | |
| 191 | + const isDPartsLength = Number(slaveDataDetail?.dWlcd) <= slaveDataDetail?.dMaxLength && Number(slaveDataDetail?.dWlkd) <= slaveDataDetail?.dMaxWidth; | |
| 192 | + const MaterialUtilizationRate = commonFunc.showLocalMessage(props, "MaterialUtilizationRate", "材料利用率"); | |
| 222 | 193 | const isShow = |
| 223 | - isDPartsLength && slaveDataDetail && slaveDataDetail.dMachineLength && slaveDataDetail.dMaxWidth && slaveDataDetail.dMaxLength && isMax; | |
| 224 | - | |
| 225 | - return ( | |
| 194 | + slaveDataDetail && slaveDataDetail.dMachineLength && slaveDataDetail.dMaxWidth && slaveDataDetail.dMaxLength && isMax; | |
| 195 | + console.log("🚀 ~ isDPartsLength:", isDPartsLength,isMax) | |
| 196 | + return ( | |
| 226 | 197 | <> |
| 227 | 198 | {isShow ? ( |
| 228 | 199 | <div |
| ... | ... | @@ -245,11 +216,11 @@ const BoxShowImgMaterial = props => { |
| 245 | 216 | style={{ |
| 246 | 217 | position: "absolute", |
| 247 | 218 | left: "0px", |
| 248 | - width: `${(dWlcd * (clientWidth - 100)) / dWlcd}px`, | |
| 249 | - fontSize: `${size || 11}px`, | |
| 219 | + width: `${(dWlcd * (clientWidth - 50)) / (dWlcd + 60)}px`, | |
| 220 | + fontSize: "11px", | |
| 250 | 221 | textAlign: "center", |
| 251 | 222 | height: "30px", |
| 252 | - bottom: `-${80}px`, | |
| 223 | + bottom: `-${100}px`, | |
| 253 | 224 | lineHeight: "30px", |
| 254 | 225 | }} |
| 255 | 226 | > |
| ... | ... | @@ -284,7 +255,7 @@ const BoxShowImgMaterial = props => { |
| 284 | 255 | display: "inline-block", |
| 285 | 256 | }} |
| 286 | 257 | > |
| 287 | - 材料利用率: | |
| 258 | + {MaterialUtilizationRate}: | |
| 288 | 259 | </span> |
| 289 | 260 | <span |
| 290 | 261 | style={{ |
| ... | ... | @@ -318,10 +289,10 @@ const BoxShowImgMaterial = props => { |
| 318 | 289 | style={{ |
| 319 | 290 | position: "absolute", |
| 320 | 291 | top: "0", |
| 321 | - right: "-80px", | |
| 322 | - height: `${dWlkd * scaleY}px`, | |
| 323 | - lineHeight: `${dWlkd * scaleY}px`, | |
| 324 | - fontSize: `${size || 11}px`, | |
| 292 | + right: "15px", | |
| 293 | + height: `${(dWlkd * scaleY)}px`, | |
| 294 | + lineHeight: `${(dWlkd * scaleY)}px`, | |
| 295 | + fontSize: "11px", | |
| 325 | 296 | textAlign: "center", |
| 326 | 297 | width: "30px", |
| 327 | 298 | }} |
| ... | ... | @@ -339,7 +310,7 @@ const BoxShowImgMaterial = props => { |
| 339 | 310 | position: "absolute", |
| 340 | 311 | top: "5px", |
| 341 | 312 | left: "15px", |
| 342 | - height: `${dWlkd * scaleY * 0.3}px`, | |
| 313 | + height: `${((dWlkd * scaleY)) * 0.3}px`, | |
| 343 | 314 | backgroundColor: "#333", |
| 344 | 315 | width: "1px", |
| 345 | 316 | }} |
| ... | ... | @@ -347,8 +318,6 @@ const BoxShowImgMaterial = props => { |
| 347 | 318 | <span |
| 348 | 319 | style={{ |
| 349 | 320 | color: "red", |
| 350 | - display:'inline-block', | |
| 351 | - marginTop:'10px' | |
| 352 | 321 | }} |
| 353 | 322 | > |
| 354 | 323 | {dWlkd} |
| ... | ... | @@ -366,7 +335,7 @@ const BoxShowImgMaterial = props => { |
| 366 | 335 | position: "absolute", |
| 367 | 336 | bottom: "5px", |
| 368 | 337 | left: "15px", |
| 369 | - height: `${dWlkd * scaleY * 0.3}px`, | |
| 338 | + height: `${((dWlkd * scaleY)) * 0.3}px`, | |
| 370 | 339 | backgroundColor: "#333", |
| 371 | 340 | width: "1px", |
| 372 | 341 | }} | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -467,7 +467,7 @@ const QuickQuoteEvent = props => { |
| 467 | 467 | slaveData[saveIndex] = { |
| 468 | 468 | ...slaveData[saveIndex], |
| 469 | 469 | sMachineStyle: materialStyleLength + "*" + materialStyleWidth, |
| 470 | - dMachineQty: slaveData[saveIndex].dProductQty ? slaveData[saveIndex].dProductQty : masterData.dProductQty, | |
| 470 | + dMachineQty: masterData.sBillNo && slaveData[saveIndex].dMachineQty ? slaveData[saveIndex].dMachineQty : slaveData[saveIndex].dProductQty ? slaveData[saveIndex].dProductQty : masterData.dProductQty, | |
| 471 | 471 | }; |
| 472 | 472 | if (sFieldName === "dWlcd" || sFieldName === "dWlkd") { |
| 473 | 473 | const horizontalBoxes = Math.floor(slaveData[saveIndex]?.dWlkd / Number(slaveData[saveIndex]?.dMachineWidth)); |
| ... | ... | @@ -475,12 +475,13 @@ const QuickQuoteEvent = props => { |
| 475 | 475 | const newDMaterialsKQty = horizontalBoxes * verticalBoxes; |
| 476 | 476 | slaveData[saveIndex] = { |
| 477 | 477 | ...slaveData[saveIndex], |
| 478 | - dMachineQty: Math.floor(slaveData[saveIndex].dMachineQty / slaveData[saveIndex].dSinglePQty), | |
| 478 | + dMachineQty: masterData.sBillNo && slaveData[saveIndex].dMachineQty ? slaveData[saveIndex].dMachineQty : Math.floor(slaveData[saveIndex].dMachineQty / slaveData[saveIndex].dSinglePQty), | |
| 479 | 479 | dMaterialsKQty: newDMaterialsKQty, |
| 480 | 480 | newMaterialLength: sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd, |
| 481 | 481 | newMaterialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd, |
| 482 | 482 | materialLength: sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd, |
| 483 | 483 | materialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd, |
| 484 | + sMaterialsStyle: `${ sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd || 0}*${sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd|| 0}`, | |
| 484 | 485 | }; |
| 485 | 486 | } |
| 486 | 487 | |
| ... | ... | @@ -996,6 +997,7 @@ const QuickQuoteEvent = props => { |
| 996 | 997 | newCopyTo.slave = commonUtils.isEmptyArr(slaveData) ? {} : slaveData[0]; |
| 997 | 998 | for (let i = 0; i < partsNewInfo.length; i++) { |
| 998 | 999 | const partInfo = partsNewInfo[i]; |
| 1000 | + console.log("🚀 ~ QuickQuoteEvent ~ partInfo:", partInfo) | |
| 999 | 1001 | const iIndex = i; |
| 1000 | 1002 | const partsDataRow = {}; |
| 1001 | 1003 | for (const child of Object.keys(partInfo)) { |
| ... | ... | @@ -1035,6 +1037,7 @@ const QuickQuoteEvent = props => { |
| 1035 | 1037 | materialDataRow.sControlId = partsDataRow.sId; |
| 1036 | 1038 | // materialDataRow.sSlaveId = ' '; |
| 1037 | 1039 | materialDataRow.dMaterialsKQty = partsDataRow.iNumberofMaterial; |
| 1040 | + materialDataRow.sMaterialsStyle = partsDataRow.sMaterialsStyle; | |
| 1038 | 1041 | const models = "Materials"; |
| 1039 | 1042 | materialDataRow = await props.onMaterialsChange(materialDataRow, sModelsId, masterData, [], "dAuxiliaryQty", app, token, models); |
| 1040 | 1043 | materialDataRow = commonBusiness.getCalculateAllMoney(app, models, "dAuxiliaryQty", masterData, materialDataRow); |
| ... | ... | @@ -1065,8 +1068,9 @@ const QuickQuoteEvent = props => { |
| 1065 | 1068 | processPrintDataRow.sParentId = masterData.sId; |
| 1066 | 1069 | processPrintDataRow.sControlId = partsDataRow.sId; |
| 1067 | 1070 | // processPrintDataRow.sSlaveId = ' '; |
| 1068 | - processPrintDataRow.sColorSerialMemo = JSON.stringify([{ sId: partInfo.sColorId, sName: partInfo.sColor, dColor: partInfo.iColor }]); | |
| 1069 | - | |
| 1071 | + const iSpecialColor = partInfo.iSpecialColor !== undefined ? partInfo.iSpecialColor : partInfo.partInfoiSpecialColor; | |
| 1072 | + processPrintDataRow.sColorSerialMemo = JSON.stringify([{ sId: partInfo.sColorId, sName: partInfo.sColor, dColor: partInfo.iColor, iSpecialColor }]); | |
| 1073 | + | |
| 1070 | 1074 | processData.push(processPrintDataRow); |
| 1071 | 1075 | // 配套工序 |
| 1072 | 1076 | if (bProcessAssort) { |
| ... | ... | @@ -2367,6 +2371,7 @@ const BoxComponent = props => { |
| 2367 | 2371 | // 查找符合条件的索引 |
| 2368 | 2372 | const { selectedNode } = props.state; |
| 2369 | 2373 | const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel); |
| 2374 | + | |
| 2370 | 2375 | if (index !== undefined && index !== -1) { |
| 2371 | 2376 | // 计算开数 |
| 2372 | 2377 | // 获取原始对象并创建一个新的对象进行更新 |
| ... | ... | @@ -2389,10 +2394,10 @@ const BoxComponent = props => { |
| 2389 | 2394 | ).toFixed(2) |
| 2390 | 2395 | ), |
| 2391 | 2396 | // dWlcd: selectedNode.sTypeKey === 'juantong' ? Math.floor(dProductQty / dSinglePQty * ( length/ 1000)) : dWlcd, |
| 2392 | - dWlcd: dWlcd, | |
| 2393 | - dWlkd: dWlkd, | |
| 2397 | + dWlcd: sBillNo ? slaveData[index]?.dWlcd : dWlcd, | |
| 2398 | + dWlkd: sBillNo ? slaveData[index]?.dWlkd : dWlkd, | |
| 2394 | 2399 | dAuxiliaryQty: Math.floor((dProductQty / dSinglePQty) * (length / 1000)), |
| 2395 | - dMachineQty: Math.floor(dProductQty / dSinglePQty), | |
| 2400 | + dMachineQty: sBillNo && slaveData[index].dMachineQty ? slaveData[index].dMachineQty : Math.floor(dProductQty / dSinglePQty), | |
| 2396 | 2401 | dSinglePQty: dSinglePQty, |
| 2397 | 2402 | dMaterialsKQty: dMaterialsKQty, |
| 2398 | 2403 | scale: scale, |
| ... | ... | @@ -3243,6 +3248,8 @@ const ManyComponent = props => { |
| 3243 | 3248 | }, |
| 3244 | 3249 | fixedHeight: 145, |
| 3245 | 3250 | }; |
| 3251 | + const pricingInProgress = commonFunc.showLocalMessage(props, "sNuclearPricing", "核价中"); | |
| 3252 | + const progress = commonFunc.showLocalMessage(props, "progress", "进度"); | |
| 3246 | 3253 | return ( |
| 3247 | 3254 | <div className={`xly-bill-list ${styles.many}`}> |
| 3248 | 3255 | <StaticEditTable {...tableProps} /> |
| ... | ... | @@ -3295,7 +3302,7 @@ const ManyComponent = props => { |
| 3295 | 3302 | {BtnPriceDetails} |
| 3296 | 3303 | </Button> |
| 3297 | 3304 | <Button type="primary" size="large" loading={loading || calcPriceLoading} className={styles.calcPrice} onClick={onCalcPrice}> |
| 3298 | - {calcPriceLoading ? `核价中【进度${processPercent}%】...` : BtnPriceverification} | |
| 3305 | + {calcPriceLoading ? `${pricingInProgress}【${progress}${processPercent}%】...` : BtnPriceverification} | |
| 3299 | 3306 | </Button> |
| 3300 | 3307 | <Button |
| 3301 | 3308 | type="primary" |
| ... | ... | @@ -4190,6 +4197,14 @@ const GetBestAlgorithm = props => { |
| 4190 | 4197 | } |
| 4191 | 4198 | } |
| 4192 | 4199 | const propsData = innerDivs[innerDivs.length - 1]; |
| 4200 | + if (!propsData) { | |
| 4201 | + return { | |
| 4202 | + newMaterialLength:0, | |
| 4203 | + newMaterialWidth:0, | |
| 4204 | + dSinglePQty:0, | |
| 4205 | + index: i, | |
| 4206 | + }; | |
| 4207 | + } | |
| 4193 | 4208 | let openEdition = 0; |
| 4194 | 4209 | const { dWlcd, sBillNo } = slaveRowData; |
| 4195 | 4210 | ... | ... |