Commit 2bcb34178087dc00a22c7f7694018c5bedee86a3

Authored by 陈鑫涛
1 parent 2d13f8eb

画册默认p数展示

src/components/QuickQuote/index.jsx
@@ -1457,6 +1457,18 @@ const BoxComponent = props => { @@ -1457,6 +1457,18 @@ const BoxComponent = props => {
1457 item.showName = mappings[item.sName]; 1457 item.showName = mappings[item.sName];
1458 } 1458 }
1459 }); 1459 });
  1460 + }else {
  1461 + const mappings = {
  1462 + dZBLB: "左边留白",
  1463 + dXBJJ: "上下刀位",
  1464 + dYBJJ: "左右刀位",
  1465 + };
  1466 +
  1467 + boxConfigList.forEach(item => {
  1468 + if (mappings[item.sName]) {
  1469 + item.showName = mappings[item.sName];
  1470 + }
  1471 + });
1460 } 1472 }
1461 } 1473 }
1462 const newConfig = [...boxConfigList, ...config]; 1474 const newConfig = [...boxConfigList, ...config];
@@ -1483,8 +1495,9 @@ const BoxComponent = props => { @@ -1483,8 +1495,9 @@ const BoxComponent = props => {
1483 x.sName === "dRowGap" || 1495 x.sName === "dRowGap" ||
1484 x.sName === "dColGap" || 1496 x.sName === "dColGap" ||
1485 x.sName === "sPaperDirection", 1497 x.sName === "sPaperDirection",
1486 - default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth", 1498 + default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" || x.sName === "dSumPQty",
1487 }; 1499 };
  1500 +console.log(upViewProps12.viewConfigs,'upViewProps12.viewConfigs');
1488 1501
1489 if (selectedNode.sTypeKey === "juantong") { 1502 if (selectedNode.sTypeKey === "juantong") {
1490 upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.juantong); 1503 upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.juantong);
@@ -1765,8 +1778,6 @@ const BoxComponent = props => { @@ -1765,8 +1778,6 @@ const BoxComponent = props => {
1765 let juantongConfig = {}; 1778 let juantongConfig = {};
1766 1779
1767 if (selectedNode.sTypeKey === "juantong") { 1780 if (selectedNode.sTypeKey === "juantong") {
1768 - console.log(selectedNode.sTypeKey, "sTypeKey");  
1769 -  
1770 const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; 1781 const { dYBJJ, dXBJJ, dZBLB } = slaveData[index];
1771 juantongConfig = { 1782 juantongConfig = {
1772 dColGap: dYBJJ, 1783 dColGap: dYBJJ,
src/mobile/quotation/detailNew.jsx
@@ -1040,6 +1040,11 @@ const QuotationAllprogressDetail = baseProps => { @@ -1040,6 +1040,11 @@ const QuotationAllprogressDetail = baseProps => {
1040 }; 1040 };
1041 }); 1041 });
1042 }; 1042 };
  1043 + if (selectedNode.sTypeKey === "juantong") {
  1044 + props.onSaveState({
  1045 + masterData: { ...props.masterData, sFormId: "101251240115016002356125200" },
  1046 + });
  1047 + }
1043 getDropDownData(props); 1048 getDropDownData(props);
1044 }, [props.state.slaveConfig]); 1049 }, [props.state.slaveConfig]);
1045 const getSqlDropDownData = async ({ sId }) => { 1050 const getSqlDropDownData = async ({ sId }) => {
@@ -1069,7 +1074,10 @@ const QuotationDetail = props => { @@ -1069,7 +1074,10 @@ const QuotationDetail = props => {
1069 if (!masterConfig) return ""; 1074 if (!masterConfig) return "";
1070 const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); 1075 const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible);
1071 // 处理长宽样式 1076 // 处理长宽样式
1072 - const viewConfigs = selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); 1077 + const viewConfigs =
  1078 + selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sTypeKey !== "juantong"
  1079 + ? ableConfigs
  1080 + : ableConfigs.filter(x => x.sName !== "dHeight");
1073 if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") { 1081 if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") {
1074 viewConfigs.forEach(item => { 1082 viewConfigs.forEach(item => {
1075 if (item.sName === "dLength" || item.sName === "dWidth") { 1083 if (item.sName === "dLength" || item.sName === "dWidth") {
@@ -1081,6 +1089,20 @@ const QuotationDetail = props => { @@ -1081,6 +1089,20 @@ const QuotationDetail = props => {
1081 item.iColValue = viewConfigs[0].iColValue; 1089 item.iColValue = viewConfigs[0].iColValue;
1082 }); 1090 });
1083 } 1091 }
  1092 + const lengthData = viewConfigs.find(x => x.sName === "dLength");
  1093 + if (selectedNode.sTypeKey !== "danye") {
  1094 + if (lengthData) {
  1095 + lengthData.showName = "高(D)";
  1096 + lengthData.sChinese = "高(D)";
  1097 + lengthData.sEnglish = "Height (D)";
  1098 + }
  1099 + } else {
  1100 + if (lengthData) {
  1101 + lengthData.showName = "长(L)";
  1102 + lengthData.sChinese = "长(L)";
  1103 + lengthData.sEnglish = "Length (L)";
  1104 + }
  1105 + }
1084 const viewProps = { 1106 const viewProps = {
1085 ...props, 1107 ...props,
1086 viewConfigs: viewConfigs, 1108 viewConfigs: viewConfigs,
@@ -1147,9 +1169,7 @@ const MasterComponent = props => { @@ -1147,9 +1169,7 @@ const MasterComponent = props => {
1147 ...props, 1169 ...props,
1148 itemDetail: sDeliverName, 1170 itemDetail: sDeliverName,
1149 }; 1171 };
1150 - const baseProps = {  
1151 - ...props,  
1152 - }; 1172 +
1153 return ( 1173 return (
1154 <div> 1174 <div>
1155 <div className={styles.customer}> 1175 <div className={styles.customer}>
@@ -1161,7 +1181,9 @@ const MasterComponent = props =&gt; { @@ -1161,7 +1181,9 @@ const MasterComponent = props =&gt; {
1161 <SelectInput {...productProps} /> 1181 <SelectInput {...productProps} />
1162 </div> 1182 </div>
1163 <div className={styles.customer}> 1183 <div className={styles.customer}>
1164 - <div>尺寸(长*宽*高)</div> 1184 + <div>
  1185 + 尺寸 {dLength?.showName} * {dWidth?.showName} {dHeight?.showName ? "*" : ""} {dHeight?.showName}{" "}
  1186 + </div>
1165 <div className={styles.sizeBox}> 1187 <div className={styles.sizeBox}>
1166 <div className={styles.sizeItem}> 1188 <div className={styles.sizeItem}>
1167 <div style={{ width: "70%" }}> 1189 <div style={{ width: "70%" }}>
@@ -1409,8 +1431,9 @@ const BoxComponent = props =&gt; { @@ -1409,8 +1431,9 @@ const BoxComponent = props =&gt; {
1409 // if(!masterData) return 1431 // if(!masterData) return
1410 if ( 1432 if (
1411 (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) || 1433 (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) ||
1412 - (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth)  
1413 - ) { 1434 + (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) ||
  1435 + (selectedNode.sTypeKey === "juantong" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth))
  1436 + {
1414 const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); 1437 const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig);
1415 const tables = [ 1438 const tables = [
1416 { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, 1439 { name: "盒型类别", value: slaveRowData.sBoxType, type: null },
@@ -1531,8 +1554,36 @@ const BoxComponent = props =&gt; { @@ -1531,8 +1554,36 @@ const BoxComponent = props =&gt; {
1531 }); 1554 });
1532 let boxConfigList = []; 1555 let boxConfigList = [];
1533 if (iTag === 20) { 1556 if (iTag === 20) {
1534 - const showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; 1557 + let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"];
  1558 + if (selectedNode.sTypeKey === "juantong") {
  1559 + showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"];
  1560 + }
1535 boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; 1561 boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || [];
  1562 + if (selectedNode.sTypeKey === "juantong") {
  1563 + const mappings = {
  1564 + dZBLB: "留边",
  1565 + dXBJJ: "跳距",
  1566 + dYBJJ: "间距",
  1567 + };
  1568 +
  1569 + boxConfigList.forEach(item => {
  1570 + if (mappings[item.sName]) {
  1571 + item.showName = mappings[item.sName];
  1572 + }
  1573 + });
  1574 + } else {
  1575 + const mappings = {
  1576 + dZBLB: "左边留白",
  1577 + dXBJJ: "上下刀位",
  1578 + dYBJJ: "左右刀位",
  1579 + };
  1580 +
  1581 + boxConfigList.forEach(item => {
  1582 + if (mappings[item.sName]) {
  1583 + item.showName = mappings[item.sName];
  1584 + }
  1585 + });
  1586 + }
1536 } 1587 }
1537 const newConfig = [...boxConfigList, ...config]; 1588 const newConfig = [...boxConfigList, ...config];
1538 return { 1589 return {
@@ -1547,10 +1598,22 @@ const BoxComponent = props =&gt; { @@ -1547,10 +1598,22 @@ const BoxComponent = props =&gt; {
1547 1598
1548 // 印刷参数表单 1599 // 印刷参数表单
1549 let upViewProps12 = getUpViewPropsByITag(12); 1600 let upViewProps12 = getUpViewPropsByITag(12);
1550 - if (upViewProps12 && upViewProps12.viewConfigs && !(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) {  
1551 - upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(  
1552 - x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth"  
1553 - ); 1601 +
  1602 + const filterConditions = {
  1603 + juantong: x =>
  1604 + x.sName === "sMagnification" ||
  1605 + x.sName === "dPartsLength" ||
  1606 + x.sName === "dPartsWidth" ||
  1607 + x.sName === "dRowGap" ||
  1608 + x.sName === "dColGap" ||
  1609 + x.sName === "sPaperDirection",
  1610 + default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth",
  1611 + };
  1612 +
  1613 + if (selectedNode.sTypeKey === "juantong") {
  1614 + upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.juantong);
  1615 + } else if (!(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) {
  1616 + upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.default);
1554 } 1617 }
1555 // 拼板信息表单 1618 // 拼板信息表单
1556 const upViewProps20 = getUpViewPropsByITag(20); 1619 const upViewProps20 = getUpViewPropsByITag(20);
@@ -1638,8 +1701,25 @@ const BoxComponent = props =&gt; { @@ -1638,8 +1701,25 @@ const BoxComponent = props =&gt; {
1638 const [materialLength, setMaterialLength] = useState(0); 1701 const [materialLength, setMaterialLength] = useState(0);
1639 const [materialWidth, setMaterialWidth] = useState(0); 1702 const [materialWidth, setMaterialWidth] = useState(0);
1640 // 使用 useCallback 确保回调函数的稳定性 1703 // 使用 useCallback 确保回调函数的稳定性
1641 - const handleSaveState = useCallback(  
1642 - (length, width, slaveData, masterData, dSinglePQty, dMaterialsKQty, dProductQty, scale, dWlcd, dWlkd, innerWidth, innerHeight) => { 1704 + const handleSaveState = (
  1705 + (
  1706 + length,
  1707 + width,
  1708 + slaveData,
  1709 + masterData,
  1710 + dSinglePQty,
  1711 + dMaterialsKQty,
  1712 + dProductQty,
  1713 + scale,
  1714 + dWlcd,
  1715 + dWlkd,
  1716 + innerWidth,
  1717 + innerHeight,
  1718 + dHorizontal,
  1719 + dPortrait,
  1720 + dHorizontalType,
  1721 + dPortraitType
  1722 + ) => {
1643 // 查找符合条件的索引 1723 // 查找符合条件的索引
1644 const { selectedNode } = props.state; 1724 const { selectedNode } = props.state;
1645 1725
@@ -1678,11 +1758,31 @@ const BoxComponent = props =&gt; { @@ -1678,11 +1758,31 @@ const BoxComponent = props =&gt; {
1678 scale: scale, 1758 scale: scale,
1679 dPartsLength: innerWidth, 1759 dPartsLength: innerWidth,
1680 dPartsWidth: innerHeight, 1760 dPartsWidth: innerHeight,
  1761 + dHorizontal: dHorizontalType,
  1762 + dPortrait: dPortraitType,
  1763 + dHorizontalType: dHorizontalType, // 判断
  1764 + dPortraitType: dPortraitType,
  1765 + };
  1766 + let juantongConfig = {};
  1767 +
  1768 + if (selectedNode.sTypeKey === "juantong") {
  1769 + const { dYBJJ, dXBJJ, dZBLB } = slaveData[index];
  1770 + juantongConfig = {
  1771 + dColGap: dYBJJ,
  1772 + dRowGap: dXBJJ,
  1773 + iCol: dPortraitType,
  1774 + iRow: dHorizontalType,
  1775 + dCutEdge: dZBLB,
1681 }; 1776 };
  1777 + }
  1778 + const newSlaveData = {
  1779 + ...updatedProduct,
  1780 + ...juantongConfig,
  1781 + };
1682 // 更新状态 1782 // 更新状态
1683 props.setState(prevState => ({ 1783 props.setState(prevState => ({
1684 ...prevState, 1784 ...prevState,
1685 - slaveData: slaveData.map((item, i) => (i === index ? updatedProduct : item)), 1785 + slaveData: slaveData.map((item, i) => (i === index ? newSlaveData : item)),
1686 })); 1786 }));
1687 } 1787 }
1688 1788
@@ -1844,7 +1944,7 @@ const BoxComponent = props =&gt; { @@ -1844,7 +1944,7 @@ const BoxComponent = props =&gt; {
1844 }; 1944 };
1845 1945
1846 useEffect(() => { 1946 useEffect(() => {
1847 - if (selectedNode.sTypeKey === "kapai") { 1947 + if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
1848 const data = selectList.find(x => x.sTypes === "6"); 1948 const data = selectList.find(x => x.sTypes === "6");
1849 if (!data) return; 1949 if (!data) return;
1850 const currentBoxModel = "slaveUp" + props.boxModel; 1950 const currentBoxModel = "slaveUp" + props.boxModel;
@@ -2501,7 +2601,7 @@ const ManyComponent = props =&gt; { @@ -2501,7 +2601,7 @@ const ManyComponent = props =&gt; {
2501 // props.slaveData?.forEach(slaveRowData => { 2601 // props.slaveData?.forEach(slaveRowData => {
2502 // props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props); 2602 // props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props);
2503 // }); 2603 // });
2504 - 2604 +
2505 props.setState(pre => ({ 2605 props.setState(pre => ({
2506 ...pre, 2606 ...pre,
2507 manySelectedRowKeys: selectedRowKeys.sId, 2607 manySelectedRowKeys: selectedRowKeys.sId,