From 85cae951f830af06f9abaf924779057df5d786f7 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Fri, 20 Jun 2025 14:40:34 +0800 Subject: [PATCH] 快速报价app 多工序 --- src/components/Common/Typesetting/typesetting.js | 1 + src/mobile/components/SelectInput.jsx | 9 +++++++-- src/mobile/components/selectInput.css | 1 + src/mobile/components/selectInput.less | 2 ++ src/mobile/quotation/detailNew.jsx | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------ src/mobile/quotation/quotationDetail.css | 8 ++++++++ src/mobile/quotation/quotationDetail.less | 8 ++++++++ 7 files changed, 118 insertions(+), 14 deletions(-) diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index d3618e0..989cc78 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -607,6 +607,7 @@ const Typesetting = props => { const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; if (isCustomized && !isShow) { + if (isMobile) return; message.error("排版尺寸大于上机尺寸,请确认参数!"); } const onClick = () => { diff --git a/src/mobile/components/SelectInput.jsx b/src/mobile/components/SelectInput.jsx index fc9624a..6ad425f 100644 --- a/src/mobile/components/SelectInput.jsx +++ b/src/mobile/components/SelectInput.jsx @@ -1,5 +1,5 @@ import React, { useState, useRef, useEffect, useCallback } from "react"; -import { Input, Popup, Button, Toast, PickerView, SearchBar,Checkbox } from "antd-mobile"; +import { Input, Popup, Button, Toast, PickerView, SearchBar, Checkbox } from "antd-mobile"; import { DownOutline } from "antd-mobile-icons"; import commonConfig from "@/utils/config"; import * as commonServices from "@/services/services"; @@ -148,7 +148,12 @@ const SelectInput = props => {
{propsType === "b" ? ( - + { + props.onDataChange(tableName, itemDetail.sName, { [itemDetail.sName]: val }, null, coplyColumns); + }} + /> ) : (
{" "} diff --git a/src/mobile/components/selectInput.css b/src/mobile/components/selectInput.css index fd2a500..9e52a66 100644 --- a/src/mobile/components/selectInput.css +++ b/src/mobile/components/selectInput.css @@ -1,5 +1,6 @@ .inputBox { position: relative; + height: 100%; } .inputBox .icons { position: absolute; diff --git a/src/mobile/components/selectInput.less b/src/mobile/components/selectInput.less index ebb5515..e90c011 100644 --- a/src/mobile/components/selectInput.less +++ b/src/mobile/components/selectInput.less @@ -1,5 +1,7 @@ .inputBox { position: relative; + height: 100%; + // margin: 0.5rem 0; .icons { position: absolute; top: 50%; diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index 4e70e34..9fba459 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -1467,6 +1467,10 @@ const BoxComponent = props => { if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { return false; } + const { bAdvancedSetting } = slaveRowData; + if ((item.sName === "dPortrait" && !bAdvancedSetting) || (item.sName === "dHorizontal" && !bAdvancedSetting)) { + return false; + } return item.iTag === iTag; }); @@ -1515,20 +1519,26 @@ const BoxComponent = props => { // return pre; // }, []); useEffect(() => { - setDownAbleConfigsNew(downAbleConfigs); - }, [downAbleConfigs]); + // setDownAbleConfigsNew(downAbleConfigs); + const data = downAbleConfigs.reduce((pre, cur) => { + const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName); + pre.push(cur, ...childConfigs); + return pre; + }, []); + setDownAbleConfigsNew(data); + }, [downAbleConfigs, downAbleExtraConfigs]); // 初始化状态,存储每个 Switch 的状态 const [switchStates, setSwitchStates] = useState(null); useEffect(() => { if (!sBackProcessData) return; - const newSwitchStates = downAbleConfigsNew - .filter(item => item.sPartsName === boxModel || !item.sPartsName) - .reduce((acc, item, index) => { - acc[item.sName] = sBackProcessData ? sBackProcessData[index][item.sName] !== "" : false; - return acc; - }, {}); - - setSwitchStates(newSwitchStates); + // const newSwitchStates = downAbleConfigsNew + // .filter(item => item.sPartsName === boxModel || !item.sPartsName) + // .reduce((acc, item, index) => { + // acc[item.sName] = sBackProcessData && sBackProcessData[index]? sBackProcessData[index][item.sName] !== "" : false; + // return acc; + // }, {}); + + // setSwitchStates(newSwitchStates); }, [downAbleConfigsNew, boxModel]); // 依赖数组 // 处理 Switch 变化的函数 @@ -1544,7 +1554,7 @@ const BoxComponent = props => { .map((item, i) => ({ ...item, isSelect: switchStates ? switchStates[item.sName] : false, - sName: "sParams" + i, + // sName: "sParams" + i, sProductClassifyId: item.sId, })); const downViewProps = { @@ -1555,6 +1565,7 @@ const BoxComponent = props => { viewRow: slaveRowData, tableName: `slaveDown${boxModel}`, }; + // 获取sType为3的 const { productProcessInfo = [] } = masterData; const finishedViewProps = { @@ -1891,7 +1902,75 @@ const BoxComponent = props => { handleSwitchChange(x, val)} />
{switchStates && switchStates[x.sName] ? ( - + // 这里需要数组遍历 多个工序 +
+ +
+ {!x.sParentName ? ( + + ) : ( + + )} +
+
) : ( "" )} diff --git a/src/mobile/quotation/quotationDetail.css b/src/mobile/quotation/quotationDetail.css index 85ba57a..b27e484 100644 --- a/src/mobile/quotation/quotationDetail.css +++ b/src/mobile/quotation/quotationDetail.css @@ -159,3 +159,11 @@ right: 5%; bottom: 10%; } +.processFlex { + display: flex; + align-items: center; + justify-content: space-between; +} +.processFlex .processBtn { + margin-left: 1rem; +} diff --git a/src/mobile/quotation/quotationDetail.less b/src/mobile/quotation/quotationDetail.less index 24989a4..ec3591e 100644 --- a/src/mobile/quotation/quotationDetail.less +++ b/src/mobile/quotation/quotationDetail.less @@ -167,4 +167,12 @@ right: 5%; bottom: 10%; } +} +.processFlex{ + display: flex; + align-items: center; + justify-content: space-between; + .processBtn{ + margin-left: 1rem; + } } \ No newline at end of file -- libgit2 0.22.2