Merge branch 'dev' of https://e.coding.net/tsteam/ai-rz-web/ai-copyright into dev
This commit is contained in:
commit
82d446ffe2
@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react'
|
||||
import { post,Axios,get } from "../../util/AjaxUtils.ts";
|
||||
import {useState} from 'react'
|
||||
import {post, Axios, get} from "../../util/AjaxUtils.ts";
|
||||
import useMessage from "antd/es/message/useMessage";
|
||||
import {
|
||||
Form,
|
||||
@ -7,7 +7,8 @@ import {
|
||||
Input, Button
|
||||
} from 'antd';
|
||||
import ContractText from '../ContractText/ContractText'
|
||||
import { useDispatch } from 'react-redux'
|
||||
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);
|
||||
@ -24,30 +26,33 @@ export default function ContractModal(props: any) {
|
||||
const dispath = useDispatch()
|
||||
const getContractArray = (page: any) => {
|
||||
get({
|
||||
messageApi,
|
||||
url: `/api/contract/management/listpage/self`,
|
||||
config: {
|
||||
params: {
|
||||
page: page,
|
||||
rows: 10
|
||||
messageApi,
|
||||
url: `/api/contract/management/listpage/self`,
|
||||
config: {
|
||||
params: {
|
||||
page: page,
|
||||
rows: 10
|
||||
}
|
||||
},
|
||||
onSuccess(data: any) {
|
||||
console.log(data);
|
||||
dispath({
|
||||
type: 'upContractArray',
|
||||
val: data.data.rows
|
||||
})
|
||||
dispath({
|
||||
type: 'upContractTotal',
|
||||
val: data.data.total
|
||||
})
|
||||
// setContractArray(data.data.rows)
|
||||
|
||||
}
|
||||
},
|
||||
onSuccess(data: any) {
|
||||
console.log(data);
|
||||
dispath({
|
||||
type: 'upContractArray',
|
||||
val: data.data.rows
|
||||
})
|
||||
dispath({
|
||||
type: 'upContractTotal',
|
||||
val: data.data.total
|
||||
})
|
||||
// setContractArray(data.data.rows)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const downContract = () => {
|
||||
if (isSaving) {
|
||||
return;
|
||||
}
|
||||
post<any>({
|
||||
messageApi,
|
||||
url: `/api/contract/management/save`,
|
||||
@ -57,23 +62,22 @@ export default function ContractModal(props: any) {
|
||||
firstPartyPhone: phone
|
||||
},
|
||||
onBefore() {
|
||||
|
||||
setIsSaving(true);
|
||||
},
|
||||
onSuccess(data) {
|
||||
// console.log(data.data.data);
|
||||
// console.log('成功');
|
||||
const contractManagementId = data.data.data
|
||||
window.open(`${Axios.defaults?.baseURL}/api/contract/management/download/${contractManagementId}`)
|
||||
getContractArray(1)
|
||||
getContractArray(1)
|
||||
setModalOpen(false)
|
||||
props.closeModal()
|
||||
|
||||
},
|
||||
onFinally() {
|
||||
|
||||
setIsSaving(false);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
@ -82,8 +86,8 @@ export default function ContractModal(props: any) {
|
||||
name="Form"
|
||||
form={form}
|
||||
onFinish={onFinish}
|
||||
initialValues={{ softWare: '' }}
|
||||
style={{ maxWidth: 600, marginTop: 20 }}
|
||||
initialValues={{softWare: ''}}
|
||||
style={{maxWidth: 600, marginTop: 20}}
|
||||
>
|
||||
<div className='refunModal-item'>
|
||||
<div className='refunModal-title'>
|
||||
@ -93,7 +97,7 @@ export default function ContractModal(props: any) {
|
||||
|
||||
<Form.Item
|
||||
name="name"
|
||||
rules={[{ required: true, message: '请输入甲方姓名!' }]}
|
||||
rules={[{required: true, message: '请输入甲方姓名!'}]}
|
||||
>
|
||||
<Input style={{
|
||||
width: 405,
|
||||
@ -101,7 +105,7 @@ export default function ContractModal(props: any) {
|
||||
background: '#FFF',
|
||||
color: 'black'
|
||||
}}
|
||||
placeholder="甲方姓名"
|
||||
placeholder="甲方姓名"
|
||||
>
|
||||
</Input>
|
||||
|
||||
@ -119,7 +123,7 @@ export default function ContractModal(props: any) {
|
||||
<Form.Item
|
||||
name="phone"
|
||||
rules={[
|
||||
{ required: true, message: '请输入联联系电话!' },
|
||||
{required: true, message: '请输入联联系电话!'},
|
||||
{
|
||||
pattern: /^1[3456789]\d{9}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
@ -151,7 +155,7 @@ export default function ContractModal(props: any) {
|
||||
|
||||
<Form.Item
|
||||
name="address"
|
||||
rules={[{ required: true, message: '请输入联系地址!' }]}
|
||||
rules={[{required: true, message: '请输入联系地址!'}]}
|
||||
>
|
||||
<Input style={{
|
||||
width: 405,
|
||||
@ -159,7 +163,7 @@ export default function ContractModal(props: any) {
|
||||
background: '#FFF',
|
||||
color: 'black'
|
||||
}}
|
||||
placeholder="联系地址"
|
||||
placeholder="联系地址"
|
||||
>
|
||||
</Input>
|
||||
|
||||
@ -170,7 +174,6 @@ export default function ContractModal(props: any) {
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<Form.Item>
|
||||
<div className='refunModal-btn'>
|
||||
<Button type="primary" htmlType="submit" style={{
|
||||
@ -192,7 +195,7 @@ export default function ContractModal(props: any) {
|
||||
onCancel={() => {
|
||||
setModalOpen(false)
|
||||
}}
|
||||
okButtonProps={{ style: { background: 'red', color: 'white' } }}
|
||||
okButtonProps={{style: {background: 'red', color: 'white'}}}
|
||||
width={850}
|
||||
centered
|
||||
|
||||
@ -200,7 +203,7 @@ export default function ContractModal(props: any) {
|
||||
<div className='contract'>
|
||||
<ContractText name={name} phone={phone} address={address}></ContractText>
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 20 }}>
|
||||
<div style={{display: 'flex', justifyContent: 'flex-end', marginTop: 20}}>
|
||||
<Button type="primary" onClick={
|
||||
downContract
|
||||
}>合同下载</Button>
|
||||
|
@ -1,4 +1,3 @@
|
||||
import React from 'react'
|
||||
import './ContractText.css'
|
||||
export default function ContractText(props: any) {
|
||||
const height = window.innerHeight - 200;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { // Table,
|
||||
Pagination,
|
||||
Table,
|
||||
|
Loading…
Reference in New Issue
Block a user