Commit 4bbfa94128fb327fd13efc3dc65999c1ba849caf
1 parent
b3ddd4a4
矩形选择
Showing
2 changed files
with
16 additions
and
75 deletions
src/components/Common/Typesetting/typesetting.js
| @@ -612,6 +612,8 @@ const Typesetting = props => { | @@ -612,6 +612,8 @@ const Typesetting = props => { | ||
| 612 | } | 612 | } |
| 613 | const newDProductQty = masterData.dProductQty; | 613 | const newDProductQty = masterData.dProductQty; |
| 614 | const dMaterialsKQty = slaveDataDetail.dMaterialsKQty || 1; | 614 | const dMaterialsKQty = slaveDataDetail.dMaterialsKQty || 1; |
| 615 | + | ||
| 616 | + | ||
| 615 | if ( | 617 | if ( |
| 616 | dPartsLength !== innerWidth || | 618 | dPartsLength !== innerWidth || |
| 617 | newMaterialLength !== materialLength || | 619 | newMaterialLength !== materialLength || |
| @@ -621,6 +623,8 @@ const Typesetting = props => { | @@ -621,6 +623,8 @@ const Typesetting = props => { | ||
| 621 | newDPortraitType !== dPortraitType || | 623 | newDPortraitType !== dPortraitType || |
| 622 | (!dWlcd && sBillNo) | 624 | (!dWlcd && sBillNo) |
| 623 | ) { | 625 | ) { |
| 626 | + console.log(slaveRowData.dMachineLength,'slaveRowData.dMachineLengthss'); | ||
| 627 | + | ||
| 624 | setMaterialLength(newMaterialLength); | 628 | setMaterialLength(newMaterialLength); |
| 625 | setMaterialWidth(newMaterialWidth); | 629 | setMaterialWidth(newMaterialWidth); |
| 626 | setMaterialName(sMaterialsName); | 630 | setMaterialName(sMaterialsName); |
src/components/QuickQuote/index.jsx
| @@ -274,7 +274,7 @@ const QuickQuoteEvent = props => { | @@ -274,7 +274,7 @@ const QuickQuoteEvent = props => { | ||
| 274 | dProductQty: changeValue.dProductQty, | 274 | dProductQty: changeValue.dProductQty, |
| 275 | })); | 275 | })); |
| 276 | } | 276 | } |
| 277 | - | 277 | + |
| 278 | if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { | 278 | if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { |
| 279 | if (props.currentBoxModel) { | 279 | if (props.currentBoxModel) { |
| 280 | const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); | 280 | const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); |
| @@ -445,23 +445,7 @@ const QuickQuoteEvent = props => { | @@ -445,23 +445,7 @@ const QuickQuoteEvent = props => { | ||
| 445 | materialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd, | 445 | materialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd, |
| 446 | }; | 446 | }; |
| 447 | } | 447 | } |
| 448 | - // 如果是卡牌那么赋值sMachineStyle | ||
| 449 | - // if (selectedNode.sTypeKey === 'kapai' || selectedNode.sTypeKey === 'juantong') { | ||
| 450 | - // console.log(slaveData[saveIndex].dMaxLength,'juantong'); | ||
| 451 | - | ||
| 452 | - // if (slaveData[saveIndex].dMaxLength === undefined) { | ||
| 453 | - // slaveData[saveIndex] = { | ||
| 454 | - // ...slaveData[saveIndex], | ||
| 455 | - // dMaxLength: Number(selectedNode.sMachineStyle.split("*")[0]), | ||
| 456 | - // }; | ||
| 457 | - // } | ||
| 458 | - // if (slaveData[saveIndex].dMaxWidth === undefined) { | ||
| 459 | - // slaveData[saveIndex] = { | ||
| 460 | - // ...slaveData[saveIndex], | ||
| 461 | - // dMaxWidth: Number(selectedNode.sMachineStyle.split("*")[1]), | ||
| 462 | - // }; | ||
| 463 | - // } | ||
| 464 | - // } | 448 | + |
| 465 | if (sFieldName === "sName") { | 449 | if (sFieldName === "sName") { |
| 466 | slaveData[saveIndex] = { | 450 | slaveData[saveIndex] = { |
| 467 | ...slaveData[saveIndex], | 451 | ...slaveData[saveIndex], |
| @@ -1162,6 +1146,7 @@ const QuickQuoteEvent = props => { | @@ -1162,6 +1146,7 @@ const QuickQuoteEvent = props => { | ||
| 1162 | // 入口 | 1146 | // 入口 |
| 1163 | const QuickQuote = baseProps => { | 1147 | const QuickQuote = baseProps => { |
| 1164 | const props = QuickQuoteEvent(baseProps); | 1148 | const props = QuickQuoteEvent(baseProps); |
| 1149 | + console.log("🚀 ~ QuickQuote:", props); | ||
| 1165 | const [treeClassName, setTreeClassName] = useState(""); | 1150 | const [treeClassName, setTreeClassName] = useState(""); |
| 1166 | 1151 | ||
| 1167 | // 监听页面滚动事件 | 1152 | // 监听页面滚动事件 |
| @@ -1320,7 +1305,6 @@ const TreeComponent = props => { | @@ -1320,7 +1305,6 @@ const TreeComponent = props => { | ||
| 1320 | return { | 1305 | return { |
| 1321 | ...pre, | 1306 | ...pre, |
| 1322 | ...addState, | 1307 | ...addState, |
| 1323 | - sPrintConfig: downAbleConfigs.find(item => item.sType === "1" && item.sName === "胶印"), | ||
| 1324 | downAbleConfigs: downAbleConfigs | 1308 | downAbleConfigs: downAbleConfigs |
| 1325 | .filter(item => item.sType === "2") | 1309 | .filter(item => item.sType === "2") |
| 1326 | .map((item, index) => ({ | 1310 | .map((item, index) => ({ |
| @@ -1516,7 +1500,7 @@ const MasterComponent = props => { | @@ -1516,7 +1500,7 @@ const MasterComponent = props => { | ||
| 1516 | item.iColValue = 4; | 1500 | item.iColValue = 4; |
| 1517 | } | 1501 | } |
| 1518 | }); | 1502 | }); |
| 1519 | - } | 1503 | + } |
| 1520 | const lengthData = viewConfigs.find(x => x.sName === "dLength"); | 1504 | const lengthData = viewConfigs.find(x => x.sName === "dLength"); |
| 1521 | 1505 | ||
| 1522 | if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { | 1506 | if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { |
| @@ -1572,10 +1556,13 @@ const BoxComponent = props => { | @@ -1572,10 +1556,13 @@ const BoxComponent = props => { | ||
| 1572 | const { bBox } = selectedNode; | 1556 | const { bBox } = selectedNode; |
| 1573 | const [boxTypeList, setBoxTypeList] = useState([]); | 1557 | const [boxTypeList, setBoxTypeList] = useState([]); |
| 1574 | // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 | 1558 | // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 |
| 1559 | + console.log(props, "asdadasd"); | ||
| 1575 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; | 1560 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; |
| 1576 | const { sBillNo } = slaveRowData; | 1561 | const { sBillNo } = slaveRowData; |
| 1577 | useEffect(() => { | 1562 | useEffect(() => { |
| 1578 | if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { | 1563 | if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { |
| 1564 | + const {sBillNo} = slaveRowData | ||
| 1565 | + if(sBillNo) return | ||
| 1579 | let dropDownData = []; | 1566 | let dropDownData = []; |
| 1580 | dropDownData.push(KapaiJson); | 1567 | dropDownData.push(KapaiJson); |
| 1581 | const boxData = (dropDownData || []).map((item, index) => ({ | 1568 | const boxData = (dropDownData || []).map((item, index) => ({ |
| @@ -2415,19 +2402,14 @@ const PrintParamsComponent = props => { | @@ -2415,19 +2402,14 @@ const PrintParamsComponent = props => { | ||
| 2415 | const printParamsItem = printParams[i - 1]; | 2402 | const printParamsItem = printParams[i - 1]; |
| 2416 | const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId }; | 2403 | const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId }; |
| 2417 | 2404 | ||
| 2418 | - const viewTableId = "viewTableId_" + viewRow.sId; | ||
| 2419 | const viewProps = { | 2405 | const viewProps = { |
| 2420 | ...props, | 2406 | ...props, |
| 2421 | - viewConfigs: printParamsConfig.map(item => ({ ...item, costomStyle: `xlyPrintParams${i}` })), | 2407 | + viewConfigs: printParamsConfig, |
| 2422 | tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig }, | 2408 | tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig }, |
| 2423 | iColValueView: 24, | 2409 | iColValueView: 24, |
| 2424 | viewRow, | 2410 | viewRow, |
| 2425 | tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`, | 2411 | tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`, |
| 2426 | onDataChange: (...args) => { | 2412 | onDataChange: (...args) => { |
| 2427 | - setTimeout(() => { | ||
| 2428 | - const oLabel = document.querySelector(`#${viewTableId}`)?.querySelector(`.xlyPrintParams${i}`)?.querySelector(".ant-form-item-label"); | ||
| 2429 | - oLabel?.click(); | ||
| 2430 | - }, 200); | ||
| 2431 | if (i === 0) { | 2413 | if (i === 0) { |
| 2432 | props.onDataChange(...args); | 2414 | props.onDataChange(...args); |
| 2433 | return; | 2415 | return; |
| @@ -2440,37 +2422,11 @@ const PrintParamsComponent = props => { | @@ -2440,37 +2422,11 @@ const PrintParamsComponent = props => { | ||
| 2440 | return { ...pre, slaveData }; | 2422 | return { ...pre, slaveData }; |
| 2441 | }); | 2423 | }); |
| 2442 | }, | 2424 | }, |
| 2443 | - onCostomClick: (showConfig, { target }) => { | ||
| 2444 | - if (showConfig.sName !== "sPrint") return; | ||
| 2445 | - const className = target.getAttribute("class"); | ||
| 2446 | - const nodeName = target.nodeName; | ||
| 2447 | - if (className?.includes("select") && nodeName === "DIV") return; | ||
| 2448 | - | ||
| 2449 | - const { sPrintConfig } = state; | ||
| 2450 | - | ||
| 2451 | - if (!sPrintConfig) return; | ||
| 2452 | - const backendConfigNew = { | ||
| 2453 | - sParentFieldsName: "sPrint", | ||
| 2454 | - sBoxModel: boxModel, | ||
| 2455 | - printParamsId: viewRow.sId, | ||
| 2456 | - }; | ||
| 2457 | - | ||
| 2458 | - const dropDownData = commonUtils.convertStrToObj(sPrintConfig.sChineseDropDown, []); | ||
| 2459 | - const dropDownDataSelected = dropDownData.find(item => item.sId === viewRow.sProcessId); | ||
| 2460 | - if (!dropDownDataSelected) return; | ||
| 2461 | - const backendParamsConfigNew = commonUtils.convertStrToObj(dropDownDataSelected.sParamConfig, []); | ||
| 2462 | - | ||
| 2463 | - props.setState(pre => ({ | ||
| 2464 | - ...pre, | ||
| 2465 | - backendParamsConfig: backendParamsConfigNew, | ||
| 2466 | - backendConfig: backendConfigNew, | ||
| 2467 | - })); | ||
| 2468 | - }, | ||
| 2469 | }; | 2425 | }; |
| 2470 | 2426 | ||
| 2471 | result.push( | 2427 | result.push( |
| 2472 | <div className={styles.materialsLine}> | 2428 | <div className={styles.materialsLine}> |
| 2473 | - <div className={styles.materialsViewTable} id={viewTableId}> | 2429 | + <div className={styles.materialsViewTable}> |
| 2474 | <CommonViewTable {...viewProps} /> | 2430 | <CommonViewTable {...viewProps} /> |
| 2475 | </div> | 2431 | </div> |
| 2476 | <div className={styles.materialsBtns} style={{ width: "10%" }}> | 2432 | <div className={styles.materialsBtns} style={{ width: "10%" }}> |
| @@ -3082,11 +3038,11 @@ const BoxModelSelectedModal = props => { | @@ -3082,11 +3038,11 @@ const BoxModelSelectedModal = props => { | ||
| 3082 | 3038 | ||
| 3083 | // 后道参数额外配置 | 3039 | // 后道参数额外配置 |
| 3084 | const BackendParamsExtraComponent = props => { | 3040 | const BackendParamsExtraComponent = props => { |
| 3085 | - const { state, slaveConfig } = props; | 3041 | + const { state, slaveConfig, boxModel } = props; |
| 3086 | const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state; | 3042 | const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state; |
| 3087 | if (!backendParamsConfig.length) return ""; | 3043 | if (!backendParamsConfig.length) return ""; |
| 3088 | 3044 | ||
| 3089 | - const { sParentFieldsName, sBoxModel, printParamsId } = backendConfig; | 3045 | + const { sParentFieldsName, sBoxModel } = backendConfig; |
| 3090 | 3046 | ||
| 3091 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {}; | 3047 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {}; |
| 3092 | const { sBackProcessData = [] } = slaveRowData; | 3048 | const { sBackProcessData = [] } = slaveRowData; |
| @@ -3108,12 +3064,9 @@ const BackendParamsExtraComponent = props => { | @@ -3108,12 +3064,9 @@ const BackendParamsExtraComponent = props => { | ||
| 3108 | tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs }, | 3064 | tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs }, |
| 3109 | iColValueView: 24, | 3065 | iColValueView: 24, |
| 3110 | getViewRow: config => { | 3066 | getViewRow: config => { |
| 3111 | - if (sParentFieldsName === "sPrint") { | ||
| 3112 | - return [slaveRowData, ...sBackProcessData].find(item => item.sId === printParamsId); | ||
| 3113 | - } | ||
| 3114 | return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {}; | 3067 | return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {}; |
| 3115 | }, | 3068 | }, |
| 3116 | - tableName: `sBackendParams${sBoxModel}`, | 3069 | + tableName: `sBackendParams${boxModel}`, |
| 3117 | getSqlDropDownData: (...args) => { | 3070 | getSqlDropDownData: (...args) => { |
| 3118 | const showConfig = args[2]; | 3071 | const showConfig = args[2]; |
| 3119 | const { sParamDropDown = "", sName } = showConfig; | 3072 | const { sParamDropDown = "", sName } = showConfig; |
| @@ -3137,22 +3090,6 @@ const BackendParamsExtraComponent = props => { | @@ -3137,22 +3090,6 @@ const BackendParamsExtraComponent = props => { | ||
| 3137 | }, | 3090 | }, |
| 3138 | onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { | 3091 | onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { |
| 3139 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); | 3092 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); |
| 3140 | - | ||
| 3141 | - if (sParentFieldsName === "sPrint") { | ||
| 3142 | - if (slaveData[iIndex].sId === printParamsId) { | ||
| 3143 | - let slaveDataNew = [...slaveData]; | ||
| 3144 | - slaveDataNew[iIndex] = { ...slaveDataNew[iIndex], ...changeValue }; | ||
| 3145 | - props.setState(pre => ({ ...pre, slaveData: slaveDataNew })); | ||
| 3146 | - } else { | ||
| 3147 | - const iIndex1 = sBackProcessData.findIndex(item => item.sId === printParamsId); | ||
| 3148 | - let sBackProcessDataNew = [...sBackProcessData]; | ||
| 3149 | - sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue }; | ||
| 3150 | - slaveData[iIndex].sBackProcessData = sBackProcessDataNew; | ||
| 3151 | - props.setState(pre => ({ ...pre, slaveData })); | ||
| 3152 | - } | ||
| 3153 | - return; | ||
| 3154 | - } | ||
| 3155 | - | ||
| 3156 | const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); | 3093 | const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); |
| 3157 | const showConfig = viewConfigs.find(item => item.sName === sFieldName); | 3094 | const showConfig = viewConfigs.find(item => item.sName === sFieldName); |
| 3158 | const dropDownDataSelected = dropDownData?.length | 3095 | const dropDownDataSelected = dropDownData?.length |