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