Commit 570173547a94d3f081b4182ca93192bb937bdcd9
1 parent
f1436b73
排版
Showing
3 changed files
with
116 additions
and
97 deletions
src/components/Common/Typesetting/typesetting.js
| @@ -222,8 +222,8 @@ const Typesetting = props => { | @@ -222,8 +222,8 @@ const Typesetting = props => { | ||
| 222 | const reference = sSGroupOffset === "首盒"; // 第三列参考 | 222 | const reference = sSGroupOffset === "首盒"; // 第三列参考 |
| 223 | 223 | ||
| 224 | // 计算内层盒子尺寸 加上间距 | 224 | // 计算内层盒子尺寸 加上间距 |
| 225 | - let jInnerHeight = innerHeight + dXBJJ + dXBJJ; | ||
| 226 | - let jInnerWidth = innerWidth + dYBJJ + dYBJJ; | 225 | + let jInnerHeight = innerHeight; |
| 226 | + let jInnerWidth = innerWidth; | ||
| 227 | let dSvgBoxWidth = innerWidth; | 227 | let dSvgBoxWidth = innerWidth; |
| 228 | let dSvgBoxHeight = innerHeight; | 228 | let dSvgBoxHeight = innerHeight; |
| 229 | if (iFAngle === 90 || iFAngle === 270 || iSAngle === 90 || iSAngle === 270) { | 229 | if (iFAngle === 90 || iFAngle === 270 || iSAngle === 90 || iSAngle === 270) { |
| @@ -386,7 +386,7 @@ const Typesetting = props => { | @@ -386,7 +386,7 @@ const Typesetting = props => { | ||
| 386 | justifyContent: "center", | 386 | justifyContent: "center", |
| 387 | alignItems: "center", | 387 | alignItems: "center", |
| 388 | position: "absolute", | 388 | position: "absolute", |
| 389 | - left: `${isVertical ? dSLengthOffset : innerWidth + dFLengthOffset + dSLengthOffset + dYBJJ}px`, | 389 | + left: `${isVertical ? dSLengthOffset :iSAngle === 90 || iSAngle === 270 ? innerHeight + dFLengthOffset + dSLengthOffset + dYBJJ * 2: innerWidth + dFLengthOffset + dSLengthOffset + dYBJJ * 2}px`, |
| 390 | top: `${ | 390 | top: `${ |
| 391 | isVertical ? jInnerHeight + dXBJJ + dFWidthOffset + dSWidthOffset : iSAngle === 90 || iSAngle === 270 ? dSWidthOffset : dSWidthOffset + dXBJJ | 391 | isVertical ? jInnerHeight + dXBJJ + dFWidthOffset + dSWidthOffset : iSAngle === 90 || iSAngle === 270 ? dSWidthOffset : dSWidthOffset + dXBJJ |
| 392 | }px`, | 392 | }px`, |
| @@ -487,6 +487,7 @@ const Typesetting = props => { | @@ -487,6 +487,7 @@ const Typesetting = props => { | ||
| 487 | // 生成里层 div 的数组 | 487 | // 生成里层 div 的数组 |
| 488 | const innerDivs = []; | 488 | const innerDivs = []; |
| 489 | 489 | ||
| 490 | + console.log(cols,rows,'cols'); | ||
| 490 | 491 | ||
| 491 | for (let col = 0; col < cols; col++) { | 492 | for (let col = 0; col < cols; col++) { |
| 492 | for (let row = 0; row < rows; row++) { | 493 | for (let row = 0; row < rows; row++) { |
src/mobile/components/SelectInput.jsx
| @@ -73,7 +73,6 @@ const SelectInput = props => { | @@ -73,7 +73,6 @@ const SelectInput = props => { | ||
| 73 | const data = coplyColumns[index]; | 73 | const data = coplyColumns[index]; |
| 74 | data[itemDetail.sName] = data[itemDetail.sName] ? data[itemDetail.sName] : data.label || data.sName || data.sProcessName || data.sColorName; | 74 | data[itemDetail.sName] = data[itemDetail.sName] ? data[itemDetail.sName] : data.label || data.sName || data.sProcessName || data.sColorName; |
| 75 | setValue(columns[index]?.label || ""); | 75 | setValue(columns[index]?.label || ""); |
| 76 | - | ||
| 77 | props.onDataChange(tableName, itemDetail.sName, data, data.sId, coplyColumns); | 76 | props.onDataChange(tableName, itemDetail.sName, data, data.sId, coplyColumns); |
| 78 | setVisible(false); | 77 | setVisible(false); |
| 79 | }; | 78 | }; |
| @@ -104,6 +103,7 @@ const SelectInput = props => { | @@ -104,6 +103,7 @@ const SelectInput = props => { | ||
| 104 | useEffect(() => { | 103 | useEffect(() => { |
| 105 | if (!visible) return; | 104 | if (!visible) return; |
| 106 | let { sDropDownType, sVisColumnName } = itemDetail; | 105 | let { sDropDownType, sVisColumnName } = itemDetail; |
| 106 | + console.log("🚀 ~ useEffect ~ itemDetail:", itemDetail) | ||
| 107 | if (sVisColumnName && sVisColumnName === "sProcessName") { | 107 | if (sVisColumnName && sVisColumnName === "sProcessName") { |
| 108 | if (sDropDownType === "sql") { | 108 | if (sDropDownType === "sql") { |
| 109 | if (itemDetail.sParamDropDown) { | 109 | if (itemDetail.sParamDropDown) { |
src/mobile/quotation/detailNew.jsx
| @@ -150,6 +150,10 @@ const QuickQuoteEvent = props => { | @@ -150,6 +150,10 @@ const QuickQuoteEvent = props => { | ||
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| 152 | if (name === "master") { | 152 | if (name === "master") { |
| 153 | + const { showName: sTreeNodeName } = selectedNode; | ||
| 154 | + const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); | ||
| 155 | + const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); | ||
| 156 | + console.log("🚀 ~ iIndex:", iIndex,boxModel,props) | ||
| 153 | let masterDataNew = { ...masterData, ...changeValue }; | 157 | let masterDataNew = { ...masterData, ...changeValue }; |
| 154 | masterDataNew.handleType = masterDataNew.handleType || "update"; | 158 | masterDataNew.handleType = masterDataNew.handleType || "update"; |
| 155 | masterDataNew.sId = commonUtils.createSid(); | 159 | masterDataNew.sId = commonUtils.createSid(); |
| @@ -162,6 +166,16 @@ const QuickQuoteEvent = props => { | @@ -162,6 +166,16 @@ const QuickQuoteEvent = props => { | ||
| 162 | if (sFieldName === "sCustomerName") { | 166 | if (sFieldName === "sCustomerName") { |
| 163 | masterDataNew = { ...masterDataNew, sCustomerId: changeValue.sId }; | 167 | masterDataNew = { ...masterDataNew, sCustomerId: changeValue.sId }; |
| 164 | } | 168 | } |
| 169 | + // if ((sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight")) { | ||
| 170 | + // const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({ | ||
| 171 | + // ...item, | ||
| 172 | + // iColValue: item.iColValue || 6, | ||
| 173 | + // })); | ||
| 174 | + // slaveData[iIndex] = { | ||
| 175 | + // ...slaveData[iIndex], | ||
| 176 | + // upAbleConfigsExtra: sColumnNameConfig, | ||
| 177 | + // }; | ||
| 178 | + // } | ||
| 165 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); | 179 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); |
| 166 | } else if (name.includes("slave")) { | 180 | } else if (name.includes("slave")) { |
| 167 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); | 181 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); |
| @@ -451,12 +465,12 @@ const QuickQuoteEvent = props => { | @@ -451,12 +465,12 @@ const QuickQuoteEvent = props => { | ||
| 451 | // 核价按钮 | 465 | // 核价按钮 |
| 452 | addState.handleCalcPrice = async () => { | 466 | addState.handleCalcPrice = async () => { |
| 453 | const { masterData = {}, slaveData = [], selectedNode = {}, extraParts = {} } = state; | 467 | const { masterData = {}, slaveData = [], selectedNode = {}, extraParts = {} } = state; |
| 454 | - const selectProduct = commonFunc.showLocalMessage(props, 'selectProduct', '请先选择产品'); | ||
| 455 | - const selectCustomer = commonFunc.showLocalMessage(props, 'selectCustomer', '请先选择客户名称'); | ||
| 456 | - const selectProductUnit = commonFunc.showLocalMessage(props, 'selectProductUnit', '请先输入产品单位'); | ||
| 457 | - const inputLength = commonFunc.showLocalMessage(props, 'inputLength', '请先输入长度'); | ||
| 458 | - const inputWidth = commonFunc.showLocalMessage(props, 'inputWidth', '请先输入宽度'); | ||
| 459 | - const inputQty = commonFunc.showLocalMessage(props, 'inputQty', '请先输入数量'); | 468 | + const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品"); |
| 469 | + const selectCustomer = commonFunc.showLocalMessage(props, "selectCustomer", "请先选择客户名称"); | ||
| 470 | + const selectProductUnit = commonFunc.showLocalMessage(props, "selectProductUnit", "请先输入产品单位"); | ||
| 471 | + const inputLength = commonFunc.showLocalMessage(props, "inputLength", "请先输入长度"); | ||
| 472 | + const inputWidth = commonFunc.showLocalMessage(props, "inputWidth", "请先输入宽度"); | ||
| 473 | + const inputQty = commonFunc.showLocalMessage(props, "inputQty", "请先输入数量"); | ||
| 460 | if (commonUtils.isEmptyObject(selectedNode)) { | 474 | if (commonUtils.isEmptyObject(selectedNode)) { |
| 461 | // message.error("请先选择产品"); | 475 | // message.error("请先选择产品"); |
| 462 | Toast.show({ | 476 | Toast.show({ |
| @@ -915,9 +929,9 @@ const QuickQuoteEvent = props => { | @@ -915,9 +929,9 @@ const QuickQuoteEvent = props => { | ||
| 915 | 929 | ||
| 916 | const result = await props.handleCalculation( | 930 | const result = await props.handleCalculation( |
| 917 | false, | 931 | false, |
| 918 | - { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData ,state}, | 932 | + { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData, state }, |
| 919 | true, | 933 | true, |
| 920 | - {...props, state} | 934 | + { ...props, state } |
| 921 | ); | 935 | ); |
| 922 | 936 | ||
| 923 | if (commonUtils.isEmptyObject(result)) { | 937 | if (commonUtils.isEmptyObject(result)) { |
| @@ -1100,7 +1114,7 @@ const QuotationDetail = props => { | @@ -1100,7 +1114,7 @@ const QuotationDetail = props => { | ||
| 1100 | lengthData.showName = "高(D)"; | 1114 | lengthData.showName = "高(D)"; |
| 1101 | lengthData.sChinese = "高(D)"; | 1115 | lengthData.sChinese = "高(D)"; |
| 1102 | lengthData.sEnglish = "Height (D)"; | 1116 | lengthData.sEnglish = "Height (D)"; |
| 1103 | - if(app.userinfo?.sLanguage === 'sEnglish') { | 1117 | + if (app.userinfo?.sLanguage === "sEnglish") { |
| 1104 | lengthData.showName = lengthData.sEnglish; | 1118 | lengthData.showName = lengthData.sEnglish; |
| 1105 | } | 1119 | } |
| 1106 | } | 1120 | } |
| @@ -1109,7 +1123,7 @@ const QuotationDetail = props => { | @@ -1109,7 +1123,7 @@ const QuotationDetail = props => { | ||
| 1109 | lengthData.showName = "长(L)"; | 1123 | lengthData.showName = "长(L)"; |
| 1110 | lengthData.sChinese = "长(L)"; | 1124 | lengthData.sChinese = "长(L)"; |
| 1111 | lengthData.sEnglish = "Length (L)"; | 1125 | lengthData.sEnglish = "Length (L)"; |
| 1112 | - if(app.userinfo?.sLanguage === 'sEnglish') { | 1126 | + if (app.userinfo?.sLanguage === "sEnglish") { |
| 1113 | lengthData.showName = lengthData.sEnglish; | 1127 | lengthData.showName = lengthData.sEnglish; |
| 1114 | } | 1128 | } |
| 1115 | } | 1129 | } |
| @@ -1443,9 +1457,9 @@ const BoxComponent = props => { | @@ -1443,9 +1457,9 @@ const BoxComponent = props => { | ||
| 1443 | if ( | 1457 | if ( |
| 1444 | (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) || | 1458 | (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) || |
| 1445 | (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || | 1459 | (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || |
| 1446 | - (selectedNode.sProductType === "不干胶" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth)) | ||
| 1447 | - { | ||
| 1448 | - const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); | 1460 | + (selectedNode.sProductType === "不干胶" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) |
| 1461 | + ) { | ||
| 1462 | + const slaveNewData = slaveRowData.upAbleConfigsExtra; | ||
| 1449 | const tables = [ | 1463 | const tables = [ |
| 1450 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, | 1464 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, |
| 1451 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, | 1465 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, |
| @@ -1498,6 +1512,7 @@ const BoxComponent = props => { | @@ -1498,6 +1512,7 @@ const BoxComponent = props => { | ||
| 1498 | let key = 0; | 1512 | let key = 0; |
| 1499 | if (x.sAssignFormula) { | 1513 | if (x.sAssignFormula) { |
| 1500 | key = evaluateFormula(x.sAssignFormula, variables); | 1514 | key = evaluateFormula(x.sAssignFormula, variables); |
| 1515 | + slaveRowData[x.sName] = key; | ||
| 1501 | } else { | 1516 | } else { |
| 1502 | key = slaveRowData[x.sName]; | 1517 | key = slaveRowData[x.sName]; |
| 1503 | } | 1518 | } |
| @@ -1558,7 +1573,7 @@ const BoxComponent = props => { | @@ -1558,7 +1573,7 @@ const BoxComponent = props => { | ||
| 1558 | ) { | 1573 | ) { |
| 1559 | return false; | 1574 | return false; |
| 1560 | } | 1575 | } |
| 1561 | - const rateList = [ | 1576 | + const rateList = [ |
| 1562 | { id: 0, name: "不显示倍率" }, | 1577 | { id: 0, name: "不显示倍率" }, |
| 1563 | { id: 1, name: "每本张数" }, | 1578 | { id: 1, name: "每本张数" }, |
| 1564 | { id: 2, name: "片数" }, | 1579 | { id: 2, name: "片数" }, |
| @@ -1589,9 +1604,9 @@ const BoxComponent = props => { | @@ -1589,9 +1604,9 @@ const BoxComponent = props => { | ||
| 1589 | if (selectedNode.sProductType === "不干胶") { | 1604 | if (selectedNode.sProductType === "不干胶") { |
| 1590 | showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; | 1605 | showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; |
| 1591 | } | 1606 | } |
| 1592 | - const UlToolPosition = commonFunc.showLocalMessage(props, 'UlToolPosition', '上下刀位'); | ||
| 1593 | - const RLToolPosition = commonFunc.showLocalMessage(props, 'RLToolPosition', '左右刀位'); | ||
| 1594 | - const LeftMargin = commonFunc.showLocalMessage(props, 'LeftMargin', '左右刀位'); | 1607 | + const UlToolPosition = commonFunc.showLocalMessage(props, "UlToolPosition", "上下刀位"); |
| 1608 | + const RLToolPosition = commonFunc.showLocalMessage(props, "RLToolPosition", "左右刀位"); | ||
| 1609 | + const LeftMargin = commonFunc.showLocalMessage(props, "LeftMargin", "左右刀位"); | ||
| 1595 | 1610 | ||
| 1596 | boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; | 1611 | boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; |
| 1597 | if (selectedNode.sProductType === "不干胶") { | 1612 | if (selectedNode.sProductType === "不干胶") { |
| @@ -1634,7 +1649,7 @@ const BoxComponent = props => { | @@ -1634,7 +1649,7 @@ const BoxComponent = props => { | ||
| 1634 | // 印刷参数表单 | 1649 | // 印刷参数表单 |
| 1635 | let upViewProps12 = getUpViewPropsByITag(12); | 1650 | let upViewProps12 = getUpViewPropsByITag(12); |
| 1636 | 1651 | ||
| 1637 | -const filterConditions = { | 1652 | + const filterConditions = { |
| 1638 | juantong: x => | 1653 | juantong: x => |
| 1639 | x.sName === "sMagnification" || | 1654 | x.sName === "sMagnification" || |
| 1640 | x.sName === "dPartsLength" || | 1655 | x.sName === "dPartsLength" || |
| @@ -1642,7 +1657,8 @@ const filterConditions = { | @@ -1642,7 +1657,8 @@ const filterConditions = { | ||
| 1642 | x.sName === "dRowGap" || | 1657 | x.sName === "dRowGap" || |
| 1643 | x.sName === "dColGap" || | 1658 | x.sName === "dColGap" || |
| 1644 | x.sName === "sPaperDirection", | 1659 | x.sName === "sPaperDirection", |
| 1645 | - default: x => x.sName === "dBleed" || x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" || x.sName === "dSumPQty", | 1660 | + default: x => |
| 1661 | + x.sName === "dBleed" || x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" || x.sName === "dSumPQty", | ||
| 1646 | }; | 1662 | }; |
| 1647 | if (upViewProps12 && selectedNode.sProductType === "不干胶") { | 1663 | if (upViewProps12 && selectedNode.sProductType === "不干胶") { |
| 1648 | upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.juantong); | 1664 | upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.juantong); |
| @@ -1736,69 +1752,68 @@ const filterConditions = { | @@ -1736,69 +1752,68 @@ const filterConditions = { | ||
| 1736 | const [materialLength, setMaterialLength] = useState(0); | 1752 | const [materialLength, setMaterialLength] = useState(0); |
| 1737 | const [materialWidth, setMaterialWidth] = useState(0); | 1753 | const [materialWidth, setMaterialWidth] = useState(0); |
| 1738 | // 使用 useCallback 确保回调函数的稳定性 | 1754 | // 使用 useCallback 确保回调函数的稳定性 |
| 1739 | - const handleSaveState = | ||
| 1740 | - ( | ||
| 1741 | - length, | ||
| 1742 | - width, | ||
| 1743 | - slaveData, | ||
| 1744 | - masterData, | ||
| 1745 | - dSinglePQty, | ||
| 1746 | - dMaterialsKQty, | ||
| 1747 | - dProductQty, | ||
| 1748 | - scale, | ||
| 1749 | - dWlcd, | ||
| 1750 | - dWlkd, | ||
| 1751 | - innerWidth, | ||
| 1752 | - innerHeight, | ||
| 1753 | - dHorizontal, | ||
| 1754 | - dPortrait, | ||
| 1755 | - dHorizontalType, | ||
| 1756 | - dPortraitType | ||
| 1757 | - ) => { | ||
| 1758 | - // 查找符合条件的索引 | ||
| 1759 | - const { selectedNode } = props.state; | ||
| 1760 | - | ||
| 1761 | - const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel); | ||
| 1762 | - // 判断展长展宽是否可以放下原纸 | ||
| 1763 | - const isDPartsLength = | ||
| 1764 | - slaveData[index]?.dPartsLength < slaveData[index]?.dMaxLength && slaveData[index]?.dPartsWidth < slaveData[index]?.dMaxWidth; | ||
| 1765 | - | ||
| 1766 | - if (index !== undefined && index !== -1) { | ||
| 1767 | - // 计算开数 | ||
| 1768 | - | ||
| 1769 | - // 获取原始对象并创建一个新的对象进行更新 | ||
| 1770 | - const updatedProduct = { | ||
| 1771 | - ...slaveData[index], | ||
| 1772 | - materialLength: length, | ||
| 1773 | - materialWidth: width, | ||
| 1774 | - dMachineLength: length, // 上机长 | ||
| 1775 | - dMachineWidth: width, // 上机宽 | ||
| 1776 | - sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸 | ||
| 1777 | - sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸 | ||
| 1778 | - sMaterialRate: (((length * width) / (dWlcd * dWlkd)) * 100).toFixed(2), | ||
| 1779 | - newMaterialLength: length, | ||
| 1780 | - newMaterialWidth: width, | ||
| 1781 | - sLayoutRate: Number( | ||
| 1782 | - ( | ||
| 1783 | - (((length || slaveData[index].materialLength) * (width || slaveData[index].materialWidth)) / | ||
| 1784 | - (slaveData[index].dMaxLength * slaveData[index].dMaxWidth)) * | ||
| 1785 | - 100 | ||
| 1786 | - ).toFixed(2) | ||
| 1787 | - ), | ||
| 1788 | - dWlcd: dWlcd, | ||
| 1789 | - dWlkd: dWlkd, | ||
| 1790 | - dMachineQty: Math.floor(dProductQty / dSinglePQty), | ||
| 1791 | - dSinglePQty: dSinglePQty, | ||
| 1792 | - dMaterialsKQty: dMaterialsKQty, | ||
| 1793 | - scale: scale, | ||
| 1794 | - dPartsLength: innerWidth, | ||
| 1795 | - dPartsWidth: innerHeight, | ||
| 1796 | - dHorizontal: dHorizontalType, | ||
| 1797 | - dPortrait: dPortraitType, | ||
| 1798 | - dHorizontalType: dHorizontalType, // 判断 | ||
| 1799 | - dPortraitType: dPortraitType, | ||
| 1800 | - }; | ||
| 1801 | - let juantongConfig = {}; | 1755 | + const handleSaveState = ( |
| 1756 | + length, | ||
| 1757 | + width, | ||
| 1758 | + slaveData, | ||
| 1759 | + masterData, | ||
| 1760 | + dSinglePQty, | ||
| 1761 | + dMaterialsKQty, | ||
| 1762 | + dProductQty, | ||
| 1763 | + scale, | ||
| 1764 | + dWlcd, | ||
| 1765 | + dWlkd, | ||
| 1766 | + innerWidth, | ||
| 1767 | + innerHeight, | ||
| 1768 | + dHorizontal, | ||
| 1769 | + dPortrait, | ||
| 1770 | + dHorizontalType, | ||
| 1771 | + dPortraitType | ||
| 1772 | + ) => { | ||
| 1773 | + // 查找符合条件的索引 | ||
| 1774 | + const { selectedNode } = props.state; | ||
| 1775 | + | ||
| 1776 | + const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel); | ||
| 1777 | + // 判断展长展宽是否可以放下原纸 | ||
| 1778 | + const isDPartsLength = | ||
| 1779 | + slaveData[index]?.dPartsLength < slaveData[index]?.dMaxLength && slaveData[index]?.dPartsWidth < slaveData[index]?.dMaxWidth; | ||
| 1780 | + | ||
| 1781 | + if (index !== undefined && index !== -1) { | ||
| 1782 | + // 计算开数 | ||
| 1783 | + | ||
| 1784 | + // 获取原始对象并创建一个新的对象进行更新 | ||
| 1785 | + const updatedProduct = { | ||
| 1786 | + ...slaveData[index], | ||
| 1787 | + materialLength: length, | ||
| 1788 | + materialWidth: width, | ||
| 1789 | + dMachineLength: length, // 上机长 | ||
| 1790 | + dMachineWidth: width, // 上机宽 | ||
| 1791 | + sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸 | ||
| 1792 | + sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸 | ||
| 1793 | + sMaterialRate: (((length * width) / (dWlcd * dWlkd)) * 100).toFixed(2), | ||
| 1794 | + newMaterialLength: length, | ||
| 1795 | + newMaterialWidth: width, | ||
| 1796 | + sLayoutRate: Number( | ||
| 1797 | + ( | ||
| 1798 | + (((length || slaveData[index].materialLength) * (width || slaveData[index].materialWidth)) / | ||
| 1799 | + (slaveData[index].dMaxLength * slaveData[index].dMaxWidth)) * | ||
| 1800 | + 100 | ||
| 1801 | + ).toFixed(2) | ||
| 1802 | + ), | ||
| 1803 | + dWlcd: dWlcd, | ||
| 1804 | + dWlkd: dWlkd, | ||
| 1805 | + dMachineQty: Math.floor(dProductQty / dSinglePQty), | ||
| 1806 | + dSinglePQty: dSinglePQty, | ||
| 1807 | + dMaterialsKQty: dMaterialsKQty, | ||
| 1808 | + scale: scale, | ||
| 1809 | + dPartsLength: innerWidth, | ||
| 1810 | + dPartsWidth: innerHeight, | ||
| 1811 | + dHorizontal: dHorizontalType, | ||
| 1812 | + dPortrait: dPortraitType, | ||
| 1813 | + dHorizontalType: dHorizontalType, // 判断 | ||
| 1814 | + dPortraitType: dPortraitType, | ||
| 1815 | + }; | ||
| 1816 | + let juantongConfig = {}; | ||
| 1802 | 1817 | ||
| 1803 | if (selectedNode.sProductType === "不干胶") { | 1818 | if (selectedNode.sProductType === "不干胶") { |
| 1804 | const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; | 1819 | const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; |
| @@ -1814,17 +1829,16 @@ const filterConditions = { | @@ -1814,17 +1829,16 @@ const filterConditions = { | ||
| 1814 | ...updatedProduct, | 1829 | ...updatedProduct, |
| 1815 | ...juantongConfig, | 1830 | ...juantongConfig, |
| 1816 | }; | 1831 | }; |
| 1817 | - // 更新状态 | ||
| 1818 | - props.setState(prevState => ({ | ||
| 1819 | - ...prevState, | ||
| 1820 | - slaveData: slaveData.map((item, i) => (i === index ? newSlaveData : item)), | ||
| 1821 | - })); | ||
| 1822 | - } | ||
| 1823 | - | ||
| 1824 | - setMaterialLength(length); | ||
| 1825 | - setMaterialWidth(width); | 1832 | + // 更新状态 |
| 1833 | + props.setState(prevState => ({ | ||
| 1834 | + ...prevState, | ||
| 1835 | + slaveData: slaveData.map((item, i) => (i === index ? newSlaveData : item)), | ||
| 1836 | + })); | ||
| 1826 | } | 1837 | } |
| 1827 | - ; | 1838 | + |
| 1839 | + setMaterialLength(length); | ||
| 1840 | + setMaterialWidth(width); | ||
| 1841 | + }; | ||
| 1828 | const onSaveDPartsLength = useCallback((innerWidth, innerHeight, slaveData) => { | 1842 | const onSaveDPartsLength = useCallback((innerWidth, innerHeight, slaveData) => { |
| 1829 | const { selectedNode } = props.state; | 1843 | const { selectedNode } = props.state; |
| 1830 | const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel); | 1844 | const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel); |
| @@ -2302,7 +2316,11 @@ const PrintParamsComponent = props => { | @@ -2302,7 +2316,11 @@ const PrintParamsComponent = props => { | ||
| 2302 | const result = []; | 2316 | const result = []; |
| 2303 | for (let i = 0; i < printParams.length + 1; i++) { | 2317 | for (let i = 0; i < printParams.length + 1; i++) { |
| 2304 | const printParamsItem = printParams[i - 1]; | 2318 | const printParamsItem = printParams[i - 1]; |
| 2305 | - const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId,sProcessId:i === 0 ? slaveRowData.sId : printParamsItem.sId}; | 2319 | + const viewRow = { |
| 2320 | + ...(i === 0 ? slaveRowData : printParamsItem), | ||
| 2321 | + sProductClassifyId: selectedNode.sId, | ||
| 2322 | + sProcessId: i === 0 ? slaveRowData.sId : printParamsItem.sId, | ||
| 2323 | + }; | ||
| 2306 | 2324 | ||
| 2307 | const viewProps = { | 2325 | const viewProps = { |
| 2308 | ...props, | 2326 | ...props, |