diff --git a/src/components/Common/CommonCostomTabBill.js b/src/components/Common/CommonCostomTabBill.js index 500eb53..76c89d9 100644 --- a/src/components/Common/CommonCostomTabBill.js +++ b/src/components/Common/CommonCostomTabBill.js @@ -2468,7 +2468,6 @@ class CommonNewBill extends Component { const proName = proObj.sproName; let sRowData = slaveRow; //取第一条BOM的id - console.log('addState1addState1', name, tableData); sRowData = { ...sRowData, sBomId: tableData[0].sBomId }; const value = { sProName: proName, 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..b206a22 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -17,7 +17,6 @@ import { cloneDeep } from "lodash"; import moment from "moment"; const QuickQuoteEvent = props => { const { location, selectedNode, sModelsId } = props; - const [isDraftSaved, setIsDraftSaved] = useState(false); // const selectedNode = JSON.parse(location.state).quotationData; const addState = {}; @@ -357,7 +356,6 @@ const QuickQuoteEvent = props => { }); return; } - const type = isDraftSaved ? "add" : "update"; props.onSaveState( { ...addState.onGetAllDelData(), @@ -878,6 +876,7 @@ const QuickQuoteEvent = props => { manyqtysData: state.manyData, }, })); + const result = await props.handleCalculation( false, { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData }, @@ -1467,6 +1466,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 +1518,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 +1553,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 +1564,7 @@ const BoxComponent = props => { viewRow: slaveRowData, tableName: `slaveDown${boxModel}`, }; + // 获取sType为3的 const { productProcessInfo = [] } = masterData; const finishedViewProps = { @@ -1891,7 +1901,75 @@ const BoxComponent = props => { handleSwitchChange(x, val)} />
{switchStates && switchStates[x.sName] ? ( - + // 这里需要数组遍历 多个工序 +
+ +
+ {!x.sParentName ? ( + + ) : ( + + )} +
+
) : ( "" )} @@ -2200,7 +2278,7 @@ const ManyComponent = props => { }; props.onSaveState( { - masterData: { ...props.masterData, handleType: props.masterData.handleType || "update" }, + masterData: { ...props.masterData, handleType: props.isDraftSaved ? "add" : "update" }, ...addState, }, () => { diff --git a/src/mobile/quotation/master.jsx b/src/mobile/quotation/master.jsx index 7cbfa2c..b5cabbe 100644 --- a/src/mobile/quotation/master.jsx +++ b/src/mobile/quotation/master.jsx @@ -15,6 +15,7 @@ const masterEvent = props => { const { token } = app; const [state, setState] = useState(null); const [isInitialized, setIsInitialized] = useState(false); + const [isDraftSaved, setIsDraftSaved] = useState(false); const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; @@ -186,6 +187,8 @@ const masterEvent = props => { onSaveState: handleSaveState, onSaveData: handleSaveData, onSubmit: handleSave, + isDraftSaved, + setIsDraftSaved, // onButtonClick: handleButtonClick, ...state, }; @@ -360,7 +363,6 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { manyDataCache = [], dQuickQuoteProductQty, } = nextProps; - console.log("🚀 ~ handleCalculation ~ dQuickQuoteProductQty:", dQuickQuoteProductQty) let { slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData } = nextProps; const sMakePerson = masterData.sMakePerson; const data = []; @@ -408,15 +410,25 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { masterData.sFormId = nextProps.masterData.sFormId; masterData.sBillNo = nextProps.masterData.sBillNo; } - masterData.handleType = nextProps.handleType && nextProps.handleType === "update" ? "update" : "add"; + // masterData.handleType = nextProps.handleType && nextProps.handleType === "update" ? "update" : "add"; if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) { masterData.sMakePerson = sMakePerson; + if (masterData.sBillNo === "") { + const slaveUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${"172129113112117410664746760"}?sModelsId=${ + props.sModelsId + }`; + const value = { sId: masterData.sId }; + const slaveReturnData = (await commonServices.postValueService(props.app.token, value, slaveUrl)).data; + const data = slaveReturnData.dataset.rows[0].dataSet[0]; + masterData = { ...data }; + } } slaveData = valueReturn[`${slaveConfig.sTbName.toLowerCase()}_tmp`].map(item => { item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; - item.sId = commonUtils.createSid(); + item.sId = commonUtils.createSid(); return item; }); + controlData = valueReturn[`${controlConfig.sTbName.toLowerCase()}_tmp`].map(item => { item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; item.sId = commonUtils.createSid(); @@ -539,7 +551,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { ...addState, }); } else { - masterData.handleType = "update"; + // masterData.handleType = "update"; if (isWait) { return { slaveData, @@ -798,7 +810,8 @@ const handleSaveData = async (params, props) => { Toast.show({ content: "保存成功", }); - masterData.handleType = "update"; + // masterData.handleType = "update"; + props.setIsDraftSaved(true); props.onSaveState({ enabled: false, currentId: masterData.sId, 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