Commit f208ee1c9ba784964b08183c3f2c5c74f34a9e75
1 parent
b0087800
印刷新增额外参数;
Showing
1 changed file
with
60 additions
and
11 deletions
src/components/QuickQuote/index.jsx
| ... | ... | @@ -274,7 +274,7 @@ const QuickQuoteEvent = props => { |
| 274 | 274 | dProductQty: changeValue.dProductQty, |
| 275 | 275 | })); |
| 276 | 276 | } |
| 277 | - | |
| 277 | + | |
| 278 | 278 | if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { |
| 279 | 279 | if (props.currentBoxModel) { |
| 280 | 280 | const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); |
| ... | ... | @@ -1146,7 +1146,6 @@ const QuickQuoteEvent = props => { |
| 1146 | 1146 | // 入口 |
| 1147 | 1147 | const QuickQuote = baseProps => { |
| 1148 | 1148 | const props = QuickQuoteEvent(baseProps); |
| 1149 | - console.log("🚀 ~ QuickQuote:", props); | |
| 1150 | 1149 | const [treeClassName, setTreeClassName] = useState(""); |
| 1151 | 1150 | |
| 1152 | 1151 | // 监听页面滚动事件 |
| ... | ... | @@ -1306,6 +1305,7 @@ const TreeComponent = props => { |
| 1306 | 1305 | return { |
| 1307 | 1306 | ...pre, |
| 1308 | 1307 | ...addState, |
| 1308 | + sPrintConfig: downAbleConfigs.find(item => item.sType === "1" && item.sName === "胶印"), | |
| 1309 | 1309 | downAbleConfigs: downAbleConfigs |
| 1310 | 1310 | .filter(item => item.sType === "2") |
| 1311 | 1311 | .map((item, index) => ({ |
| ... | ... | @@ -1501,7 +1501,7 @@ const MasterComponent = props => { |
| 1501 | 1501 | item.iColValue = 4; |
| 1502 | 1502 | } |
| 1503 | 1503 | }); |
| 1504 | - } | |
| 1504 | + } | |
| 1505 | 1505 | const lengthData = viewConfigs.find(x => x.sName === "dLength"); |
| 1506 | 1506 | |
| 1507 | 1507 | if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { |
| ... | ... | @@ -1557,13 +1557,12 @@ const BoxComponent = props => { |
| 1557 | 1557 | const { bBox } = selectedNode; |
| 1558 | 1558 | const [boxTypeList, setBoxTypeList] = useState([]); |
| 1559 | 1559 | // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 |
| 1560 | - console.log(props, "asdadasd"); | |
| 1561 | 1560 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; |
| 1562 | 1561 | const { sBillNo } = slaveRowData; |
| 1563 | 1562 | useEffect(() => { |
| 1564 | 1563 | if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { |
| 1565 | - const {sBillNo} = slaveRowData | |
| 1566 | - if(sBillNo) return | |
| 1564 | + const { sBillNo } = slaveRowData; | |
| 1565 | + if (sBillNo) return; | |
| 1567 | 1566 | let dropDownData = []; |
| 1568 | 1567 | dropDownData.push(KapaiJson); |
| 1569 | 1568 | const boxData = (dropDownData || []).map((item, index) => ({ |
| ... | ... | @@ -2403,14 +2402,19 @@ const PrintParamsComponent = props => { |
| 2403 | 2402 | const printParamsItem = printParams[i - 1]; |
| 2404 | 2403 | const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId }; |
| 2405 | 2404 | |
| 2405 | + const viewTableId = "viewTableId_" + viewRow.sId; | |
| 2406 | 2406 | const viewProps = { |
| 2407 | 2407 | ...props, |
| 2408 | - viewConfigs: printParamsConfig, | |
| 2408 | + viewConfigs: printParamsConfig.map(item => ({ ...item, costomStyle: `xlyPrintParams${i}` })), | |
| 2409 | 2409 | tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig }, |
| 2410 | 2410 | iColValueView: 24, |
| 2411 | 2411 | viewRow, |
| 2412 | 2412 | tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`, |
| 2413 | 2413 | onDataChange: (...args) => { |
| 2414 | + setTimeout(() => { | |
| 2415 | + const oLabel = document.querySelector(`#${viewTableId}`)?.querySelector(`.xlyPrintParams${i}`)?.querySelector(".ant-form-item-label"); | |
| 2416 | + oLabel?.click(); | |
| 2417 | + }, 200); | |
| 2414 | 2418 | if (i === 0) { |
| 2415 | 2419 | props.onDataChange(...args); |
| 2416 | 2420 | return; |
| ... | ... | @@ -2423,11 +2427,37 @@ const PrintParamsComponent = props => { |
| 2423 | 2427 | return { ...pre, slaveData }; |
| 2424 | 2428 | }); |
| 2425 | 2429 | }, |
| 2430 | + onCostomClick: (showConfig, { target }) => { | |
| 2431 | + if (showConfig.sName !== "sPrint") return; | |
| 2432 | + const className = target.getAttribute("class"); | |
| 2433 | + const nodeName = target.nodeName; | |
| 2434 | + if (className?.includes("select") && nodeName === "DIV") return; | |
| 2435 | + | |
| 2436 | + const { sPrintConfig } = state; | |
| 2437 | + | |
| 2438 | + if (!sPrintConfig) return; | |
| 2439 | + const backendConfigNew = { | |
| 2440 | + sParentFieldsName: "sPrint", | |
| 2441 | + sBoxModel: boxModel, | |
| 2442 | + printParamsId: viewRow.sId, | |
| 2443 | + }; | |
| 2444 | + | |
| 2445 | + const dropDownData = commonUtils.convertStrToObj(sPrintConfig.sChineseDropDown, []); | |
| 2446 | + const dropDownDataSelected = dropDownData.find(item => item.sId === viewRow.sProcessId); | |
| 2447 | + if (!dropDownDataSelected) return; | |
| 2448 | + const backendParamsConfigNew = commonUtils.convertStrToObj(dropDownDataSelected.sParamConfig, []); | |
| 2449 | + | |
| 2450 | + props.setState(pre => ({ | |
| 2451 | + ...pre, | |
| 2452 | + backendParamsConfig: backendParamsConfigNew, | |
| 2453 | + backendConfig: backendConfigNew, | |
| 2454 | + })); | |
| 2455 | + }, | |
| 2426 | 2456 | }; |
| 2427 | 2457 | |
| 2428 | 2458 | result.push( |
| 2429 | 2459 | <div className={styles.materialsLine}> |
| 2430 | - <div className={styles.materialsViewTable}> | |
| 2460 | + <div className={styles.materialsViewTable} id={viewTableId}> | |
| 2431 | 2461 | <CommonViewTable {...viewProps} /> |
| 2432 | 2462 | </div> |
| 2433 | 2463 | <div className={styles.materialsBtns} style={{ width: "10%" }}> |
| ... | ... | @@ -3039,11 +3069,11 @@ const BoxModelSelectedModal = props => { |
| 3039 | 3069 | |
| 3040 | 3070 | // 后道参数额外配置 |
| 3041 | 3071 | const BackendParamsExtraComponent = props => { |
| 3042 | - const { state, slaveConfig, boxModel } = props; | |
| 3072 | + const { state, slaveConfig } = props; | |
| 3043 | 3073 | const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state; |
| 3044 | 3074 | if (!backendParamsConfig.length) return ""; |
| 3045 | 3075 | |
| 3046 | - const { sParentFieldsName, sBoxModel } = backendConfig; | |
| 3076 | + const { sParentFieldsName, sBoxModel, printParamsId } = backendConfig; | |
| 3047 | 3077 | |
| 3048 | 3078 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {}; |
| 3049 | 3079 | const { sBackProcessData = [] } = slaveRowData; |
| ... | ... | @@ -3066,9 +3096,12 @@ const BackendParamsExtraComponent = props => { |
| 3066 | 3096 | iColValueView: 24, |
| 3067 | 3097 | viewRow: { sId: slaveRowData.sId }, |
| 3068 | 3098 | getViewRow: config => { |
| 3099 | + if (sParentFieldsName === "sPrint") { | |
| 3100 | + return [slaveRowData, ...sBackProcessData].find(item => item.sId === printParamsId); | |
| 3101 | + } | |
| 3069 | 3102 | return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {}; |
| 3070 | 3103 | }, |
| 3071 | - tableName: `sBackendParams${boxModel}`, | |
| 3104 | + tableName: `sBackendParams${sBoxModel}`, | |
| 3072 | 3105 | getSqlDropDownData: (...args) => { |
| 3073 | 3106 | const showConfig = args[2]; |
| 3074 | 3107 | const { sParamDropDown = "", sName } = showConfig; |
| ... | ... | @@ -3092,6 +3125,22 @@ const BackendParamsExtraComponent = props => { |
| 3092 | 3125 | }, |
| 3093 | 3126 | onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { |
| 3094 | 3127 | const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); |
| 3128 | + | |
| 3129 | + if (sParentFieldsName === "sPrint") { | |
| 3130 | + if (slaveData[iIndex].sId === printParamsId) { | |
| 3131 | + let slaveDataNew = [...slaveData]; | |
| 3132 | + slaveDataNew[iIndex] = { ...slaveDataNew[iIndex], ...changeValue }; | |
| 3133 | + props.setState(pre => ({ ...pre, slaveData: slaveDataNew })); | |
| 3134 | + } else { | |
| 3135 | + const iIndex1 = sBackProcessData.findIndex(item => item.sId === printParamsId); | |
| 3136 | + let sBackProcessDataNew = [...sBackProcessData]; | |
| 3137 | + sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue }; | |
| 3138 | + slaveData[iIndex].sBackProcessData = sBackProcessDataNew; | |
| 3139 | + props.setState(pre => ({ ...pre, slaveData })); | |
| 3140 | + } | |
| 3141 | + return; | |
| 3142 | + } | |
| 3143 | + | |
| 3095 | 3144 | const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); |
| 3096 | 3145 | const showConfig = viewConfigs.find(item => item.sName === sFieldName); |
| 3097 | 3146 | const dropDownDataSelected = dropDownData?.length | ... | ... |