From c1d45a5c94b42cf0f187ee0d2956615c51850e4d Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Thu, 6 Jun 2024 16:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E5=8E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/baseComponents/EditBaseComponent/index.js | 16 ++- src/baseComponents/EditComponent/index.js | 13 +- .../CustomPages/BS/BS070ShowPrint.js | 18 ++- .../CustomPages/BS/BS076ShowOperateLog.js | 84 ++++++++++++ src/components/common/ShowModal.js | 3 + src/files/edit/BS057.js | 25 +++- src/files/edit/SC028.js | 126 +++++++++++------- src/routes/Home.js | 6 +- 8 files changed, 230 insertions(+), 61 deletions(-) create mode 100644 src/components/CustomPages/BS/BS076ShowOperateLog.js diff --git a/src/baseComponents/EditBaseComponent/index.js b/src/baseComponents/EditBaseComponent/index.js index 845b0f1..4876467 100644 --- a/src/baseComponents/EditBaseComponent/index.js +++ b/src/baseComponents/EditBaseComponent/index.js @@ -672,7 +672,7 @@ params【字段属性】=值 case 23: case 24: errVerifyMsg = "请选择" + label break; - default:errVerifyMsg = "请输入" + label + default: errVerifyMsg = "请输入" + label break; } } @@ -691,7 +691,7 @@ params【字段属性】=值 // }) // } if (rule.required && (colValue === undefined || colValue === null || colValue === '' - || controlType !== 3 && controlType !== 24 && empty(colValue, true)) + || controlType !== 3 && controlType !== 24 && empty(colValue, true)) || controlType === 24 && colValue.filter(i => !i.IS_DELETED).length == 0) { errors.push(rule.message); } @@ -2751,16 +2751,26 @@ params【字段属性】=值 */ doSave = (api, saveData, params) => { this.setState({ btnLoading: true }); + let that = this; this.props.dispatch({ type: 'app/getDataByPost', payload: saveData, url: api, onComplete: (ret) => { + var delay = 2000 if (ret) { + if (that.props.data?.onCancel) { + that.props.data.onCancel(); + } + if (that.props.data?.close) { + //wyw onCancel 在 ShowModal 被赋值 只能添加 close 来处理窗体关闭事件需要的执行(刷新主界面信息) + that.props.data.close(); + } + delay = 500//如果需要请求api刷新页面数据 2000感觉太卡了 message.success('执行成功'); } this.onAfterSave({ ...params, isSuccess: ret, saveData }); - setTimeout(() => { this.setState({ btnLoading: false }) }, 2000); + setTimeout(() => { this.setState({ btnLoading: false }) }, delay); } }); }; diff --git a/src/baseComponents/EditComponent/index.js b/src/baseComponents/EditComponent/index.js index 754ea1d..3b1f174 100644 --- a/src/baseComponents/EditComponent/index.js +++ b/src/baseComponents/EditComponent/index.js @@ -1535,6 +1535,17 @@ class EditComponent extends EditBaseComponent { }); }; + clearData = () => { + this.setState({ + data: {} + }); + } + + setStateData = (tmpData) => { + this.setState({ + data: tmpData + }); + } onAfterSave(params) { super.onAfterSave(params); @@ -1551,7 +1562,7 @@ class EditComponent extends EditBaseComponent { } this.useCodeRules = null; if (typeof onSave === 'function') { - onSave(this.state.data); + onSave(this.state.data, this.clearData,this.setStateData); } if (closeType === 1 && this.billStatus === 1 ||//仅编辑时关闭 closeType === 2 && this.billStatus !== 1 ||//仅新增时关闭 diff --git a/src/components/CustomPages/BS/BS070ShowPrint.js b/src/components/CustomPages/BS/BS070ShowPrint.js index 9050575..01f289b 100644 --- a/src/components/CustomPages/BS/BS070ShowPrint.js +++ b/src/components/CustomPages/BS/BS070ShowPrint.js @@ -12,6 +12,7 @@ class BS070ShowPrint extends React.Component { constructor(props) { super(props); this.state = { + tmpData: {}, Nav_SafeCheck: {}, Nav_ListSafeCheckDetail: [], Nav_ApproveApply: {}, @@ -45,6 +46,17 @@ class BS070ShowPrint extends React.Component { } + //显示操作日志 + OperateLogShow() { + const newtmpData = { + data: { id: this.props.data.id, key: guid() }, + formCode: "BS076", + } + this.setState({ + tmpData: newtmpData, + }); + } + loadData = (id) => { // id= CHECKID +'_'+SUBMITID CHECKID\SUBMITID 可能只有其一 但是一定会有_ var orgId = this.props.login ? this.props.login.OrgId : ''; @@ -94,6 +106,8 @@ class BS070ShowPrint extends React.Component {
+ {/* */} + {/* onClick={() => this.CheckerCheckToActual(10)} */} @@ -120,7 +134,7 @@ class BS070ShowPrint extends React.Component { }) }

-

{ +

{ Nav_SafeCheck.Nav_ListCheckProjectCategory && Nav_SafeCheck.Nav_ListCheckProjectCategory.map((item, i) => { // return

{item.Nav_CheckProjectCategory.NAME}

return (i > 0 ? "," : "") + item.Nav_CheckProjectCategory.NAME @@ -346,6 +360,8 @@ class BS070ShowPrint extends React.Component { + + } } diff --git a/src/components/CustomPages/BS/BS076ShowOperateLog.js b/src/components/CustomPages/BS/BS076ShowOperateLog.js new file mode 100644 index 0000000..9e95721 --- /dev/null +++ b/src/components/CustomPages/BS/BS076ShowOperateLog.js @@ -0,0 +1,84 @@ +import { Button, Descriptions, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, ShowPrintClose, showFiles } from '../../../utils/common'; +import ReactToPrint from 'react-to-print'; +import { ExportToExcel } from '@woowalker/feui' +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +import { message } from 'antd/lib/index'; +import styles from '../../../components/CustomPages/HI/StepForm.css'; +import config from '../../../config.js'; + +class BS076ShowOperateLog extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + btndisplay: 'none', + isCheck: false, //是否待办 审批 + } + } + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + + loadData = (ids) => { + var orgId = this.props.login ? this.props.login.OrgId : ''; + let json = initFilter(orgId, ids); + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'BS/BSOperateLog/OrderEntities', + onComplete: (ret) => { + debugger + if (ret) { + this.setState({ + data: ret, + }) + } + } + }); + } + render() { + const { data } = this.state; + const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; + return
+
(this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}> +
} content={() => this.componentRef} />
+ + + + + + + + + + + + {(data && data.length > 0) ? data.map((item, i) => { + return + + + + + + + }) : } + +
履职记录
操作人操作类型开始时间操作时间是否按时完成
{item.USRTNAME} {enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]} {item.CREATE_TIME} {item.OPERTETIME} {item.ISINTTIME != null ? (item.ISINTTIME ? '是' : '否') : ""}
查无记录
+
+ + } +} +export default connect(({ login, app }) => ({ login, app }))(BS076ShowOperateLog) diff --git a/src/components/common/ShowModal.js b/src/components/common/ShowModal.js index 0c1d6e6..b5d964e 100644 --- a/src/components/common/ShowModal.js +++ b/src/components/common/ShowModal.js @@ -54,6 +54,9 @@ class ShowModal extends React.Component { showContent = () => { let showData = this.props.data; if (showData && showData.content) { + if (showData.content?.props?.data) { + showData.content.props.data.onCancel = this.handleCloseModal + } if (typeof showData.content === 'function') { return showData.content(); } diff --git a/src/files/edit/BS057.js b/src/files/edit/BS057.js index f3a5209..b8231ae 100644 --- a/src/files/edit/BS057.js +++ b/src/files/edit/BS057.js @@ -228,7 +228,6 @@ export default { if (colInfo.FIELD_NAME == "Nav_ListCheckDetailQuestion") { var listQ = record.Nav_ListCheckDetailQuestion.filter(e => e.IS_DELETED == null || e.IS_DELETED == undefined || e.IS_DELETED != true) if (listQ == null || listQ.length < 1) { - debugger //数据清空 for (let i = 0; i < stateData.Nav_ListSafeCheckDetail.length; i++) { if (record.ID == stateData.Nav_ListSafeCheckDetail[i].ID) { @@ -275,7 +274,7 @@ export default { detailNew.Nav_ListCheckDetailUser.forEach(e => { e.ID = guid() e.SAFE_CHECK_DETAIL_ID = detailNew.ID - debugger + // debugger if (!e.ISMAINCHECK) { e.FLOW_STATUS = 1 } @@ -462,16 +461,30 @@ export default { } }, - //btnSubAdd: (params) => { btnSubAdd: ({ record, parentRecord, setState, close, loadData, login, btn, dispatch }) => { - const dataSubForm = { + // btnSubAdd: (params) => { + // debugger + let dataSubForm = { content: { - loadData(); + close: () => { + loadData();//onCancel 会被 重新赋值 在此做刷新 }, + onCancel: () => { + //此方法要有不能被删除 别处会重写 + }, + onSave: (data, clearData, setStateData) => { + //wyw 昌老师写的这个不能加,因为这样传参被修改了,限定逻辑不对了(onBeforeEdit 不执行,不知道拿什么去限制不然也是可以传入parentRecord) + // let tmpData = { + // SAFE_CHECK_ID: data.SAFE_CHECK_ID, + // ORG_ID: data.ORG_ID, + // Nav_ListUserCheck: data.Nav_ListUserCheck + // } + // setStateData(tmpData); + + } }} />, }; return { diff --git a/src/files/edit/SC028.js b/src/files/edit/SC028.js index 157f986..2c90fa1 100644 --- a/src/files/edit/SC028.js +++ b/src/files/edit/SC028.js @@ -50,7 +50,7 @@ export default { if (stateData.MEETINGTYPE != null && stateData.MEETINGTYPE > 0) { setFieldVisible("Nav_ListPReView", false); setFieldValue("Nav_ListPReView", null); //评审人员不可见 - let json = initFilter(stateData.ORG_ID, stateData.ID, null, null, null, stateData.MEETINGTYPE); + let json = initFilter(stateData.ORG_ID, stateData.ID, null, null, null, stateData.MEETINGTYPE,0); dispatch({ type: 'app/getDataByPost', url: 'SC/SCMTMeeting/GetPAll', @@ -80,6 +80,7 @@ export default { // setFieldValue("Nav_User_Originator.NAME", login.user.NAME) const temps = []; + temps.push({ field: 'isNew', value: "1" }); temps.push({ field: 'DEPARTMENT_ID', value: login.user.DEPARTMENT_ID }); temps.push({ field: 'Nav_Department.NAME', value: login.user.Nav_Department?.NAME }); temps.push({ field: 'USER_ID_ORIGINATOR', value: login.user.ID }) @@ -101,58 +102,87 @@ export default { // 安委会时,安委会成员默认全选,可删除,可添加其他人员 // 基层安全会按部门/车间/班组点选或模糊查询,默认部门所有人员向下包含 /// 普通会议 10 文件审核会议 20 文件评审会 30 - /// 安委会 40 基层安全会 50 - setFieldValue("Nav_ListMeetingContent", null); if (value == 40 || value == 50) { setFieldVisible("Nav_ListPReView", false); - setFieldValue("Nav_ListPReView", null); //评审人员不可见 - //加载人员信息 - // this.getPAll(value, colInfo.ORG_ID, getFieldValue("ID"), setFieldVisible, setFieldValue, dispatch, setFieldValueByBatch) - - // export function getPAll(meetingType, orgId, meetingId, setFieldVisible, setFieldValue, dispatch, setFieldValueByBatch) { - if (value == 40 || value == 50) { - setFieldVisible("Nav_ListPReView", false); - setFieldValue("Nav_ListPReView", null); //评审人员不可见 - let json = initFilter(colInfo.ORG_ID, getFieldValue("ID"), null, null, null, value); - dispatch({ - type: 'app/getDataByPost', - url: 'SC/SCMTMeeting/GetPAll', - payload: json, - onlyData: false, - onComplete: (ret) => { - let temps = []; - if (ret && ret.IsSuccessful && ret.Data) { - let detail = ret.Data.map((item, i) => { - item['ROW_NO'] = i + 1; - return item; - }); - temps.push({ field: "Nav_ListPAll", value: detail }); - } else { - temps.push({ field: "Nav_ListPAll", value: null }); - } - setFieldValueByBatch(temps); - } - }); - } - - - - + setFieldValue("Nav_ListPReView", null); + } else if (value == 30) { + // 文件评审会 + setFieldVisible("Nav_ListPReView", true); } else { - //参会人员 处理 - let temps = []; - temps.push({ field: "Nav_ListPAll", value: null }); - setFieldValueByBatch(temps); - - if (value == 30) { - // 文件评审会 - setFieldVisible("Nav_ListPReView", true); - } else { - setFieldVisible("Nav_ListPReView", false); - setFieldValue("Nav_ListPReView", null); //评审人员不可见 - } + setFieldVisible("Nav_ListPReView", false); + setFieldValue("Nav_ListPReView", null); //评审人员不可见 } + var isNew = getFieldValue('isNew')//手动创建 有值 + if (isNew == null || isNew == undefined) { + isNew = 0 + } + let json = initFilter(colInfo.ORG_ID, getFieldValue("ID"), null, null, null, value,isNew); + dispatch({ + type: 'app/getDataByPost', + url: 'SC/SCMTMeeting/GetPAll', + payload: json, + onlyData: false, + onComplete: (ret) => { + let temps = []; + if (ret && ret.IsSuccessful && ret.Data) { + let detail = ret.Data.map((item, i) => { + item['ROW_NO'] = i + 1; + return item; + }); + temps.push({ field: "Nav_ListPAll", value: detail }); + } else { + temps.push({ field: "Nav_ListPAll", value: null }); + } + setFieldValueByBatch(temps); + } + }); + + + // setFieldValue("Nav_ListMeetingContent", null); + // if (value == 40 || value == 50) { + // setFieldVisible("Nav_ListPReView", false); + // setFieldValue("Nav_ListPReView", null); //评审人员不可见 + // //加载人员信息 + // if (value == 40 || value == 50) { + // setFieldVisible("Nav_ListPReView", false); + // setFieldValue("Nav_ListPReView", null); //评审人员不可见 + // let json = initFilter(colInfo.ORG_ID, getFieldValue("ID"), null, null, null, value); + // dispatch({ + // type: 'app/getDataByPost', + // url: 'SC/SCMTMeeting/GetPAll', + // payload: json, + // onlyData: false, + // onComplete: (ret) => { + // let temps = []; + // if (ret && ret.IsSuccessful && ret.Data) { + // let detail = ret.Data.map((item, i) => { + // item['ROW_NO'] = i + 1; + // return item; + // }); + // temps.push({ field: "Nav_ListPAll", value: detail }); + // } else { + // temps.push({ field: "Nav_ListPAll", value: null }); + // } + // setFieldValueByBatch(temps); + // } + // }); + // } + // } else { + // //参会人员 处理 + // let temps = []; + // temps.push({ field: "Nav_ListPAll", value: null }); + // setFieldValueByBatch(temps); + + // if (value == 30) { + // // 文件评审会 + // setFieldVisible("Nav_ListPReView", true); + // } else { + // setFieldVisible("Nav_ListPReView", false); + // setFieldValue("Nav_ListPReView", null); //评审人员不可见 + // } + // } + } else if (colInfo != null && colInfo.FIELD_NAME == "Nav_ListMeetingContent") { // //会议内容修改 // //加载 会议意见 diff --git a/src/routes/Home.js b/src/routes/Home.js index 27deea8..502bb93 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -651,8 +651,10 @@ class Home extends React.Component { }; clearData = () => { let newtmpData = { ...this.state.tmpData }; - newtmpData["data"].id = ""; - newtmpData["data"].homeReload = false; + if (newtmpData["data"] != null) { + newtmpData["data"].id = ""; + newtmpData["data"].homeReload = false; + } newtmpData.formCode = ""; this.setState({ formVisible: false,