Commit 31d680e09615b1c15a5222f691c46312b3844490

Authored by 陈鑫涛
1 parent 7f17dfc3

盒型设计新增图片

src/components/Common/BoxDesignCompontent/svg.js
@@ -234,7 +234,6 @@ const SvgBox = props => { @@ -234,7 +234,6 @@ const SvgBox = props => {
234 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`; 234 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`;
235 } 235 }
236 } else if (props.showNew === 1) { 236 } else if (props.showNew === 1) {
237 - console.log("🚀 ~ initSVG ~ props:", props)  
238 let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale; 237 let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
239 let leftSize = 0; 238 let leftSize = 0;
240 let topSize = 0; 239 let topSize = 0;
src/components/Common/CommonComponent/index.js
@@ -1104,7 +1104,7 @@ export default class CommonComponent extends Component { @@ -1104,7 +1104,7 @@ export default class CommonComponent extends Component {
1104 if (sName === 'sIcon') { 1104 if (sName === 'sIcon') {
1105 return (<><Upload {...this.getUploadProps()}>{this.getUploadContents()}</Upload><Button {...this.getUploadButtonProps()}>X</Button></>); 1105 return (<><Upload {...this.getUploadProps()}>{this.getUploadContents()}</Upload><Button {...this.getUploadButtonProps()}>X</Button></>);
1106 } 1106 }
1107 - if (sName === 'sPackPath') { 1107 + if (sName === 'sPackPath' || sName === 'sPackDetailPathUpLoad') {
1108 const uploadProps = { 1108 const uploadProps = {
1109 listType: 'picture-card', 1109 listType: 'picture-card',
1110 className: 'avatar-uploader', 1110 className: 'avatar-uploader',
src/components/QuickQuote/index.jsx
@@ -906,7 +906,6 @@ const QuickQuoteEvent = props =&gt; { @@ -906,7 +906,6 @@ const QuickQuoteEvent = props =&gt; {
906 // 入口 906 // 入口
907 const QuickQuote = baseProps => { 907 const QuickQuote = baseProps => {
908 const props = QuickQuoteEvent(baseProps); 908 const props = QuickQuoteEvent(baseProps);
909 - console.log("🚀 ~ QuickQuote:", props)  
910 909
911 const [treeClassName, setTreeClassName] = useState(""); 910 const [treeClassName, setTreeClassName] = useState("");
912 911
@@ -919,7 +918,6 @@ const QuickQuote = baseProps =&gt; { @@ -919,7 +918,6 @@ const QuickQuote = baseProps =&gt; {
919 }, []); 918 }, []);
920 919
921 return ( 920 return (
922 -  
923 <div className={styles.quickQuote}> 921 <div className={styles.quickQuote}>
924 <div className={styles.content}> 922 <div className={styles.content}>
925 {!props.hideBackBtn && ( 923 {!props.hideBackBtn && (
@@ -1074,10 +1072,7 @@ const TreeComponent = props =&gt; { @@ -1074,10 +1072,7 @@ const TreeComponent = props =&gt; {
1074 selectedNode: select.selectedNodes[0]?.treeNode || {}, 1072 selectedNode: select.selectedNodes[0]?.treeNode || {},
1075 masterData: { ...masterData, sProductName: sProductName || select.node.title, sProductUnit: sProductUnit || select.node.treeNode.sUnit }, 1073 masterData: { ...masterData, sProductName: sProductName || select.node.title, sProductUnit: sProductUnit || select.node.treeNode.sUnit },
1076 }; 1074 };
1077 -  
1078 }); 1075 });
1079 - console.log(props,'Tree');  
1080 -  
1081 }} 1076 }}
1082 // defaultSelectedKeys={[activeTree]} 1077 // defaultSelectedKeys={[activeTree]}
1083 defaultExpandAll={true} 1078 defaultExpandAll={true}
@@ -1093,7 +1088,6 @@ const ContentComponent = props =&gt; { @@ -1093,7 +1088,6 @@ const ContentComponent = props =&gt; {
1093 const { selectedNode = {}, extraParts = {} } = props.state; 1088 const { selectedNode = {}, extraParts = {} } = props.state;
1094 const { showName } = selectedNode; 1089 const { showName } = selectedNode;
1095 const extraPartsList = extraParts[showName] || []; 1090 const extraPartsList = extraParts[showName] || [];
1096 - console.log("🚀 ~ extraPartsList:", extraPartsList)  
1097 let { sAllPartsName = "" } = selectedNode; 1091 let { sAllPartsName = "" } = selectedNode;
1098 let bEmpty = false; 1092 let bEmpty = false;
1099 if (commonUtils.isEmptyObject(selectedNode)) { 1093 if (commonUtils.isEmptyObject(selectedNode)) {
@@ -1104,7 +1098,6 @@ const ContentComponent = props =&gt; { @@ -1104,7 +1098,6 @@ const ContentComponent = props =&gt; {
1104 } 1098 }
1105 1099
1106 const boxModelList = sAllPartsName.split(","); 1100 const boxModelList = sAllPartsName.split(",");
1107 - console.log("🚀 ~ boxModelList:", boxModelList)  
1108 const [activeKey, setActiveKey] = useState(0); 1101 const [activeKey, setActiveKey] = useState(0);
1109 1102
1110 useEffect(() => { 1103 useEffect(() => {
@@ -1166,7 +1159,6 @@ const ContentComponent = props =&gt; { @@ -1166,7 +1159,6 @@ const ContentComponent = props =&gt; {
1166 } 1159 }
1167 }; 1160 };
1168 1161
1169 - console.log("🚀 ~ props:", props)  
1170 return ( 1162 return (
1171 <> 1163 <>
1172 {/* <Divider {...dividerProps}>产品参数</Divider> */} 1164 {/* <Divider {...dividerProps}>产品参数</Divider> */}
@@ -1267,8 +1259,7 @@ const BoxComponent = props =&gt; { @@ -1267,8 +1259,7 @@ const BoxComponent = props =&gt; {
1267 }; 1259 };
1268 1260
1269 const getUpViewPropsByITag = iTag => { 1261 const getUpViewPropsByITag = iTag => {
1270 - console.log(slaveConfig,'slaveConfig1');  
1271 - 1262 +
1272 const config = slaveConfig.gdsconfigformslave.filter(item => { 1263 const config = slaveConfig.gdsconfigformslave.filter(item => {
1273 if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { 1264 if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") {
1274 return false; 1265 return false;
@@ -1518,10 +1509,10 @@ const BoxComponent = props =&gt; { @@ -1518,10 +1509,10 @@ const BoxComponent = props =&gt; {
1518 materialWidth, 1509 materialWidth,
1519 bBox: true, // 快速报价盒型展示 1510 bBox: true, // 快速报价盒型展示
1520 }; 1511 };
  1512 +
1521 let boxList = []; 1513 let boxList = [];
1522 if (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) { 1514 if (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) {
1523 const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); 1515 const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig);
1524 - console.log("🚀 ~ slaveRowData:", slaveRowData)  
1525 const tables = [ 1516 const tables = [
1526 { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, 1517 { name: "盒型类别", value: slaveRowData.sBoxType, type: null },
1527 { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, 1518 { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes },
@@ -1905,8 +1896,7 @@ const ManyComponent = props =&gt; { @@ -1905,8 +1896,7 @@ const ManyComponent = props =&gt; {
1905 1896
1906 // 核价事件 1897 // 核价事件
1907 const onCalcPrice = () => { 1898 const onCalcPrice = () => {
1908 - console.log(props,'propsprops');  
1909 - 1899 +
1910 const addState = { 1900 const addState = {
1911 ...props.onGetAllDelData(), 1901 ...props.onGetAllDelData(),
1912 manyDataCache: [], 1902 manyDataCache: [],
@@ -2043,7 +2033,10 @@ const ManyComponent = props =&gt; { @@ -2043,7 +2033,10 @@ const ManyComponent = props =&gt; {
2043 2033
2044 // 选择盒型弹窗 2034 // 选择盒型弹窗
2045 const BoxModelSelectedModal = props => { 2035 const BoxModelSelectedModal = props => {
2046 - const { boxModelSelectedModalVisible } = props; 2036 + const { dividerProps, state, boxModel, boxModelSelectedModalVisible } = props;
  2037 + const { masterData = {}, slaveConfig, slaveData = [], selectedNode = {}, downAbleConfigs = [], finishedConfigs = [] } = state;
  2038 + const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
  2039 +
2047 if (!boxModelSelectedModalVisible) return ""; 2040 if (!boxModelSelectedModalVisible) return "";
2048 2041
2049 const onCancel = () => { 2042 const onCancel = () => {
@@ -2066,10 +2059,10 @@ const BoxModelSelectedModal = props =&gt; { @@ -2066,10 +2059,10 @@ const BoxModelSelectedModal = props =&gt; {
2066 // ["sBoxId", "盒型ID"], 2059 // ["sBoxId", "盒型ID"],
2067 ["sName", "名称", 119], 2060 ["sName", "名称", 119],
2068 ["sPackDetailPath", "刀线图", 300], 2061 ["sPackDetailPath", "刀线图", 300],
  2062 + // ["sPackDetailPathUpLoad", "刀线图", 300],
2069 ["sPackPath", "3D图", 300], 2063 ["sPackPath", "3D图", 300],
2070 ["operation", "操作", 80], 2064 ["operation", "操作", 80],
2071 ]; 2065 ];
2072 -  
2073 const config = { 2066 const config = {
2074 sId: commonUtils.createSid(), 2067 sId: commonUtils.createSid(),
2075 // bisMutiSelect: true, 2068 // bisMutiSelect: true,
@@ -2129,6 +2122,67 @@ const BoxModelSelectedModal = props =&gt; { @@ -2129,6 +2122,67 @@ const BoxModelSelectedModal = props =&gt; {
2129 )), 2122 )),
2130 [boxTypeList.length] 2123 [boxTypeList.length]
2131 ); 2124 );
  2125 + const getSvgProps = svg => {
  2126 + if (!svg) return;
  2127 + const { sColumnNameConfig, sBoxType, sBoxBody, dBoxLength, dBoxWidth, dBoxHeight, sTypes } = svg;
  2128 + const slaveData = JSON.parse(sColumnNameConfig);
  2129 + const boxList = [];
  2130 + const tables = [
  2131 + { name: "盒型类别", value: sBoxType, type: null },
  2132 + { name: "盒身", value: sBoxBody, type: sTypes },
  2133 + { name: "盒长", value: dBoxLength, type: null },
  2134 + { name: "盒宽", value: dBoxWidth, type: null },
  2135 + { name: "盒高", value: dBoxHeight, type: null },
  2136 + ];
  2137 + // const { slaveData = [] } = this.props;
  2138 + const titleList1 = [
  2139 + { name: "上方盒舌", value: "dSFHS" },
  2140 + { name: "盒底组件", value: "dHDC" },
  2141 + { name: "下方盒舌", value: "dXFHS" },
  2142 + { name: "左(上)插位组件", value: "dZSCW" },
  2143 + { name: "左贴边位", value: "dZTBW" },
  2144 + { name: "左(下)插位组件", value: "dZXCW" },
  2145 + { name: "右(上)插位组件", value: "dYSCW" },
  2146 + { name: "右贴边位", value: "dYTBW" },
  2147 + { name: "右(下)插位组件", value: "dYXCW" },
  2148 + ];
  2149 + slaveData.forEach(x => {
  2150 + boxList.push({
  2151 + value: x.iValue,
  2152 + sName: titleList1.find(item => item.value === x.sCode)?.name || "",
  2153 + isEditable: true,
  2154 + isSelect: false,
  2155 + selectValue: null,
  2156 + selectLabel: "",
  2157 + selectImage: null,
  2158 + type: x.sTypes || null,
  2159 + show: true,
  2160 + showName: x.sName, // 参数名称
  2161 + });
  2162 + });
  2163 + tables.forEach(x => {
  2164 + boxList.push({
  2165 + value: x.value,
  2166 + sName: x.name,
  2167 + isEditable: true,
  2168 + isSelect: false,
  2169 + selectValue: null,
  2170 + selectLabel: "",
  2171 + selectImage: null,
  2172 + type: x.type || null,
  2173 + show: true,
  2174 + showName: x.name, // 参数名称
  2175 + });
  2176 + });
  2177 + const svgProps = {
  2178 + ...props,
  2179 + boxList,
  2180 + dSvgBoxWidth: 100,
  2181 + dSvgBoxHeight: 100,
  2182 + showNew: 1,
  2183 + };
  2184 + return svgProps;
  2185 + };
2132 2186
2133 const tableProps = { 2187 const tableProps = {
2134 ...commonBusiness.getTableTypes("box", { 2188 ...commonBusiness.getTableTypes("box", {
@@ -2144,7 +2198,19 @@ const BoxModelSelectedModal = props =&gt; { @@ -2144,7 +2198,19 @@ const BoxModelSelectedModal = props =&gt; {
2144 columns 2198 columns
2145 .filter(item => item.dataIndex?.includes("Path")) 2199 .filter(item => item.dataIndex?.includes("Path"))
2146 .forEach(column => { 2200 .forEach(column => {
2147 - column.render = (value, record, index) => (value ? <img src={value} alt="" width={270} height={270} /> : "暂无图片"); 2201 + // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片");
  2202 + column.render = (value, record, index) =>
  2203 + column.dataIndex === "sPackDetailPath" ? (
  2204 + boxData[index].sPackDetailPathUpLoad ? (
  2205 + <img src={value} alt="" width={270} height={270} />
  2206 + ) : (
  2207 + <DynamicSVG {...getSvgProps(boxData[index])} />
  2208 + )
  2209 + ) : value ? (
  2210 + <img src={value} alt="" width={270} height={270} />
  2211 + ) : (
  2212 + "暂无图片"
  2213 + );
2148 }); 2214 });
2149 2215
2150 columns 2216 columns
src/mobile/components/SelectInput.jsx
@@ -9,7 +9,6 @@ import styles from &quot;./selectInput.less&quot;; @@ -9,7 +9,6 @@ import styles from &quot;./selectInput.less&quot;;
9 import debounce from "lodash/debounce"; 9 import debounce from "lodash/debounce";
10 10
11 const SelectInput = props => { 11 const SelectInput = props => {
12 - console.log("🚀 ~ selectInputValue:", props);  
13 const [value, setValue] = useState(props.sValue || ""); // 如果存在 name 属性,将其值赋值给 value 12 const [value, setValue] = useState(props.sValue || ""); // 如果存在 name 属性,将其值赋值给 value
14 const [values, setValues] = useState(""); 13 const [values, setValues] = useState("");
15 const [searchValue, setSearchValue] = useState(""); 14 const [searchValue, setSearchValue] = useState("");
@@ -24,7 +23,6 @@ const SelectInput = props =&gt; { @@ -24,7 +23,6 @@ const SelectInput = props =&gt; {
24 // }, [props.sValue]); 23 // }, [props.sValue]);
25 useEffect(() => { 24 useEffect(() => {
26 if (!itemDetail) return; 25 if (!itemDetail) return;
27 - console.log(itemDetail, tableName, "viewRowNew");  
28 26
29 const viewRowNew = itemDetail.sName ? viewRow?.[itemDetail.sName] : ""; 27 const viewRowNew = itemDetail.sName ? viewRow?.[itemDetail.sName] : "";
30 setValue(viewRowNew || ""); // 动态更新 value 28 setValue(viewRowNew || ""); // 动态更新 value
@@ -35,7 +33,7 @@ const SelectInput = props =&gt; { @@ -35,7 +33,7 @@ const SelectInput = props =&gt; {
35 const url = `${commonConfig.server_host}business/getSelectLimit/${sId}?sModelsId=${sModelsId}&sName=${""}`; 33 const url = `${commonConfig.server_host}business/getSelectLimit/${sId}?sModelsId=${sModelsId}&sName=${""}`;
36 const body = { 34 const body = {
37 sSqlCondition: { 35 sSqlCondition: {
38 - sProductClassifyId: quotationData.sId, 36 + sProductClassifyId: quotationData?quotationData.sId:'',
39 }, 37 },
40 sKeyUpFilterName: searchValue, 38 sKeyUpFilterName: searchValue,
41 pageNum: 1, 39 pageNum: 1,
@@ -82,8 +80,6 @@ const SelectInput = props =&gt; { @@ -82,8 +80,6 @@ const SelectInput = props =&gt; {
82 debouncedChangeOption(val); 80 debouncedChangeOption(val);
83 }; 81 };
84 useEffect(() => { 82 useEffect(() => {
85 - console.log("🚀 ~ useEffect ~ itemDetailssss:", itemDetail)  
86 -  
87 if (!visible) return; 83 if (!visible) return;
88 let { sDropDownType } = itemDetail; 84 let { sDropDownType } = itemDetail;
89 if (sDropDownType === "sql") { 85 if (sDropDownType === "sql") {
src/mobile/quotation/detailNew.jsx
@@ -14,7 +14,6 @@ import Typesetting from &quot;@/components/Common/Typesetting/typesetting&quot;; @@ -14,7 +14,6 @@ import Typesetting from &quot;@/components/Common/Typesetting/typesetting&quot;;
14 import DynamicSVG from "@/components/Common/BoxDesignCompontent/svg"; 14 import DynamicSVG from "@/components/Common/BoxDesignCompontent/svg";
15 import ShowImgM from "@/components/Common/BoxShowImgMaterial/indexNew"; 15 import ShowImgM from "@/components/Common/BoxShowImgMaterial/indexNew";
16 const QuickQuoteEvent = props => { 16 const QuickQuoteEvent = props => {
17 - console.log("🚀 ~ QuickQuoteEvent:", props);  
18 const { location } = props; 17 const { location } = props;
19 const selectedNode = JSON.parse(location.state).quotationData; 18 const selectedNode = JSON.parse(location.state).quotationData;
20 const addState = {}; 19 const addState = {};
@@ -81,7 +80,7 @@ const QuickQuoteEvent = props =&gt; { @@ -81,7 +80,7 @@ const QuickQuoteEvent = props =&gt; {
81 80
82 const sQuoConfig = commonUtils.convertStrToObj(props.masterData.sQuoConfig, {}); 81 const sQuoConfig = commonUtils.convertStrToObj(props.masterData.sQuoConfig, {});
83 82
84 - const [state, setState] = useState(addState.onGetFilterState(sQuoConfig, true)); 83 + const [state, setState] = useState(props.state);
85 84
86 const { formData = [] } = state; 85 const { formData = [] } = state;
87 const { bLinkFieledClick } = props; 86 const { bLinkFieledClick } = props;
@@ -896,23 +895,18 @@ const QuickQuoteEvent = props =&gt; { @@ -896,23 +895,18 @@ const QuickQuoteEvent = props =&gt; {
896 masterConfig: masterConfig && masterConfig.length ? masterConfig[0] : {}, 895 masterConfig: masterConfig && masterConfig.length ? masterConfig[0] : {},
897 }; 896 };
898 }; 897 };
899 -const getProps = props => {  
900 - const { state } = props;  
901 898
902 - return {  
903 - ...props,  
904 - };  
905 -};  
906 const QuotationAllprogressDetail = baseProps => { 899 const QuotationAllprogressDetail = baseProps => {
  900 + const { location } = baseProps;
907 // const props = QuickQuoteEvent(baseProps); 901 // const props = QuickQuoteEvent(baseProps);
908 - const [state, setState] = useState(JsonData.state); 902 + // const [state, setState] = useState(JsonData.state);
909 const propss = { 903 const propss = {
910 - ...baseProps, 904 + // ...baseProps,
  905 + location,
911 ...JsonData, 906 ...JsonData,
912 - setState,  
913 - state,  
914 }; 907 };
915 - const props = getProps(propss); 908 + const props = QuickQuoteEvent(propss);
  909 + console.log("🚀 ~ QuotationAllprogressDetail:", props);
916 return ( 910 return (
917 <div className={styles.quotationDetailBox}> 911 <div className={styles.quotationDetailBox}>
918 <QuotationDetail {...props} /> 912 <QuotationDetail {...props} />
@@ -1296,8 +1290,8 @@ const BoxComponent = props =&gt; { @@ -1296,8 +1290,8 @@ const BoxComponent = props =&gt; {
1296 viewRow: slaveRowData, 1290 viewRow: slaveRowData,
1297 tableName: `slaveDown${boxModel}`, 1291 tableName: `slaveDown${boxModel}`,
1298 }; 1292 };
1299 - console.log(downViewProps,'downViewProps');  
1300 - 1293 + console.log(downViewProps, "downViewProps");
  1294 +
1301 const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []); 1295 const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []);
1302 const radioValue = calcMethodData[0]?.sCode; 1296 const radioValue = calcMethodData[0]?.sCode;
1303 const [materialLength, setMaterialLength] = useState(0); 1297 const [materialLength, setMaterialLength] = useState(0);
@@ -1421,25 +1415,7 @@ const BoxComponent = props =&gt; { @@ -1421,25 +1415,7 @@ const BoxComponent = props =&gt; {
1421 setBoxPopup(true); 1415 setBoxPopup(true);
1422 } 1416 }
1423 }; 1417 };
1424 - useEffect(() => {  
1425 - // const boxModelData = slaveData.find(x => x.sBoxModel === boxModel);  
1426 - // const selectListDetail = selectList.find(x => x.sName === boxModelData?.sName);  
1427 - // const data = selectList.find(x => x.sId === selectListDetail.sId);  
1428 - // if (!data) return;  
1429 - // const slaveNewData = JSON.parse(data.sColumnNameConfig).map(x => {  
1430 - // return {  
1431 - // [x.sName]: x.sDefault,  
1432 - // };  
1433 - // });  
1434 - // const slaveDataDetail = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};  
1435 - // const rowData = {  
1436 - // ...slaveDataDetail,  
1437 - // ...data,  
1438 - // ...Object.assign({}, ...slaveNewData),  
1439 - // };  
1440 - // setSlaveRowData(rowData);  
1441 - // setSelected(selectListDetail?.sBoxType);  
1442 - }, [slaveData]); 1418 +
1443 return ( 1419 return (
1444 <div> 1420 <div>
1445 <Selector 1421 <Selector