import React, { useState, useEffect } from 'react' import { Row, Col, Form, Input, DatePicker, Button, Upload, message, Modal, Divider } from "antd" import { formItemLayout } from '../../../../components/crud/FormLayoutProps' import { httppost2,httppost5 } from '../../../../utils/request' import apiurl from '../../../../service/apiurl' import { exportFile } from '../../../../utils/tools' import './index.less' export default function BasicSituation() { const [form] = Form.useForm(); const [skdisabled, setSkDisabled] = useState(true) const [basicObj, setBasicObj] = useState({}) const getBasicInfo = async () => { try { const res = await httppost2(apiurl.gcyx.jbqk.list) if (res.code == 200) { setBasicObj(res.data) form.setFieldsValue(res.data) } } catch (error) { console.log(error); } } const onFinish = async (val) => { try { const res = await httppost2(apiurl.gcyx.jbqk.edit, { ...basicObj, ...val }) if (res.code == 200) { setSkDisabled(true) message.success('编辑成功') } } catch (error) { console.log(error); } } // 导出 const exportExcel = () => { httppost5(apiurl.gcyx.jbqk.export).then(res => { exportFile(`基本情况.xlsx`, res.data) }) } useEffect(() => { getBasicInfo() }, []) return (