Commit b3ddd4a4130384437cfe83003d1a3ffc69a58d9c
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi into main
Showing
1 changed file
with
58 additions
and
9 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", ""); |
| ... | ... | @@ -1162,7 +1162,6 @@ const QuickQuoteEvent = props => { |
| 1162 | 1162 | // 入口 |
| 1163 | 1163 | const QuickQuote = baseProps => { |
| 1164 | 1164 | const props = QuickQuoteEvent(baseProps); |
| 1165 | - console.log("🚀 ~ QuickQuote:", props); | |
| 1166 | 1165 | const [treeClassName, setTreeClassName] = useState(""); |
| 1167 | 1166 | |
| 1168 | 1167 | // 监听页面滚动事件 |
| ... | ... | @@ -1321,6 +1320,7 @@ const TreeComponent = props => { |
| 1321 | 1320 | return { |
| 1322 | 1321 | ...pre, |
| 1323 | 1322 | ...addState, |
| 1323 | + sPrintConfig: downAbleConfigs.find(item => item.sType === "1" && item.sName === "胶印"), | |
| 1324 | 1324 | downAbleConfigs: downAbleConfigs |
| 1325 | 1325 | .filter(item => item.sType === "2") |
| 1326 | 1326 | .map((item, index) => ({ |
| ... | ... | @@ -1516,7 +1516,7 @@ const MasterComponent = props => { |
| 1516 | 1516 | item.iColValue = 4; |
| 1517 | 1517 | } |
| 1518 | 1518 | }); |
| 1519 | - } | |
| 1519 | + } | |
| 1520 | 1520 | const lengthData = viewConfigs.find(x => x.sName === "dLength"); |
| 1521 | 1521 | |
| 1522 | 1522 | if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { |
| ... | ... | @@ -1572,7 +1572,6 @@ const BoxComponent = props => { |
| 1572 | 1572 | const { bBox } = selectedNode; |
| 1573 | 1573 | const [boxTypeList, setBoxTypeList] = useState([]); |
| 1574 | 1574 | // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 |
| 1575 | - console.log(props, "asdadasd"); | |
| 1576 | 1575 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; |
| 1577 | 1576 | const { sBillNo } = slaveRowData; |
| 1578 | 1577 | useEffect(() => { |
| ... | ... | @@ -2416,14 +2415,19 @@ const PrintParamsComponent = props => { |
| 2416 | 2415 | const printParamsItem = printParams[i - 1]; |
| 2417 | 2416 | const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId }; |
| 2418 | 2417 | |
| 2418 | + const viewTableId = "viewTableId_" + viewRow.sId; | |
| 2419 | 2419 | const viewProps = { |
| 2420 | 2420 | ...props, |
| 2421 | - viewConfigs: printParamsConfig, | |
| 2421 | + viewConfigs: printParamsConfig.map(item => ({ ...item, costomStyle: `xlyPrintParams${i}` })), | |
| 2422 | 2422 | tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig }, |
| 2423 | 2423 | iColValueView: 24, |
| 2424 | 2424 | viewRow, |
| 2425 | 2425 | tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`, |
| 2426 | 2426 | onDataChange: (...args) => { |
| 2427 | + setTimeout(() => { | |
| 2428 | + const oLabel = document.querySelector(`#${viewTableId}`)?.querySelector(`.xlyPrintParams${i}`)?.querySelector(".ant-form-item-label"); | |
| 2429 | + oLabel?.click(); | |
| 2430 | + }, 200); | |
| 2427 | 2431 | if (i === 0) { |
| 2428 | 2432 | props.onDataChange(...args); |
| 2429 | 2433 | return; |
| ... | ... | @@ -2436,11 +2440,37 @@ const PrintParamsComponent = props => { |
| 2436 | 2440 | return { ...pre, slaveData }; |
| 2437 | 2441 | }); |
| 2438 | 2442 | }, |
| 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 | + }, | |
| 2439 | 2469 | }; |
| 2440 | 2470 | |
| 2441 | 2471 | result.push( |
| 2442 | 2472 | <div className={styles.materialsLine}> |
| 2443 | - <div className={styles.materialsViewTable}> | |
| 2473 | + <div className={styles.materialsViewTable} id={viewTableId}> | |
| 2444 | 2474 | <CommonViewTable {...viewProps} /> |
| 2445 | 2475 | </div> |
| 2446 | 2476 | <div className={styles.materialsBtns} style={{ width: "10%" }}> |
| ... | ... | @@ -3052,11 +3082,11 @@ const BoxModelSelectedModal = props => { |
| 3052 | 3082 | |
| 3053 | 3083 | // 后道参数额外配置 |
| 3054 | 3084 | const BackendParamsExtraComponent = props => { |
| 3055 | - const { state, slaveConfig, boxModel } = props; | |
| 3085 | + const { state, slaveConfig } = props; | |
| 3056 | 3086 | const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state; |
| 3057 | 3087 | if (!backendParamsConfig.length) return ""; |
| 3058 | 3088 | |
| 3059 | - const { sParentFieldsName, sBoxModel } = backendConfig; | |
| 3089 | + const { sParentFieldsName, sBoxModel, printParamsId } = backendConfig; | |
| 3060 | 3090 | |
| 3061 | 3091 | const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {}; |
| 3062 | 3092 | const { sBackProcessData = [] } = slaveRowData; |
| ... | ... | @@ -3078,9 +3108,12 @@ const BackendParamsExtraComponent = props => { |
| 3078 | 3108 | tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs }, |
| 3079 | 3109 | iColValueView: 24, |
| 3080 | 3110 | getViewRow: config => { |
| 3111 | + if (sParentFieldsName === "sPrint") { | |
| 3112 | + return [slaveRowData, ...sBackProcessData].find(item => item.sId === printParamsId); | |
| 3113 | + } | |
| 3081 | 3114 | return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {}; |
| 3082 | 3115 | }, |
| 3083 | - tableName: `sBackendParams${boxModel}`, | |
| 3116 | + tableName: `sBackendParams${sBoxModel}`, | |
| 3084 | 3117 | getSqlDropDownData: (...args) => { |
| 3085 | 3118 | const showConfig = args[2]; |
| 3086 | 3119 | const { sParamDropDown = "", sName } = showConfig; |
| ... | ... | @@ -3104,6 +3137,22 @@ const BackendParamsExtraComponent = props => { |
| 3104 | 3137 | }, |
| 3105 | 3138 | onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { |
| 3106 | 3139 | 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 | + | |
| 3107 | 3156 | const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); |
| 3108 | 3157 | const showConfig = viewConfigs.find(item => item.sName === sFieldName); |
| 3109 | 3158 | const dropDownDataSelected = dropDownData?.length | ... | ... |