import { Button, Descriptions, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, showUsersSign } 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 '../HI/StepForm.css'; import config from "../../../config.js"; import FormPage from '../../FormPage' class CM023ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, btndisplay: 'none', isCheck: false, //是否待办 审批 listSign: null } } 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); } } onTableBtnExport() { let TableWrap = document.getElementById('table1'); let Table = TableWrap.getElementsByTagName('table1')[0]; const wb = XLSX.utils.table_to_book(Table); XLSX.writeFile(wb, this.props.record.Nav_Department.NAME + '.xlsx') } onClickApprove = (appVisible) => { const newtmpData = { data: { id: this.props.data.id, isShow: true, key: guid(), param: this.props.data.param, appVisible: appVisible, BtnAgreeDisplay: 'none' }, formCode: 'PF123', } this.setState({ tmpData: newtmpData, }); } sign = () => { let json = initFilter(this.props.login.OrgId, this.props.data.id, null, null, null, this.props.data.TaskID); extendRule(json, 'ID', 1, this.props.data.id); extendRule(json, "Parameter1", 1, this.props.data.TaskID) this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'CM/CMRspEstimate/Sign', onComplete: (ret) => { this.BtnClose() } }); } BtnClose = () => { if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function') this.props.data.onCancel(); } loadData = (id) => { var orgId = this.props.login ? this.props.login.OrgId : ''; var isCheck = (this.props.data.tableKey != undefined && this.props.data.tableKey == "1") ? true : false let json = initFilter(orgId); extendRule(json, 'ID', 1, id); extendInclude(json, 'Nav_Department') extendInclude(json, 'Nav_User') extendInclude(json, 'Nav_UserReport') extendInclude(json, 'Nav_DepartmentReport') extendInclude(json, 'Nav_AccidentType') extendInclude(json, 'Nav_ListJoin.Nav_User') extendInclude(json, 'Nav_ListRspConditions.Nav_RspEstimateCondition') extendInclude(json, 'Nav_ListEventKind.Nav_RspAccdentKind') extendInclude(json, 'Nav_ListEstimate.Nav_User.Nav_UserSignFiles.Nav_ImgFile.Nav_File') extendInclude(json, 'Nav_Approve.Nav_ApproveDetails.Nav_ApproveUser.Nav_UserSignFiles.Nav_ImgFile.Nav_File') extendIgnoreDataRule(json) this.props.dispatch({ type: 'app/getDataByPost', payload: json, // url: 'CM/RspEstimate/Get', url: 'CM/CMRspEstimate/GetOrder', onComplete: (ret) => { if (ret) { var listSign = [] if (isCheck && ret.STATUS == 10) { if (ret.Nav_ListEstimate != null && ret.Nav_ListEstimate.length > 0) { for (let i = 0; i < ret.Nav_ListEstimate.length; i++) { if (ret.Nav_ListEstimate[i].ISSIGN) { listSign.push(ret.Nav_ListEstimate[i]) } if (ret.Nav_ListEstimate[i].USER_ID == this.props.login.userId) { if (!ret.Nav_ListEstimate[i].ISSIGN) { isCheck = true } else { isCheck = false } } } } } else if (ret.STATUS > 10) { listSign = ret.Nav_ListEstimate } this.setState({ data: ret, isCheck: isCheck, listSign: listSign }) } } }); } render() { const { data, isCheck, listSign } = this.state; const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; return
| : null} {/* {isCheck ? | : null} */} | : null} |
{(i + 1) + ") " + item.Nav_RspEstimateCondition.NAME + " :" + (item.RSP_CONDITION_STATUS != null ? enums.CMRspConditionStatus.enums[item.RSP_CONDITION_STATUS] : "")}
})}| 序号 | 应急响应评估项目 | 结果 |
| {i + 1} | {item.Nav_RspEstimateCondition.NAME} | {item.RSP_CONDITION_STATUS != null ? enums.CMRspConditionStatus.enums[item.RSP_CONDITION_STATUS] : ""} |