This commit is contained in:
wyw 2024-04-19 15:57:40 +08:00
commit f186f1a127
8 changed files with 1539 additions and 1295 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ import React from 'react'
import { connect } from 'dva' import { connect } from 'dva'
import { initFilter, extendRule, extendOrder } from "../../../utils/common" import { initFilter, extendRule, extendOrder } from "../../../utils/common"
import { ChartPieShow, ChartBarShow } from "../../../utils/commonEcharsShow" import { ChartPieShow, ChartBarShow } from "../../../utils/commonEcharsShow"
import { Table, Button, Row, Col,Modal ,Icon} from 'antd'; import { Table, Button, Row, Col,Modal,Form ,DatePicker,Icon} from 'antd';
import echarts from 'echarts'; import echarts from 'echarts';
import styles from '../HI/StepForm.css'; import styles from '../HI/StepForm.css';
import moment from 'moment' import moment from 'moment'
@ -22,6 +22,8 @@ class BI008FormRunAnalysis extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectStartTime: moment(this.getStartDate(), 'YYYY-MM-DD 00:00:00'),
selectEndTime:moment(this.getEndDate(), 'YYYY-MM-DD 23:59:59'),
visible: false, visible: false,
noticeTitle: '', noticeTitle: '',
tmpData: {}, tmpData: {},
@ -300,7 +302,27 @@ class BI008FormRunAnalysis extends React.Component {
// visible: true // visible: true
// })); // }));
// } // }
getStartDate=()=>{
let date = new Date()
let y = date.getFullYear()
let m = date.getMonth() + 1
let d = date.getDate();
// 当前日期
let nowDate = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
let pastDate = moment(nowDate).add(-1, "month").format('YYYY-MM-DD 00:00:00')
return pastDate;
}
getEndDate=()=>{
let date = new Date()
let y = date.getFullYear()
let m = date.getMonth() + 1
let d = date.getDate();
// 当前日期
let nowDate = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
let pastDate = moment(nowDate).format('YYYY-MM-DD 23:59:59')
return pastDate;
}
getDate=(type)=>{ getDate=(type)=>{
let date = new Date() let date = new Date()
let y = date .getFullYear() let y = date .getFullYear()
@ -587,6 +609,18 @@ class BI008FormRunAnalysis extends React.Component {
} }
}) })
} }
startChange=(value)=>{
this.setState({
selectStartTime:value,
startTime:value.format("YYYYMMDD")
})
};
endChange=(value)=>{
this.setState({
selectEndTime:value,
endTime:value.format("YYYYMMDD")
})
};
closeModal = () => { // 退出弹窗 closeModal = () => { // 退出弹窗
this.clearData(); this.clearData();
} }
@ -607,6 +641,10 @@ class BI008FormRunAnalysis extends React.Component {
const { startTime, endTime,finishCount,overtimeCount,totalCount,unfinishCount, const { startTime, endTime,finishCount,overtimeCount,totalCount,unfinishCount,
weekColor,monthColor,threeMonthColor,sixMonthColor,yearColor, weekColor,monthColor,threeMonthColor,sixMonthColor,yearColor,
} = this.state; } = this.state;
const formItemLayout = {
labelCol: { span: 10 },
wrapperCol: { span: 14 },
}
let allFinishRate=totalCount ===0?0:((finishCount+overtimeCount)/totalCount * 100).toFixed(0); let allFinishRate=totalCount ===0?0:((finishCount+overtimeCount)/totalCount * 100).toFixed(0);
let finishRate=totalCount ===0?0:(finishCount/totalCount * 100).toFixed(0); let finishRate=totalCount ===0?0:(finishCount/totalCount * 100).toFixed(0);
return <div> return <div>
@ -615,22 +653,52 @@ class BI008FormRunAnalysis extends React.Component {
<h1 style={{ textAlign: "center",marginTop:'30px',fontWeight:'bold'}}>{this.props?.login?.currActivatedMenu?.MENU_FORM_PARAMS}安全生产标准化运行情况</h1> <h1 style={{ textAlign: "center",marginTop:'30px',fontWeight:'bold'}}>{this.props?.login?.currActivatedMenu?.MENU_FORM_PARAMS}安全生产标准化运行情况</h1>
<Row style={{ textAlign: 'center',fontSize:'15px'}}> <span>({startTime}-{endTime})</span></Row> <Row style={{ textAlign: 'center',fontSize:'15px'}}> <span>({startTime}-{endTime})</span></Row>
<br></br> <br></br>
<span style={{width:"800px",marginLeft:"30px"}}> <Row>
<Col span={14} style={{ marginLeft: "10px" }}>
<Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>总任务数<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'black'}}>{totalCount}</span></Button> <Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>总任务数<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'black'}}>{totalCount}</span></Button>
<Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>正常已办<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'green'}}>{finishCount}</span></Button> <Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>正常已办<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'green'}}>{finishCount}</span></Button>
<Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>超时已办<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'orange'}}>{overtimeCount}</span></Button> <Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>超时已办<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'orange'}}>{overtimeCount}</span></Button>
<Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>未完成数<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'red'}}>{unfinishCount}</span></Button> <Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>未完成数<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'red'}}>{unfinishCount}</span></Button>
<Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>完成率<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'orange'}}>{allFinishRate}%</span></Button> <Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>完成率<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'orange'}}>{allFinishRate}%</span></Button>
<Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>及时完成率<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'orange'}}>{finishRate}%</span></Button> <Button style={{width:"100px",height:"60px",borderRadius: '8px',border:'1px RGB(24, 149, 255) solid',marginRight:"10px"}}>及时完成率<br></br><span style={{fontWeight:"bold",fontSize:"20px",color:'orange'}}>{finishRate}%</span></Button>
</span> </Col>
<span style={{float:"right",marginTop:"20px",width:"400px"}}> <Col span={3} style={{ marginLeft: "10px",marginTop:'20px' }}>
<Col span={4}> <Button type='link' style= {{color:weekColor,marginRight:"5px"}} onClick={() => this.getDate("Week")}>最近1周</Button></Col> <Form.Item
<Col span={4}> <Button type='link' style= {{color:monthColor,marginRight:"5px"}} onClick={() => this.getDate("Month")}>最近1月</Button></Col> label={'查询时间'}
<Col span={4}> <Button type='link' style= {{color:threeMonthColor,marginRight:"5px"}} onClick={() => this.getDate("ThreeMonth")}>最近3月</Button></Col> {...formItemLayout}
<Col span={4}> <Button type='link' style= {{color:sixMonthColor,marginRight:"5px"}} onClick={() => this.getDate("SixMonth")}>最近半年</Button></Col> >
<Col span={4}> <Button type='link' style= {{color:yearColor,marginRight:"5px"}} onClick={() => this.getDate("Year")}>最近1年</Button></Col> <DatePicker
style={{ width: "120px" }}
// defaultValue={moment(this.state.startTime, 'YYYY-MM-DD 00:00:00')}
value={this.state.selectStartTime}
format="YYYY-MM-DD" onChange={this.startChange}/>
</Form.Item>
</Col>
<Col span={3} style={{ marginLeft: "10px",marginTop:'20px' }}>
<Form.Item
label={'至'}
{...formItemLayout}
>
<DatePicker
style={{ width: "120px" }}
// defaultValue={moment(this.state.endTime, 'YYYY-MM-DD 23:59:59')}
value={this.state.selectEndTime}
format="YYYY-MM-DD" onChange={this.endChange}/>
</Form.Item>
</Col>
<Col span={1} style={{ marginLeft: "50px" ,marginTop:'20px' }}><Button type='primary' onClick={() => this.loadData()}>查询</Button></Col>
</Row>
{/* <Col span={4}> <Button type='link' style= {{color:weekColor,marginRight:"5px"}} onClick={() => this.getDate("Week")}>最近1周</Button></Col> */}
{/* <Col span={4}> <Button type='link' style= {{color:monthColor,marginRight:"5px"}} onClick={() => this.getDate("Month")}>最近1月</Button></Col> */}
{/* <Col span={4}> <Button type='link' style= {{color:threeMonthColor,marginRight:"5px"}} onClick={() => this.getDate("ThreeMonth")}>最近3月</Button></Col> */}
{/* <Col span={4}> <Button type='link' style= {{color:sixMonthColor,marginRight:"5px"}} onClick={() => this.getDate("SixMonth")}>最近半年</Button></Col> */}
{/* <Col span={4}> <Button type='link' style= {{color:yearColor,marginRight:"5px"}} onClick={() => this.getDate("Year")}>最近1年</Button></Col> */}
{/* <Col span={4}> <Button type='link' style= {{color:yearColor,marginRight:"5px"}} onClick={() => this.getDate("All")}>全部</Button></Col> */} {/* <Col span={4}> <Button type='link' style= {{color:yearColor,marginRight:"5px"}} onClick={() => this.getDate("All")}>全部</Button></Col> */}
</span>
<hr style={{border:'1px dashed #ccc',marginBottom:"20px",marginTop:"20px"}}></hr> <hr style={{border:'1px dashed #ccc',marginBottom:"20px",marginTop:"20px"}}></hr>
<Row style={{marginTop:"10px"}}> <Row style={{marginTop:"10px"}}>
<Col span={4}> <Col span={4}>

View File

@ -112,7 +112,6 @@ class HM042ShowPrint extends React.Component {
this.state.isAudit = "inline"; this.state.isAudit = "inline";
} }
this.setState({ data: ret }) this.setState({ data: ret })
this.state.data.Nav_Details = this.removeDuplicateObj(this.state.data.Nav_Details);
if (ret.ID) { if (ret.ID) {
this.props.dispatch({ this.props.dispatch({
type: 'app/getDataByPost', type: 'app/getDataByPost',

View File

@ -482,7 +482,7 @@ class SE018PaperPage extends React.Component {
</tr> </tr>
} }
{ {
it.Nav_Test.TYPE !== 0 && it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_D != "" && it.Nav_Test.OPTION_D != undefined &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? answer : null}> <tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}> <td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}>
{ {

View File

@ -1,5 +1,5 @@
import { message } from "antd/lib/index"; import { message } from "antd/lib/index";
import { Button, Popconfirm, Row, Col, Form, Input,InputNumber, DatePicker,Select, Table } from 'antd'; import { Button, Popconfirm, Row, Col, Form, Input, InputNumber, DatePicker, Select, Table } from 'antd';
import React from 'react'; import React from 'react';
import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common"; import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common";
import styles from '../../CustomPages/HI/StepForm.css'; import styles from '../../CustomPages/HI/StepForm.css';
@ -10,7 +10,7 @@ class SEConfigPage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
isLoading:false, isLoading: false,
data: { data: {
ID: null, ID: null,
SAFE_SERVEY_TRIGGER_TIME: null, SAFE_SERVEY_TRIGGER_TIME: null,
@ -38,7 +38,7 @@ class SEConfigPage extends React.Component {
this.props.closeFn(); this.props.closeFn();
else if (typeof this.props.data.closeTab == 'function') { else if (typeof this.props.data.closeTab == 'function') {
this.props.data.closeTab(this.props.data.id) this.props.data.closeTab(this.props.data.id)
} else if (typeof this.props.onCancel === "function"){ } else if (typeof this.props.onCancel === "function") {
this.props.onCancel(); this.props.onCancel();
} }
} }
@ -55,25 +55,25 @@ class SEConfigPage extends React.Component {
} }
}); });
} }
fmtEnum(name,value){ fmtEnum(name, value) {
const enums = this.props.app.enums; const enums = this.props.app.enums;
if (!enums || !enums[name]) return ''; if (!enums || !enums[name]) return '';
return enums[name].enums[value] || ''; return enums[name].enums[value] || '';
} }
onSave = () =>{ onSave = () => {
let data = JSON.parse(JSON.stringify(this.state.data)); let data = JSON.parse(JSON.stringify(this.state.data));
if (data.DEP_TRAIN_PLAN_END_TIME && data.DEP_TRAIN_PLAN_START_TIME){ if (data.DEP_TRAIN_PLAN_END_TIME && data.DEP_TRAIN_PLAN_START_TIME) {
let s = new Date(data.DEP_TRAIN_PLAN_START_TIME); let s = new Date(data.DEP_TRAIN_PLAN_START_TIME);
let e = new Date(data.DEP_TRAIN_PLAN_END_TIME); let e = new Date(data.DEP_TRAIN_PLAN_END_TIME);
if (e.getTime() - s.getTime() < 1 * 24 * 60 * 60 * 1000){ if (e.getTime() - s.getTime() < 1 * 24 * 60 * 60 * 1000) {
message.error('截止时间至少比开始时间大一天'); message.error('截止时间至少比开始时间大一天');
return; return;
} }
} }
if (!data.ID){ if (!data.ID) {
data.ID = guid(); data.ID = guid();
} }
this.setState({isLoading:true}); this.setState({ isLoading: true });
this.props.dispatch({ this.props.dispatch({
type: 'app/getDataByPost', type: 'app/getDataByPost',
payload: data, payload: data,
@ -81,19 +81,19 @@ class SEConfigPage extends React.Component {
onComplete: (ret) => { onComplete: (ret) => {
if (ret) { if (ret) {
message.success('保存成功!'); message.success('保存成功!');
this.setState({isLoading:false}); this.setState({ isLoading: false });
} }
} }
}); });
} }
render() { render() {
const { data } = this.state; const { data } = this.state;
const dateFormat = 'YYYY/MM/DD'; const dateFormat = 'MM-DD';
return <> return <>
<div style={{ padding: '10px' }}> <div style={{ padding: '10px' }}>
<Button style={{ marginLeft: '8px' }} onClick={() => this.onSave()} icon="save" type="primary" loading={this.state.isLoading}>保存</Button> <Button style={{ marginLeft: '8px' }} onClick={() => this.onSave()} icon="save" type="primary" loading={this.state.isLoading}>保存</Button>
</div> </div>
<div ref={el => (this.componentRef = el)} style={{ padding: '20px',backgroundColor:'FFF' }} id={'tableId' + this.props.data.id}> <div ref={el => (this.componentRef = el)} style={{ padding: '20px', backgroundColor: 'FFF' }} id={'tableId' + this.props.data.id}>
<h1 style={{ textAlign: 'center', margin: '15px' }}>安全教育培训基础设置</h1> <h1 style={{ textAlign: 'center', margin: '15px' }}>安全教育培训基础设置</h1>
<table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}> <table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
<tr> <tr>
@ -104,7 +104,7 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} > <td colSpan={4} rowSpan={1} >
<InputNumber value={data.C_TEST_COUNT} min={0} max={9999} <InputNumber value={data.C_TEST_COUNT} min={0} max={9999}
onChange={ onChange={
value =>{ value => {
let data = this.state.data; let data = this.state.data;
data.C_TEST_COUNT = value; data.C_TEST_COUNT = value;
this.setState(data) this.setState(data)
@ -117,7 +117,7 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} > <td colSpan={4} rowSpan={1} >
<InputNumber value={data.C_TEST_SCORE} min={0} max={9999} <InputNumber value={data.C_TEST_SCORE} min={0} max={9999}
onChange={ onChange={
value =>{ value => {
let data = this.state.data; let data = this.state.data;
data.C_TEST_SCORE = value; data.C_TEST_SCORE = value;
this.setState(data) this.setState(data)
@ -134,7 +134,7 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} > <td colSpan={4} rowSpan={1} >
<InputNumber value={data.S_TEST_COUNT} min={0} max={9999} <InputNumber value={data.S_TEST_COUNT} min={0} max={9999}
onChange={ onChange={
value =>{ value => {
let data = this.state.data; let data = this.state.data;
data.S_TEST_COUNT = value; data.S_TEST_COUNT = value;
this.setState(data) this.setState(data)
@ -147,7 +147,7 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} > <td colSpan={4} rowSpan={1} >
<InputNumber value={data.S_TEST_SCORE} min={0} max={9999} <InputNumber value={data.S_TEST_SCORE} min={0} max={9999}
onChange={ onChange={
value =>{ value => {
let data = this.state.data; let data = this.state.data;
data.S_TEST_SCORE = value; data.S_TEST_SCORE = value;
this.setState(data) this.setState(data)
@ -164,7 +164,7 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} > <td colSpan={4} rowSpan={1} >
<InputNumber value={data.M_TEST_COUNT} min={0} max={9999} <InputNumber value={data.M_TEST_COUNT} min={0} max={9999}
onChange={ onChange={
value =>{ value => {
let data = this.state.data; let data = this.state.data;
data.M_TEST_COUNT = value; data.M_TEST_COUNT = value;
this.setState(data) this.setState(data)
@ -177,7 +177,7 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} > <td colSpan={4} rowSpan={1} >
<InputNumber value={data.M_TEST_SCORE} min={0} max={9999} <InputNumber value={data.M_TEST_SCORE} min={0} max={9999}
onChange={ onChange={
value =>{ value => {
let data = this.state.data; let data = this.state.data;
data.M_TEST_SCORE = value; data.M_TEST_SCORE = value;
this.setState(data) this.setState(data)
@ -191,7 +191,7 @@ class SEConfigPage extends React.Component {
</tr> </tr>
<tr> <tr>
<td colSpan={4} rowSpan={1} >试题总分</td> <td colSpan={4} rowSpan={1} >试题总分</td>
<td colSpan={20} rowSpan={1} > { data.C_TEST_COUNT * data.C_TEST_SCORE + data.S_TEST_COUNT * data.S_TEST_SCORE + data.M_TEST_COUNT * data.M_TEST_SCORE} <td colSpan={20} rowSpan={1} > {data.C_TEST_COUNT * data.C_TEST_SCORE + data.S_TEST_COUNT * data.S_TEST_SCORE + data.M_TEST_COUNT * data.M_TEST_SCORE}
</td> </td>
</tr> </tr>
<tr> <tr>
@ -201,8 +201,9 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} >安全意识调查触发时间</td> <td colSpan={4} rowSpan={1} >安全意识调查触发时间</td>
<td colSpan={20} rowSpan={1} > <td colSpan={20} rowSpan={1} >
<DatePicker <DatePicker
format={dateFormat}
value={data.SAFE_SERVEY_TRIGGER_TIME ? moment(data.SAFE_SERVEY_TRIGGER_TIME) : null} value={data.SAFE_SERVEY_TRIGGER_TIME ? moment(data.SAFE_SERVEY_TRIGGER_TIME) : null}
onChange={ value => { onChange={value => {
let data = this.state.data; let data = this.state.data;
data.SAFE_SERVEY_TRIGGER_TIME = value; data.SAFE_SERVEY_TRIGGER_TIME = value;
this.setState(data) this.setState(data)
@ -214,8 +215,9 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} >培训需求调查触发时间</td> <td colSpan={4} rowSpan={1} >培训需求调查触发时间</td>
<td colSpan={20} rowSpan={1} > <td colSpan={20} rowSpan={1} >
<DatePicker <DatePicker
value={data.TRAIN_SURVEY_TRIGGER_TIME ? moment(data.TRAIN_SURVEY_TRIGGER_TIME) : null } format={dateFormat}
onChange={ value => { value={data.TRAIN_SURVEY_TRIGGER_TIME ? moment(data.TRAIN_SURVEY_TRIGGER_TIME) : null}
onChange={value => {
let data = this.state.data; let data = this.state.data;
data.TRAIN_SURVEY_TRIGGER_TIME = value; data.TRAIN_SURVEY_TRIGGER_TIME = value;
this.setState(data) this.setState(data)
@ -227,8 +229,9 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} >部门培训计划发起时间</td> <td colSpan={4} rowSpan={1} >部门培训计划发起时间</td>
<td colSpan={20} rowSpan={1} > <td colSpan={20} rowSpan={1} >
<DatePicker <DatePicker
format={dateFormat}
value={data.DEP_TRAIN_PLAN_START_TIME ? moment(data.DEP_TRAIN_PLAN_START_TIME) : null} value={data.DEP_TRAIN_PLAN_START_TIME ? moment(data.DEP_TRAIN_PLAN_START_TIME) : null}
onChange={ value => { onChange={value => {
let data = this.state.data; let data = this.state.data;
data.DEP_TRAIN_PLAN_START_TIME = value; data.DEP_TRAIN_PLAN_START_TIME = value;
this.setState(data) this.setState(data)
@ -240,8 +243,9 @@ class SEConfigPage extends React.Component {
<td colSpan={4} rowSpan={1} >部门培训计划截至时间</td> <td colSpan={4} rowSpan={1} >部门培训计划截至时间</td>
<td colSpan={20} rowSpan={1} > <td colSpan={20} rowSpan={1} >
<DatePicker <DatePicker
value={data.DEP_TRAIN_PLAN_END_TIME ? moment(data.DEP_TRAIN_PLAN_END_TIME) : null } format={dateFormat}
onChange={ value => { value={data.DEP_TRAIN_PLAN_END_TIME ? moment(data.DEP_TRAIN_PLAN_END_TIME) : null}
onChange={value => {
let data = this.state.data; let data = this.state.data;
data.DEP_TRAIN_PLAN_END_TIME = value; data.DEP_TRAIN_PLAN_END_TIME = value;
this.setState(data) this.setState(data)

View File

@ -128,7 +128,7 @@ class SESafeSurveyTest extends React.Component {
NAME = ret.Nav_Papers[0].Nav_Safe.NAME; NAME = ret.Nav_Papers[0].Nav_Safe.NAME;
END_TIME = ret.Nav_Papers[0].Nav_Safe.END_TIME; END_TIME = ret.Nav_Papers[0].Nav_Safe.END_TIME;
} }
if (moment().format("YYYY-MM-DD HH:mm:ss") > END_TIME) { if (moment().format("YYYY-MM-DD HH:mm:ss") < END_TIME && this.props.data.tableKey != undefined) {
message.error('已过答题截止时间!'); message.error('已过答题截止时间!');
this.props.dispatch({ this.props.dispatch({
type: 'app/getDataByPost', type: 'app/getDataByPost',
@ -457,7 +457,7 @@ class SESafeSurveyTest extends React.Component {
</tr> </tr>
} }
{ {
it.Nav_Test.TYPE !== 0 && it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_D != "" && it.Nav_Test.OPTION_D != undefined &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? answer : null}> <tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}> <td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}>
{ {

View File

@ -257,6 +257,43 @@ class Home extends React.Component {
// return retrundate; // return retrundate;
// }; // };
showTodayModal = (
dataId,
formCode,
TaskID,
title,
taskCode,
taskStartdt,
taskStatus
) => {
const newtmpData = {
data: {
id: dataId,
TaskID: TaskID,
onCancel: this.handleCancel,
taskCode: taskCode,
tableKey: this.state.tableKey,
noticeTitle: title,
taskStartdt: taskStartdt,
taskStatus: taskStatus,
homeReload: true,
},
formCode: "PF135",
};
this.setState(
{
noticeTitle: "今日提醒",
taskCode: taskCode,
tmpData: newtmpData,
currActivatedMenu: "",
},
() =>
this.setState({
formVisible: true,
})
);
};
showAll = (key) => { showAll = (key) => {
const { tableData } = this.state; const { tableData } = this.state;
@ -508,7 +545,7 @@ class Home extends React.Component {
}; };
handleCancel = () => { handleCancel = () => {
// 退出弹窗 // 退出弹窗
this.getBaseData(1, this.state.tableKey, 5); // this.getBaseData(1, this.state.tableKey, 5);
this.clearData(); this.clearData();
}; };
closeModal = () => { closeModal = () => {