Commit e32e83c7ceadb134b6e029148d1c402f26893d7f

Authored by 陈鑫涛
1 parent 8b16dc30

快速报价展示图片

src/components/Common/CommonComponent/index.js
@@ -1137,7 +1137,7 @@ export default class CommonComponent extends Component { @@ -1137,7 +1137,7 @@ export default class CommonComponent extends Component {
1137 this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []); 1137 this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []);
1138 } else { 1138 } else {
1139 // this.setState({ sPackDetailPath: imageUrlNew }); 1139 // this.setState({ sPackDetailPath: imageUrlNew });
1140 - this.props.onChange(this.props.name, sName, { sPackDetailPath: imageUrlNew }, this.props.sId, []); 1140 + this.props.onChange(this.props.name, sName, { sPackDetailPathUpLoad: imageUrlNew }, this.props.sId, []);
1141 } 1141 }
1142 } else if (response && response.code === -1) { 1142 } else if (response && response.code === -1) {
1143 message.error(response.msg); 1143 message.error(response.msg);
@@ -1148,7 +1148,7 @@ export default class CommonComponent extends Component { @@ -1148,7 +1148,7 @@ export default class CommonComponent extends Component {
1148 showUploadList: false, 1148 showUploadList: false,
1149 openFileDialogOnClick: this.props.enabled, 1149 openFileDialogOnClick: this.props.enabled,
1150 }; 1150 };
1151 - const imageUrl = sName === 'sPackPath' ? this.props.record.sPackPath : this.props.record.sPackDetailPath; 1151 + const imageUrl = sName === 'sPackPath' ? this.props.record.sPackPath : this.props.record.sPackDetailPathUpLoad;
1152 return ( 1152 return (
1153 <div> 1153 <div>
1154 <Upload 1154 <Upload
src/components/QuickQuote/index.jsx
@@ -246,7 +246,6 @@ const QuickQuoteEvent = props =&gt; { @@ -246,7 +246,6 @@ const QuickQuoteEvent = props =&gt; {
246 handleType: slaveData[iIndex].handleType || "update", 246 handleType: slaveData[iIndex].handleType || "update",
247 }; 247 };
248 } 248 }
249 -  
250 } else { 249 } else {
251 if (iIndex === -1) { 250 if (iIndex === -1) {
252 slaveData.push({ 251 slaveData.push({
@@ -904,6 +903,7 @@ const QuickQuoteEvent = props =&gt; { @@ -904,6 +903,7 @@ const QuickQuoteEvent = props =&gt; {
904 }; 903 };
905 // 入口 904 // 入口
906 const QuickQuote = baseProps => { 905 const QuickQuote = baseProps => {
  906 + console.log("🚀 ~ baseProps:", baseProps);
907 const props = QuickQuoteEvent(baseProps); 907 const props = QuickQuoteEvent(baseProps);
908 const [treeClassName, setTreeClassName] = useState(""); 908 const [treeClassName, setTreeClassName] = useState("");
909 909
@@ -1323,7 +1323,6 @@ const BoxComponent = props =&gt; { @@ -1323,7 +1323,6 @@ const BoxComponent = props =&gt; {
1323 return props.getSqlDropDownData(...args); 1323 return props.getSqlDropDownData(...args);
1324 }, 1324 },
1325 extraContent: child => { 1325 extraContent: child => {
1326 -  
1327 const value = sBackProcessData.find(item => item[child.sName]) || {}; 1326 const value = sBackProcessData.find(item => item[child.sName]) || {};
1328 const { bSetArea, bSetQty, sName, sSetQtyUnt } = value; 1327 const { bSetArea, bSetQty, sName, sSetQtyUnt } = value;
1329 1328
@@ -1424,7 +1423,7 @@ const BoxComponent = props =&gt; { @@ -1424,7 +1423,7 @@ const BoxComponent = props =&gt; {
1424 ); 1423 );
1425 }, 1424 },
1426 }; 1425 };
1427 - 1426 +
1428 // 获取sType为3的 1427 // 获取sType为3的
1429 const { productProcessInfo = [] } = masterData; 1428 const { productProcessInfo = [] } = masterData;
1430 const finishedViewProps = { 1429 const finishedViewProps = {
@@ -1645,6 +1644,8 @@ const BoxComponent = props =&gt; { @@ -1645,6 +1644,8 @@ const BoxComponent = props =&gt; {
1645 }); 1644 });
1646 }); 1645 });
1647 } 1646 }
  1647 + console.log(slaveRowData, "slaveRowData");
  1648 +
1648 const svgProps = { 1649 const svgProps = {
1649 ...props, 1650 ...props,
1650 boxList, 1651 boxList,
@@ -1718,14 +1719,24 @@ const BoxComponent = props =&gt; { @@ -1718,14 +1719,24 @@ const BoxComponent = props =&gt; {
1718 <div className={styles.boxPart1Right}> 1719 <div className={styles.boxPart1Right}>
1719 <div className={styles.boxRreview}> 1720 <div className={styles.boxRreview}>
1720 <Image.PreviewGroup> 1721 <Image.PreviewGroup>
1721 - {svgProps.boxList.length ? (  
1722 - // <Image width={300} src={slaveRowData.sPackDetailPath} /> 1722 + {slaveRowData.sPackDetailPathUpLoad ? (
  1723 + <Image width={300} src={slaveRowData.sPackDetailPathUpLoad} />
  1724 + ) : svgProps.boxList.length ? (
1723 <div style={{ width: " 300px", height: "300px" }}> 1725 <div style={{ width: " 300px", height: "300px" }}>
1724 <DynamicSVG {...svgProps} /> 1726 <DynamicSVG {...svgProps} />
1725 </div> 1727 </div>
1726 ) : ( 1728 ) : (
1727 - <div className={styles.noImg}>暂无图片</div> 1729 + "暂无图片"
1728 )} 1730 )}
  1731 + {/* {svgProps.boxList.length ? (
  1732 + slaveRowData.sPackDetailPathUpLoad ?
  1733 + <Image width={300} src={slaveRowData.sPackDetailPathUpLoad} />:
  1734 + <div style={{ width: " 300px", height: "300px" }}>
  1735 + <DynamicSVG {...svgProps} />
  1736 + </div>
  1737 + ) : (
  1738 + <div className={styles.noImg}>暂无图片</div>
  1739 + )} */}
1729 {/* <div className={styles.boxRreviewTitile}>展开图</div> */} 1740 {/* <div className={styles.boxRreviewTitile}>展开图</div> */}
1730 {slaveRowData.sPackPath ? ( 1741 {slaveRowData.sPackPath ? (
1731 <Image width={300} src={slaveRowData.sPackPath} /> 1742 <Image width={300} src={slaveRowData.sPackPath} />
@@ -1944,7 +1955,6 @@ const ManyComponent = props =&gt; { @@ -1944,7 +1955,6 @@ const ManyComponent = props =&gt; {
1944 1955
1945 // 核价事件 1956 // 核价事件
1946 const onCalcPrice = () => { 1957 const onCalcPrice = () => {
1947 -  
1948 const addState = { 1958 const addState = {
1949 ...props.onGetAllDelData(), 1959 ...props.onGetAllDelData(),
1950 manyDataCache: [], 1960 manyDataCache: [],
@@ -2106,7 +2116,7 @@ const BoxModelSelectedModal = props =&gt; { @@ -2106,7 +2116,7 @@ const BoxModelSelectedModal = props =&gt; {
2106 ["iOrder", "#", 60], 2116 ["iOrder", "#", 60],
2107 // ["sBoxId", "盒型ID"], 2117 // ["sBoxId", "盒型ID"],
2108 ["sName", "名称", 119], 2118 ["sName", "名称", 119],
2109 - ["sPackDetailPath", "刀线图", 300], 2119 + ["sPackDetailPathUpLoad", "刀线图", 300],
2110 // ["sPackDetailPathUpLoad", "刀线图", 300], 2120 // ["sPackDetailPathUpLoad", "刀线图", 300],
2111 ["sPackPath", "3D图", 300], 2121 ["sPackPath", "3D图", 300],
2112 ["operation", "操作", 80], 2122 ["operation", "操作", 80],
@@ -2243,13 +2253,14 @@ const BoxModelSelectedModal = props =&gt; { @@ -2243,13 +2253,14 @@ const BoxModelSelectedModal = props =&gt; {
2243 fixedHeight: "calc(100vh - 365px)", 2253 fixedHeight: "calc(100vh - 365px)",
2244 noVlistTable: true, 2254 noVlistTable: true,
2245 onCostomColums: columns => { 2255 onCostomColums: columns => {
  2256 + console.log("🚀 ~ columns:", columns);
2246 columns 2257 columns
2247 .filter(item => item.dataIndex?.includes("Path")) 2258 .filter(item => item.dataIndex?.includes("Path"))
2248 .forEach(column => { 2259 .forEach(column => {
2249 // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片"); 2260 // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片");
2250 column.render = (value, record, index) => 2261 column.render = (value, record, index) =>
2251 - column.dataIndex === "sPackDetailPath" ? (  
2252 - boxData[index].sPackDetailPathUpLoad ? ( 2262 + column.dataIndex === "sPackDetailPathUpLoad" ? (
  2263 + value ? (
2253 <img src={value} alt="" width={270} height={270} /> 2264 <img src={value} alt="" width={270} height={270} />
2254 ) : ( 2265 ) : (
2255 <DynamicSVG {...getSvgProps(boxData[index])} /> 2266 <DynamicSVG {...getSvgProps(boxData[index])} />
src/mobile/quotation/detailNew.jsx
@@ -107,22 +107,6 @@ const QuickQuoteEvent = props =&gt; { @@ -107,22 +107,6 @@ const QuickQuoteEvent = props =&gt; {
107 } 107 }
108 }); 108 });
109 }, []); 109 }, []);
110 - // 获取主表信息  
111 - useEffect(() => {  
112 - const configUrl = `${commonConfig.server_host}business/getModelBysId/${props.sModelsId}?sModelsId=${props.sModelsId}`;  
113 - commonServices  
114 - .getService(props.app.token, configUrl)  
115 - .then(({ data: masterReturn }) => {  
116 - if (masterReturn.code === 1) {  
117 - const materFormData = masterReturn.dataset.rows[0].formData;  
118 - const processConfig = materFormData.find(x => x.sTbName === "QuoQuotationprocess");  
119 - const materialsConfig = materFormData.find(x => x.sTbName === "QuoQuotationmaterials");  
120 - setMasterConfig(materFormData);  
121 - setState(pre => ({ ...pre, processConfig, materialsConfig }));  
122 - }  
123 - })  
124 - .catch(error => {});  
125 - }, [props.sModelsId]);  
126 // 获取盒型定义配置 110 // 获取盒型定义配置
127 useEffect(() => { 111 useEffect(() => {
128 if (!formData.length) return; 112 if (!formData.length) return;
@@ -183,7 +167,6 @@ const QuickQuoteEvent = props =&gt; { @@ -183,7 +167,6 @@ const QuickQuoteEvent = props =&gt; {
183 } 167 }
184 setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); 168 setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState }));
185 } else if (name.includes("slave")) { 169 } else if (name.includes("slave")) {
186 -  
187 const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); 170 const boxModel = name.replace("slaveUp", "").replace("slaveDown", "");
188 if (sFieldName === "sName") { 171 if (sFieldName === "sName") {
189 if (!changeValue.sName) return; 172 if (!changeValue.sName) return;
@@ -553,8 +536,9 @@ const QuickQuoteEvent = props =&gt; { @@ -553,8 +536,9 @@ const QuickQuoteEvent = props =&gt; {
553 const dataReturn = (await commonServices.postValueService(token, paramMap, url)).data; 536 const dataReturn = (await commonServices.postValueService(token, paramMap, url)).data;
554 537
555 if (dataReturn.code === 1) { 538 if (dataReturn.code === 1) {
556 - const { app, sModelsId } = props;  
557 - const { slaveConfig, masterData: masterData1, processConfig, materialsConfig } = state; 539 + // const { app, sModelsId } = props;
  540 + // const { slaveConfig, masterData: masterData1, processConfig, materialsConfig } = state;
  541 + const { slaveConfig, masterData: masterData1, materialsConfig, processConfig, sModelsId, app } = props;
558 const { productClassify, partsNewInfo = [], productProcessInfo, partsInfo: partsOldInfo } = dataReturn.dataset.rows[0]; 542 const { productClassify, partsNewInfo = [], productProcessInfo, partsInfo: partsOldInfo } = dataReturn.dataset.rows[0];
559 543
560 const slaveData = []; 544 const slaveData = [];
@@ -1118,7 +1102,9 @@ const handleCalculation = async (bSave, nextProps, isWait) =&gt; { @@ -1118,7 +1102,9 @@ const handleCalculation = async (bSave, nextProps, isWait) =&gt; {
1118 }; 1102 };
1119 const getProps = baseProps => { 1103 const getProps = baseProps => {
1120 const { location, quotationData, app, sModelsId } = baseProps; 1104 const { location, quotationData, app, sModelsId } = baseProps;
1121 - const getSqlDropDownDatas = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { 1105 + const { token } = app;
  1106 + const [state, setState] = useState(null);
  1107 + const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => {
1122 const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; 1108 const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`;
1123 const body = { 1109 const body = {
1124 sSqlCondition: { 1110 sSqlCondition: {
@@ -1128,7 +1114,7 @@ const getProps = baseProps =&gt; { @@ -1128,7 +1114,7 @@ const getProps = baseProps =&gt; {
1128 pageNum: 1, 1114 pageNum: 1,
1129 pageSize: 20, 1115 pageSize: 20,
1130 }; 1116 };
1131 - const retrunData = await commonServices.postValueService(propss.token, body, url); 1117 + const retrunData = await commonServices.postValueService(props.token, body, url);
1132 if (retrunData.data.code === 1) { 1118 if (retrunData.data.code === 1) {
1133 /* 获取数据集 */ 1119 /* 获取数据集 */
1134 const { rows, totalPageCount, currentPageNo, totalCount } = retrunData.data.dataset; 1120 const { rows, totalPageCount, currentPageNo, totalCount } = retrunData.data.dataset;
@@ -1140,28 +1126,46 @@ const getProps = baseProps =&gt; { @@ -1140,28 +1126,46 @@ const getProps = baseProps =&gt; {
1140 }; 1126 };
1141 } 1127 }
1142 }; 1128 };
  1129 +
  1130 + // 获取主表信息
  1131 + useEffect(() => {
  1132 + const configUrl = `${commonConfig.server_host}business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}`;
  1133 + commonServices
  1134 + .getService(token, configUrl)
  1135 + .then(({ data: masterReturn }) => {
  1136 + if (masterReturn.code === 1) {
  1137 + const formData = masterReturn.dataset.rows[0].formData;
  1138 + const processConfig = formData.find(x => x.sTbName === "QuoQuotationprocess");
  1139 + const materialsConfig = formData.find(x => x.sTbName === "QuoQuotationmaterials");
  1140 + const slaveConfig = formData.find(x => x.sTbName === "QuoQuotationslave");
  1141 + setState(pre => ({ ...pre, formData, processConfig, materialsConfig, slaveConfig }));
  1142 + }
  1143 + })
  1144 + .catch(error => {});
  1145 + }, [sModelsId]);
  1146 +
1143 // 处理 formData 1147 // 处理 formData
1144 - let propss = { 1148 + let props = {
1145 ...baseProps, 1149 ...baseProps,
1146 selectedNode: quotationData, 1150 selectedNode: quotationData,
1147 state: {}, 1151 state: {},
1148 manyDataCache: [], 1152 manyDataCache: [],
1149 token: baseProps.app.token, 1153 token: baseProps.app.token,
1150 - onSaveState: newState => {  
1151 - propss = { ...propss, ...newState };  
1152 - },  
1153 - getSqlDropDownData: getSqlDropDownDatas, 1154 + onSaveState: setState,
  1155 + getSqlDropDownData,
1154 onMaterialsChange: handleMaterialsChange, 1156 onMaterialsChange: handleMaterialsChange,
1155 sortData, 1157 sortData,
1156 handleCalculation, 1158 handleCalculation,
1157 }; 1159 };
1158 return { 1160 return {
1159 - ...baseProps,  
1160 - ...propss, 1161 + ...props,
  1162 + ...state,
1161 }; 1163 };
1162 }; 1164 };
1163 const QuotationAllprogressDetail = baseProps => { 1165 const QuotationAllprogressDetail = baseProps => {
1164 - const props = QuickQuoteEvent(getProps(baseProps)); 1166 + const masterProps = getProps(baseProps);
  1167 + console.log("🚀 ~ masterProps:", masterProps);
  1168 + const props = QuickQuoteEvent(masterProps);
1165 1169
1166 const { selectedNode, location, quotationData, app, sModelsId } = props; 1170 const { selectedNode, location, quotationData, app, sModelsId } = props;
1167 const { showName, sUnit } = quotationData; 1171 const { showName, sUnit } = quotationData;
@@ -2251,9 +2255,9 @@ const ManyComponent = props =&gt; { @@ -2251,9 +2255,9 @@ const ManyComponent = props =&gt; {
2251 dProductQty: baseCount, 2255 dProductQty: baseCount,
2252 dQuickQuoteProductQty: baseCount, 2256 dQuickQuoteProductQty: baseCount,
2253 })); 2257 }));
2254 - // props.onSaveState({  
2255 - // manyDataCache: [],  
2256 - // }); 2258 + props.onSaveState({
  2259 + manyDataCache: [],
  2260 + });
2257 }, [masterData.dProductQty, manyData.length]); 2261 }, [masterData.dProductQty, manyData.length]);
2258 const tableProps = { 2262 const tableProps = {
2259 ...commonBusiness.getTableTypes("many", { ...props, ...state }), 2263 ...commonBusiness.getTableTypes("many", { ...props, ...state }),