Commit f1436b73dfb82971320255853ddf4064530f1736
1 parent
06e3687b
盒型默认参数根据主表变化
Showing
2 changed files
with
55 additions
and
31 deletions
src/components/Common/Typesetting/typesetting.js
| @@ -277,17 +277,6 @@ const Typesetting = props => { | @@ -277,17 +277,6 @@ const Typesetting = props => { | ||
| 277 | 277 | ||
| 278 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; | 278 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; |
| 279 | // const remaining = false; | 279 | // const remaining = false; |
| 280 | - console.log(innerWidth, '盒长'); | ||
| 281 | - console.log(innerHeight, '盒高'); | ||
| 282 | - console.log(dFWidthOffset, '首盒纵向偏移'); | ||
| 283 | - console.log(dFLengthOffset, '首盒横向偏移'); | ||
| 284 | - console.log(dSWidthOffset,radioValue?.sSWidthOffset, '次盒纵向偏移'); | ||
| 285 | - console.log(dSLengthOffset,radioValue?.sSLengthOffset, '次盒横向偏移'); | ||
| 286 | - console.log(boxLengthOffset, '第二列横向偏移'); | ||
| 287 | - console.log(boxWidthOffset, '第二列纵向偏移'); | ||
| 288 | - console.log(variabless,'variabless'); | ||
| 289 | - | ||
| 290 | - | ||
| 291 | const isOdd = num => { | 280 | const isOdd = num => { |
| 292 | return num % 2 !== 0; | 281 | return num % 2 !== 0; |
| 293 | }; | 282 | }; |
| @@ -497,14 +486,8 @@ const Typesetting = props => { | @@ -497,14 +486,8 @@ const Typesetting = props => { | ||
| 497 | }, [radioValue, slaveRowData, masterData, selectedNode, slaveData]); | 486 | }, [radioValue, slaveRowData, masterData, selectedNode, slaveData]); |
| 498 | // 生成里层 div 的数组 | 487 | // 生成里层 div 的数组 |
| 499 | const innerDivs = []; | 488 | const innerDivs = []; |
| 500 | - // 如果第一列 | ||
| 501 | - // if (rows === 0) { | ||
| 502 | - // const maxWidth = Number(slaveDataDetail?.dMaxWidth) | ||
| 503 | - // if (maxWidth > innerHeight) { | ||
| 504 | - // rows = 1 | ||
| 505 | - // } | ||
| 506 | - // } | ||
| 507 | - | 489 | + |
| 490 | + | ||
| 508 | for (let col = 0; col < cols; col++) { | 491 | for (let col = 0; col < cols; col++) { |
| 509 | for (let row = 0; row < rows; row++) { | 492 | for (let row = 0; row < rows; row++) { |
| 510 | const leftPosition = col * innerWidthCombined; | 493 | const leftPosition = col * innerWidthCombined; |
| @@ -553,7 +536,16 @@ const Typesetting = props => { | @@ -553,7 +536,16 @@ const Typesetting = props => { | ||
| 553 | innerDivs.push(createBoxOne(0, rows, 3, leftPosition + dZBLB, topPosition + dSBLB, iFAngle, DisableMateriallIcon)); | 536 | innerDivs.push(createBoxOne(0, rows, 3, leftPosition + dZBLB, topPosition + dSBLB, iFAngle, DisableMateriallIcon)); |
| 554 | } | 537 | } |
| 555 | } | 538 | } |
| 556 | - | 539 | + // 如果第一列 |
| 540 | + if (rows === 0) { | ||
| 541 | + const maxWidth = Number(slaveDataDetail?.dMaxWidth) | ||
| 542 | + if (maxWidth > innerHeight) { | ||
| 543 | + let leftPosition = 0; | ||
| 544 | + let topPosition = 0; | ||
| 545 | + innerDivs.push(createBoxOne(cols, 0, 3, leftPosition + dZBLB, topPosition + dSBLB, iFAngle, DisableMateriallIcon)); | ||
| 546 | + } | ||
| 547 | + } | ||
| 548 | + console.log(cols, '列数', rows, '行数'); | ||
| 557 | // 判断展开长展开宽是否变化 | 549 | // 判断展开长展开宽是否变化 |
| 558 | if (dPartsLength !== innerWidth && !innerDivs.length) { | 550 | if (dPartsLength !== innerWidth && !innerDivs.length) { |
| 559 | setDPartsLength(innerWidth); | 551 | setDPartsLength(innerWidth); |
| @@ -669,12 +661,13 @@ const Typesetting = props => { | @@ -669,12 +661,13 @@ const Typesetting = props => { | ||
| 669 | Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength) && | 661 | Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength) && |
| 670 | Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); | 662 | Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); |
| 671 | 663 | ||
| 672 | - const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; | 664 | + const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length > 0; |
| 673 | console.log( | 665 | console.log( |
| 674 | slaveDataDetail?.dMaxLength, | 666 | slaveDataDetail?.dMaxLength, |
| 675 | slaveDataDetail?.dMaxWidth, | 667 | slaveDataDetail?.dMaxWidth, |
| 676 | slaveRowData?.dMachineLength, | 668 | slaveRowData?.dMachineLength, |
| 677 | slaveRowData?.dMachineWidth, | 669 | slaveRowData?.dMachineWidth, |
| 670 | + innerDivs, | ||
| 678 | isMax, | 671 | isMax, |
| 679 | isShow, | 672 | isShow, |
| 680 | "isMax" | 673 | "isMax" |
src/components/QuickQuote/index.jsx
| @@ -179,6 +179,7 @@ const QuickQuoteEvent = props => { | @@ -179,6 +179,7 @@ const QuickQuoteEvent = props => { | ||
| 179 | 179 | ||
| 180 | addState.onDataChange = (name, sFieldName, changeValue, sId, dropDownData, isWait) => { | 180 | addState.onDataChange = (name, sFieldName, changeValue, sId, dropDownData, isWait) => { |
| 181 | const { masterData = {}, slaveData = [], selectedNode = {}, manyData = [] } = state; | 181 | const { masterData = {}, slaveData = [], selectedNode = {}, manyData = [] } = state; |
| 182 | + | ||
| 182 | const extraState = { | 183 | const extraState = { |
| 183 | calcPriceFinished: false, | 184 | calcPriceFinished: false, |
| 184 | }; | 185 | }; |
| @@ -188,9 +189,13 @@ const QuickQuoteEvent = props => { | @@ -188,9 +189,13 @@ const QuickQuoteEvent = props => { | ||
| 188 | } | 189 | } |
| 189 | 190 | ||
| 190 | if (name === "master") { | 191 | if (name === "master") { |
| 192 | + const { showName: sTreeNodeName } = selectedNode; | ||
| 193 | + const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); | ||
| 194 | + const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); | ||
| 191 | const masterDataNew = { ...masterData, ...changeValue }; | 195 | const masterDataNew = { ...masterData, ...changeValue }; |
| 192 | masterDataNew.handleType = masterDataNew.handleType || "update"; | 196 | masterDataNew.handleType = masterDataNew.handleType || "update"; |
| 193 | masterDataNew.sId = masterDataNew.sId || commonUtils.createSid(); | 197 | masterDataNew.sId = masterDataNew.sId || commonUtils.createSid(); |
| 198 | + | ||
| 194 | if (sFieldName === "dProductQty") { | 199 | if (sFieldName === "dProductQty") { |
| 195 | setState(pre => ({ | 200 | setState(pre => ({ |
| 196 | ...pre, | 201 | ...pre, |
| @@ -198,6 +203,17 @@ const QuickQuoteEvent = props => { | @@ -198,6 +203,17 @@ const QuickQuoteEvent = props => { | ||
| 198 | })); | 203 | })); |
| 199 | } | 204 | } |
| 200 | 205 | ||
| 206 | + if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { | ||
| 207 | + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({ | ||
| 208 | + ...item, | ||
| 209 | + iColValue: item.iColValue || 6, | ||
| 210 | + })); | ||
| 211 | + slaveData[iIndex] = { | ||
| 212 | + ...slaveData[iIndex], | ||
| 213 | + upAbleConfigsExtra:sColumnNameConfig | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + } | ||
| 201 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); | 217 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); |
| 202 | } else if (name.includes("slave")) { | 218 | } else if (name.includes("slave")) { |
| 203 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); | 219 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); |
| @@ -353,6 +369,14 @@ const QuickQuoteEvent = props => { | @@ -353,6 +369,14 @@ const QuickQuoteEvent = props => { | ||
| 353 | dFlap: "", | 369 | dFlap: "", |
| 354 | }; | 370 | }; |
| 355 | } | 371 | } |
| 372 | + const {upAbleConfigsExtra} = slaveData[saveIndex] || {}; | ||
| 373 | + | ||
| 374 | + upAbleConfigsExtra.forEach(item => { | ||
| 375 | + if (item.sName === sFieldName) { | ||
| 376 | + item.sAssignFormula = null | ||
| 377 | + } | ||
| 378 | + }) | ||
| 379 | + | ||
| 356 | setState(pre => ({ ...pre, slaveData, ...extraState })); | 380 | setState(pre => ({ ...pre, slaveData, ...extraState })); |
| 357 | } else if (name === "finished") { | 381 | } else if (name === "finished") { |
| 358 | const { productProcessInfo = [] } = masterData; | 382 | const { productProcessInfo = [] } = masterData; |
| @@ -1165,12 +1189,17 @@ const TreeComponent = props => { | @@ -1165,12 +1189,17 @@ const TreeComponent = props => { | ||
| 1165 | }; | 1189 | }; |
| 1166 | if (selectedNode.sProductType === "不干胶") { | 1190 | if (selectedNode.sProductType === "不干胶") { |
| 1167 | props.onSaveState({ | 1191 | props.onSaveState({ |
| 1168 | - masterData: { ...props.masterData, sFormId: "101251240115016002356125200" }, | 1192 | + masterData: { ...props.masterData, sFormId: "101251240115016002356125200",sOldFormId:props.masterData.sFormId }, |
| 1193 | + }); | ||
| 1194 | + } else { | ||
| 1195 | + props.onSaveState({ | ||
| 1196 | + masterData: { ...props.masterData, sFormId:props.masterData.sOldFormId || props.masterData.sFormId }, | ||
| 1169 | }); | 1197 | }); |
| 1170 | } | 1198 | } |
| 1171 | - | 1199 | + |
| 1172 | getDropDownData(props); | 1200 | getDropDownData(props); |
| 1173 | }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]); | 1201 | }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]); |
| 1202 | + console.log(props.masterData,'pppppp',selectedNode.sProductType); | ||
| 1174 | 1203 | ||
| 1175 | return ( | 1204 | return ( |
| 1176 | <Tree | 1205 | <Tree |
| @@ -1432,6 +1461,7 @@ const BoxComponent = props => { | @@ -1432,6 +1461,7 @@ const BoxComponent = props => { | ||
| 1432 | })); | 1461 | })); |
| 1433 | 1462 | ||
| 1434 | const showUpAbleConfigsExtra = upAbleConfigsExtra.filter(x => x.bVisible === 1); | 1463 | const showUpAbleConfigsExtra = upAbleConfigsExtra.filter(x => x.bVisible === 1); |
| 1464 | + console.log("🚀 ~ showUpAbleConfigsExtra:", showUpAbleConfigsExtra); | ||
| 1435 | const upAbleConfigs = [ | 1465 | const upAbleConfigs = [ |
| 1436 | ...slaveConfig.gdsconfigformslave.filter(item => item.iTag === 10).filter(item => (bBox ? true : item.sName !== "sName")), | 1466 | ...slaveConfig.gdsconfigformslave.filter(item => item.iTag === 10).filter(item => (bBox ? true : item.sName !== "sName")), |
| 1437 | ...showUpAbleConfigsExtra, | 1467 | ...showUpAbleConfigsExtra, |
| @@ -1444,6 +1474,7 @@ const BoxComponent = props => { | @@ -1444,6 +1474,7 @@ const BoxComponent = props => { | ||
| 1444 | viewRow: slaveRowData, | 1474 | viewRow: slaveRowData, |
| 1445 | tableName: `slaveUp${boxModel}`, | 1475 | tableName: `slaveUp${boxModel}`, |
| 1446 | }; | 1476 | }; |
| 1477 | + console.log("🚀 ~ upViewProps:", props.state); | ||
| 1447 | 1478 | ||
| 1448 | const getUpViewPropsByITag = iTag => { | 1479 | const getUpViewPropsByITag = iTag => { |
| 1449 | const config = slaveConfig.gdsconfigformslave | 1480 | const config = slaveConfig.gdsconfigformslave |
| @@ -1900,7 +1931,7 @@ const BoxComponent = props => { | @@ -1900,7 +1931,7 @@ const BoxComponent = props => { | ||
| 1900 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || | 1931 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || |
| 1901 | (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) | 1932 | (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) |
| 1902 | ) { | 1933 | ) { |
| 1903 | - const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); | 1934 | + const slaveNewData = slaveRowData.upAbleConfigsExtra; |
| 1904 | const tables = [ | 1935 | const tables = [ |
| 1905 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, | 1936 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, |
| 1906 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, | 1937 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, |
| @@ -1954,6 +1985,7 @@ const BoxComponent = props => { | @@ -1954,6 +1985,7 @@ const BoxComponent = props => { | ||
| 1954 | let key = 0; | 1985 | let key = 0; |
| 1955 | if (x.sAssignFormula) { | 1986 | if (x.sAssignFormula) { |
| 1956 | key = evaluateFormula(x.sAssignFormula, variables); | 1987 | key = evaluateFormula(x.sAssignFormula, variables); |
| 1988 | + slaveRowData[x.sName] = key; | ||
| 1957 | } else { | 1989 | } else { |
| 1958 | key = slaveRowData[x.sName]; | 1990 | key = slaveRowData[x.sName]; |
| 1959 | } | 1991 | } |
| @@ -1993,6 +2025,8 @@ const BoxComponent = props => { | @@ -1993,6 +2025,8 @@ const BoxComponent = props => { | ||
| 1993 | dSvgBoxHeight: 300, | 2025 | dSvgBoxHeight: 300, |
| 1994 | showNew: 1, | 2026 | showNew: 1, |
| 1995 | }; | 2027 | }; |
| 2028 | + // upViewProps.viewRow = | ||
| 2029 | + | ||
| 1996 | const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; | 2030 | const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; |
| 1997 | const PrintingParameters = props.getI18nName("PrintingParameters", "印刷参数"); | 2031 | const PrintingParameters = props.getI18nName("PrintingParameters", "印刷参数"); |
| 1998 | 2032 | ||
| @@ -2001,7 +2035,6 @@ const BoxComponent = props => { | @@ -2001,7 +2035,6 @@ const BoxComponent = props => { | ||
| 2001 | 2035 | ||
| 2002 | const noImage = commonFunc.showLocalMessage(props, "ImpositionInformation", "暂无图片"); | 2036 | const noImage = commonFunc.showLocalMessage(props, "ImpositionInformation", "暂无图片"); |
| 2003 | 2037 | ||
| 2004 | - | ||
| 2005 | const imagesData = [ | 2038 | const imagesData = [ |
| 2006 | { src: slaveRowData.sPackDetailPathUpLoad, alt: "展开图" }, | 2039 | { src: slaveRowData.sPackDetailPathUpLoad, alt: "展开图" }, |
| 2007 | { src: slaveRowData.sPackPath, alt: "立体图" }, | 2040 | { src: slaveRowData.sPackPath, alt: "立体图" }, |
| @@ -2099,14 +2132,13 @@ const BoxComponent = props => { | @@ -2099,14 +2132,13 @@ const BoxComponent = props => { | ||
| 2099 | {/* <div className={styles.boxRreviewTitile}>展开图</div> */} | 2132 | {/* <div className={styles.boxRreviewTitile}>展开图</div> */} |
| 2100 | {slaveRowData.sPackPath ? ( | 2133 | {slaveRowData.sPackPath ? ( |
| 2101 | // <Image width={300} src={slaveRowData.sPackPath} /> | 2134 | // <Image width={300} src={slaveRowData.sPackPath} /> |
| 2102 | - | 2135 | + |
| 2103 | <Carousel style={{ width: "300px", height: "300px" }} className={styles.carousel} dots> | 2136 | <Carousel style={{ width: "300px", height: "300px" }} className={styles.carousel} dots> |
| 2104 | - { imagesData.map((image, index) => ( | 2137 | + {imagesData.map((image, index) => ( |
| 2105 | <div key={index} className="carousel-item"> | 2138 | <div key={index} className="carousel-item"> |
| 2106 | - <Image width={300} src={image.src} alt={image.alt} /> | 2139 | + <Image width={300} src={image.src} alt={image.alt} /> |
| 2107 | </div> | 2140 | </div> |
| 2108 | - )) | ||
| 2109 | - } | 2141 | + ))} |
| 2110 | </Carousel> | 2142 | </Carousel> |
| 2111 | ) : ( | 2143 | ) : ( |
| 2112 | <div className={styles.noImg}>{noImage}</div> | 2144 | <div className={styles.noImg}>{noImage}</div> |
| @@ -2765,7 +2797,6 @@ const BoxModelSelectedModal = props => { | @@ -2765,7 +2797,6 @@ const BoxModelSelectedModal = props => { | ||
| 2765 | columns | 2797 | columns |
| 2766 | .filter(item => item.dataIndex?.includes("Path")) | 2798 | .filter(item => item.dataIndex?.includes("Path")) |
| 2767 | .forEach(column => { | 2799 | .forEach(column => { |
| 2768 | - | ||
| 2769 | // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片"); | 2800 | // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片"); |
| 2770 | column.render = (value, record, index) => | 2801 | column.render = (value, record, index) => |
| 2771 | column.dataIndex === "sPackDetailPathUpLoad" ? ( | 2802 | column.dataIndex === "sPackDetailPathUpLoad" ? ( |