Commit 7c225fe084f04bc7b9e65be6fb5a8c54c2b24a8d

Authored by 陈鑫涛
1 parent 8fccb317

主表长宽高根据字段展示

src/components/Common/BoxDesignCompontent/svg.js
... ... @@ -76,7 +76,7 @@ const SvgBox = props => {
76 76 const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); // 创建 <g>
77 77  
78 78 svg.innerHTML = "";
79   -
  79 + if (!(boxList && boxList.length)) return
80 80 // 获取盒型类型
81 81 const svgTypes = boxList.find(x => x.sName === "盒身")?.type || 1;
82 82 setSvgType(svgTypes);
... ...
src/components/Common/CommonComponent/index.js
... ... @@ -1143,10 +1143,8 @@ export default class CommonComponent extends Component {
1143 1143 if (response && response.code === 1) {
1144 1144 const imageUrlNew = `${commonConfig.server_host}file/downloadLogo?sLogoName=logo${sName}${this.props.record.sName}&date=${new Date().getTime()}`;
1145 1145 if (sName === 'sPackPath') {
1146   - // this.setState({ sPackPath: imageUrlNew });
1147   - this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []);
  1146 + this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []);
1148 1147 } else {
1149   - // this.setState({ sPackDetailPath: imageUrlNew });
1150 1148 this.props.onChange(this.props.name, sName, { sPackDetailPathUpLoad: imageUrlNew }, this.props.sId, []);
1151 1149 }
1152 1150 } else if (response && response.code === -1) {
... ...
src/components/QuickQuote/index.jsx
... ... @@ -1299,11 +1299,13 @@ const MasterComponent = props =&gt; {
1299 1299  
1300 1300 const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible);
1301 1301 // 处理长宽样式
1302   - const viewConfigs =
1303   - selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶"
1304   - ? ableConfigs
1305   - : ableConfigs.filter(x => x.sName !== "dHeight");
1306   - if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶") {
  1302 + // selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶"
  1303 + // ? ableConfigs
  1304 + // : ableConfigs.filter(x => x.sName !== "dHeight");
  1305 + const { sStripType = 0 } = selectedNode;
  1306 + // {"0":"长宽高","1":"高宽"} ,0显示长宽高,1显示宽高
  1307 + const viewConfigs = Number(sStripType) === 0 ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight");
  1308 + if (Number(sStripType) === 0) {
1307 1309 viewConfigs.forEach(item => {
1308 1310 if (item.sName === "dLength" || item.sName === "dWidth") {
1309 1311 item.iColValue = 4;
... ... @@ -1454,7 +1456,6 @@ const BoxComponent = props =&gt; {
1454 1456 }
1455 1457 return item.iTag === iTag;
1456 1458 });
1457   - console.log(selectedNode, "selectedNode");
1458 1459  
1459 1460 let boxConfigList = [];
1460 1461 if (iTag === 20) {
... ... @@ -2631,7 +2632,8 @@ const BoxModelSelectedModal = props =&gt; {
2631 2632 const getSvgProps = svg => {
2632 2633 if (!svg) return;
2633 2634 const { sColumnNameConfig, sBoxType, sBoxBody, dBoxLength, dBoxWidth, dBoxHeight, sTypes } = svg;
2634   - const slaveData = JSON.parse(sColumnNameConfig);
  2635 + const slaveData = sColumnNameConfig ? JSON.parse(sColumnNameConfig) : null;
  2636 + if (!slaveData) return;
2635 2637 const boxList = [];
2636 2638 const tables = [
2637 2639 { name: "盒型类别", value: sBoxType, type: null },
... ...
src/mobile/quotation/detailNew.jsx
... ... @@ -1040,7 +1040,7 @@ const QuotationAllprogressDetail = baseProps =&gt; {
1040 1040 };
1041 1041 });
1042 1042 };
1043   - if (selectedNode.sTypeKey === "juantong") {
  1043 + if (selectedNode.sProductType === "不干胶") {
1044 1044 props.onSaveState({
1045 1045 masterData: { ...props.masterData, sFormId: "101251240115016002356125200" },
1046 1046 });
... ... @@ -1075,10 +1075,10 @@ const QuotationDetail = props =&gt; {
1075 1075 const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible);
1076 1076 // 处理长宽样式
1077 1077 const viewConfigs =
1078   - selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sTypeKey !== "juantong"
  1078 + selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sTypeKey !== "不干胶"
1079 1079 ? ableConfigs
1080 1080 : ableConfigs.filter(x => x.sName !== "dHeight");
1081   - if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") {
  1081 + if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶") {
1082 1082 viewConfigs.forEach(item => {
1083 1083 if (item.sName === "dLength" || item.sName === "dWidth") {
1084 1084 item.iColValue = 4;
... ... @@ -1432,7 +1432,7 @@ const BoxComponent = props =&gt; {
1432 1432 if (
1433 1433 (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) ||
1434 1434 (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) ||
1435   - (selectedNode.sTypeKey === "juantong" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth))
  1435 + (selectedNode.sProductType === "不干胶" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth))
1436 1436 {
1437 1437 const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig);
1438 1438 const tables = [
... ... @@ -1547,7 +1547,24 @@ const BoxComponent = props =&gt; {
1547 1547 ) {
1548 1548 return false;
1549 1549 }
1550   - if (selectedNode.sTypeKey !== "kapai" && item.sName === "sMagnification") {
  1550 + const rateList = [
  1551 + { id: 0, name: "不显示倍率" },
  1552 + { id: 1, name: "每本张数" },
  1553 + { id: 2, name: "片数" },
  1554 + ];
  1555 + if (Number(selectedNode.iRateType) === 0 && item.sName === "sMagnification") {
  1556 + return false;
  1557 + } else {
  1558 + if (item.sName === "sMagnification") {
  1559 + item.showName = rateList.find(rate => rate.id === Number(selectedNode.iRateType))?.name || "倍率";
  1560 + }
  1561 + }
  1562 + if (item.sName === "sPaperDirection" && selectedNode.sTypeKey === "huace") {
  1563 + return false;
  1564 + }
  1565 + // 判断bPartsDimension 是否显示展长展宽,0不显示,1显示
  1566 +
  1567 + if (selectedNode.bPartsDimension === false && (item.sName === "dPartsLength" || item.sName === "dPartsWidth")) {
1551 1568 return false;
1552 1569 }
1553 1570 return item.iTag === iTag;
... ... @@ -1555,11 +1572,11 @@ const BoxComponent = props =&gt; {
1555 1572 let boxConfigList = [];
1556 1573 if (iTag === 20) {
1557 1574 let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"];
1558   - if (selectedNode.sTypeKey === "juantong") {
  1575 + if (selectedNode.sProductType === "不干胶") {
1559 1576 showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"];
1560 1577 }
1561 1578 boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || [];
1562   - if (selectedNode.sTypeKey === "juantong") {
  1579 + if (selectedNode.sProductType === "不干胶") {
1563 1580 const mappings = {
1564 1581 dZBLB: "留边",
1565 1582 dXBJJ: "跳距",
... ... @@ -1599,7 +1616,7 @@ const BoxComponent = props =&gt; {
1599 1616 // 印刷参数表单
1600 1617 let upViewProps12 = getUpViewPropsByITag(12);
1601 1618  
1602   - const filterConditions = {
  1619 +const filterConditions = {
1603 1620 juantong: x =>
1604 1621 x.sName === "sMagnification" ||
1605 1622 x.sName === "dPartsLength" ||
... ... @@ -1607,13 +1624,13 @@ const BoxComponent = props =&gt; {
1607 1624 x.sName === "dRowGap" ||
1608 1625 x.sName === "dColGap" ||
1609 1626 x.sName === "sPaperDirection",
1610   - default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth",
  1627 + default: x => x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" || x.sName === "dSumPQty",
1611 1628 };
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);
  1629 + if (upViewProps12 && selectedNode.sProductType === "不干胶") {
  1630 + upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.juantong);
  1631 + }
  1632 + if (upViewProps12 && !(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) {
  1633 + upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.default);
1617 1634 }
1618 1635 // 拼板信息表单
1619 1636 const upViewProps20 = getUpViewPropsByITag(20);
... ... @@ -1765,7 +1782,7 @@ const BoxComponent = props =&gt; {
1765 1782 };
1766 1783 let juantongConfig = {};
1767 1784  
1768   - if (selectedNode.sTypeKey === "juantong") {
  1785 + if (selectedNode.sProductType === "不干胶") {
1769 1786 const { dYBJJ, dXBJJ, dZBLB } = slaveData[index];
1770 1787 juantongConfig = {
1771 1788 dColGap: dYBJJ,
... ... @@ -1944,7 +1961,7 @@ const BoxComponent = props =&gt; {
1944 1961 };
1945 1962  
1946 1963 useEffect(() => {
1947   - if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
  1964 + if (selectedNode.sTypeKey === "kapai" || selectedNode.sProductType === "不干胶") {
1948 1965 const data = selectList.find(x => x.sTypes === "6");
1949 1966 if (!data) return;
1950 1967 const currentBoxModel = "slaveUp" + props.boxModel;
... ...