调整截止时间已过

issues25489
杨树林 5 years ago
parent bfb55c75cb
commit 9221e98f84

@ -62,7 +62,7 @@ class PollDetailTabForthRules extends Component{
this.unitChoose(this.props.rules);
}
if(this.props.flagPageEdit != prevProps.flagPageEdit){
this.setState({flagPageEdit:this.props.flagPageEdit})
this.setState({flagPageEdit: this.props.flagPageEdit})
}
}
componentDidMount=()=>{
@ -107,7 +107,7 @@ class PollDetailTabForthRules extends Component{
//修改发布规则里面的结束时间
changeRuleEndTime=(e,date,index)=>{
let arr=Object.assign({}, this.state.rules[parseInt(index)]);
arr.end_time=handleDateString(date);
if(date!="" && date!=undefined && moment(date,dataformat)>moment() && moment(date,dataformat)>moment(arr.publish_time,dataformat)){
arr.end_flag=""
@ -139,7 +139,7 @@ class PollDetailTabForthRules extends Component{
})
this.props.rulesCheckInfo && this.props.rulesCheckInfo(rules)
}
// changeOpen=(e,index)=>{
// let arr=Object.assign({}, this.state.rules[parseInt(index)]);
// arr.open= true;
@ -168,9 +168,9 @@ class PollDetailTabForthRules extends Component{
rules[index]=arr;
//修改选择分班下拉选项(是否被选中)
//let course_group = this.state.course_group;
this.unitChoose(rules);
this.setState({
rules:rules,
@ -194,8 +194,8 @@ class PollDetailTabForthRules extends Component{
}
});
}
let course_group =this.state.course_group;
let course_group =this.state.course_group;
course_group.forEach(ele=>{
if(arr.indexOf(ele.course_group_id) != -1){
ele.course_choosed = 1
@ -356,10 +356,10 @@ class PollDetailTabForthRules extends Component{
max-width:280px;
}
`}</style>
{
{
rules && rules.length > 0 && rules.map((rule,r)=>{
const courseGroup = rule.course_search !="" ?
const courseGroup = rule.course_search != "" ?
course_group.filter( item => item.course_group_name.indexOf(rule.course_search) != -1)
:course_group
@ -451,19 +451,19 @@ class PollDetailTabForthRules extends Component{
<Tooltip placement="bottom" title={rule.e_timeflag ? this.props.isAdmin()?"截止时间已过,不能再修改":"":""}>
<span>
<DatePicker
showToday={false}
dropdownClassName="hideDisable"
placeholder="请选择截止时间"
locale={locale}
className={rule.end_flag && rule.end_flag !="" ? "noticeTip winput-240-40":"winput-240-40" }
value={rule.end_time && moment(rule.end_time,dataformat)}
onChange={(e, date)=>this.changeRuleEndTime(e, date,r)}
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime}
showToday={false}
dropdownClassName="hideDisable"
placeholder="请选择截止时间"
locale={locale}
className={rule.end_flag && rule.end_flag !="" ? "noticeTip winput-240-40":"winput-240-40" }
value={rule.end_time && moment(rule.end_time,dataformat)}
onChange={(e, date)=>this.changeRuleEndTime(e, date,r)}
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={ rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.e_timeflag == true ? true : !flagPageEdit}
style={{"height":"42px"}}
disabled={rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ? true : !flagPageEdit : rule.e_timeflag == true ? true : !flagPageEdit}
style={{"height":"42px"}}
></DatePicker>
</span>
</Tooltip>
@ -480,7 +480,7 @@ class PollDetailTabForthRules extends Component{
<a className="mr20" onClick={()=>this.removeRules(`${r}`)}><i className="iconfont icon-shanchu color-grey-9 font-18"></i></a>
</Tooltip>
:"":
r > 0 && rule.p_timeflag == false ?
r > 0 && rule.p_timeflag == false ?
<Tooltip title="删除">
<a className="mr20" onClick={()=>this.removeRules(`${r}`)}><i className="iconfont icon-shanchu color-grey-9 font-18"></i></a>
</Tooltip>
@ -490,13 +490,13 @@ class PollDetailTabForthRules extends Component{
</li>
:""
}
</div>
</div>
)
})
})
}
</div>
)
}
}
export default PollDetailTabForthRules;
export default PollDetailTabForthRules;

Loading…
Cancel
Save