From b9a3604b9cf5c4031919cf06c605679c75e35549 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Thu, 3 Jul 2025 14:39:52 +0800 Subject: [PATCH] 卡牌默认展示图片 --- src/components/Common/Typesetting/typesetting.js | 4 ++-- src/components/QuickQuote/index.jsx | 72 ++++++++++++++++++++++++++---------------------------------------------- src/mobile/components/SelectInput.jsx | 4 +++- src/mobile/quotation/detailNew.jsx | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------ src/mobile/quotation/index.css | 5 ++++- src/mobile/quotation/index.jsx | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- src/mobile/quotation/index.less | 10 +++++++--- 7 files changed, 187 insertions(+), 111 deletions(-) diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index 36401ef..d222529 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -241,9 +241,9 @@ const Typesetting = props => { let cols = dSWidthOffsetCombined === 0 ? 0 : Math.floor(outerWidth / dSWidthOffsetCombined); const rowsCombined = innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset); let rows = rowsCombined === 0 ? 0 : Math.floor(outerHeight / rowsCombined); - let colsMaxLength = (cols) * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ) + dZBLB + dYBLB - dSLengthOffset; + let colsMaxLength = (cols) * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ) + dZBLB + dYBLB - (reference ? 0 : dSLengthOffset); - let rowsMaxLength = rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset) + dXBJJ) + dSBLB + dXBLB - dSWidthOffset; + let rowsMaxLength = rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset) + dXBJJ) + dSBLB + dXBLB - (reference ? 0 : dSWidthOffset) ; while (colsMaxLength >= outerWidth && cols > 0) { cols = cols - 1; colsMaxLength = (cols) * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset) + dYBJJ); diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 1034401..5920e0d 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -15,7 +15,7 @@ import AntdDraggableModal from "@/components/Common/AntdDraggableModal"; import styles from "./index.less"; import Typesetting from "@/components/Common/Typesetting/typesetting"; import DynamicSVG from "@/components/Common/BoxDesignCompontent/svg"; -import KapaiJson from './kapai.json' +import KapaiJson from "./kapai.json"; // 事件 const QuickQuoteEvent = props => { const addState = {}; @@ -263,6 +263,7 @@ const QuickQuoteEvent = props => { } const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); + console.log("🚀 ~ iIndex:", iIndex); if (name.includes("slaveDown")) { const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]); const extraRowData = {}; @@ -1242,10 +1243,9 @@ const TreeComponent = props => { masterData: { ...props.masterData, sFormId: props.masterData.sOldFormId || props.masterData.sFormId }, }); } - getDropDownData(props); }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]); - + const { slaveData } = props.state; return ( { const { bBox } = selectedNode; const [boxTypeList, setBoxTypeList] = useState([]); - const [boxData, setBoxData] = useState([]); useEffect(() => { if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { - // const getSqlDropDownData = async ({ sId }, cb) => { - // const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; - // const body = { - // sKeyUpFilterName: "", - // pageNum: 1, - // pageSize: 1000, - // sSqlCondition: { - // sProductClassifyId: selectedNode.sId, - // }, - // }; - // const retrunData = await commonServices.postValueService(props.app.token, body, url); - // const dropDownData = retrunData.data?.dataset?.rows; - // console.log("🚀 ~ getSqlDropDownData ~ dropDownData:", dropDownData) - // }; - - // getSqlDropDownData({ sId: "17428091410008594700322758474000" }, dropDownData => { - // const boxTypeList = Array.from(new Set((dropDownData || []).map(item => item.sBoxType || "其它"))); - // setBoxTypeList(boxTypeList); - // setBoxData( - // (dropDownData || []).map((item, index) => ({ - // ...item, - // iOrder: index + 1, - // })) - // ); - // }); - let dropDownData = [] - dropDownData.push(KapaiJson) - const boxTypeList = Array.from(new Set((dropDownData || []).map(item => item.sBoxType || "其它"))); - setBoxTypeList(boxTypeList); - setBoxData( - (dropDownData || []).map((item, index) => ({ - ...item, - iOrder: index + 1, - })) - ); + let dropDownData = []; + dropDownData.push(KapaiJson); + const boxData = (dropDownData || []).map((item, index) => ({ + ...item, + iOrder: index + 1, + })); + props.onDataChange("slaveUp" + boxModel, "sName", { sName: KapaiJson.sName }, KapaiJson.sId, boxData); } }, [boxModel]); - useEffect(() => { - const kapaiData = boxData.find(x => x.sTypes === "6"); - if (!kapaiData) return; - props.onDataChange("slaveUp" + boxModel, "sName", { sName: kapaiData.sName }, kapaiData.sId, boxData); - }, [boxData]); + const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; const { upAbleConfigsExtra = [], calcMethodData = [], boxPicData = [], radioValue = calcMethodData[0]?.sCode } = slaveRowData; - const calcMethod = calcMethodData.map(item => ({ value: item.sCode, label: item.showName, @@ -2182,7 +2148,15 @@ const BoxComponent = props => { {bBox ? ( <> {svgProps.boxList.length ? ( -
+
) : ( @@ -2202,6 +2176,12 @@ const BoxComponent = props => { ))}
+ ) : selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong" ? ( + +
+ +
+
) : (
{noImage}
)} diff --git a/src/mobile/components/SelectInput.jsx b/src/mobile/components/SelectInput.jsx index 9297f74..fd4a99e 100644 --- a/src/mobile/components/SelectInput.jsx +++ b/src/mobile/components/SelectInput.jsx @@ -40,6 +40,9 @@ const SelectInput = props => { } else { setValue(viewRowNew || ""); // 动态更新 value } + // 处理默认数据 + console.log("🚀 ~ useEffect ~ itemDetail:", itemDetail) + }, [itemDetail, itemDetail?.sName, viewRow]); const [columns, setColumns] = useState([]); const [coplyColumns, setCopyColumns] = useState(columns); @@ -103,7 +106,6 @@ const SelectInput = props => { useEffect(() => { if (!visible) return; let { sDropDownType, sVisColumnName } = itemDetail; - console.log("🚀 ~ useEffect ~ itemDetail:", itemDetail) if (sVisColumnName && sVisColumnName === "sProcessName") { if (sDropDownType === "sql") { if (itemDetail.sParamDropDown) { diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index dd05299..6a37b2a 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -151,9 +151,6 @@ const QuickQuoteEvent = props => { if (name === "master") { const { showName: sTreeNodeName } = selectedNode; - const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); - const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); - console.log("🚀 ~ iIndex:", iIndex, boxModel, props); let masterDataNew = { ...masterData, ...changeValue }; masterDataNew.handleType = masterDataNew.handleType || "update"; masterDataNew.sId = commonUtils.createSid(); @@ -166,16 +163,30 @@ const QuickQuoteEvent = props => { if (sFieldName === "sCustomerName") { masterDataNew = { ...masterDataNew, sCustomerId: changeValue.sId }; } - // if ((sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight")) { - // const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({ - // ...item, - // iColValue: item.iColValue || 6, - // })); - // slaveData[iIndex] = { - // ...slaveData[iIndex], - // upAbleConfigsExtra: sColumnNameConfig, - // }; - // } + if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { + if (props.currentBoxModel) { + const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); + const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({ + ...item, + iColValue: item.iColValue || 6, + })); + slaveData[iIndex] = { + ...slaveData[iIndex], + upAbleConfigsExtra: sColumnNameConfig, + }; + } else { + if (!slaveData[0]) return; + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[0].sColumnNameConfig, []).map(item => ({ + ...item, + iColValue: item.iColValue || 6, + })); + slaveData[0] = { + ...slaveData[0], + upAbleConfigsExtra: sColumnNameConfig, + }; + } + } setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); } else if (name.includes("slave")) { const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); @@ -203,6 +214,13 @@ const QuickQuoteEvent = props => { const { selectedNode = {}, slaveConfig } = state; const { showName: sTreeNodeName } = selectedNode; const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); + if (sFieldName === "dSumPQty" && (sTreeNodeName.includes("骑马") || sTreeNodeName.includes("锁线"))) { + if (!changeValue.dSumPQty || changeValue.dSumPQty % 4 !== 0) { + message.info("P数要为4的倍数!"); + changeValue.dSumPQty = 4; + extraState.slaveUpKey = `key_${commonUtils.createSid()}`; + } + } if (name.includes("slaveDown")) { const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue.sId); dropDownDataSelected && (dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName); @@ -227,6 +245,8 @@ const QuickQuoteEvent = props => { value: sParamDefault, sParam: sParam, [`sParams${index}`]: sParamDefault, + sParamKey: `sParam${iOrder}`, + sParamKeyNew: sFieldName || `sParam${iOrder}`, }; }) .filter(item => item !== ""); @@ -312,23 +332,46 @@ const QuickQuoteEvent = props => { }; } - if (sFieldName === "sPrint") { + // if (sFieldName === "sPrint") { + // slaveData[saveIndex] = { + // ...slaveData[saveIndex], + // sProcessId: changeValue.sId, + // sPrintProcessId: changeValue.sId, + // dMachineWidth: slaveData[saveIndex].dWlkd, + // dMachineLength: slaveData[saveIndex].dWlcd, + // }; + // } + + // if (sFieldName === "dMaxLength") { + // slaveData[saveIndex] = { + // ...slaveData[saveIndex], + // dMaxLength: changeValue.dMachineLength, + // dMaxWidth: changeValue.dMachineWidth, + // }; + // } + if (sFieldName === "bFlap") { slaveData[saveIndex] = { ...slaveData[saveIndex], - sProcessId: changeValue.sId, - sPrintProcessId: changeValue.sId, - dMachineWidth: slaveData[saveIndex].dWlkd, - dMachineLength: slaveData[saveIndex].dWlcd, + bFold: false, + sFold: "", + dFold: "", + dAdhesive: "", }; } - - if (sFieldName === "dMaxLength") { + if (sFieldName === "bFold") { slaveData[saveIndex] = { ...slaveData[saveIndex], - dMaxLength: changeValue.dMachineLength, - dMaxWidth: changeValue.dMachineWidth, + bFlap: false, + dFlap: "", }; } + const { upAbleConfigsExtra = [] } = slaveData[saveIndex] || {}; + + upAbleConfigsExtra.forEach(item => { + if (item.sName === sFieldName) { + item.sAssignFormula = null; + } + }); setState(pre => ({ ...pre, slaveData, ...extraState })); } else if (name === "finished") { const { productProcessInfo = [] } = masterData; @@ -715,10 +758,10 @@ const QuickQuoteEvent = props => { delete partsDataRow.dMaterialsKQty; delete partsDataRow.dMaterialsLength; delete partsDataRow.dMaterialsWidth; - if (productClassify.bSpecialRules) { - partsDataRow.dMachineLength = partsDataRow.dMaxMachineLength; - partsDataRow.dMachineWidth = partsDataRow.dMaxMachineWidth; - } + // if (productClassify.bSpecialRules) { + // partsDataRow.dMachineLength = partsDataRow.dMaxMachineLength; + // partsDataRow.dMachineWidth = partsDataRow.dMaxMachineWidth; + // } controlData.push(partsDataRow); // 材料信息 for (let i = 0; i < partInfo.materialsInfo.length; i++) { @@ -1060,7 +1103,7 @@ const QuotationAllprogressDetail = baseProps => { }; }); }; - if (selectedNode.sProductType === "不干胶") { + if (selectedNode.sTypeKey === "juantong") { props.onSaveState({ masterData: { ...props.masterData, sFormId: "101251240115016002356125200" }, }); @@ -1457,11 +1500,11 @@ const BoxComponent = props => { })); const showUpAbleConfigsExtra = upAbleConfigsExtra.filter(x => x.bVisible === 1); let boxList = []; + const { sStripType = 0 } = selectedNode; // if(!masterData) return if ( - (slaveRowData && slaveRowData.sColumnNameConfig && masterData?.dLength && masterData?.dWidth && masterData?.dHeight) || - (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || - (selectedNode.sProductType === "不干胶" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) + (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || + (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) ) { const slaveNewData = slaveRowData.upAbleConfigsExtra; const tables = [ @@ -1600,12 +1643,15 @@ const BoxComponent = props => { if (!selectedNode.bBleed && item.sName === "dBleed") { return false; } + if (selectedNode.sTypeKey !== "juantong" && item.sName === "sPaperDirection") { + return false; + } return item.iTag === iTag; }); let boxConfigList = []; if (iTag === 20) { let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; - if (selectedNode.sProductType === "不干胶") { + if (selectedNode.sTypeKey === "juantong") { showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; } const UlToolPosition = commonFunc.showLocalMessage(props, "UlToolPosition", "上下刀位"); @@ -1613,7 +1659,7 @@ const BoxComponent = props => { const LeftMargin = commonFunc.showLocalMessage(props, "LeftMargin", "左右刀位"); boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; - if (selectedNode.sProductType === "不干胶") { + if (selectedNode.sTypeKey === "juantong") { const mappings = { dZBLB: "留边", dXBJJ: "跳距", @@ -1660,15 +1706,21 @@ const BoxComponent = props => { x.sName === "dPartsWidth" || x.sName === "dRowGap" || x.sName === "dColGap" || + x.sName === "dBleed" || x.sName === "sPaperDirection", default: x => - x.sName === "dBleed" || x.sName === "sMagnification" || x.sName === "dPartsLength" || x.sName === "dPartsWidth" || x.sName === "dSumPQty", + x.sName === "sPaperDirection" || + x.sName === "dBleed" || + x.sName === "sMagnification" || + x.sName === "dPartsLength" || + x.sName === "dPartsWidth" || + x.sName === "dSumPQty", }; - if (upViewProps12 && selectedNode.sProductType === "不干胶") { + if (upViewProps12 && selectedNode.sTypeKey === "juantong") { upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.juantong); } if (upViewProps12 && !(selectedNode.sTypeKey === "huace" && slaveRowData.sBoxModel === "封面")) { - upViewProps12.viewConfigs = upViewProps12?.viewConfigs.filter(filterConditions.default); + upViewProps12.viewConfigs = upViewProps12.viewConfigs.filter(filterConditions.default); } // 拼板信息表单 const upViewProps20 = getUpViewPropsByITag(20); @@ -1819,7 +1871,7 @@ const BoxComponent = props => { }; let juantongConfig = {}; - if (selectedNode.sProductType === "不干胶") { + if (selectedNode.sTypeKey === "juantong") { const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; juantongConfig = { dColGap: dYBJJ, @@ -1996,7 +2048,7 @@ const BoxComponent = props => { }; useEffect(() => { - if (selectedNode.sTypeKey === "kapai" || selectedNode.sProductType === "不干胶") { + if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { const data = selectList.find(x => x.sTypes === "6"); if (!data) return; const currentBoxModel = "slaveUp" + props.boxModel; @@ -2318,13 +2370,15 @@ const PrintParamsComponent = props => { }; }); console.log("🚀 ~ printParamsConfig:", printParamsConfig); - // printParamsConfig.forEach(item=>{ - // const showDropDown = commonUtils.isNotEmptyArr(item.dropDownData) - // ? this.props.showConfig.dropDownData - // : typeof this.props.showConfig.showDropDown === "object" - // ? this.props.showConfig.showDropDown - // : commonUtils.objectToArr(commonUtils.convertStrToObj(this.props.showConfig.showDropDown)); - // }) + printParamsConfig.forEach(item => { + // const showDropDown = commonUtils.isNotEmptyArr(item.dropDownData) + // ? props.showConfig.dropDownData + // : typeof props.showConfig.showDropDown === "object" + // ? props.showConfig.showDropDown + // : commonUtils.objectToArr(commonUtils.convertStrToObj(props.showConfig.showDropDown)); + const showDropDown = item.showDropDown; + console.log("🚀 ~ showDropDown:", showDropDown,props.showConfig); + }); const result = []; for (let i = 0; i < printParams.length + 1; i++) { const printParamsItem = printParams[i - 1]; @@ -2621,7 +2675,7 @@ const ManyComponent = props => { useEffect(() => { if (calcPriceLoading) { setProcessPercent(0); - } + } }, [calcPriceLoading]); // 监听确认下单数量结束 @@ -2774,12 +2828,11 @@ const ManyComponent = props => { fill="solid" size="small" onClick={() => { - - console.log(data,changeValue, value,'asdasdasd'); + console.log(data, changeValue, value, "asdasdasd"); const i = data.findIndex(item => item.sId === changeValue.sId); if (i !== -1) { data[i].dManyQty = Number(value); - handleRadioChange(data[i]) + handleRadioChange(data[i]); } setVisible(false); setValue(""); diff --git a/src/mobile/quotation/index.css b/src/mobile/quotation/index.css index 8b5932d..da57c8d 100644 --- a/src/mobile/quotation/index.css +++ b/src/mobile/quotation/index.css @@ -12,7 +12,7 @@ height: 100%; } .quotationBox .quotationNavigation :global .adm-side-bar { - background-color: #EBF2FD; + background-color: #ebf2fd; } .quotationBox .quotationContent { width: 70%; @@ -40,3 +40,6 @@ margin-left: 0.625rem; font-weight: 700; } +.quotationBox .quotationContent .nestedItems .contentItem { + background-color: '#333'; +} diff --git a/src/mobile/quotation/index.jsx b/src/mobile/quotation/index.jsx index ad2201c..2540acb 100644 --- a/src/mobile/quotation/index.jsx +++ b/src/mobile/quotation/index.jsx @@ -22,7 +22,7 @@ const QuotationAllprogress = baseProps => { }; const dataUrl = `${commonConfig.server_host}filterTree/getFilterTree/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; - // if (dataReturn.dataset.rows) return + // if (dataReturn.dataset.rows) return const treeDataList = dataReturn.dataset.rows[0].children.map(item => { return item; }); @@ -96,9 +96,11 @@ const TreeComponent = props => { }; // 内容 const ContentComponent = props => { - const { contentList = [] ,selectedKey} = props.state || {}; + const { contentList = [], selectedKey } = props.state || {}; + console.log("🚀 ~ contentList:", contentList); // 路由 const handleGridClick = item => () => { + if (item.children && item.children.length > 0) return; props.dispatch({ type: "content/onRouterMobile", payload: { @@ -108,21 +110,53 @@ const ContentComponent = props => { sModelType: props.sModelType, quotationData: { ...item, - sProductClassifyId:selectedKey + sProductClassifyId: selectedKey, }, - }, }); }; + return (
- {contentList.map(item => ( -
- - {item.showName} -
- ))} +
); }; +const RecursiveItemList = ({ items, handleGridClick }) => { + const renderItems = (list, level = 0) => { + return list.map(item => ( +
+ {/* { + item.children && item.children.length > 0 ? +
{item.showName}
+ : +
+ + {item.showName} +
+ } */} +
+ + {item.showName} +
+ {item.children && item.children.length > 0 ?
{renderItems(item.children, level + 1)}
: null} +
+ )); + }; + + return
{renderItems(items)}
; +}; export default QuotationAllprogress; diff --git a/src/mobile/quotation/index.less b/src/mobile/quotation/index.less index d07dd13..8aea396 100644 --- a/src/mobile/quotation/index.less +++ b/src/mobile/quotation/index.less @@ -1,4 +1,3 @@ - .quotationBox { width: 100%; height: 100%; @@ -10,8 +9,8 @@ .quotationNavigation { width: 30%; height: 100%; - :global .adm-side-bar { - background-color: #EBF2FD; + :global .adm-side-bar { + background-color: #ebf2fd; } } .quotationContent { @@ -39,5 +38,10 @@ font-weight: 700; } } + .nestedItems { + .contentItem { + background-color: '#333'; + } + } } } -- libgit2 0.22.2