Commit 6646c6bd2d30e2de6938142bc75da9d53774e48d
1 parent
cddd259c
重新打开后卡牌不展示的问题
Showing
2 changed files
with
56 additions
and
28 deletions
src/components/Common/Typesetting/typesetting.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | -import React, { useEffect, useState, useRef } from "react"; | ||
| 3 | -import { Modal, message } from "antd-v4"; | ||
| 4 | -import { VerticalRightOutlined, VerticalLeftOutlined, LeftOutlined, RightOutlined, UpOutlined, DownOutlined } from "@ant-design/icons"; | ||
| 5 | -import * as commonUtils from "@/utils/utils"; /* 通用方法 */ | ||
| 6 | -import commonConfig from "@/utils/config"; | ||
| 7 | -import styles from "./index.less"; | ||
| 8 | -import DynamicSVG from "../../Common/BoxDesignCompontent/svg"; | ||
| 9 | -import * as commonFunc from "@/components/Common/commonFunc"; | 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'; | ||
| 10 | 16 | ||
| 11 | const Typesetting = props => { | 17 | const Typesetting = props => { |
| 12 | const { | 18 | const { |
| @@ -41,6 +47,7 @@ const Typesetting = props => { | @@ -41,6 +47,7 @@ const Typesetting = props => { | ||
| 41 | } = slaveRowData; | 47 | } = slaveRowData; |
| 42 | 48 | ||
| 43 | const { masterData, selectedNode, slaveData } = state; | 49 | const { masterData, selectedNode, slaveData } = state; |
| 50 | + if (!masterData) return | ||
| 44 | // 如果是卷筒类 那么上下左右留白等于左留白 | 51 | // 如果是卷筒类 那么上下左右留白等于左留白 |
| 45 | if (selectedNode && selectedNode.sTypeKey === "juantong") { | 52 | if (selectedNode && selectedNode.sTypeKey === "juantong") { |
| 46 | dSBLB = dZBLB; | 53 | dSBLB = dZBLB; |
| @@ -564,10 +571,9 @@ const Typesetting = props => { | @@ -564,10 +571,9 @@ const Typesetting = props => { | ||
| 564 | onSaveDPartsLength(innerWidth, innerHeight, slaveData); | 571 | onSaveDPartsLength(innerWidth, innerHeight, slaveData); |
| 565 | } | 572 | } |
| 566 | const propsData = innerDivs[innerDivs.length - 1]; | 573 | const propsData = innerDivs[innerDivs.length - 1]; |
| 567 | - | ||
| 568 | let openEdition = 0; | 574 | let openEdition = 0; |
| 569 | if (propsData && L) { | 575 | if (propsData && L) { |
| 570 | - console.log(111111); | 576 | + const {dWlcd,sBillNo} = slaveRowData |
| 571 | 577 | ||
| 572 | const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName; | 578 | const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName; |
| 573 | const propsDataLeft = Number(propsData.props.style.left.slice(0, -2)); | 579 | const propsDataLeft = Number(propsData.props.style.left.slice(0, -2)); |
| @@ -612,10 +618,9 @@ const Typesetting = props => { | @@ -612,10 +618,9 @@ const Typesetting = props => { | ||
| 612 | newMaterialWidth !== materialWidth || | 618 | newMaterialWidth !== materialWidth || |
| 613 | materialName !== sMaterialsName || | 619 | materialName !== sMaterialsName || |
| 614 | newDHorizontalType !== dHorizontalType || | 620 | newDHorizontalType !== dHorizontalType || |
| 615 | - newDPortraitType !== dPortraitType | 621 | + newDPortraitType !== dPortraitType || |
| 622 | + (!dWlcd && sBillNo) | ||
| 616 | ) { | 623 | ) { |
| 617 | - console.log(222222); | ||
| 618 | - | ||
| 619 | setMaterialLength(newMaterialLength); | 624 | setMaterialLength(newMaterialLength); |
| 620 | setMaterialWidth(newMaterialWidth); | 625 | setMaterialWidth(newMaterialWidth); |
| 621 | setMaterialName(sMaterialsName); | 626 | setMaterialName(sMaterialsName); |
| @@ -666,10 +671,7 @@ const Typesetting = props => { | @@ -666,10 +671,7 @@ const Typesetting = props => { | ||
| 666 | dHorizontalType, | 671 | dHorizontalType, |
| 667 | dPortraitType | 672 | dPortraitType |
| 668 | ); | 673 | ); |
| 669 | - } else if (selectedNode.sTypeKey === 'kapai') { | ||
| 670 | - console.log(111111111); | ||
| 671 | - | ||
| 672 | - } | 674 | + } |
| 673 | openEdition = (((newMaterialLength * newMaterialWidth) / (maxWidth * maxHeight)) * 100).toFixed(2); | 675 | openEdition = (((newMaterialLength * newMaterialWidth) / (maxWidth * maxHeight)) * 100).toFixed(2); |
| 674 | 676 | ||
| 675 | setTimeout(() => { | 677 | setTimeout(() => { |
src/components/QuickQuote/index.jsx
| @@ -1142,7 +1142,7 @@ const QuickQuoteEvent = props => { | @@ -1142,7 +1142,7 @@ const QuickQuoteEvent = props => { | ||
| 1142 | // 入口 | 1142 | // 入口 |
| 1143 | const QuickQuote = baseProps => { | 1143 | const QuickQuote = baseProps => { |
| 1144 | const props = QuickQuoteEvent(baseProps); | 1144 | const props = QuickQuoteEvent(baseProps); |
| 1145 | - console.log("🚀 ~ QuickQuote:", props) | 1145 | + console.log("🚀 ~ QuickQuote:", props); |
| 1146 | const [treeClassName, setTreeClassName] = useState(""); | 1146 | const [treeClassName, setTreeClassName] = useState(""); |
| 1147 | 1147 | ||
| 1148 | // 监听页面滚动事件 | 1148 | // 监听页面滚动事件 |
| @@ -1320,14 +1320,21 @@ const TreeComponent = props => { | @@ -1320,14 +1320,21 @@ const TreeComponent = props => { | ||
| 1320 | }; | 1320 | }; |
| 1321 | }); | 1321 | }); |
| 1322 | }; | 1322 | }; |
| 1323 | - if (selectedNode.sTypeKey === "juantong") { | ||
| 1324 | - props.onSaveState({ | ||
| 1325 | - masterData: { ...props.masterData, sFormId: "101251240115016002356125200", sOldFormId: props.masterData.sFormId }, | ||
| 1326 | - }); | ||
| 1327 | - } else { | ||
| 1328 | - props.onSaveState({ | ||
| 1329 | - masterData: { ...props.masterData, sFormId: props.masterData.sOldFormId || props.masterData.sFormId }, | ||
| 1330 | - }); | 1323 | + const { masterData } = props; |
| 1324 | + if (masterData.sFormId !== "101251240115016002356125200") { | ||
| 1325 | + localStorage.setItem("quickMasterFormId", masterData.sFormId); | ||
| 1326 | + } | ||
| 1327 | + const quickMasterFormId = localStorage.getItem("quickMasterFormId"); | ||
| 1328 | + if (quickMasterFormId) { | ||
| 1329 | + if (selectedNode.sTypeKey === "juantong") { | ||
| 1330 | + props.onSaveState({ | ||
| 1331 | + masterData: { ...props.masterData, sFormId: "101251240115016002356125200" }, | ||
| 1332 | + }); | ||
| 1333 | + } else { | ||
| 1334 | + props.onSaveState({ | ||
| 1335 | + masterData: { ...props.masterData, sFormId: quickMasterFormId }, | ||
| 1336 | + }); | ||
| 1337 | + } | ||
| 1331 | } | 1338 | } |
| 1332 | getDropDownData(props); | 1339 | getDropDownData(props); |
| 1333 | }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]); | 1340 | }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]); |
| @@ -1480,13 +1487,14 @@ const MasterComponent = props => { | @@ -1480,13 +1487,14 @@ const MasterComponent = props => { | ||
| 1480 | if (!masterConfig) return ""; | 1487 | if (!masterConfig) return ""; |
| 1481 | 1488 | ||
| 1482 | const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); | 1489 | const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); |
| 1490 | + const JosnAbleConfigs = JSON.parse(JSON.stringify(ableConfigs)); | ||
| 1483 | // 处理长宽样式 | 1491 | // 处理长宽样式 |
| 1484 | // selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶" | 1492 | // selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶" |
| 1485 | // ? ableConfigs | 1493 | // ? ableConfigs |
| 1486 | // : ableConfigs.filter(x => x.sName !== "dHeight"); | 1494 | // : ableConfigs.filter(x => x.sName !== "dHeight"); |
| 1487 | const { sStripType = 0 } = selectedNode; | 1495 | const { sStripType = 0 } = selectedNode; |
| 1488 | // {"0":"长宽高","1":"高宽"} ,0显示长宽高,1显示宽高 | 1496 | // {"0":"长宽高","1":"高宽"} ,0显示长宽高,1显示宽高 |
| 1489 | - const viewConfigs = Number(sStripType) === 0 ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); | 1497 | + const viewConfigs = Number(sStripType) === 0 ? JosnAbleConfigs : JosnAbleConfigs.filter(x => x.sName !== "dHeight"); |
| 1490 | if (Number(sStripType) === 0) { | 1498 | if (Number(sStripType) === 0) { |
| 1491 | viewConfigs.forEach(item => { | 1499 | viewConfigs.forEach(item => { |
| 1492 | if (item.sName === "dLength" || item.sName === "dWidth") { | 1500 | if (item.sName === "dLength" || item.sName === "dWidth") { |
| @@ -1552,6 +1560,10 @@ const BoxComponent = props => { | @@ -1552,6 +1560,10 @@ const BoxComponent = props => { | ||
| 1552 | 1560 | ||
| 1553 | const { bBox } = selectedNode; | 1561 | const { bBox } = selectedNode; |
| 1554 | const [boxTypeList, setBoxTypeList] = useState([]); | 1562 | const [boxTypeList, setBoxTypeList] = useState([]); |
| 1563 | + // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 | ||
| 1564 | + console.log(props, "asdadasd"); | ||
| 1565 | + const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; | ||
| 1566 | + const { sBillNo } = slaveRowData; | ||
| 1555 | useEffect(() => { | 1567 | useEffect(() => { |
| 1556 | if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { | 1568 | if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { |
| 1557 | let dropDownData = []; | 1569 | let dropDownData = []; |
| @@ -1564,7 +1576,21 @@ const BoxComponent = props => { | @@ -1564,7 +1576,21 @@ const BoxComponent = props => { | ||
| 1564 | } | 1576 | } |
| 1565 | }, [boxModel]); | 1577 | }, [boxModel]); |
| 1566 | 1578 | ||
| 1567 | - const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; | 1579 | + // useEffect(() => { |
| 1580 | + // if (sBillNo) { | ||
| 1581 | + // setTimeout(() => { | ||
| 1582 | + // if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { | ||
| 1583 | + // let dropDownData = []; | ||
| 1584 | + // dropDownData.push(KapaiJson); | ||
| 1585 | + // const boxData = (dropDownData || []).map((item, index) => ({ | ||
| 1586 | + // ...item, | ||
| 1587 | + // iOrder: index + 1, | ||
| 1588 | + // })); | ||
| 1589 | + // props.onDataChange("slaveUp" + boxModel, "sName", { sName: KapaiJson.sName }, KapaiJson.sId, boxData); | ||
| 1590 | + // } | ||
| 1591 | + // }, 500); | ||
| 1592 | + // } | ||
| 1593 | + // }, [masterData.dLength]); | ||
| 1568 | const { upAbleConfigsExtra = [], calcMethodData = [], boxPicData = [], radioValue = calcMethodData[0]?.sCode } = slaveRowData; | 1594 | const { upAbleConfigsExtra = [], calcMethodData = [], boxPicData = [], radioValue = calcMethodData[0]?.sCode } = slaveRowData; |
| 1569 | const calcMethod = calcMethodData.map(item => ({ | 1595 | const calcMethod = calcMethodData.map(item => ({ |
| 1570 | value: item.sCode, | 1596 | value: item.sCode, |