|
|
|
@ -34,7 +34,8 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
this.state={
|
|
|
|
|
group_ids:[],
|
|
|
|
|
endtime:"",
|
|
|
|
|
course_groups:undefined
|
|
|
|
|
course_groups:undefined,
|
|
|
|
|
Checkboxtype:true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
@ -165,7 +166,7 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
|
|
|
|
|
arr.map((item,key)=>{
|
|
|
|
|
if(item.id===id){
|
|
|
|
|
item.end_time=dateString
|
|
|
|
|
item.end_time=date===null?"":moment(handleDateString(dateString)).format('YYYY-MM-DD HH:mm')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -176,11 +177,12 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
propsSaves=(ds,endtime)=>{
|
|
|
|
|
let {course_groups}=this.state;
|
|
|
|
|
let {course_groups}=this.state;
|
|
|
|
|
|
|
|
|
|
if(this.props.typs=="end"){
|
|
|
|
|
this.props.Saves()
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
if(this.props.typs!="end"){
|
|
|
|
|
if(!endtime){
|
|
|
|
|
this.setState({
|
|
|
|
@ -198,6 +200,7 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let type=false
|
|
|
|
|
if(course_groups===undefined||course_groups.length===0){
|
|
|
|
|
this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm"))
|
|
|
|
|
}else{
|
|
|
|
@ -206,7 +209,15 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
course_groups.map((items,key)=>{
|
|
|
|
|
if(item===items.id){
|
|
|
|
|
if(!items.end_time){
|
|
|
|
|
arr.push(moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"))
|
|
|
|
|
type=true
|
|
|
|
|
this.setState({
|
|
|
|
|
endtimetype:true,
|
|
|
|
|
endtimetypeid:items.id,
|
|
|
|
|
endtimetypevalue:"截止时间不能为空"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
// arr.push(moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"))
|
|
|
|
|
}else{
|
|
|
|
|
arr.push(items.end_time)
|
|
|
|
|
}
|
|
|
|
@ -214,23 +225,53 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if(type===false){
|
|
|
|
|
this.props.Saves(ds,arr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.props.Saves(ds,arr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Checkboxtype=(e)=>{
|
|
|
|
|
|
|
|
|
|
let {course_groups}=this.state;
|
|
|
|
|
|
|
|
|
|
let arr=[];
|
|
|
|
|
if(e.target.checked==true){
|
|
|
|
|
course_groups.map((item,key)=>{
|
|
|
|
|
arr.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
arr=[]
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
Checkboxtype:e.target.checked,
|
|
|
|
|
group_ids:arr
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
let {group_ids,endtime,course_groups}=this.state;
|
|
|
|
|
|
|
|
|
|
// console.log(course_groups)
|
|
|
|
|
// TODO course_groups为空时的处理
|
|
|
|
|
return(
|
|
|
|
|
<div>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ant-input, .ant-input .ant-input-suffix{
|
|
|
|
|
background-color: #fff !important;
|
|
|
|
|
}
|
|
|
|
|
.width300{
|
|
|
|
|
width:300px;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
{
|
|
|
|
|
this.props.OneSelftype===true?<style>
|
|
|
|
|
{
|
|
|
|
@ -272,19 +313,19 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
{this.props.Topval}
|
|
|
|
|
<span className={"color-blue underline"}>{this.props.Topvalright}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p className="task-popup-text-center font-16 mt10">
|
|
|
|
|
{this.props.Botvalleft===undefined?"":<span className={"colorFF6800"}>"{this.props.Botvalleft}"</span>}
|
|
|
|
|
{this.props.Botval}
|
|
|
|
|
</p>
|
|
|
|
|
{/*<p className="task-popup-text-center font-16 mt10">*/}
|
|
|
|
|
{/*{this.props.Botvalleft===undefined?"":<span className={"colorFF6800"}>"{this.props.Botvalleft}"</span>}*/}
|
|
|
|
|
{/*{this.props.Botval}*/}
|
|
|
|
|
{/*</p>*/}
|
|
|
|
|
</React.Fragment> }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.props.starttime===undefined||
|
|
|
|
|
this.props.starttime===""?""
|
|
|
|
|
: <p className="task-popup-text-center font-16 mt10 mb10">
|
|
|
|
|
<span className={"font-14 mr20 color979797"}>
|
|
|
|
|
<span className={"mr10"}>发布时间:</span>
|
|
|
|
|
{this.props.starttime}</span>
|
|
|
|
|
{/*<span className={"font-14 mr20 color979797"}>*/}
|
|
|
|
|
{/*<span className={"mr10"}>发布时间:</span>*/}
|
|
|
|
|
{/*{this.props.starttime}</span>*/}
|
|
|
|
|
{this.props.modaltype===undefined||this.props.modaltype===2? <span className={"font-14 color979797"}>
|
|
|
|
|
{/*{this.props.endtime}*/}
|
|
|
|
|
<span className={"mr10"}>截止时间</span>
|
|
|
|
@ -304,7 +345,7 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
className={ this.state.endtimetype===true?"noticeTip":""}
|
|
|
|
|
/>
|
|
|
|
|
{this.state.endtimetype===true?<div className={"color-red fr mr90 mt5"}>{this.state.endtimetypevalue}</div>:""}
|
|
|
|
|
<div className={"fr mr90 mt5"}>(仅支持半点和整点)</div>
|
|
|
|
|
{/*<div className={"fr mr90 mt5"}>(仅支持半点和整点)</div>*/}
|
|
|
|
|
</span>:""}
|
|
|
|
|
</p>}
|
|
|
|
|
{/* usingCheckBeforePost 为true的时候 全选所有分班 */}
|
|
|
|
@ -332,7 +373,7 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
|
|
|
|
|
<span style={{"float":"left","color":"#05101A"}} className="task-hide color-grey-name ml50">分班名称</span>
|
|
|
|
|
|
|
|
|
|
<span style={{"float":"right","color":"#05101A"}} className="task-hide color-grey-name mr20">截止时间(仅支持半点和整点)</span>
|
|
|
|
|
<span style={{"float":"right","color":"#05101A"}} className="task-hide color-grey-name mr20">截止时间</span>
|
|
|
|
|
</li>
|
|
|
|
|
</div>}
|
|
|
|
|
{this.props.modaltype===undefined||this.props.modaltype===2
|
|
|
|
@ -350,7 +391,7 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
<div className="clearfix edu-txt-center lineh-40 mb10" key={key}>
|
|
|
|
|
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
|
|
|
|
|
<Checkbox
|
|
|
|
|
className="task-hide edu-txt-left"
|
|
|
|
|
className="task-hide edu-txt-left width300"
|
|
|
|
|
name="shixun_homework[]"
|
|
|
|
|
value={item.id}
|
|
|
|
|
key={item.id}
|
|
|
|
@ -367,9 +408,9 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
format={dateFormat}
|
|
|
|
|
placeholder="请选择截止时间"
|
|
|
|
|
width={"210px"}
|
|
|
|
|
value={item.end_time===null||item.end_time===""?"":moment(item.end_time, dateFormat)}
|
|
|
|
|
value={item.end_time===null||item.end_time===""?"":moment(handleDateString(item.end_time), dateFormat)}
|
|
|
|
|
onChange={(e,data)=>this.onChangeTimeendlist(e,data,item.id)}
|
|
|
|
|
className={ this.state.endtimetype===true?"noticeTip fr":"fr"}
|
|
|
|
|
className={ this.state.endtimetypeid===item.id&&this.state.endtimetype===true||moment(handleDateString(item.end_time),"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")?"noticeTip fr":"fr"}
|
|
|
|
|
/>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
@ -383,6 +424,7 @@ class OneSelfOrderModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div className="clearfix mt30 edu-txt-center mb10">
|
|
|
|
|
<Checkbox className="fl ml10" checked={this.state.Checkboxtype} onChange={this.Checkboxtype}>全选</Checkbox>
|
|
|
|
|
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname}</a>
|
|
|
|
|
<a className="task-btn task-btn-orange" onClick={()=>this.propsSaves(group_ids,this.state.endtime)}>{this.props.Savesname}</a>
|
|
|
|
|
</div>
|
|
|
|
|