From e32e83c7ceadb134b6e029148d1c402f26893d7f Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Thu, 12 Jun 2025 14:46:22 +0800 Subject: [PATCH] 快速报价展示图片 --- src/components/Common/CommonComponent/index.js | 4 ++-- src/components/QuickQuote/index.jsx | 31 +++++++++++++++++++++---------- src/mobile/quotation/detailNew.jsx | 68 ++++++++++++++++++++++++++++++++++++-------------------------------- 3 files changed, 59 insertions(+), 44 deletions(-) diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index e8623e9..8c4355e 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -1137,7 +1137,7 @@ export default class CommonComponent extends Component { this.props.onChange(this.props.name, sName, { sPackPath: imageUrlNew }, this.props.sId, []); } else { // this.setState({ sPackDetailPath: imageUrlNew }); - this.props.onChange(this.props.name, sName, { sPackDetailPath: imageUrlNew }, this.props.sId, []); + this.props.onChange(this.props.name, sName, { sPackDetailPathUpLoad: imageUrlNew }, this.props.sId, []); } } else if (response && response.code === -1) { message.error(response.msg); @@ -1148,7 +1148,7 @@ export default class CommonComponent extends Component { showUploadList: false, openFileDialogOnClick: this.props.enabled, }; - const imageUrl = sName === 'sPackPath' ? this.props.record.sPackPath : this.props.record.sPackDetailPath; + const imageUrl = sName === 'sPackPath' ? this.props.record.sPackPath : this.props.record.sPackDetailPathUpLoad; return (
{ handleType: slaveData[iIndex].handleType || "update", }; } - } else { if (iIndex === -1) { slaveData.push({ @@ -904,6 +903,7 @@ const QuickQuoteEvent = props => { }; // 入口 const QuickQuote = baseProps => { + console.log("🚀 ~ baseProps:", baseProps); const props = QuickQuoteEvent(baseProps); const [treeClassName, setTreeClassName] = useState(""); @@ -1323,7 +1323,6 @@ const BoxComponent = props => { return props.getSqlDropDownData(...args); }, extraContent: child => { - const value = sBackProcessData.find(item => item[child.sName]) || {}; const { bSetArea, bSetQty, sName, sSetQtyUnt } = value; @@ -1424,7 +1423,7 @@ const BoxComponent = props => { ); }, }; - + // 获取sType为3的 const { productProcessInfo = [] } = masterData; const finishedViewProps = { @@ -1645,6 +1644,8 @@ const BoxComponent = props => { }); }); } + console.log(slaveRowData, "slaveRowData"); + const svgProps = { ...props, boxList, @@ -1718,14 +1719,24 @@ const BoxComponent = props => {
- {svgProps.boxList.length ? ( - // + {slaveRowData.sPackDetailPathUpLoad ? ( + + ) : svgProps.boxList.length ? (
) : ( -
暂无图片
+ "暂无图片" )} + {/* {svgProps.boxList.length ? ( + slaveRowData.sPackDetailPathUpLoad ? + : +
+ +
+ ) : ( +
暂无图片
+ )} */} {/*
展开图
*/} {slaveRowData.sPackPath ? ( @@ -1944,7 +1955,6 @@ const ManyComponent = props => { // 核价事件 const onCalcPrice = () => { - const addState = { ...props.onGetAllDelData(), manyDataCache: [], @@ -2106,7 +2116,7 @@ const BoxModelSelectedModal = props => { ["iOrder", "#", 60], // ["sBoxId", "盒型ID"], ["sName", "名称", 119], - ["sPackDetailPath", "刀线图", 300], + ["sPackDetailPathUpLoad", "刀线图", 300], // ["sPackDetailPathUpLoad", "刀线图", 300], ["sPackPath", "3D图", 300], ["operation", "操作", 80], @@ -2243,13 +2253,14 @@ const BoxModelSelectedModal = props => { fixedHeight: "calc(100vh - 365px)", noVlistTable: true, onCostomColums: columns => { + console.log("🚀 ~ columns:", columns); columns .filter(item => item.dataIndex?.includes("Path")) .forEach(column => { // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? : '') : ) : "暂无图片"); column.render = (value, record, index) => - column.dataIndex === "sPackDetailPath" ? ( - boxData[index].sPackDetailPathUpLoad ? ( + column.dataIndex === "sPackDetailPathUpLoad" ? ( + value ? ( ) : ( diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index 76dc2f3..cb73d39 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -107,22 +107,6 @@ const QuickQuoteEvent = props => { } }); }, []); - // 获取主表信息 - useEffect(() => { - const configUrl = `${commonConfig.server_host}business/getModelBysId/${props.sModelsId}?sModelsId=${props.sModelsId}`; - commonServices - .getService(props.app.token, configUrl) - .then(({ data: masterReturn }) => { - if (masterReturn.code === 1) { - const materFormData = masterReturn.dataset.rows[0].formData; - const processConfig = materFormData.find(x => x.sTbName === "QuoQuotationprocess"); - const materialsConfig = materFormData.find(x => x.sTbName === "QuoQuotationmaterials"); - setMasterConfig(materFormData); - setState(pre => ({ ...pre, processConfig, materialsConfig })); - } - }) - .catch(error => {}); - }, [props.sModelsId]); // 获取盒型定义配置 useEffect(() => { if (!formData.length) return; @@ -183,7 +167,6 @@ const QuickQuoteEvent = props => { } setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); } else if (name.includes("slave")) { - const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); if (sFieldName === "sName") { if (!changeValue.sName) return; @@ -553,8 +536,9 @@ const QuickQuoteEvent = props => { const dataReturn = (await commonServices.postValueService(token, paramMap, url)).data; if (dataReturn.code === 1) { - const { app, sModelsId } = props; - const { slaveConfig, masterData: masterData1, processConfig, materialsConfig } = state; + // const { app, sModelsId } = props; + // const { slaveConfig, masterData: masterData1, processConfig, materialsConfig } = state; + const { slaveConfig, masterData: masterData1, materialsConfig, processConfig, sModelsId, app } = props; const { productClassify, partsNewInfo = [], productProcessInfo, partsInfo: partsOldInfo } = dataReturn.dataset.rows[0]; const slaveData = []; @@ -1118,7 +1102,9 @@ const handleCalculation = async (bSave, nextProps, isWait) => { }; const getProps = baseProps => { const { location, quotationData, app, sModelsId } = baseProps; - const getSqlDropDownDatas = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { + const { token } = app; + const [state, setState] = useState(null); + const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; const body = { sSqlCondition: { @@ -1128,7 +1114,7 @@ const getProps = baseProps => { pageNum: 1, pageSize: 20, }; - const retrunData = await commonServices.postValueService(propss.token, body, url); + const retrunData = await commonServices.postValueService(props.token, body, url); if (retrunData.data.code === 1) { /* 获取数据集 */ const { rows, totalPageCount, currentPageNo, totalCount } = retrunData.data.dataset; @@ -1140,28 +1126,46 @@ const getProps = baseProps => { }; } }; + + // 获取主表信息 + useEffect(() => { + const configUrl = `${commonConfig.server_host}business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}`; + commonServices + .getService(token, configUrl) + .then(({ data: masterReturn }) => { + if (masterReturn.code === 1) { + const formData = masterReturn.dataset.rows[0].formData; + const processConfig = formData.find(x => x.sTbName === "QuoQuotationprocess"); + const materialsConfig = formData.find(x => x.sTbName === "QuoQuotationmaterials"); + const slaveConfig = formData.find(x => x.sTbName === "QuoQuotationslave"); + setState(pre => ({ ...pre, formData, processConfig, materialsConfig, slaveConfig })); + } + }) + .catch(error => {}); + }, [sModelsId]); + // 处理 formData - let propss = { + let props = { ...baseProps, selectedNode: quotationData, state: {}, manyDataCache: [], token: baseProps.app.token, - onSaveState: newState => { - propss = { ...propss, ...newState }; - }, - getSqlDropDownData: getSqlDropDownDatas, + onSaveState: setState, + getSqlDropDownData, onMaterialsChange: handleMaterialsChange, sortData, handleCalculation, }; return { - ...baseProps, - ...propss, + ...props, + ...state, }; }; const QuotationAllprogressDetail = baseProps => { - const props = QuickQuoteEvent(getProps(baseProps)); + const masterProps = getProps(baseProps); + console.log("🚀 ~ masterProps:", masterProps); + const props = QuickQuoteEvent(masterProps); const { selectedNode, location, quotationData, app, sModelsId } = props; const { showName, sUnit } = quotationData; @@ -2251,9 +2255,9 @@ const ManyComponent = props => { dProductQty: baseCount, dQuickQuoteProductQty: baseCount, })); - // props.onSaveState({ - // manyDataCache: [], - // }); + props.onSaveState({ + manyDataCache: [], + }); }, [masterData.dProductQty, manyData.length]); const tableProps = { ...commonBusiness.getTableTypes("many", { ...props, ...state }), -- libgit2 0.22.2