diff --git a/src/files/edit/SK006.js b/src/files/edit/SK006.js index 84a4ab7..9af8941 100644 --- a/src/files/edit/SK006.js +++ b/src/files/edit/SK006.js @@ -37,7 +37,7 @@ export default { } }, - onSubChange: ({ row, setDataState, pageCode, record, colInfo, dispatch, stateData, props }) => { + onSubChange: ({ row, setDataState, pageCode, record,saveRowRecord, colInfo, dispatch, stateData, props }) => { if (colInfo.FIELD_NAME == "Nav_CheckNoticeDetailUsers") { @@ -59,6 +59,42 @@ export default { setDataState({ ...stateData }); } + if (colInfo.FIELD_NAME == 'Nav_Contents.CHECKCONTENT') { + let trainId = getDataFieldValue(record, 'CHECK_CONTENTS_ID'); + if (trainId) { + const json = initFilter(); + extendRule(json, 'ID', 1, trainId); + extendInclude(json, 'Nav_ContentsBasics.Nav_Law') + dispatch({ + type: 'app/getDataByPost', + url: 'SK/SKCheckContents/SKOrderPaged', + payload: json, + onComplete: (ret) => { + if (ret) { + //record["Nav_Posts"] = []; + let copyRecord={...record}; + if (ret && ret.length > 0) { + let identifyings= ret[0].Nav_ContentsBasics.map(item => { + return { + CHECK_CONTENTS_ID: record.ID, + ID: guid(), + LAW_ID: item.LAW_ID, + Nav_Law: item.Nav_Law, + ORG_ID: record.ORG_ID, + }; + }); + copyRecord["Nav_CheckNoticeDetailBasics"]=[...identifyings] + } + console.log(copyRecord) + saveRowRecord(copyRecord) + } + } + }) + } else { + record.Nav_CheckNoticeDetailBasics = []; + saveRowRecord(record) + } + } }, updateCheckUser: ({ row, pageCode, record, colInfo, resetFields, stateData, saveHeadRecord, saveRowRecord, getSelectedRecords, setState, emptyEditSelectedKeys }) => { //,state const temps = state['editTableSelectedKeysT_BS_SAFE_CHECK_DETAIL'];// + editCode + (parentId ? parentId : '') diff --git a/src/files/edit/SK010.js b/src/files/edit/SK010.js index c462bd8..e30d158 100644 --- a/src/files/edit/SK010.js +++ b/src/files/edit/SK010.js @@ -62,7 +62,7 @@ export default { }) } }, - onSubChange: ({ row, setDataState, pageCode, record, colInfo, dispatch, stateData, props }) => { + onSubChange: ({ row, setDataState, saveRowRecord,pageCode, record, colInfo, dispatch, stateData, props }) => { if (colInfo.FIELD_NAME == "Nav_CheckRecordDetailUsers") { @@ -84,6 +84,42 @@ export default { setDataState({ ...stateData }); } + if (colInfo.FIELD_NAME == 'Nav_Contents.CHECKCONTENT') { + let trainId = getDataFieldValue(record, 'CHECK_CONTENTS_ID'); + if (trainId) { + const json = initFilter(); + extendRule(json, 'ID', 1, trainId); + extendInclude(json, 'Nav_ContentsBasics.Nav_Law') + dispatch({ + type: 'app/getDataByPost', + url: 'SK/SKCheckContents/SKOrderPaged', + payload: json, + onComplete: (ret) => { + if (ret) { + //record["Nav_Posts"] = []; + let copyRecord={...record}; + if (ret && ret.length > 0) { + let identifyings= ret[0].Nav_ContentsBasics.map(item => { + return { + CHECK_CONTENTS_ID: record.ID, + ID: guid(), + LAW_ID: item.LAW_ID, + Nav_Law: item.Nav_Law, + ORG_ID: record.ORG_ID, + }; + }); + copyRecord["Nav_CheckRecordDetailBasics"]=[...identifyings] + } + console.log(copyRecord) + saveRowRecord(copyRecord) + } + } + }) + } else { + record.Nav_CheckRecordDetailBasics = []; + saveRowRecord(record) + } + } }, btnSubAdd: ({ record,data, parentRecord, stateData,setState, close, loadData, login, btn, dispatch }) => {