Commit b952f4162dbcd82b3ef031ed7bfc3385afcfead0
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi
Showing
9 changed files
with
138 additions
and
23 deletions
src/components/Common/CommonCostomTabBill.js
| ... | ... | @@ -2468,7 +2468,6 @@ class CommonNewBill extends Component { |
| 2468 | 2468 | const proName = proObj.sproName; |
| 2469 | 2469 | let sRowData = slaveRow; |
| 2470 | 2470 | //取第一条BOM的id |
| 2471 | - console.log('addState1addState1', name, tableData); | |
| 2472 | 2471 | sRowData = { ...sRowData, sBomId: tableData[0].sBomId }; |
| 2473 | 2472 | const value = { |
| 2474 | 2473 | sProName: proName, | ... | ... |
src/components/Common/Typesetting/typesetting.js
| ... | ... | @@ -607,6 +607,7 @@ const Typesetting = props => { |
| 607 | 607 | |
| 608 | 608 | const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; |
| 609 | 609 | if (isCustomized && !isShow) { |
| 610 | + if (isMobile) return; | |
| 610 | 611 | message.error("排版尺寸大于上机尺寸,请确认参数!"); |
| 611 | 612 | } |
| 612 | 613 | const onClick = () => { | ... | ... |
src/mobile/components/SelectInput.jsx
| 1 | 1 | import React, { useState, useRef, useEffect, useCallback } from "react"; |
| 2 | -import { Input, Popup, Button, Toast, PickerView, SearchBar,Checkbox } from "antd-mobile"; | |
| 2 | +import { Input, Popup, Button, Toast, PickerView, SearchBar, Checkbox } from "antd-mobile"; | |
| 3 | 3 | import { DownOutline } from "antd-mobile-icons"; |
| 4 | 4 | import commonConfig from "@/utils/config"; |
| 5 | 5 | import * as commonServices from "@/services/services"; |
| ... | ... | @@ -148,7 +148,12 @@ const SelectInput = props => { |
| 148 | 148 | <div> |
| 149 | 149 | <div className={styles.inputBox}> |
| 150 | 150 | {propsType === "b" ? ( |
| 151 | - <Checkbox style={{height:'3.125rem'}}/> | |
| 151 | + <Checkbox | |
| 152 | + style={{ height: "3.125rem" }} | |
| 153 | + onChange={val => { | |
| 154 | + props.onDataChange(tableName, itemDetail.sName, { [itemDetail.sName]: val }, null, coplyColumns); | |
| 155 | + }} | |
| 156 | + /> | |
| 152 | 157 | ) : ( |
| 153 | 158 | <div> |
| 154 | 159 | {" "} | ... | ... |
src/mobile/components/selectInput.css
src/mobile/components/selectInput.less
src/mobile/quotation/detailNew.jsx
| ... | ... | @@ -17,7 +17,6 @@ import { cloneDeep } from "lodash"; |
| 17 | 17 | import moment from "moment"; |
| 18 | 18 | const QuickQuoteEvent = props => { |
| 19 | 19 | const { location, selectedNode, sModelsId } = props; |
| 20 | - const [isDraftSaved, setIsDraftSaved] = useState(false); | |
| 21 | 20 | // const selectedNode = JSON.parse(location.state).quotationData; |
| 22 | 21 | const addState = {}; |
| 23 | 22 | |
| ... | ... | @@ -357,7 +356,6 @@ const QuickQuoteEvent = props => { |
| 357 | 356 | }); |
| 358 | 357 | return; |
| 359 | 358 | } |
| 360 | - const type = isDraftSaved ? "add" : "update"; | |
| 361 | 359 | props.onSaveState( |
| 362 | 360 | { |
| 363 | 361 | ...addState.onGetAllDelData(), |
| ... | ... | @@ -878,6 +876,7 @@ const QuickQuoteEvent = props => { |
| 878 | 876 | manyqtysData: state.manyData, |
| 879 | 877 | }, |
| 880 | 878 | })); |
| 879 | + | |
| 881 | 880 | const result = await props.handleCalculation( |
| 882 | 881 | false, |
| 883 | 882 | { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData }, |
| ... | ... | @@ -1467,6 +1466,10 @@ const BoxComponent = props => { |
| 1467 | 1466 | if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { |
| 1468 | 1467 | return false; |
| 1469 | 1468 | } |
| 1469 | + const { bAdvancedSetting } = slaveRowData; | |
| 1470 | + if ((item.sName === "dPortrait" && !bAdvancedSetting) || (item.sName === "dHorizontal" && !bAdvancedSetting)) { | |
| 1471 | + return false; | |
| 1472 | + } | |
| 1470 | 1473 | |
| 1471 | 1474 | return item.iTag === iTag; |
| 1472 | 1475 | }); |
| ... | ... | @@ -1515,20 +1518,26 @@ const BoxComponent = props => { |
| 1515 | 1518 | // return pre; |
| 1516 | 1519 | // }, []); |
| 1517 | 1520 | useEffect(() => { |
| 1518 | - setDownAbleConfigsNew(downAbleConfigs); | |
| 1519 | - }, [downAbleConfigs]); | |
| 1521 | + // setDownAbleConfigsNew(downAbleConfigs); | |
| 1522 | + const data = downAbleConfigs.reduce((pre, cur) => { | |
| 1523 | + const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName); | |
| 1524 | + pre.push(cur, ...childConfigs); | |
| 1525 | + return pre; | |
| 1526 | + }, []); | |
| 1527 | + setDownAbleConfigsNew(data); | |
| 1528 | + }, [downAbleConfigs, downAbleExtraConfigs]); | |
| 1520 | 1529 | // 初始化状态,存储每个 Switch 的状态 |
| 1521 | 1530 | const [switchStates, setSwitchStates] = useState(null); |
| 1522 | 1531 | useEffect(() => { |
| 1523 | 1532 | if (!sBackProcessData) return; |
| 1524 | - const newSwitchStates = downAbleConfigsNew | |
| 1525 | - .filter(item => item.sPartsName === boxModel || !item.sPartsName) | |
| 1526 | - .reduce((acc, item, index) => { | |
| 1527 | - acc[item.sName] = sBackProcessData ? sBackProcessData[index][item.sName] !== "" : false; | |
| 1528 | - return acc; | |
| 1529 | - }, {}); | |
| 1530 | - | |
| 1531 | - setSwitchStates(newSwitchStates); | |
| 1533 | + // const newSwitchStates = downAbleConfigsNew | |
| 1534 | + // .filter(item => item.sPartsName === boxModel || !item.sPartsName) | |
| 1535 | + // .reduce((acc, item, index) => { | |
| 1536 | + // acc[item.sName] = sBackProcessData && sBackProcessData[index]? sBackProcessData[index][item.sName] !== "" : false; | |
| 1537 | + // return acc; | |
| 1538 | + // }, {}); | |
| 1539 | + | |
| 1540 | + // setSwitchStates(newSwitchStates); | |
| 1532 | 1541 | }, [downAbleConfigsNew, boxModel]); // 依赖数组 |
| 1533 | 1542 | |
| 1534 | 1543 | // 处理 Switch 变化的函数 |
| ... | ... | @@ -1544,7 +1553,7 @@ const BoxComponent = props => { |
| 1544 | 1553 | .map((item, i) => ({ |
| 1545 | 1554 | ...item, |
| 1546 | 1555 | isSelect: switchStates ? switchStates[item.sName] : false, |
| 1547 | - sName: "sParams" + i, | |
| 1556 | + // sName: "sParams" + i, | |
| 1548 | 1557 | sProductClassifyId: item.sId, |
| 1549 | 1558 | })); |
| 1550 | 1559 | const downViewProps = { |
| ... | ... | @@ -1555,6 +1564,7 @@ const BoxComponent = props => { |
| 1555 | 1564 | viewRow: slaveRowData, |
| 1556 | 1565 | tableName: `slaveDown${boxModel}`, |
| 1557 | 1566 | }; |
| 1567 | + | |
| 1558 | 1568 | // 获取sType为3的 |
| 1559 | 1569 | const { productProcessInfo = [] } = masterData; |
| 1560 | 1570 | const finishedViewProps = { |
| ... | ... | @@ -1891,7 +1901,75 @@ const BoxComponent = props => { |
| 1891 | 1901 | <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} /> |
| 1892 | 1902 | <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}> |
| 1893 | 1903 | {switchStates && switchStates[x.sName] ? ( |
| 1894 | - <SelectInput {...downViewProps} itemDetail={{ ...x, sVisColumnName: "sProcessName", sDropDownType: "sql" }} downIndex={i} /> | |
| 1904 | + // 这里需要数组遍历 多个工序 | |
| 1905 | + <div className={styles.processFlex}> | |
| 1906 | + <SelectInput {...downViewProps} itemDetail={{ ...x, sVisColumnName: "sProcessName", sDropDownType: "sql" }} downIndex={i} /> | |
| 1907 | + <div className={styles.processBtn}> | |
| 1908 | + {!x.sParentName ? ( | |
| 1909 | + <Button | |
| 1910 | + color="primary" | |
| 1911 | + fill="solid" | |
| 1912 | + size="small" | |
| 1913 | + style={{ | |
| 1914 | + width: "1.93rem", | |
| 1915 | + height: "1.93rem", | |
| 1916 | + display: "flex", | |
| 1917 | + justifyContent: "center", | |
| 1918 | + alignItems: "center", | |
| 1919 | + textAlign: "center", | |
| 1920 | + }} | |
| 1921 | + onClick={() => { | |
| 1922 | + props.setState(pre => { | |
| 1923 | + const newSId = commonUtils.createSid(); | |
| 1924 | + const newConfig = { | |
| 1925 | + ...x, | |
| 1926 | + sId: newSId, | |
| 1927 | + sParentName: x.showName, | |
| 1928 | + sName: `${x.sName}_${newSId}`, | |
| 1929 | + }; | |
| 1930 | + return { | |
| 1931 | + ...pre, | |
| 1932 | + downAbleExtraConfigs: [...downAbleExtraConfigs, newConfig], | |
| 1933 | + }; | |
| 1934 | + }); | |
| 1935 | + }} | |
| 1936 | + > | |
| 1937 | + <AddOutline /> | |
| 1938 | + </Button> | |
| 1939 | + ) : ( | |
| 1940 | + <Button | |
| 1941 | + color="danger" | |
| 1942 | + fill="solid" | |
| 1943 | + size="small" | |
| 1944 | + style={{ | |
| 1945 | + width: "1.93rem", | |
| 1946 | + height: "1.93rem", | |
| 1947 | + display: "flex", | |
| 1948 | + justifyContent: "center", | |
| 1949 | + alignItems: "center", | |
| 1950 | + textAlign: "center", | |
| 1951 | + }} | |
| 1952 | + onClick={() => { | |
| 1953 | + props.setState(pre => { | |
| 1954 | + const iIndex = downAbleExtraConfigs.findIndex(item => item.sId === x.sId); | |
| 1955 | + | |
| 1956 | + const slaveRowIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); | |
| 1957 | + const { sBackProcessData = [] } = slaveData[slaveRowIndex]; | |
| 1958 | + const iIndex1 = sBackProcessData.findIndex(item => item[x.sName]); | |
| 1959 | + slaveData[slaveRowIndex].sBackProcessData?.splice(iIndex1, 1); | |
| 1960 | + return { | |
| 1961 | + ...pre, | |
| 1962 | + downAbleExtraConfigs: [...downAbleExtraConfigs.slice(0, iIndex), ...downAbleExtraConfigs.slice(iIndex + 1)], | |
| 1963 | + slaveData, | |
| 1964 | + }; | |
| 1965 | + }); | |
| 1966 | + }} | |
| 1967 | + > | |
| 1968 | + <MinusOutline /> | |
| 1969 | + </Button> | |
| 1970 | + )} | |
| 1971 | + </div> | |
| 1972 | + </div> | |
| 1895 | 1973 | ) : ( |
| 1896 | 1974 | "" |
| 1897 | 1975 | )} |
| ... | ... | @@ -2200,7 +2278,7 @@ const ManyComponent = props => { |
| 2200 | 2278 | }; |
| 2201 | 2279 | props.onSaveState( |
| 2202 | 2280 | { |
| 2203 | - masterData: { ...props.masterData, handleType: props.masterData.handleType || "update" }, | |
| 2281 | + masterData: { ...props.masterData, handleType: props.isDraftSaved ? "add" : "update" }, | |
| 2204 | 2282 | ...addState, |
| 2205 | 2283 | }, |
| 2206 | 2284 | () => { | ... | ... |
src/mobile/quotation/master.jsx
| ... | ... | @@ -15,6 +15,7 @@ const masterEvent = props => { |
| 15 | 15 | const { token } = app; |
| 16 | 16 | const [state, setState] = useState(null); |
| 17 | 17 | const [isInitialized, setIsInitialized] = useState(false); |
| 18 | + const [isDraftSaved, setIsDraftSaved] = useState(false); | |
| 18 | 19 | |
| 19 | 20 | const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { |
| 20 | 21 | const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; |
| ... | ... | @@ -186,6 +187,8 @@ const masterEvent = props => { |
| 186 | 187 | onSaveState: handleSaveState, |
| 187 | 188 | onSaveData: handleSaveData, |
| 188 | 189 | onSubmit: handleSave, |
| 190 | + isDraftSaved, | |
| 191 | + setIsDraftSaved, | |
| 189 | 192 | // onButtonClick: handleButtonClick, |
| 190 | 193 | ...state, |
| 191 | 194 | }; |
| ... | ... | @@ -360,7 +363,6 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { |
| 360 | 363 | manyDataCache = [], |
| 361 | 364 | dQuickQuoteProductQty, |
| 362 | 365 | } = nextProps; |
| 363 | - console.log("🚀 ~ handleCalculation ~ dQuickQuoteProductQty:", dQuickQuoteProductQty) | |
| 364 | 366 | let { slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData } = nextProps; |
| 365 | 367 | const sMakePerson = masterData.sMakePerson; |
| 366 | 368 | const data = []; |
| ... | ... | @@ -408,15 +410,25 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { |
| 408 | 410 | masterData.sFormId = nextProps.masterData.sFormId; |
| 409 | 411 | masterData.sBillNo = nextProps.masterData.sBillNo; |
| 410 | 412 | } |
| 411 | - masterData.handleType = nextProps.handleType && nextProps.handleType === "update" ? "update" : "add"; | |
| 413 | + // masterData.handleType = nextProps.handleType && nextProps.handleType === "update" ? "update" : "add"; | |
| 412 | 414 | if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) { |
| 413 | 415 | masterData.sMakePerson = sMakePerson; |
| 416 | + if (masterData.sBillNo === "") { | |
| 417 | + const slaveUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${"172129113112117410664746760"}?sModelsId=${ | |
| 418 | + props.sModelsId | |
| 419 | + }`; | |
| 420 | + const value = { sId: masterData.sId }; | |
| 421 | + const slaveReturnData = (await commonServices.postValueService(props.app.token, value, slaveUrl)).data; | |
| 422 | + const data = slaveReturnData.dataset.rows[0].dataSet[0]; | |
| 423 | + masterData = { ...data }; | |
| 424 | + } | |
| 414 | 425 | } |
| 415 | 426 | slaveData = valueReturn[`${slaveConfig.sTbName.toLowerCase()}_tmp`].map(item => { |
| 416 | 427 | item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; |
| 417 | - item.sId = commonUtils.createSid(); | |
| 428 | + item.sId = commonUtils.createSid(); | |
| 418 | 429 | return item; |
| 419 | 430 | }); |
| 431 | + | |
| 420 | 432 | controlData = valueReturn[`${controlConfig.sTbName.toLowerCase()}_tmp`].map(item => { |
| 421 | 433 | item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; |
| 422 | 434 | item.sId = commonUtils.createSid(); |
| ... | ... | @@ -539,7 +551,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) => { |
| 539 | 551 | ...addState, |
| 540 | 552 | }); |
| 541 | 553 | } else { |
| 542 | - masterData.handleType = "update"; | |
| 554 | + // masterData.handleType = "update"; | |
| 543 | 555 | if (isWait) { |
| 544 | 556 | return { |
| 545 | 557 | slaveData, |
| ... | ... | @@ -798,7 +810,8 @@ const handleSaveData = async (params, props) => { |
| 798 | 810 | Toast.show({ |
| 799 | 811 | content: "保存成功", |
| 800 | 812 | }); |
| 801 | - masterData.handleType = "update"; | |
| 813 | + // masterData.handleType = "update"; | |
| 814 | + props.setIsDraftSaved(true); | |
| 802 | 815 | props.onSaveState({ |
| 803 | 816 | enabled: false, |
| 804 | 817 | currentId: masterData.sId, | ... | ... |
src/mobile/quotation/quotationDetail.css
src/mobile/quotation/quotationDetail.less