|
|
|
@ -637,7 +637,8 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
|
|
|
|
|
//允许补交
|
|
|
|
|
onChanges = (e) => {
|
|
|
|
|
// debugger
|
|
|
|
|
console.log("640");
|
|
|
|
|
console.log(this.state.end_time);
|
|
|
|
|
if(e.target.value ==="允许补交"){
|
|
|
|
|
if(this.state.end_time !== null && this.state.end_time!== undefined){
|
|
|
|
|
// console.log(this.state.end_time);
|
|
|
|
@ -955,26 +956,55 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disabledEndDate = (end_time) => {
|
|
|
|
|
const publish_time = this.state.publish_time;
|
|
|
|
|
if (!end_time || !publish_time) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return end_time.valueOf() <= publish_time.valueOf();
|
|
|
|
|
// disabledEndDate = (end_time) => {
|
|
|
|
|
// const publish_time = this.state.publish_time;
|
|
|
|
|
// if (!end_time || !publish_time) {
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// return end_time.valueOf() <= publish_time.valueOf();
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// disabledEndDates = (end_time) => {
|
|
|
|
|
// const publish_time = this.state.end_time
|
|
|
|
|
// if (!end_time || !publish_time) {
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// console.log("end_time.valueOf()")
|
|
|
|
|
// // console.log(end_time.valueOf());
|
|
|
|
|
// // console.log(publish_time.valueOf());
|
|
|
|
|
// return end_time.valueOf() <= publish_time.valueOf();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
disabledStartDatestart= (startValue) => {
|
|
|
|
|
const endValue = this.state.end_time
|
|
|
|
|
|
|
|
|
|
if (!startValue || !endValue) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
disabledEndDates = (end_time) => {
|
|
|
|
|
const publish_time = this.state.end_time
|
|
|
|
|
if (!end_time || !publish_time) {
|
|
|
|
|
return startValue.valueOf() > endValue.valueOf();
|
|
|
|
|
};
|
|
|
|
|
disabledEndDateend = (endValue) => {
|
|
|
|
|
const startValue = this.state.publish_time;
|
|
|
|
|
if (!endValue || !startValue) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
console.log("end_time.valueOf()")
|
|
|
|
|
// console.log(end_time.valueOf());
|
|
|
|
|
// console.log(publish_time.valueOf());
|
|
|
|
|
return end_time.valueOf() <= publish_time.valueOf();
|
|
|
|
|
return endValue.valueOf() <= startValue.valueOf();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disabledEndDateendd = (endsValue) => {
|
|
|
|
|
const endValues = this.state.end_time
|
|
|
|
|
|
|
|
|
|
if (!endsValue|| !endValues) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return endsValue.valueOf() <= endValues.valueOf();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChangedata = (field, value, dateString) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
[field]: handleDateString(dateString),
|
|
|
|
@ -1085,7 +1115,10 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
// console.log(value);
|
|
|
|
|
console.log(dateString);
|
|
|
|
|
// console.log(handleDateString(dateString));
|
|
|
|
|
this.onChangedata('publish_time', value, dateString);
|
|
|
|
|
// this.onChangedata('publish_time', value, dateString);
|
|
|
|
|
this.setState({
|
|
|
|
|
publish_time:moment(handleDateString(dateString))
|
|
|
|
|
})
|
|
|
|
|
if(this.state.allowreplenishment === "允许补交") {
|
|
|
|
|
this.setState({
|
|
|
|
|
end_time:moment(handleDateString(dateString)).add(1, 'months'),
|
|
|
|
@ -1144,11 +1177,13 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.onChangedata('end_time', value, dateString);
|
|
|
|
|
// this.onChangedata('end_time', value, dateString);
|
|
|
|
|
if(this.state.allowreplenishment === "允许补交"){
|
|
|
|
|
this.setState({
|
|
|
|
|
late_time:moment(handleDateString(dateString)).add(1, 'months'),
|
|
|
|
|
late_times:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
|
|
|
|
|
end_time:moment(handleDateString(dateString)).add(1, 'months'),
|
|
|
|
|
deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
|
|
|
|
|
late_time:moment(handleDateString(dateString)).add(2, 'months'),
|
|
|
|
|
late_times:moment(handleDateString(dateString)).add(2, 'months').format('YYYY-MM-DD HH:mm'),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1647,7 +1682,7 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
<DatePicker
|
|
|
|
|
showToday={false}
|
|
|
|
|
id={"publishtimeid"}
|
|
|
|
|
disabledDate={this.disabledDateTime}
|
|
|
|
|
disabledDate={this.disabledStartDatestart}
|
|
|
|
|
disabledTime={disabledDateTime}
|
|
|
|
|
className={borreds}
|
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
@ -1679,7 +1714,7 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
<DatePicker
|
|
|
|
|
showToday={false}
|
|
|
|
|
id={"end_timeid"}
|
|
|
|
|
disabledDate={this.disabledDateTime}
|
|
|
|
|
disabledDate={this.disabledEndDateend}
|
|
|
|
|
disabledTime={disabledDateTime}
|
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
|
className={borredss}
|
|
|
|
@ -1760,7 +1795,7 @@ class Trainingjobsetting extends Component {
|
|
|
|
|
<DatePicker
|
|
|
|
|
showToday={false}
|
|
|
|
|
id={"late_timeid"}
|
|
|
|
|
disabledDate={this.disabledEndDates}
|
|
|
|
|
disabledDate={this.disabledEndDateendd}
|
|
|
|
|
disabledTime={disabledDateTime}
|
|
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
|
|
value={late_time && moment(late_time, dataformat)}
|
|
|
|
|