From 97cd9090fec756eb6dec720cbd0d66fff1ed5764 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Thu, 30 May 2024 14:19:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E6=96=B0=E5=A2=9E=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/baseComponents/EditBaseComponent/index.js | 10 +++ src/baseComponents/EditComponent/index.js | 8 +- .../CustomPages/BS/BS034ShowPrint.js | 4 +- .../CustomPages/BS/BS069ShowPrint.js | 2 +- src/files/edit/BS034.js | 16 ++-- src/files/edit/BS057.js | 77 +++++++++++++++++-- src/files/edit/BS077.js | 50 ++++++++++++ src/utils/common.js | 11 +++ 8 files changed, 160 insertions(+), 18 deletions(-) create mode 100644 src/files/edit/BS077.js diff --git a/src/baseComponents/EditBaseComponent/index.js b/src/baseComponents/EditBaseComponent/index.js index 989e27e..845b0f1 100644 --- a/src/baseComponents/EditBaseComponent/index.js +++ b/src/baseComponents/EditBaseComponent/index.js @@ -2896,6 +2896,16 @@ params【字段属性】=值 } ]; tempData.rules = [...rule]; + } else if (btnConfig.customParams != null && btnConfig.customParams.indexOf('parentRecord') > -1) { + //wyw BS057 弹窗 BS077 传递父项信息 到页面 + let rule = [ + { + field: "parentRecord", + operator: 1, + value: this.state.data + } + ]; + tempData.rules = [...rule]; } } else { let cParams = btnConfig.customParams.split('&'); diff --git a/src/baseComponents/EditComponent/index.js b/src/baseComponents/EditComponent/index.js index 5ce6157..754ea1d 100644 --- a/src/baseComponents/EditComponent/index.js +++ b/src/baseComponents/EditComponent/index.js @@ -1720,10 +1720,16 @@ class EditComponent extends EditBaseComponent { else if (btnType === 7) {//自定义 const clickEventFun = this.getDynJsFunc(clickEventFunName); const { validateFieldsAndScroll } = this.props.form; + var parentRecordSuit = parentRecord + if (btnConfig.customParams != null && btnConfig.customParams.indexOf('parentRecord') > -1 && this.state.data) { + // wyw 子表按钮添加主页面信息传参到子页面 + //wyw BS057 弹窗 BS077 传递父项信息 到页面 + parentRecordSuit = this.state.data + } if (typeof clickEventFun === 'function') { const btnParam = clickEventFun({ record, - parentRecord: parentRecord, + parentRecord: parentRecordSuit, dispatch: this.props.dispatch, loadData: () => { this.onLoadData() }, login: this.props.login, diff --git a/src/components/CustomPages/BS/BS034ShowPrint.js b/src/components/CustomPages/BS/BS034ShowPrint.js index e131cb9..89ea7ec 100644 --- a/src/components/CustomPages/BS/BS034ShowPrint.js +++ b/src/components/CustomPages/BS/BS034ShowPrint.js @@ -183,7 +183,7 @@ class BS034ShowPrint extends React.Component { 问题等级 整改建议与措施 检查人员 - 备注 + {/* 备注 */} 隐患地点 附件 @@ -213,7 +213,7 @@ class BS034ShowPrint extends React.Component { return (j > 0 ? "," : "") + user.Nav_User?.NAME }) } - {item.REMARK_RESULT} + {/* {item.REMARK_RESULT} */} {item.ADDRESS} { diff --git a/src/components/CustomPages/BS/BS069ShowPrint.js b/src/components/CustomPages/BS/BS069ShowPrint.js index cf1c631..47ccff9 100644 --- a/src/components/CustomPages/BS/BS069ShowPrint.js +++ b/src/components/CustomPages/BS/BS069ShowPrint.js @@ -94,7 +94,7 @@ class BS069ShowPrint extends React.Component { { data ?
- {data.Nav_Reject?.Nav_User.NAME} + {data.Nav_Reject?.Nav_User?.NAME} {data.Nav_Reject?.REASON} { showFiles(data.Nav_Reject.Nav_Files, config.picServerHost) diff --git a/src/files/edit/BS034.js b/src/files/edit/BS034.js index f3df8e8..32d046f 100644 --- a/src/files/edit/BS034.js +++ b/src/files/edit/BS034.js @@ -46,6 +46,7 @@ export default { element.QUESTION_LEVEL = null } else if (element.CHECKRESULT == 20) { if (element.Nav_ListCheckDetailQuestion != null && element.Nav_ListCheckDetailQuestion.length > 0) { + strDEMAND = '' //显示整改建议与措施 // strDEMAND = element.Nav_ListCheckDetailQuestion[0].Nav_Question.DEMAND for (let i = 0; i < element.Nav_ListCheckDetailQuestion.length; i++) { @@ -163,13 +164,14 @@ export default { //退回 btnBack: ({ record, setState, close, loadData, getLoadParam, login, btn, dispatch }) => { - const data={ - content: { - loadData(); - }, - }}/>, + const data = { + content: { + loadData(); + }, + }} />, }; return { content: diff --git a/src/files/edit/BS057.js b/src/files/edit/BS057.js index 8e012bc..f3a5209 100644 --- a/src/files/edit/BS057.js +++ b/src/files/edit/BS057.js @@ -3,7 +3,7 @@ import ConfirmButton from '../../components/common/ConfirmButton'; import { Button, Input, Modal, message } from 'antd' import storage from '../../utils/storage' import config from "../../config.js" -import { extendInclude, extendRule, getDataFieldValue, initFilter, empty, extendOrder, guid, getSubTableData, onBeforeSaveHandleRecordLog, auditOptionShow2, extend } from "../../utils/common"; +import { extendInclude, extendRule, getDataFieldValue, initFilter, empty, extendOrder, guid, getSubTableData, onBeforeSaveHandleRecordLog, auditOptionShow2, GetRiskReasonShow } from "../../utils/common"; import Item from 'antd/lib/list/Item'; import styles from '../../components/CustomPages/HI/StepForm.css'; import ShowModal from '../../components/common/ShowModal'; @@ -35,6 +35,7 @@ export default { // params.record["Nav_CheckMain.Nav_CheckQuestion.DEMAND"] = params.getDataFieldValue("DEMAND_SAME"); var strDEMAND = '' stateData.Nav_ListSafeCheckDetail.forEach(element => { + strDEMAND = '' if (element.QUESTION_LEVEL != null && element.QUESTION_LEVEL == 0) { element.QUESTION_LEVEL = null } @@ -93,7 +94,6 @@ export default { }) } }, - btnOK: ({ record, close, loadData, getLoadParam, login, btn, dispatch }) => { const confirmRevert = () => { if (record.Nav_ListCheckDetailUser.length > 0) { @@ -135,7 +135,6 @@ export default { }, handleRenderRowControl(params) { - // debugger // if (params.colConfig.field === 'Nav_Files') { // } else @@ -164,8 +163,34 @@ export default { return "" } } - - } else { + } else if (params.record.CHECKRESULT == "20" && params.record.ISAUTOLOAD != null && params.record.ISAUTOLOAD == false) { + //只修改手动新增的检查记录 + if (params.colConfig.field === 'Nav_ListCheckDetailQuestion') { + return <> + {params.record.CHECKRESULT_DESCRIPTION} + + } else if (params.colConfig.field == 'QUESTION_LEVEL') { + return <> + {params.record.QUESTION_LEVEL_DESCRIPTION} + + } else if (params.colConfig.field == 'ADDRESS') { + return <> + {params.record.ADDRESS} + + } else if (params.colConfig.field == 'Nav_ListCheckDetailReason') { + // params.record.Nav_ListCheckDetailReason?.forEach((item, i) => { + // return <> + // {item.Nav_RiskReason.NAME} + // + // }) + return <> + { + GetRiskReasonShow(params.record.Nav_ListCheckDetailReason) + } + + } + } + else { //填表 如果是 主要选择人 其他 => 控件 无 => 空 有问题 显示等级 // if (params.colConfig.field === 'QUESTION_LEVEL') { // if (params.record.QUESTION_LEVEL == null && params.record.QUESTION_LEVEL == 0) { @@ -176,7 +201,6 @@ export default { // return <> // } // } - } } @@ -416,5 +440,44 @@ export default { // // record.QUESTION_LEVEL = 20 // // } } - } + }, + + //新增记录 + btnAdd: ({ record, data, setState, close, loadData, getLoadParam, login, btn, dispatch }) => { + // btnAdd: (params) => { + const data1 = { + content: { + loadData(); + }, + }} />, + }; + return { + content: + + + } + }, + + //btnSubAdd: (params) => { + btnSubAdd: ({ record, parentRecord, setState, close, loadData, login, btn, dispatch }) => { + const dataSubForm = { + content: { + loadData(); + }, + }} />, + }; + return { + content: + + + } + }, } diff --git a/src/files/edit/BS077.js b/src/files/edit/BS077.js new file mode 100644 index 0000000..77e1c88 --- /dev/null +++ b/src/files/edit/BS077.js @@ -0,0 +1,50 @@ +import ConfirmButton from '../../components/common/ConfirmButton'; +import { Button, message } from 'antd' +import storage from '../../utils/storage' +import config from "../../config.js" +import { extendInclude, extendRule, getDataFieldValue, initFilter, empty, extendOrder, guid, getSubTableData, onBeforeSaveHandleRecordLog, auditOptionShow2 } from "../../utils/common"; +import Item from 'antd/lib/list/Item'; +import styles from '../../components/CustomPages/HI/StepForm.css'; +import EditRowShowModal from '../../components/common/EditRowShowModal'; +import FormPage from '../../components/FormPage'; +export default { + onBeforeEdit: ({ data, setFieldEditable, setFieldValueByBatch }) => { + if (data.rules && data.rules.length > 0) { + // var parentInfo = data.rules[0].value + var parentInfo = data.rules[0]//.value + + if (parentInfo.Nav_ListCheckRiskArea && parentInfo.Nav_ListCheckProject && parentInfo.Nav_ListCheckProjectCategory) { + var AREA_IDS = '' + var PROJECT_IDS = '' + var CATEGORY_IDS = '' + for (var i = 0; i < parentInfo.Nav_ListCheckRiskArea.length; i++) { + AREA_IDS += ',' + parentInfo.Nav_ListCheckRiskArea[i].RISK_AREA_ID + } + for (var i = 0; i < parentInfo.Nav_ListCheckProject.length; i++) { + PROJECT_IDS += ',' + parentInfo.Nav_ListCheckProject[i].CHECK_PROJECT_ID + } + for (var i = 0; i < parentInfo.Nav_ListCheckProjectCategory.length; i++) { + CATEGORY_IDS += ',' + parentInfo.Nav_ListCheckProjectCategory[i].CHECK_PROJECT_CATEGORY_ID + } + let temps = []; + temps.push({ field: "ROW_NO", value: parentInfo.Nav_ListSafeCheckDetail.length }); + temps.push({ field: "SAFE_CHECK_ID", value: parentInfo.ID }); + temps.push({ field: "AREA_IDS", value: AREA_IDS }); + temps.push({ field: "PROJECT_IDS", value: PROJECT_IDS }); + temps.push({ field: "CATEGORY_IDS", value: CATEGORY_IDS }); + temps.push({ field: "CHECK_TYPE_ID", value: parentInfo.CHECK_TYPE_ID }); + temps.push({ field: "CHECK_TYPE_LEVEL_ID", value: parentInfo.CHECK_TYPE_LEVEL_ID }); + temps.push({ field: "DEPARTMENT_ID", value: parentInfo.DEPARTMENTID }); + temps.push({ field: "CHECKOBJECT", value: parentInfo.CHECKOBJECT }); + temps.push({ field: "Nav_ListUserCheck", value: parentInfo.Nav_ListSafeCheckDetail[0].Nav_ListCheckDetailUser }); + if (parentInfo.Nav_ListCheckRiskArea != null && parentInfo.Nav_ListCheckRiskArea.length == 1) { + temps.push({ field: "Nav_CheckArea.NAME", value: parentInfo.Nav_ListCheckRiskArea[0].Nav_RiskArea.NAME }); + temps.push({ field: "RISK_AREA_ID", value: parentInfo.Nav_ListCheckRiskArea[0].RISK_AREA_ID }); + setFieldEditable("Nav_CheckArea.NAME", false) + } + + setFieldValueByBatch(temps); + } + } + }, +} diff --git a/src/utils/common.js b/src/utils/common.js index c0fc4c2..ac80612 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -2031,3 +2031,14 @@ export function getSixMonth(number, yearString = "", monthString = "") { return retrundate; } +export function GetRiskReasonShow(ListCheckDetailReason) { + if (ListCheckDetailReason == null || ListCheckDetailReason.length < 1) { + return '' + } else { + let resultShow = '' + ListCheckDetailReason.forEach((item, i) => { + resultShow +=((i>0?' ':'')+ item.Nav_RiskReason.NAME) + }) + return resultShow + } +}