Commit 3f28391907868104f6f793f4eae030c844cb920f
1 parent
c124239d
高级设置功能
Showing
2 changed files
with
35 additions
and
17 deletions
src/components/Common/Typesetting/typesetting.js
| @@ -36,6 +36,7 @@ const Typesetting = props => { | @@ -36,6 +36,7 @@ const Typesetting = props => { | ||
| 36 | sWidthFormula, // 盒宽公式 | 36 | sWidthFormula, // 盒宽公式 |
| 37 | sPackDetailPath, | 37 | sPackDetailPath, |
| 38 | sColumnNameConfig, | 38 | sColumnNameConfig, |
| 39 | + bAdvancedSetting, // 高级设置 | ||
| 39 | } = slaveRowData; | 40 | } = slaveRowData; |
| 40 | const { masterData, selectedNode, slaveData } = state; | 41 | const { masterData, selectedNode, slaveData } = state; |
| 41 | // 生成盒子图片 | 42 | // 生成盒子图片 |
| @@ -247,7 +248,7 @@ const Typesetting = props => { | @@ -247,7 +248,7 @@ const Typesetting = props => { | ||
| 247 | //剩余量能不能放一下单独一个 | 248 | //剩余量能不能放一下单独一个 |
| 248 | const commonHeightCheck = remainingHeight > jInnerHeight; | 249 | const commonHeightCheck = remainingHeight > jInnerHeight; |
| 249 | const commonWidthCheck = remainingWidth > jInnerWidth; | 250 | const commonWidthCheck = remainingWidth > jInnerWidth; |
| 250 | - const isCustomized = false; | 251 | + const isCustomized = bAdvancedSetting; |
| 251 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; | 252 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; |
| 252 | // const remaining = false; | 253 | // const remaining = false; |
| 253 | 254 | ||
| @@ -258,16 +259,16 @@ const Typesetting = props => { | @@ -258,16 +259,16 @@ const Typesetting = props => { | ||
| 258 | // 是否定制 | 259 | // 是否定制 |
| 259 | if (isCustomized) { | 260 | if (isCustomized) { |
| 260 | if (isVertical) { | 261 | if (isVertical) { |
| 261 | - cols = dHorizontal; | ||
| 262 | - rows = Math.trunc(dPortrait / 2); | 262 | + cols = dHorizontal || 0; |
| 263 | + rows = dPortrait ? Math.trunc(dPortrait / 2) : 0; | ||
| 263 | if (isOdd(dPortrait)) { | 264 | if (isOdd(dPortrait)) { |
| 264 | remaining = true; | 265 | remaining = true; |
| 265 | } else { | 266 | } else { |
| 266 | remaining = false; | 267 | remaining = false; |
| 267 | } | 268 | } |
| 268 | } else { | 269 | } else { |
| 269 | - cols = Math.trunc(dHorizontal / 2); | ||
| 270 | - rows = dPortrait; | 270 | + cols = dHorizontal ? Math.trunc(dHorizontal / 2) : 0; |
| 271 | + rows = dPortrait || 0; | ||
| 271 | if (isOdd(dHorizontal)) { | 272 | if (isOdd(dHorizontal)) { |
| 272 | remaining = true; | 273 | remaining = true; |
| 273 | } else { | 274 | } else { |
| @@ -599,7 +600,11 @@ const Typesetting = props => { | @@ -599,7 +600,11 @@ const Typesetting = props => { | ||
| 599 | } | 600 | } |
| 600 | }, 0); // 使用 0 延迟,将任务放入事件队列 | 601 | }, 0); // 使用 0 延迟,将任务放入事件队列 |
| 601 | } | 602 | } |
| 602 | - const isMax = slaveDataDetail?.dMaxLength && Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength); | 603 | + const isMax = |
| 604 | + slaveDataDetail?.dMaxLength && | ||
| 605 | + Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength) && | ||
| 606 | + Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); | ||
| 607 | + | ||
| 603 | const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; | 608 | const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; |
| 604 | 609 | ||
| 605 | const onClick = () => { | 610 | const onClick = () => { |
src/components/QuickQuote/index.jsx
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import { useRef, useEffect, useState, useCallback, useMemo } from "react"; | 2 | import { useRef, useEffect, useState, useCallback, useMemo } from "react"; |
| 3 | -import { Button, Divider, Tabs, Tree, Radio, Image, Modal, Input, message, Badge } from "antd-v4"; | 3 | +import { Button, Divider, Tabs, Tree, Radio, Image, Modal, Input, message, Badge, Checkbox } from "antd-v4"; |
| 4 | import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined } from "@ant-design/icons"; | 4 | import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined } from "@ant-design/icons"; |
| 5 | import { cloneDeep } from "lodash"; | 5 | import { cloneDeep } from "lodash"; |
| 6 | import commonConfig from "@/utils/config"; | 6 | import commonConfig from "@/utils/config"; |
| @@ -186,6 +186,7 @@ const QuickQuoteEvent = props => { | @@ -186,6 +186,7 @@ const QuickQuoteEvent = props => { | ||
| 186 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); | 186 | setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); |
| 187 | } else if (name.includes("slave")) { | 187 | } else if (name.includes("slave")) { |
| 188 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); | 188 | const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); |
| 189 | + | ||
| 189 | if (sFieldName === "sName") { | 190 | if (sFieldName === "sName") { |
| 190 | if (!changeValue.sName) return; | 191 | if (!changeValue.sName) return; |
| 191 | const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName); | 192 | const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName); |
| @@ -319,7 +320,6 @@ const QuickQuoteEvent = props => { | @@ -319,7 +320,6 @@ const QuickQuoteEvent = props => { | ||
| 319 | dMaxWidth: Number(selectedNode.sMachineStyle.split("*")[1]), | 320 | dMaxWidth: Number(selectedNode.sMachineStyle.split("*")[1]), |
| 320 | }; | 321 | }; |
| 321 | } | 322 | } |
| 322 | - | ||
| 323 | setState(pre => ({ ...pre, slaveData, ...extraState })); | 323 | setState(pre => ({ ...pre, slaveData, ...extraState })); |
| 324 | } else if (name === "finished") { | 324 | } else if (name === "finished") { |
| 325 | const { productProcessInfo = [] } = masterData; | 325 | const { productProcessInfo = [] } = masterData; |
| @@ -1000,7 +1000,7 @@ const TreeComponent = props => { | @@ -1000,7 +1000,7 @@ const TreeComponent = props => { | ||
| 1000 | // 点击节点后查询数据 | 1000 | // 点击节点后查询数据 |
| 1001 | useEffect(() => { | 1001 | useEffect(() => { |
| 1002 | if (!selectedNode.sId || commonUtils.isEmptyObject(slaveConfig)) return; | 1002 | if (!selectedNode.sId || commonUtils.isEmptyObject(slaveConfig)) return; |
| 1003 | - | 1003 | + |
| 1004 | timeRef.current += 1; | 1004 | timeRef.current += 1; |
| 1005 | 1005 | ||
| 1006 | const getSqlDropDownData = async ({ sId }) => { | 1006 | const getSqlDropDownData = async ({ sId }) => { |
| @@ -1105,7 +1105,7 @@ const TreeComponent = props => { | @@ -1105,7 +1105,7 @@ const TreeComponent = props => { | ||
| 1105 | // 内容组件 | 1105 | // 内容组件 |
| 1106 | const ContentComponent = props => { | 1106 | const ContentComponent = props => { |
| 1107 | const { selectedNode = {}, extraParts = {} } = props.state; | 1107 | const { selectedNode = {}, extraParts = {} } = props.state; |
| 1108 | - const manyqtysInfo= commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'manyqtysInfo') : '多数量报价' ; | 1108 | + const manyqtysInfo = commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, "manyqtysInfo") : "多数量报价"; |
| 1109 | const { showName } = selectedNode; | 1109 | const { showName } = selectedNode; |
| 1110 | const extraPartsList = extraParts[showName] || []; | 1110 | const extraPartsList = extraParts[showName] || []; |
| 1111 | let { sAllPartsName = "" } = selectedNode; | 1111 | let { sAllPartsName = "" } = selectedNode; |
| @@ -1289,10 +1289,16 @@ const BoxComponent = props => { | @@ -1289,10 +1289,16 @@ const BoxComponent = props => { | ||
| 1289 | }; | 1289 | }; |
| 1290 | 1290 | ||
| 1291 | const getUpViewPropsByITag = iTag => { | 1291 | const getUpViewPropsByITag = iTag => { |
| 1292 | + | ||
| 1292 | const config = slaveConfig.gdsconfigformslave.filter(item => { | 1293 | const config = slaveConfig.gdsconfigformslave.filter(item => { |
| 1293 | if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { | 1294 | if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { |
| 1294 | return false; | 1295 | return false; |
| 1295 | } | 1296 | } |
| 1297 | + const { bAdvancedSetting } = slaveRowData; | ||
| 1298 | + | ||
| 1299 | + if ((item.sName === "dPortrait" && !bAdvancedSetting) || (item.sName === "dHorizontal" && !bAdvancedSetting)) { | ||
| 1300 | + return false | ||
| 1301 | + } | ||
| 1296 | 1302 | ||
| 1297 | return item.iTag === iTag; | 1303 | return item.iTag === iTag; |
| 1298 | }); | 1304 | }); |
| @@ -1730,7 +1736,9 @@ const BoxComponent = props => { | @@ -1730,7 +1736,9 @@ const BoxComponent = props => { | ||
| 1730 | showNew: 1, | 1736 | showNew: 1, |
| 1731 | }; | 1737 | }; |
| 1732 | const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; | 1738 | const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; |
| 1733 | - const PrintingParameters = commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'PrintingParameters') : '印刷参数' ; | 1739 | + const PrintingParameters = commonUtils.isNotEmptyObject(props.app) |
| 1740 | + ? commonFunc.showMessage(props.app.commonConst, "PrintingParameters") | ||
| 1741 | + : "印刷参数"; | ||
| 1734 | 1742 | ||
| 1735 | return ( | 1743 | return ( |
| 1736 | <Tabs | 1744 | <Tabs |
| @@ -1770,6 +1778,7 @@ const BoxComponent = props => { | @@ -1770,6 +1778,7 @@ const BoxComponent = props => { | ||
| 1770 | onChange={e => { | 1778 | onChange={e => { |
| 1771 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); | 1779 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); |
| 1772 | slaveData[iIndex].radioValue = e.target.value; | 1780 | slaveData[iIndex].radioValue = e.target.value; |
| 1781 | + slaveData[iIndex].bAdvancedSetting = false | ||
| 1773 | props.setState(pre => ({ | 1782 | props.setState(pre => ({ |
| 1774 | ...pre, | 1783 | ...pre, |
| 1775 | slaveData: [...slaveData], | 1784 | slaveData: [...slaveData], |
| @@ -2032,15 +2041,19 @@ const ManyComponent = props => { | @@ -2032,15 +2041,19 @@ const ManyComponent = props => { | ||
| 2032 | const [submitLoading, setSubmitLoading] = useState(false); | 2041 | const [submitLoading, setSubmitLoading] = useState(false); |
| 2033 | const [processPercent, setProcessPercent] = useState(0); | 2042 | const [processPercent, setProcessPercent] = useState(0); |
| 2034 | 2043 | ||
| 2035 | - const BtnNewQuotation= commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'BtnNewQuotation') : '新报价' ; | 2044 | + const BtnNewQuotation = commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, "BtnNewQuotation") : "新报价"; |
| 2036 | 2045 | ||
| 2037 | - const BtnDraft= commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'BtnDraft') : '存草稿' ; | 2046 | + const BtnDraft = commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, "BtnDraft") : "存草稿"; |
| 2038 | 2047 | ||
| 2039 | - const BtnPriceverification= commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'BtnPriceverification') : '核价' ; | 2048 | + const BtnPriceverification = commonUtils.isNotEmptyObject(props.app) |
| 2049 | + ? commonFunc.showMessage(props.app.commonConst, "BtnPriceverification") | ||
| 2050 | + : "核价"; | ||
| 2040 | 2051 | ||
| 2041 | - const BtnConfirmQuantity= commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'BtnConfirmQuantity') : '确认下单数量' ; | 2052 | + const BtnConfirmQuantity = commonUtils.isNotEmptyObject(props.app) |
| 2053 | + ? commonFunc.showMessage(props.app.commonConst, "BtnConfirmQuantity") | ||
| 2054 | + : "确认下单数量"; | ||
| 2042 | 2055 | ||
| 2043 | - const btnOrdering= commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'btnOrdering') : '下单中...' ; | 2056 | + const btnOrdering = commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, "btnOrdering") : "下单中..."; |
| 2044 | 2057 | ||
| 2045 | // 核价事件 | 2058 | // 核价事件 |
| 2046 | const onCalcPrice = () => { | 2059 | const onCalcPrice = () => { |
| @@ -2330,7 +2343,7 @@ const BoxModelSelectedModal = props => { | @@ -2330,7 +2343,7 @@ const BoxModelSelectedModal = props => { | ||
| 2330 | }; | 2343 | }; |
| 2331 | return svgProps; | 2344 | return svgProps; |
| 2332 | }; | 2345 | }; |
| 2333 | - const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected)) | 2346 | + const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected)); |
| 2334 | const tableProps = { | 2347 | const tableProps = { |
| 2335 | ...commonBusiness.getTableTypes("box", { | 2348 | ...commonBusiness.getTableTypes("box", { |
| 2336 | ...props, | 2349 | ...props, |