Commit b952f4162dbcd82b3ef031ed7bfc3385afcfead0

Authored by Min
2 parents 29d550e0 25cac788

Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi

src/components/Common/CommonCostomTabBill.js
@@ -2468,7 +2468,6 @@ class CommonNewBill extends Component { @@ -2468,7 +2468,6 @@ class CommonNewBill extends Component {
2468 const proName = proObj.sproName; 2468 const proName = proObj.sproName;
2469 let sRowData = slaveRow; 2469 let sRowData = slaveRow;
2470 //取第一条BOM的id 2470 //取第一条BOM的id
2471 - console.log('addState1addState1', name, tableData);  
2472 sRowData = { ...sRowData, sBomId: tableData[0].sBomId }; 2471 sRowData = { ...sRowData, sBomId: tableData[0].sBomId };
2473 const value = { 2472 const value = {
2474 sProName: proName, 2473 sProName: proName,
src/components/Common/Typesetting/typesetting.js
@@ -607,6 +607,7 @@ const Typesetting = props => { @@ -607,6 +607,7 @@ const Typesetting = props => {
607 607
608 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;
609 if (isCustomized && !isShow) { 609 if (isCustomized && !isShow) {
  610 + if (isMobile) return;
610 message.error("排版尺寸大于上机尺寸,请确认参数!"); 611 message.error("排版尺寸大于上机尺寸,请确认参数!");
611 } 612 }
612 const onClick = () => { 613 const onClick = () => {
src/mobile/components/SelectInput.jsx
1 import React, { useState, useRef, useEffect, useCallback } from "react"; 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 import { DownOutline } from "antd-mobile-icons"; 3 import { DownOutline } from "antd-mobile-icons";
4 import commonConfig from "@/utils/config"; 4 import commonConfig from "@/utils/config";
5 import * as commonServices from "@/services/services"; 5 import * as commonServices from "@/services/services";
@@ -148,7 +148,12 @@ const SelectInput = props => { @@ -148,7 +148,12 @@ const SelectInput = props => {
148 <div> 148 <div>
149 <div className={styles.inputBox}> 149 <div className={styles.inputBox}>
150 {propsType === "b" ? ( 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 <div> 158 <div>
154 {" "} 159 {" "}
src/mobile/components/selectInput.css
1 .inputBox { 1 .inputBox {
2 position: relative; 2 position: relative;
  3 + height: 100%;
3 } 4 }
4 .inputBox .icons { 5 .inputBox .icons {
5 position: absolute; 6 position: absolute;
src/mobile/components/selectInput.less
1 .inputBox { 1 .inputBox {
2 position: relative; 2 position: relative;
  3 + height: 100%;
  4 + // margin: 0.5rem 0;
3 .icons { 5 .icons {
4 position: absolute; 6 position: absolute;
5 top: 50%; 7 top: 50%;
src/mobile/quotation/detailNew.jsx
@@ -17,7 +17,6 @@ import { cloneDeep } from &quot;lodash&quot;; @@ -17,7 +17,6 @@ import { cloneDeep } from &quot;lodash&quot;;
17 import moment from "moment"; 17 import moment from "moment";
18 const QuickQuoteEvent = props => { 18 const QuickQuoteEvent = props => {
19 const { location, selectedNode, sModelsId } = props; 19 const { location, selectedNode, sModelsId } = props;
20 - const [isDraftSaved, setIsDraftSaved] = useState(false);  
21 // const selectedNode = JSON.parse(location.state).quotationData; 20 // const selectedNode = JSON.parse(location.state).quotationData;
22 const addState = {}; 21 const addState = {};
23 22
@@ -357,7 +356,6 @@ const QuickQuoteEvent = props =&gt; { @@ -357,7 +356,6 @@ const QuickQuoteEvent = props =&gt; {
357 }); 356 });
358 return; 357 return;
359 } 358 }
360 - const type = isDraftSaved ? "add" : "update";  
361 props.onSaveState( 359 props.onSaveState(
362 { 360 {
363 ...addState.onGetAllDelData(), 361 ...addState.onGetAllDelData(),
@@ -878,6 +876,7 @@ const QuickQuoteEvent = props =&gt; { @@ -878,6 +876,7 @@ const QuickQuoteEvent = props =&gt; {
878 manyqtysData: state.manyData, 876 manyqtysData: state.manyData,
879 }, 877 },
880 })); 878 }));
  879 +
881 const result = await props.handleCalculation( 880 const result = await props.handleCalculation(
882 false, 881 false,
883 { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData }, 882 { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData },
@@ -1467,6 +1466,10 @@ const BoxComponent = props =&gt; { @@ -1467,6 +1466,10 @@ const BoxComponent = props =&gt; {
1467 if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { 1466 if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") {
1468 return false; 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 return item.iTag === iTag; 1474 return item.iTag === iTag;
1472 }); 1475 });
@@ -1515,20 +1518,26 @@ const BoxComponent = props =&gt; { @@ -1515,20 +1518,26 @@ const BoxComponent = props =&gt; {
1515 // return pre; 1518 // return pre;
1516 // }, []); 1519 // }, []);
1517 useEffect(() => { 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 // 初始化状态,存储每个 Switch 的状态 1529 // 初始化状态,存储每个 Switch 的状态
1521 const [switchStates, setSwitchStates] = useState(null); 1530 const [switchStates, setSwitchStates] = useState(null);
1522 useEffect(() => { 1531 useEffect(() => {
1523 if (!sBackProcessData) return; 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 }, [downAbleConfigsNew, boxModel]); // 依赖数组 1541 }, [downAbleConfigsNew, boxModel]); // 依赖数组
1533 1542
1534 // 处理 Switch 变化的函数 1543 // 处理 Switch 变化的函数
@@ -1544,7 +1553,7 @@ const BoxComponent = props =&gt; { @@ -1544,7 +1553,7 @@ const BoxComponent = props =&gt; {
1544 .map((item, i) => ({ 1553 .map((item, i) => ({
1545 ...item, 1554 ...item,
1546 isSelect: switchStates ? switchStates[item.sName] : false, 1555 isSelect: switchStates ? switchStates[item.sName] : false,
1547 - sName: "sParams" + i, 1556 + // sName: "sParams" + i,
1548 sProductClassifyId: item.sId, 1557 sProductClassifyId: item.sId,
1549 })); 1558 }));
1550 const downViewProps = { 1559 const downViewProps = {
@@ -1555,6 +1564,7 @@ const BoxComponent = props =&gt; { @@ -1555,6 +1564,7 @@ const BoxComponent = props =&gt; {
1555 viewRow: slaveRowData, 1564 viewRow: slaveRowData,
1556 tableName: `slaveDown${boxModel}`, 1565 tableName: `slaveDown${boxModel}`,
1557 }; 1566 };
  1567 +
1558 // 获取sType为3的 1568 // 获取sType为3的
1559 const { productProcessInfo = [] } = masterData; 1569 const { productProcessInfo = [] } = masterData;
1560 const finishedViewProps = { 1570 const finishedViewProps = {
@@ -1891,7 +1901,75 @@ const BoxComponent = props =&gt; { @@ -1891,7 +1901,75 @@ const BoxComponent = props =&gt; {
1891 <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} /> 1901 <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} />
1892 <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}> 1902 <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}>
1893 {switchStates && switchStates[x.sName] ? ( 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 =&gt; { @@ -2200,7 +2278,7 @@ const ManyComponent = props =&gt; {
2200 }; 2278 };
2201 props.onSaveState( 2279 props.onSaveState(
2202 { 2280 {
2203 - masterData: { ...props.masterData, handleType: props.masterData.handleType || "update" }, 2281 + masterData: { ...props.masterData, handleType: props.isDraftSaved ? "add" : "update" },
2204 ...addState, 2282 ...addState,
2205 }, 2283 },
2206 () => { 2284 () => {
src/mobile/quotation/master.jsx
@@ -15,6 +15,7 @@ const masterEvent = props =&gt; { @@ -15,6 +15,7 @@ const masterEvent = props =&gt; {
15 const { token } = app; 15 const { token } = app;
16 const [state, setState] = useState(null); 16 const [state, setState] = useState(null);
17 const [isInitialized, setIsInitialized] = useState(false); 17 const [isInitialized, setIsInitialized] = useState(false);
  18 + const [isDraftSaved, setIsDraftSaved] = useState(false);
18 19
19 const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { 20 const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => {
20 const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; 21 const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`;
@@ -186,6 +187,8 @@ const masterEvent = props =&gt; { @@ -186,6 +187,8 @@ const masterEvent = props =&gt; {
186 onSaveState: handleSaveState, 187 onSaveState: handleSaveState,
187 onSaveData: handleSaveData, 188 onSaveData: handleSaveData,
188 onSubmit: handleSave, 189 onSubmit: handleSave,
  190 + isDraftSaved,
  191 + setIsDraftSaved,
189 // onButtonClick: handleButtonClick, 192 // onButtonClick: handleButtonClick,
190 ...state, 193 ...state,
191 }; 194 };
@@ -360,7 +363,6 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -360,7 +363,6 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
360 manyDataCache = [], 363 manyDataCache = [],
361 dQuickQuoteProductQty, 364 dQuickQuoteProductQty,
362 } = nextProps; 365 } = nextProps;
363 - console.log("🚀 ~ handleCalculation ~ dQuickQuoteProductQty:", dQuickQuoteProductQty)  
364 let { slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData } = nextProps; 366 let { slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData } = nextProps;
365 const sMakePerson = masterData.sMakePerson; 367 const sMakePerson = masterData.sMakePerson;
366 const data = []; 368 const data = [];
@@ -408,15 +410,25 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -408,15 +410,25 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
408 masterData.sFormId = nextProps.masterData.sFormId; 410 masterData.sFormId = nextProps.masterData.sFormId;
409 masterData.sBillNo = nextProps.masterData.sBillNo; 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 if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) { 414 if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) {
413 masterData.sMakePerson = sMakePerson; 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 slaveData = valueReturn[`${slaveConfig.sTbName.toLowerCase()}_tmp`].map(item => { 426 slaveData = valueReturn[`${slaveConfig.sTbName.toLowerCase()}_tmp`].map(item => {
416 item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; 427 item.handleType = dQuickQuoteProductQty ? "update" : item.handleType;
417 - item.sId = commonUtils.createSid(); 428 + item.sId = commonUtils.createSid();
418 return item; 429 return item;
419 }); 430 });
  431 +
420 controlData = valueReturn[`${controlConfig.sTbName.toLowerCase()}_tmp`].map(item => { 432 controlData = valueReturn[`${controlConfig.sTbName.toLowerCase()}_tmp`].map(item => {
421 item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; 433 item.handleType = dQuickQuoteProductQty ? "update" : item.handleType;
422 item.sId = commonUtils.createSid(); 434 item.sId = commonUtils.createSid();
@@ -539,7 +551,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -539,7 +551,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
539 ...addState, 551 ...addState,
540 }); 552 });
541 } else { 553 } else {
542 - masterData.handleType = "update"; 554 + // masterData.handleType = "update";
543 if (isWait) { 555 if (isWait) {
544 return { 556 return {
545 slaveData, 557 slaveData,
@@ -798,7 +810,8 @@ const handleSaveData = async (params, props) =&gt; { @@ -798,7 +810,8 @@ const handleSaveData = async (params, props) =&gt; {
798 Toast.show({ 810 Toast.show({
799 content: "保存成功", 811 content: "保存成功",
800 }); 812 });
801 - masterData.handleType = "update"; 813 + // masterData.handleType = "update";
  814 + props.setIsDraftSaved(true);
802 props.onSaveState({ 815 props.onSaveState({
803 enabled: false, 816 enabled: false,
804 currentId: masterData.sId, 817 currentId: masterData.sId,
src/mobile/quotation/quotationDetail.css
@@ -159,3 +159,11 @@ @@ -159,3 +159,11 @@
159 right: 5%; 159 right: 5%;
160 bottom: 10%; 160 bottom: 10%;
161 } 161 }
  162 +.processFlex {
  163 + display: flex;
  164 + align-items: center;
  165 + justify-content: space-between;
  166 +}
  167 +.processFlex .processBtn {
  168 + margin-left: 1rem;
  169 +}
src/mobile/quotation/quotationDetail.less
@@ -167,4 +167,12 @@ @@ -167,4 +167,12 @@
167 right: 5%; 167 right: 5%;
168 bottom: 10%; 168 bottom: 10%;
169 } 169 }
  170 +}
  171 +.processFlex{
  172 + display: flex;
  173 + align-items: center;
  174 + justify-content: space-between;
  175 + .processBtn{
  176 + margin-left: 1rem;
  177 + }
170 } 178 }
171 \ No newline at end of file 179 \ No newline at end of file