diff --git a/src/components/Common/CommonViewDragable/index.js b/src/components/Common/CommonViewDragable/index.js index bb1ffe4..15f0d17 100644 --- a/src/components/Common/CommonViewDragable/index.js +++ b/src/components/Common/CommonViewDragable/index.js @@ -30,7 +30,10 @@ const CommonViewDragable = props => { const { tableName } = props; const [state, dispatch] = useReducer(reducer, initialState); - const selectedRowKeys = props[`${tableName}SelectedRowKeys`] || []; + let selectedRowKeys = props[`${tableName}SelectedRowKeys`] || []; + if(commonUtils.isEmptyArr(selectedRowKeys) && commonUtils.isNotEmptyArr(props[`${tableName}Data`]) ) { + selectedRowKeys = [props[`${tableName}Data`][0]] + } const key = selectedRowKeys[0] || commonUtils.createSid(); const selectedData = handleGetSelectedData(props); diff --git a/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js b/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js index 87e6e94..c5bd18d 100644 --- a/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js +++ b/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js @@ -3008,7 +3008,7 @@ const controlProps = props => { /* 排版数改变时 如果该控制表合版数据只有一条 则改变packData该条的拼版数 改变备注 */ if (commonUtils.isNotEmptyArr(packData)) { const packFilterData = packData.filter(item => item.sControlId === tableDataRow.sId); - console.log("1222", packFilterData); + if (commonUtils.isNotEmptyArr(packFilterData) && packFilterData.length === 1) { const iIndex = packData.findIndex(itemPack => itemPack.sId === packFilterData[0].sId); const addState = {}; @@ -3017,6 +3017,14 @@ const controlProps = props => { addState.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? "update" : tableDataRow.handleType; tableDataRow.iCombineNum = tableDataRow.dSinglePQty; if (iIndex > -1) { + if(commonUtils.isEmptyObject(packData[iIndex].sProductNo)) { + const slaveRow = slaveData.find(row => row.sId === packData[iIndex].sSlaveId); + + if(commonUtils.isNotEmptyObject(slaveRow)) { + packData[iIndex].sProductNo = slaveRow.sProductNo; + packData[iIndex].sProductName = slaveRow.sProductName; + } + } packData[iIndex] = { ...packData[iIndex], ...addState }; const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty, sCombinePartsName } = packData[iIndex]; const tableCombineSelectedData = [];