This commit is contained in:
lyp 2024-12-02 15:31:39 +08:00
commit 82d446ffe2
3 changed files with 43 additions and 41 deletions

View File

@ -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={{

View File

@ -1,4 +1,3 @@
import React from 'react'
import './ContractText.css'
export default function ContractText(props: any) {
const height = window.innerHeight - 200;

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { // Table,
Pagination,
Table,