|
|
|
@ -49,6 +49,8 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
super(props)
|
|
|
|
|
this.publishModal = React.createRef();
|
|
|
|
|
this.endModal = React.createRef();
|
|
|
|
|
this.fetchMoment = moment()
|
|
|
|
|
|
|
|
|
|
this.state={
|
|
|
|
|
unified_setting: true,
|
|
|
|
|
rules: [],
|
|
|
|
@ -123,6 +125,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
} else if (result.data.publish_time && moment(result.data.publish_time) < moment()) {
|
|
|
|
|
disable_unified_setting = true
|
|
|
|
|
}
|
|
|
|
|
this.fetchMoment = moment()
|
|
|
|
|
this.setState({
|
|
|
|
|
// starttimetype:starttype,
|
|
|
|
|
// endtimetype:endtype,
|
|
|
|
@ -231,7 +234,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
end_time: endTime.format(dateFormat)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (!this.state.late_time && endTime) {
|
|
|
|
|
if (this.state.allow_late && !this.state.late_time && endTime) {
|
|
|
|
|
this.setState({
|
|
|
|
|
late_time: endTime.add(1, 'months').format(dateFormat)
|
|
|
|
|
})
|
|
|
|
@ -265,9 +268,12 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
const currentEndTime = this._getCurrentEndTime()
|
|
|
|
|
let evaluation_start, evaluation_end, evaluation_num = 0, absence_penalty = 0;
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (currentEndTime) {
|
|
|
|
|
evaluation_start = moment(currentEndTime).add(7, 'days').format(dateFormat)
|
|
|
|
|
evaluation_end = moment(currentEndTime).add(21, 'days').format(dateFormat)
|
|
|
|
|
if (this.state.allow_late && this.state.late_time) {
|
|
|
|
|
evaluation_start = moment(this.state.late_time).add(14, 'days').format(dateFormat)
|
|
|
|
|
evaluation_end = moment(this.state.late_time).add(28, 'days').format(dateFormat)
|
|
|
|
|
} else if (currentEndTime) {
|
|
|
|
|
evaluation_start = moment(currentEndTime).add(14, 'days').format(dateFormat)
|
|
|
|
|
evaluation_end = moment(currentEndTime).add(28, 'days').format(dateFormat)
|
|
|
|
|
}
|
|
|
|
|
if (!this.state.evaluation_num) {
|
|
|
|
|
evaluation_num = 3
|
|
|
|
@ -320,10 +326,14 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
const { evaluation_end } = this.state;
|
|
|
|
|
const anonymous_appeal = e.target.checked
|
|
|
|
|
let appeal_time, appeal_penalty = this.state.appeal_penalty
|
|
|
|
|
const currentEndTime = this._getCurrentEndTime()
|
|
|
|
|
|
|
|
|
|
if (anonymous_appeal) {
|
|
|
|
|
appeal_penalty = 2
|
|
|
|
|
if (evaluation_end) {
|
|
|
|
|
appeal_time = moment(evaluation_end).add(7, 'days').format(dateFormat)
|
|
|
|
|
if (this.state.allow_late && this.state.late_time) {
|
|
|
|
|
appeal_time = moment(this.state.late_time).add(5 * 7, 'days').format(dateFormat)
|
|
|
|
|
} else if (currentEndTime) {
|
|
|
|
|
appeal_time = moment(currentEndTime).add(5 * 7, 'days').format(dateFormat)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
appeal_time = null;
|
|
|
|
@ -386,7 +396,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
answer_public: e.target.checked
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 补交设置 允许补交
|
|
|
|
|
allow_late_change=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
allow_late: e.target.value
|
|
|
|
@ -401,6 +411,10 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
late_time: moment(handleDateString(currentEndTime)).add(1, 'months').format(dateFormat)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
late_time: null
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1031,7 +1045,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
{/* <Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":publish_time_type===true?"发布时间已过,则不能修改":""}>
|
|
|
|
|
</Tooltip> */}
|
|
|
|
|
|
|
|
|
|
<ConditionToolTip condition={moment(this.state.init_publish_time) < moment()} title={"时间已过,不能再修改"}>
|
|
|
|
|
<ConditionToolTip condition={moment(this.state.init_publish_time) < this.fetchMoment} title={"时间已过,不能再修改"}>
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
|
|
<DatePicker
|
|
|
|
@ -1063,7 +1077,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
<span>截止时间:</span>
|
|
|
|
|
{/* <Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":end_time_type===true?"截止时间已过,则不能修改":""}>
|
|
|
|
|
</Tooltip> */}
|
|
|
|
|
<ConditionToolTip condition={moment(this.state.init_end_time) < moment()} title={"时间已过,不能再修改"}>
|
|
|
|
|
<ConditionToolTip condition={moment(this.state.init_end_time) < this.fetchMoment} title={"时间已过,不能再修改"}>
|
|
|
|
|
<span>
|
|
|
|
|
<DatePicker
|
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
@ -1122,7 +1136,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
|
|
|
|
|
<RadioGroup onChange={this.allow_late_change} value={allow_late}>
|
|
|
|
|
|
|
|
|
|
<Radio style={radioStyle} value={true} disabled={noAuth}>允许补交</Radio>
|
|
|
|
|
<Radio style={radioStyle} value={true} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>允许补交</Radio>
|
|
|
|
|
|
|
|
|
|
<div className={"h21 mb10 ml30 mt20"}>
|
|
|
|
|
<span>迟交扣分:</span>
|
|
|
|
@ -1135,7 +1149,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
|
|
|
|
|
<div className={" mb10 ml30"}>
|
|
|
|
|
<span>结束时间:</span>
|
|
|
|
|
<ConditionToolTip condition={moment(init_late_time) < moment()} title={"时间已过,不能再修改"}>
|
|
|
|
|
<ConditionToolTip condition={moment(init_late_time) < this.fetchMoment} title={"时间已过,不能再修改"}>
|
|
|
|
|
<span>
|
|
|
|
|
<DatePicker
|
|
|
|
|
showToday={false}
|
|
|
|
@ -1164,7 +1178,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Radio style={radioStyle} value={false} disabled={noAuth}>禁止补交</Radio>
|
|
|
|
|
<Radio style={radioStyle} value={false} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>禁止补交</Radio>
|
|
|
|
|
|
|
|
|
|
</RadioGroup>
|
|
|
|
|
|
|
|
|
@ -1183,7 +1197,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
<div className={"h20 mb30 ml60"}>
|
|
|
|
|
<span>开启时间:</span>
|
|
|
|
|
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?"发布时间已过,则不能修改":""}>
|
|
|
|
|
<ConditionToolTip condition={moment(init_evaluation_start) < moment()} title={"时间已过,不能再修改"}>
|
|
|
|
|
<ConditionToolTip condition={moment(init_evaluation_start) < this.fetchMoment} title={"时间已过,不能再修改"}>
|
|
|
|
|
<span>
|
|
|
|
|
<DatePicker
|
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
@ -1216,7 +1230,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
{/* <Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?"发布时间已过,则不能修改":""}>
|
|
|
|
|
</Tooltip> */}
|
|
|
|
|
|
|
|
|
|
<ConditionToolTip condition={moment(init_evaluation_end) < moment()} title={"时间已过,不能再修改"}>
|
|
|
|
|
<ConditionToolTip condition={moment(init_evaluation_end) < this.fetchMoment} title={"时间已过,不能再修改"}>
|
|
|
|
|
<span>
|
|
|
|
|
<DatePicker
|
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
@ -1313,7 +1327,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
|
<span>结束时间:</span>
|
|
|
|
|
{/* <Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?"发布时间已过,则不能修改":""}>
|
|
|
|
|
</Tooltip> */}
|
|
|
|
|
<ConditionToolTip condition={moment(init_appeal_time) < moment()} title={"时间已过,不能再修改"}>
|
|
|
|
|
<ConditionToolTip condition={moment(init_appeal_time) < this.fetchMoment} title={"时间已过,不能再修改"}>
|
|
|
|
|
<span>
|
|
|
|
|
<DatePicker
|
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
|