修改取消所有报名后的问题

This commit is contained in:
何童崇 2022-05-18 18:57:50 +08:00
parent da0caba73b
commit 85d81c2553
1 changed files with 43 additions and 33 deletions

View File

@ -84,40 +84,50 @@ function Apply(props) {
userId: current_user.user_id,
profession: data.profession,
};
console.log(applyInfo);
if (Array.isArray(data.registrationStudentTaskList) && data.registrationStudentTaskList.length) {
let initTaskList = [];
for (const [i, item] of data.registrationStudentTaskList.entries()) {
applyInfo['memo' + i] = item.memo;
applyInfo['taskId' + i] = item.taskId;
applyInfo['memoAttachmentId' + i] = item.memoAttachmentId;
if (i == 0) {
setFiles([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId
}]);
} else {
setFiles1([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId,
}]);
if (Array.isArray(data.registrationStudentTaskList)) {
if (data.registrationStudentTaskList.length) {
let initTaskList = [];
for (const [i, item] of data.registrationStudentTaskList.entries()) {
applyInfo['memo' + i] = item.memo;
applyInfo['taskId' + i] = item.taskId;
applyInfo['memoAttachmentId' + i] = item.memoAttachmentId;
if (i == 0) {
setFiles([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId
}]);
} else {
setFiles1([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId,
}]);
}
initTaskList.push({
id: item.id,
memo: item.memo,
memoAttachmentId: item.memoAttachmentId,
taskId: item.taskId,
});
}
setMyTaskList(initTaskList);
initTaskList.push({
id: item.id,
memo: item.memo,
memoAttachmentId: item.memoAttachmentId,
taskId: item.taskId,
});
}
setMyTaskList(initTaskList);
// idid
if (data.registrationStudentTaskList.length === 1 && data.registrationStudentTaskList[0].taskId != taskId) {
addTask(data.registrationStudentTaskList);
// idid
if (data.registrationStudentTaskList.length === 1 && data.registrationStudentTaskList[0].taskId != taskId) {
addTask(data.registrationStudentTaskList);
}
} else {
//
new Promise((resove) => {
setMyTaskList(() => {
resove();
return [initTask]
});
}).then(res => setFieldsValue({ 'taskId0': taskId }))
}
}
@ -152,7 +162,7 @@ function Apply(props) {
setLoading(true);
const params = {
grade: values.grade,
location: values.location.join(),
location: Array.isArray(values.location) && values.location.join(),
mail: values.mail,
phone: values.phone,
proveAttachmentId: values.proveAttachmentId.file ? values.proveAttachmentId.file.response.id : userApplyInfo.proveAttachmentId,
@ -451,7 +461,7 @@ function Apply(props) {
}
{
myTaskList.length < 2 && <Button className="add_task" type="primary" onClick={addTask}>添加课题</Button>
myTaskList.length < 2 && <Button className="add_task" type="primary" onClick={() => { addTask() }}>添加课题</Button>
}
<Form.Item className='subInfo introArea'>