下载中
This commit is contained in:
parent
0dc89773a1
commit
26d884921e
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react'
|
||||
import {useState} from 'react'
|
||||
import {post, Axios, get} from "../../util/AjaxUtils.ts";
|
||||
import useMessage from "antd/es/message/useMessage";
|
||||
import {
|
||||
@ -8,6 +8,7 @@ import {
|
||||
} from 'antd';
|
||||
import ContractText from '../ContractText/ContractText'
|
||||
import {useDispatch} from 'react-redux'
|
||||
|
||||
export default function ContractModal(props: any) {
|
||||
const [messageApi, messageApiHolder] = useMessage();
|
||||
const [modalOpen, setModalOpen] = useState(false)
|
||||
@ -15,6 +16,7 @@ export default function ContractModal(props: any) {
|
||||
const [name, setName] = useState(''); // 甲方姓名状态
|
||||
const [phone, setPhone] = useState(''); // 电话状态
|
||||
const [address, setAddress] = useState(''); // 地址状态
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const onFinish = (values: any) => {
|
||||
setName(values.name);
|
||||
setPhone(values.phone);
|
||||
@ -48,6 +50,9 @@ export default function ContractModal(props: any) {
|
||||
})
|
||||
}
|
||||
const downContract = () => {
|
||||
if (isSaving) {
|
||||
return;
|
||||
}
|
||||
post<any>({
|
||||
messageApi,
|
||||
url: `/api/contract/management/save`,
|
||||
@ -57,7 +62,7 @@ export default function ContractModal(props: any) {
|
||||
firstPartyPhone: phone
|
||||
},
|
||||
onBefore() {
|
||||
|
||||
setIsSaving(true);
|
||||
},
|
||||
onSuccess(data) {
|
||||
// console.log(data.data.data);
|
||||
@ -67,10 +72,9 @@ export default function ContractModal(props: any) {
|
||||
getContractArray(1)
|
||||
setModalOpen(false)
|
||||
props.closeModal()
|
||||
|
||||
},
|
||||
onFinally() {
|
||||
|
||||
setIsSaving(false);
|
||||
}
|
||||
})
|
||||
|
||||
@ -170,7 +174,6 @@ export default function ContractModal(props: any) {
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<Form.Item>
|
||||
<div className='refunModal-btn'>
|
||||
<Button type="primary" htmlType="submit" style={{
|
||||
|
Loading…
Reference in New Issue
Block a user