报名提交确认框

This commit is contained in:
谢思 2022-04-13 15:16:50 +08:00
parent fc6b6dbede
commit ad7f878357
1 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,5 @@
import React , { useCallback, useEffect , useState } from 'react';
import { Breadcrumb, Button, Form, Input, Select, Upload } from 'antd';
import { Breadcrumb, Button, Form, Input, Select, Upload, Modal } from 'antd';
import {getUserApplyInfo, applyGlcc} from '../api';
import axios from 'axios';
import TextArea from 'antd/lib/input/TextArea';
@ -10,8 +10,8 @@ const Option = Select.Option;
function Apply(props) {
const {form, current_user, showNotification, isGlccApplyDate} = props;
//
// current_user && (current_user.user_id = 1061)
// current_user && (current_user.userName = "")
// current_user && (current_user.user_id = 1)
// current_user && (current_user.userName = "使")
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [reload, setReload] = useState(undefined);
const [imageUrl, setImageUrl] = useState(undefined);
@ -72,17 +72,23 @@ function Apply(props) {
e.preventDefault();
validateFieldsAndScroll((err, values) => {
if (!err) {
const params ={
...values,
projectLogoId: values.logo.file.response.data.id,
userId: current_user.user_id,
userName: current_user.username
}
applyGlcc(params).then(response=>{
if(response && response.message === "success"){
setReload(Math.random());
}
})
Modal.confirm({
title: "确认提交",
content: "确定提交报名信息,提交后报名信息将无法修改。",
onOk: ()=>{
const params ={
...values,
projectLogoId: values.logo.file.response.data.id,
userId: current_user.user_id,
userName: current_user.username
}
applyGlcc(params).then(response=>{
if(response && response.message === "success"){
showNotification("报名成功");
setReload(Math.random());
}
})}
})
}
});
};