|
|
@ -31,7 +31,8 @@ class GraduationTasksSubmitnew extends Component{
|
|
|
|
minmaxtype:false,
|
|
|
|
minmaxtype:false,
|
|
|
|
selectobjct:undefined,
|
|
|
|
selectobjct:undefined,
|
|
|
|
Loadtype:false,
|
|
|
|
Loadtype:false,
|
|
|
|
spinnings:false
|
|
|
|
spinnings:false,
|
|
|
|
|
|
|
|
shixunsreplace:false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -88,111 +89,11 @@ class GraduationTasksSubmitnew extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
if(fileList.length === 0){
|
|
|
|
if(fileList.length === 0){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Modalstype:true,
|
|
|
|
tshixunsreplace:true,
|
|
|
|
Modalstopval:'请上传附件!',
|
|
|
|
|
|
|
|
Loadtype:true,
|
|
|
|
|
|
|
|
ModalSave:this.cancelAttachment,
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.Commoninterface(fileList,selectmemberslist,workslist);
|
|
|
|
|
|
|
|
|
|
|
|
let userids=[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var list of selectmemberslist){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(list.user_id!=undefined&&list.user_id!=null){
|
|
|
|
|
|
|
|
userids.push(list.user_id)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(workslist.task_type===1){
|
|
|
|
|
|
|
|
userids=undefined
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let listid=[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var list of fileList){
|
|
|
|
|
|
|
|
listid.push(list.response.id)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// e.preventDefault();
|
|
|
|
|
|
|
|
if( GraduationTasksnewtype===true){
|
|
|
|
|
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
|
|
|
|
|
if (!err) {
|
|
|
|
|
|
|
|
console.log(values.description);
|
|
|
|
|
|
|
|
// console.log(fileList);
|
|
|
|
|
|
|
|
if(values.description===undefined||values.description===""){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(workslist&&workslist.task_type===2){
|
|
|
|
|
|
|
|
if(userids!=undefined){
|
|
|
|
|
|
|
|
if(userids.length<2){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
minvalue:2,
|
|
|
|
|
|
|
|
setvalue:"小于",
|
|
|
|
|
|
|
|
minmaxtype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}else if(userids.length>5){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
minvalue:5,
|
|
|
|
|
|
|
|
setvalue:"大于",
|
|
|
|
|
|
|
|
minmaxtype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
spinnings:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let id=this.props.match.params.task_Id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let url="/graduation_tasks/"+id+"/graduation_works.json";
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
|
|
|
description:values.description,
|
|
|
|
|
|
|
|
attachment_ids:listid,
|
|
|
|
|
|
|
|
user_ids:userids
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
).then((response) => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
spinnings:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if(response.status===200) {
|
|
|
|
|
|
|
|
GraduationTasksnewtype=false;
|
|
|
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// Modalstype:true,
|
|
|
|
|
|
|
|
// Modalstopval:response.data.message,
|
|
|
|
|
|
|
|
// ModalSave:()=>this.setedit(response.data.work_id),
|
|
|
|
|
|
|
|
// Loadtype:true
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
this.setedit(response.data.work_id)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
GraduationTasksnewtype=true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setTimeout(function () {
|
|
|
|
|
|
|
|
// GraduationTasksnewtype=true
|
|
|
|
|
|
|
|
// },10000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleSelectChange = (value) => {
|
|
|
|
handleSelectChange = (value) => {
|
|
|
@ -433,10 +334,116 @@ class GraduationTasksSubmitnew extends Component{
|
|
|
|
window.history.go(-1)
|
|
|
|
window.history.go(-1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//公用数据
|
|
|
|
|
|
|
|
Commoninterface = (fileList,selectmemberslist,workslist)=>{
|
|
|
|
|
|
|
|
let userids=[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var list of selectmemberslist){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(list.user_id!=undefined&&list.user_id!=null){
|
|
|
|
|
|
|
|
userids.push(list.user_id)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(workslist.task_type===1){
|
|
|
|
|
|
|
|
userids=undefined
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let listid=[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var list of fileList){
|
|
|
|
|
|
|
|
listid.push(list.response.id)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// e.preventDefault();
|
|
|
|
|
|
|
|
if( GraduationTasksnewtype===true){
|
|
|
|
|
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
|
|
|
|
|
if (!err) {
|
|
|
|
|
|
|
|
console.log(values.description);
|
|
|
|
|
|
|
|
// console.log(fileList);
|
|
|
|
|
|
|
|
if(values.description===undefined||values.description===""){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(workslist&&workslist.task_type===2){
|
|
|
|
|
|
|
|
if(userids!=undefined){
|
|
|
|
|
|
|
|
if(userids.length<2){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
minvalue:2,
|
|
|
|
|
|
|
|
setvalue:"小于",
|
|
|
|
|
|
|
|
minmaxtype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}else if(userids.length>5){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
minvalue:5,
|
|
|
|
|
|
|
|
setvalue:"大于",
|
|
|
|
|
|
|
|
minmaxtype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
spinnings:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let id=this.props.match.params.task_Id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let url="/graduation_tasks/"+id+"/graduation_works.json";
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
|
|
|
description:values.description,
|
|
|
|
|
|
|
|
attachment_ids:listid,
|
|
|
|
|
|
|
|
user_ids:userids
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
).then((response) => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
spinnings:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if(response.status===200) {
|
|
|
|
|
|
|
|
GraduationTasksnewtype=false;
|
|
|
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// Modalstype:true,
|
|
|
|
|
|
|
|
// Modalstopval:response.data.message,
|
|
|
|
|
|
|
|
// ModalSave:()=>this.setedit(response.data.work_id),
|
|
|
|
|
|
|
|
// Loadtype:true
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
this.setedit(response.data.work_id)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
GraduationTasksnewtype=true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//确认
|
|
|
|
|
|
|
|
hidestartshixunsreplace=()=>{
|
|
|
|
|
|
|
|
let {fileList,selectmemberslist,workslist}=this.state;
|
|
|
|
|
|
|
|
this.Commoninterface(fileList,selectmemberslist,workslist);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//取消
|
|
|
|
|
|
|
|
hidestartshixunsreplacetwo=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
shixunsreplace:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
let {search,fileList, workslist,setvalue,minvalue,minmaxtype,Loadtype,
|
|
|
|
let {search,fileList, workslist,setvalue,minvalue,minmaxtype,Loadtype,
|
|
|
|
Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist} =this.state;
|
|
|
|
Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist,shixunsreplace} =this.state;
|
|
|
|
|
|
|
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
let category_id=this.props.match.params.category_id;
|
|
|
|
let category_id=this.props.match.params.category_id;
|
|
|
@ -481,6 +488,24 @@ render(){
|
|
|
|
modalSave={ModalSave}
|
|
|
|
modalSave={ModalSave}
|
|
|
|
loadtype={Loadtype}
|
|
|
|
loadtype={Loadtype}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
|
|
|
keyboard={false}
|
|
|
|
|
|
|
|
title="提示"
|
|
|
|
|
|
|
|
visible={shixunsreplace}
|
|
|
|
|
|
|
|
closable={false}
|
|
|
|
|
|
|
|
footer={null}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div className="task-popup-content">
|
|
|
|
|
|
|
|
<p className="task-popup-text-center font-16 ">还未上传附件</p>
|
|
|
|
|
|
|
|
<p className="task-popup-text-center font-16 pb20">是否确认提交作品?</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="task-popup-submit clearfix">
|
|
|
|
|
|
|
|
<a className="task-btn task-btn-orange fr "
|
|
|
|
|
|
|
|
onClick={() => this.hidestartshixunsreplace()}>确认</a>
|
|
|
|
|
|
|
|
<a className="task-btn fr mr50"
|
|
|
|
|
|
|
|
onClick={() => this.hidestartshixunsreplacetwo()}>取消</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
<div className={"educontent mb20"}>
|
|
|
|
<div className={"educontent mb20"}>
|
|
|
|
|
|
|
|
|
|
|
@ -520,13 +545,10 @@ render(){
|
|
|
|
.upload_1 .ant-upload-list {
|
|
|
|
.upload_1 .ant-upload-list {
|
|
|
|
width: 350px;
|
|
|
|
width: 350px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.contentbox{
|
|
|
|
|
|
|
|
margin-bottom:0px !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`}</style>
|
|
|
|
`}</style>
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item
|
|
|
|
label="内容"
|
|
|
|
label="内容"
|
|
|
|
className={"contentbox"}
|
|
|
|
className={"contentbox mdInForm"}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{getFieldDecorator('description', {
|
|
|
|
{getFieldDecorator('description', {
|
|
|
|
rules: [{
|
|
|
|
rules: [{
|
|
|
@ -583,7 +605,7 @@ render(){
|
|
|
|
|
|
|
|
|
|
|
|
{workslist&&workslist.task_type===1?"":
|
|
|
|
{workslist&&workslist.task_type===1?"":
|
|
|
|
<div className="stud-class-set pd20 coursenavbox edu-back-white"
|
|
|
|
<div className="stud-class-set pd20 coursenavbox edu-back-white"
|
|
|
|
style={{borderTop:'1px solid #ccc'}}
|
|
|
|
style={{borderTop:'0.5px solid #ccc'}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item
|
|
|
|
label="小组成员"
|
|
|
|
label="小组成员"
|
|
|
|