Commit e32e83c7ceadb134b6e029148d1c402f26893d7f
1 parent
8b16dc30
快速报价展示图片
Showing
3 changed files
with
59 additions
and
44 deletions
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -1137,7 +1137,7 @@ export default class CommonComponent extends Component { |
| 1137 | 1137 | this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []); |
| 1138 | 1138 | } else { |
| 1139 | 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 | 1142 | } else if (response && response.code === -1) { |
| 1143 | 1143 | message.error(response.msg); |
| ... | ... | @@ -1148,7 +1148,7 @@ export default class CommonComponent extends Component { |
| 1148 | 1148 | showUploadList: false, |
| 1149 | 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 | 1152 | return ( |
| 1153 | 1153 | <div> |
| 1154 | 1154 | <Upload | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -246,7 +246,6 @@ const QuickQuoteEvent = props => { |
| 246 | 246 | handleType: slaveData[iIndex].handleType || "update", |
| 247 | 247 | }; |
| 248 | 248 | } |
| 249 | - | |
| 250 | 249 | } else { |
| 251 | 250 | if (iIndex === -1) { |
| 252 | 251 | slaveData.push({ |
| ... | ... | @@ -904,6 +903,7 @@ const QuickQuoteEvent = props => { |
| 904 | 903 | }; |
| 905 | 904 | // 入口 |
| 906 | 905 | const QuickQuote = baseProps => { |
| 906 | + console.log("🚀 ~ baseProps:", baseProps); | |
| 907 | 907 | const props = QuickQuoteEvent(baseProps); |
| 908 | 908 | const [treeClassName, setTreeClassName] = useState(""); |
| 909 | 909 | |
| ... | ... | @@ -1323,7 +1323,6 @@ const BoxComponent = props => { |
| 1323 | 1323 | return props.getSqlDropDownData(...args); |
| 1324 | 1324 | }, |
| 1325 | 1325 | extraContent: child => { |
| 1326 | - | |
| 1327 | 1326 | const value = sBackProcessData.find(item => item[child.sName]) || {}; |
| 1328 | 1327 | const { bSetArea, bSetQty, sName, sSetQtyUnt } = value; |
| 1329 | 1328 | |
| ... | ... | @@ -1424,7 +1423,7 @@ const BoxComponent = props => { |
| 1424 | 1423 | ); |
| 1425 | 1424 | }, |
| 1426 | 1425 | }; |
| 1427 | - | |
| 1426 | + | |
| 1428 | 1427 | // 获取sType为3的 |
| 1429 | 1428 | const { productProcessInfo = [] } = masterData; |
| 1430 | 1429 | const finishedViewProps = { |
| ... | ... | @@ -1645,6 +1644,8 @@ const BoxComponent = props => { |
| 1645 | 1644 | }); |
| 1646 | 1645 | }); |
| 1647 | 1646 | } |
| 1647 | + console.log(slaveRowData, "slaveRowData"); | |
| 1648 | + | |
| 1648 | 1649 | const svgProps = { |
| 1649 | 1650 | ...props, |
| 1650 | 1651 | boxList, |
| ... | ... | @@ -1718,14 +1719,24 @@ const BoxComponent = props => { |
| 1718 | 1719 | <div className={styles.boxPart1Right}> |
| 1719 | 1720 | <div className={styles.boxRreview}> |
| 1720 | 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 | 1725 | <div style={{ width: " 300px", height: "300px" }}> |
| 1724 | 1726 | <DynamicSVG {...svgProps} /> |
| 1725 | 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 | 1740 | {/* <div className={styles.boxRreviewTitile}>展开图</div> */} |
| 1730 | 1741 | {slaveRowData.sPackPath ? ( |
| 1731 | 1742 | <Image width={300} src={slaveRowData.sPackPath} /> |
| ... | ... | @@ -1944,7 +1955,6 @@ const ManyComponent = props => { |
| 1944 | 1955 | |
| 1945 | 1956 | // 核价事件 |
| 1946 | 1957 | const onCalcPrice = () => { |
| 1947 | - | |
| 1948 | 1958 | const addState = { |
| 1949 | 1959 | ...props.onGetAllDelData(), |
| 1950 | 1960 | manyDataCache: [], |
| ... | ... | @@ -2106,7 +2116,7 @@ const BoxModelSelectedModal = props => { |
| 2106 | 2116 | ["iOrder", "#", 60], |
| 2107 | 2117 | // ["sBoxId", "盒型ID"], |
| 2108 | 2118 | ["sName", "名称", 119], |
| 2109 | - ["sPackDetailPath", "刀线图", 300], | |
| 2119 | + ["sPackDetailPathUpLoad", "刀线图", 300], | |
| 2110 | 2120 | // ["sPackDetailPathUpLoad", "刀线图", 300], |
| 2111 | 2121 | ["sPackPath", "3D图", 300], |
| 2112 | 2122 | ["operation", "操作", 80], |
| ... | ... | @@ -2243,13 +2253,14 @@ const BoxModelSelectedModal = props => { |
| 2243 | 2253 | fixedHeight: "calc(100vh - 365px)", |
| 2244 | 2254 | noVlistTable: true, |
| 2245 | 2255 | onCostomColums: columns => { |
| 2256 | + console.log("🚀 ~ columns:", columns); | |
| 2246 | 2257 | columns |
| 2247 | 2258 | .filter(item => item.dataIndex?.includes("Path")) |
| 2248 | 2259 | .forEach(column => { |
| 2249 | 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 | 2261 | column.render = (value, record, index) => |
| 2251 | - column.dataIndex === "sPackDetailPath" ? ( | |
| 2252 | - boxData[index].sPackDetailPathUpLoad ? ( | |
| 2262 | + column.dataIndex === "sPackDetailPathUpLoad" ? ( | |
| 2263 | + value ? ( | |
| 2253 | 2264 | <img src={value} alt="" width={270} height={270} /> |
| 2254 | 2265 | ) : ( |
| 2255 | 2266 | <DynamicSVG {...getSvgProps(boxData[index])} /> | ... | ... |
src/mobile/quotation/detailNew.jsx
| ... | ... | @@ -107,22 +107,6 @@ const QuickQuoteEvent = props => { |
| 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 | 111 | useEffect(() => { |
| 128 | 112 | if (!formData.length) return; |
| ... | ... | @@ -183,7 +167,6 @@ const QuickQuoteEvent = props => { |
| 183 | 167 | } |
| 184 | 168 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); |
| 185 | 169 | } else if (name.includes("slave")) { |
| 186 | - | |
| 187 | 170 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); |
| 188 | 171 | if (sFieldName === "sName") { |
| 189 | 172 | if (!changeValue.sName) return; |
| ... | ... | @@ -553,8 +536,9 @@ const QuickQuoteEvent = props => { |
| 553 | 536 | const dataReturn = (await commonServices.postValueService(token, paramMap, url)).data; |
| 554 | 537 | |
| 555 | 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 | 542 | const { productClassify, partsNewInfo = [], productProcessInfo, partsInfo: partsOldInfo } = dataReturn.dataset.rows[0]; |
| 559 | 543 | |
| 560 | 544 | const slaveData = []; |
| ... | ... | @@ -1118,7 +1102,9 @@ const handleCalculation = async (bSave, nextProps, isWait) => { |
| 1118 | 1102 | }; |
| 1119 | 1103 | const getProps = baseProps => { |
| 1120 | 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 | 1108 | const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; |
| 1123 | 1109 | const body = { |
| 1124 | 1110 | sSqlCondition: { |
| ... | ... | @@ -1128,7 +1114,7 @@ const getProps = baseProps => { |
| 1128 | 1114 | pageNum: 1, |
| 1129 | 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 | 1118 | if (retrunData.data.code === 1) { |
| 1133 | 1119 | /* 获取数据集 */ |
| 1134 | 1120 | const { rows, totalPageCount, currentPageNo, totalCount } = retrunData.data.dataset; |
| ... | ... | @@ -1140,28 +1126,46 @@ const getProps = baseProps => { |
| 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 | 1147 | // 处理 formData |
| 1144 | - let propss = { | |
| 1148 | + let props = { | |
| 1145 | 1149 | ...baseProps, |
| 1146 | 1150 | selectedNode: quotationData, |
| 1147 | 1151 | state: {}, |
| 1148 | 1152 | manyDataCache: [], |
| 1149 | 1153 | token: baseProps.app.token, |
| 1150 | - onSaveState: newState => { | |
| 1151 | - propss = { ...propss, ...newState }; | |
| 1152 | - }, | |
| 1153 | - getSqlDropDownData: getSqlDropDownDatas, | |
| 1154 | + onSaveState: setState, | |
| 1155 | + getSqlDropDownData, | |
| 1154 | 1156 | onMaterialsChange: handleMaterialsChange, |
| 1155 | 1157 | sortData, |
| 1156 | 1158 | handleCalculation, |
| 1157 | 1159 | }; |
| 1158 | 1160 | return { |
| 1159 | - ...baseProps, | |
| 1160 | - ...propss, | |
| 1161 | + ...props, | |
| 1162 | + ...state, | |
| 1161 | 1163 | }; |
| 1162 | 1164 | }; |
| 1163 | 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 | 1170 | const { selectedNode, location, quotationData, app, sModelsId } = props; |
| 1167 | 1171 | const { showName, sUnit } = quotationData; |
| ... | ... | @@ -2251,9 +2255,9 @@ const ManyComponent = props => { |
| 2251 | 2255 | dProductQty: baseCount, |
| 2252 | 2256 | dQuickQuoteProductQty: baseCount, |
| 2253 | 2257 | })); |
| 2254 | - // props.onSaveState({ | |
| 2255 | - // manyDataCache: [], | |
| 2256 | - // }); | |
| 2258 | + props.onSaveState({ | |
| 2259 | + manyDataCache: [], | |
| 2260 | + }); | |
| 2257 | 2261 | }, [masterData.dProductQty, manyData.length]); |
| 2258 | 2262 | const tableProps = { |
| 2259 | 2263 | ...commonBusiness.getTableTypes("many", { ...props, ...state }), | ... | ... |