// 发票类型维护
import React from 'react';
//import '../../assets/css/system.css';
import store from '../../store';
import {
    Form, Table, Input, Popconfirm, Row, Col, Button, Pagination, message, Divider, Spin, DatePicker, Select, Modal
} from 'antd';
import { $http } from '../../containers/config/https';
// 主菜单弹框
import InvPurChaseModal from './InvPurChaseModal.jsx';
import RangeDatePicker from 'components/rangePicker/index';
import CommonPagination from 'components/pagination/index';
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';
const Option = Select.Option;
//const { RangePicker } = DatePicker;
//const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
///import { CompositeDisposable } from 'rx';

const dateFormat = 'YYYY-MM-DD'; //定义全局日期格式

class InvPurChaseMain extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            userInfo: {},
            // 主菜单列表数据
            data: [],
            columns: [],
            // 抽屉显示
            visible: false,
            //领取库存弹框显示
            reVisible: false,
            // 主菜单分页数据
            invTypeID: '',
            userID: '',
            prefix: '',
            endDate: undefined,
            stDate: undefined,
            total: 0,
            page: 1,
            pageSize: 10,
            flag: '',
            title: '',
            invList: [],
            userList: [],
            userReList: [],
            invReType: [],
            // 是否显示loading
            showLoading: true,
            // 表格loading
            loading: true,
            useStatus: '',
            hospID: '',
            startValue: null, //日期选择器开始时间
            endValue: null, //日期选择器结束时间

            languageTable1: {}, // 国际化Table1
            languageTable2: {}, // 国际化Table2
            languageData: {}, // 国际化语言包
            language: {},   // 国际化语言
            languageCode: JSON.parse(window.sessionStorage.userData).language, // 国际化语言标识
        };
        {/*this.columns = [
            {
                title: '购入人',
                dataIndex: 'PurchUserName',
                width: '100px',
                align: "center"
            },
            {
                title: '发票类型描述',
                dataIndex: 'InvTypeDesc',
                width: '150px',
                align: "center"
            },
            {
                title: '开始号码',
                dataIndex: 'StartNo',
                width: '150px',
                align: "center"
            },
            {
                title: '结束号码',
                dataIndex: 'EndNo',
                width: '150px',
                align: "center"
            },
            {
                title: '当前号码',
                dataIndex: 'CurrentNo',
                width: '150px',
                align: "center"
            },
            {
                title: '前缀',
                dataIndex: 'Prefix',
                width: '150px',
                align: "center"
            },
            {
                title: '',
                dataIndex: 'Avilable',
                width: '100px',
                align: "center"
            },
            {
                title: '购入日期',
                dataIndex: 'PurchDate',
                width: '150px',
                align: "center"
            },
            {
                title: '更新人',
                dataIndex: 'UpdateUserName',
                width: '100px',
                align: "center"
            },
            {
                title: '医院',
                dataIndex: 'HospDesc',
                width: '150px',
                align: "center"
            },
            {
                title: '操作',
                dataIndex: 'operation',
                align: "center",
                render: (text, record) => (
                    <span>
                        <Divider type="vertical" />
                        <Popconfirm title="删除不可恢复，你确定要删除吗?" onConfirm={this.handleDetele.bind(this, record)} >
                            <span className='span'>删除</span>
                        </Popconfirm>
                    </span>
                )
            },
        ];*/}
    }
    componentDidMount() {
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        this.setState({ hospID: sessionInfo.hospID }, () => {
            // 初始化列表数据
            this.tableList();
            this.handleHospQuery();
            this.handleQuery();
            // 初始化设置table的高度以及表体的高度
            this.handleInvTypeQuery();
            //获取发票类型下拉框数据
            this.handleReUserQuery();
        });

        document.querySelector('.ant-table-body').style.height = store.getState().tableHeight.y + 'px';
        // 数据异步请求，请求成功之后setState
        this.setState({
            showLoading: false
        })
    }
    componentWillUnmount() {
        this.setState = (state, callback) => {
            return
        }
    }

    //render 自定义项目名称
    listAdd = (i, j, languageCode) => {
        let { columns } = this.state
        columns.splice(i, j,
            {
                title: languageCode === 'CN' ? "操作" : 'Operation',
                key: 'op',
                align: "center",
                render: (text, record) => (
                    <span>
                        <Popconfirm title={languageCode === 'CN' ? "确定要删除吗?" : 'You sure you want to delete it?'} onConfirm={this.handleDetele.bind(this, record)} >
                            <span className='span'>{languageCode === 'CN' ? "删除" : 'Delete'}</span>
                        </Popconfirm>
                    </span>
                ),
            },
        )
    }
    onColumnRef = (ref) => {
        console.log(ref)
        this.columnRef = ref;
    }
    // 获取主列表columns
    tableList = (reactCode, compontName) => {
        var data = {
            params: [{
                "reactCode": ["InvPurChaseMain"],
                "compontName": "purchList",
                "type": "C"
            }]
        }
        console.log(1, data)
        $http.post('urlS', this, {
            code: '01040073',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let resC = res.result.C
                    let { languageCode } = this.state
                    for (var i = 0; i < resC.length; i++) {
                        resC[i].key = i;
                    }
                    if (languageCode === "EN") {
                        resC.map((item, i) => {
                            item.title = item.enDescripts
                        })
                    }

                    if (languageCode === "CN") {
                        resC.map((item, i) => {
                            item.title = item.descripts
                        })
                    }
                    let arr = res.result && resC.length > 0 ? JSON.parse(JSON.stringify(resC)).map(item => {
                        return {
                            align: item.align,
                            widthNum: parseInt(item.width),
                            width: item.width,
                            dataIndex: item.dataIndex,
                            title: <div onDoubleClick={() => this.columnRef.onOpenModel()}>{item.title}</div>,
                            display: item.display,
                            key: item.seqNo
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    this.setState({
                        columns: filterArr,
                        languageTable1: res.result.B || {},  // 国际化Table1
                        languageTable2: res.result.C || {},  // 国际化Table2
                        languageData: res.result.language || {},  // 国际化语言包
                    }, () => {
                        this.LanCNEN(this.state.languageCode)
                        this.listAdd(filterArr.length + 1, 0, languageCode);
                    })
                }
            }
        })
    }

    LanCNEN = (code) => {
        let { languageData } = this.state
        this.setState({
            language: languageData[code]
        })
    }


    /***查询条件* **/
    onChangeUseStatus = (value) => {
        this.setState({ useStatus: value });
    }
    onChangeInvTypeID = (value) => {
        this.setState({ invTypeID: value, userList: [] }, () => { this.handleUserQuery(); });
    }

    onChangeUserID = (value) => {
        this.setState({ userID: value });
    }
    onChangePrefix = (e) => {
        this.setState({ prefix: e.target.value });
    }

    onChangeStDate = (date) => {
        this.setState({ stDate: date });
    }
    onChangeEndDate = (date) => {
        this.setState({ endDate: date });
    }

    // 页码改变的回调，参数是改变后的页码及每页条数
    onChange = (page, pageSize) => {
        this.setState({ page: page, pageSize: pageSize }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });
    }

    // 调用子组件的连接事件
    onRef = (ref) => {
        this.child = ref
    }

    // 重置userInfo
    resetUserInfo() {
        this.setState({ userInfo: {} })
    }
    // 发票类型下拉框
    handleInvTypeQuery = () => {
        let data = {}
        data = {
            params: [{
                code: "",
                descripts: ""
            }]
        }
        $http.post('urlS', this, {
            code: '5001',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.invType) {
                    let tempList = this.state.invList
                    for (var i = 0; i < res.invType.length; i++) {
                        tempList.push(<Option key={res.invType[i].ID}>{res.invType[i].Descripts}</Option>)
                    }
                    this.setState({
                        invList: tempList,
                        invReType: res.invType
                    })
                }
                /*else {
                    setTimeout(() => {
                        this.setState({ invList: [] })
                    }, 1000)
                }*/
            }
        })
    }

    // 人员下拉框
    handleUserQuery = () => {
        let { invTypeID, hospID } = this.state;
        //获取sessionStorage的数据
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {}
        data = {
            params: [{
                hospID: hospID,
                userType: "2",
                invTypeID: invTypeID
            }]
        }
        $http.post('urlS', this, {
            code: '05100053',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.invUserInfo) {
                    let tempList = []
                    for (var i = 0; i < res.invUserInfo.length; i++) {
                        tempList.push(<Option key={res.invUserInfo[i].id} alias={res.invUserInfo[i].descriptsSPCode}>{res.invUserInfo[i].descripts}</Option>)
                    }
                    this.setState({
                        userList: tempList
                    })
                }
                /*else {
                    setTimeout(() => {
                        this.setState({userList: [] })
                    }, 1000)
                }*/
            }
        })
    }

    // 弹窗人员下拉框
    handleReUserQuery = () => {
        let { invTypeID, hospID } = this.state;
        //获取sessionStorage的数据
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {}
        data = {
            params: [{
                hospID: hospID,
                userType: "2",
                invTypeID: invTypeID
            }]
        }
        $http.post('urlS', this, {
            code: '05100053',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.invUserInfo) {
                    let tempList = []
                    for (var i = 0; i < res.invUserInfo.length; i++) {
                        tempList.push(<Option key={i} alias={res.invUserInfo[i].descriptsSPCode}>{res.invUserInfo[i].descripts}</Option>)
                    }
                    this.setState({
                        userReList: tempList
                    })
                }
            }
        })
    }

    // 新增
    handleAdd = () => {
        // 显示弹框
        this.child.showModal()
        // 初始化数据
        this.setState({ flag: 'add', title: '新增' })
    }

    // 删除
    handleDetele(record) {
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let updateUserID = sessionInfo.userID;
        let data = {
            params: [{
                purchID: record.PurchID,
                updateUserID: updateUserID
            }]
        }
        $http.post('urlADS', this, {
            code: '5016',
            data: data,
            success: function (res) {

                if (+res.errorCode === 0) {
                    message.success('删除成功');
                    // 刷新列表数据
                    this.handleQuery()
                }
            },
            error: function (error) {
                message.error('删除失败：' + error);
            }
        })
    }
    // 页码改变的回调，参数是改变后的页码及每页条数
    appPageChange = (page, pageSize) => {
        this.setState({
            page: page,
            pageSize: pageSize,
        }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });
    }

    // 条数改变的回调
    apponShowSizeChange = (current, size) => {
        this.setState({
            page: current,
            pageSize: size,
        }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });
    }



    // 为了返回第一页
    handleQueryBack = () => {
        this.setState({
            page: 1,
            pageSize: 10,
        }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });

    }
    ///输入框值变化时需要绑定
    onChangeHospID = (value) => {
        this.setState({ hospID: value, userList: [] }, () => {
            this.handleUserQuery();
            this.handleQuery();
        });
    }
    //医院下拉框
    handleHospQuery = () => {
        let data = {}
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        data = {
            params: [{
                hospitalId: "",
                logonGroupID: sessionInfo.groupID,
                logonHospID: sessionInfo.hospID,
                hospRequired: "1",
            }]
        }
        $http.post('urlS', this, {
            code: '01040001',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.depDoctor) {
                    let tempList = [];
                    for (var i = 0; i < res.depDoctor.length; i++) {
                        tempList.push(<Option key={res.depDoctor[i].id}>{res.depDoctor[i].descripts}</Option>)
                    }
                    this.setState({
                        hospList: tempList
                    })
                }
            }
        })
    }
    // 查询
    handleQuery = () => {
        let { invTypeID, userID, prefix, endDate, stDate, useStatus, page, pageSize, hospID } = this.state;
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        var stDateStr = stDate;
        var endDateStr = endDate;
        /*if(JSON.stringify(stDate) == "{}"||stDate===null){
            stDateStr="";

        }else{
            stDateStr=stDate.format('YYYY-MM-DD');
        }

        if(JSON.stringify(endDate) == "{}"||endDate===null){
            endDateStr="";

        }else{
            endDateStr=endDate.format('YYYY-MM-DD');
        }*/

        let data = {}

        data = {
            params: [{
                invTypeID: invTypeID,
                userID: userID,
                prefix: prefix,
                endDate: endDateStr || "",
                stDate: stDateStr || "",
                useStatus: useStatus,
                hospID: hospID
            }],
            pagination: [{
                pageSize: pageSize,
                currentPage: page,
                sortColumn: "Code",
                sortOrder: "asc"
            }]
        }
        console.log("data", data);
        $http.post('urlS', this, {
            code: '5014',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.purChase) {
                    for (var i = 0; i < res.purChase.length; i++) {
                        res.purChase[i].key = i;
                    }
                    this.setState({ data: res.purChase, total: res.total, loading: false })
                }
                /*else {
                    setTimeout(() => {
                        this.setState({data: [], total: 0, loading: false})
                    }, 3000)
                }*/
            }
        })
    }

    //领取库存弹框取消
    reCancel = () => {
        this.setState({ reVisible: false })
    }

    //领取库存弹框
    recipientAdd = () => {
        this.setState({ reVisible: true })
    }

    //调取领用库存接口
    recipientInv = () => {
        this.props.form.validateFields((err, values) => {
            if (err) {
                return;
            }
            let data = {}           //本地调用
            data = {
                params: [{
                    placeCode: values.placeCode,                //开票点编码
                    bgnDate: values.startDate,                   //开始时间
                    endDate: values.endDate,                    //截止时间
                    userID: values.userID,
                    hospID: values.hospID,
                    createUserID: JSON.parse(window.sessionStorage.userData).userID
                }],
                session: [JSON.parse(window.sessionStorage.userData)]
            }
            // $http.post('urlS', this, {
            //     code: '5015',
            //     data: data,
            //     success: function (res) {
            //         if (+res.errorCode === 0) {
            //             // 提示
            //             message.success(msg + '成功');
            //             // 新增或编辑成功重置form表单
            //             this.resetFields();
            //             // 关闭弹框
            //             this.reCancel();
            //             // 刷新列表数据
            //             this.handleQuery();
            //         }
            //     },
            //     error: function (error) {
            //         message.error(msg + '失败：' + error);
            //     }
            // })
        })
    }

    //开始日期选择器选择限制
    disabledStartDate = startValue => {
        const { endValue } = this.state;
        if (!startValue || !endValue) {
            return false;
        }
        return startValue.valueOf() > endValue.valueOf();
    };

    //失效日期选择器选择限制
    disabledEndDate = endValue => {
        const { startValue } = this.state;
        if (!endValue || !startValue) {
            return false;
        }
        return endValue.valueOf() <= startValue.valueOf();
    };

    onChange = (field, value) => {
        this.setState({
            [field]: value,
        });
    };

    //开始日期变化
    onStartChange = value => {
        this.onChange('startValue', value);
    };

    //结束日期变化
    onEndChange = value => {
        this.onChange('endValue', value);
    };

    render() {
        const { getFieldDecorator } = this.props.form;
        let { columns, language, languageCode, startValue, endValue } = this.state
        return (
            <Spin tip={languageCode === "CN" ? "加载中..." : 'loadding'} spinning={this.state.showLoading}>
                <div>
                    <div>
                        <div className="table-operations" style={{ minHeight: '50px', padding: '0 24px 10px 24px' }} >
                            <Row>
                                <Col span={24}>
                                    {language.InvPurChaseMainhospital && language.InvPurChaseMainhospital.descripts}：<Select
                                        showSearch
                                        allowClear
                                        placeholder={language.InvPurChaseMainhospital && language.InvPurChaseMainhospital.message}
                                        optionFilterProp="children"
                                        style={{ width: "150px", margin: '12px 15px 0 0' }}
                                        value={this.state.hospID}
                                        onChange={this.onChangeHospID}
                                        filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                    >{this.state.hospList}</Select>
                                    {language.InvPurChaseMaininvoiceType && language.InvPurChaseMaininvoiceType.descripts}：<Select
                                        showSearch
                                        allowClear={true}
                                        placeholder={language.InvPurChaseMaininvoiceType && language.InvPurChaseMaininvoiceType.message}
                                        optionFilterProp="children"
                                        onChange={this.onChangeInvTypeID}
                                        value={this.state.invTypeID}
                                        style={{ width: '120px', margin: '12px 15px 0 0' }}
                                        filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                    >{this.state.invList}</Select>
                                    {language.InvPurChaseMainpurchaser && language.InvPurChaseMainpurchaser.descripts}：<Select
                                        showSearch
                                        allowClear={true}
                                        placeholder={language.InvPurChaseMainpurchaser && language.InvPurChaseMainpurchaser.message}
                                        optionFilterProp="children"
                                        onChange={this.onChangeUserID}
                                        value={this.state.userID}
                                        style={{ width: '120px', margin: '12px 15px 0 0' }}
                                        filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                    >{this.state.userList}</Select>
                                    {language.InvPurChaseMaininvoiceStatus && language.InvPurChaseMaininvoiceStatus.descripts}：<Select
                                        showSearch
                                        allowClear={true}
                                        placeholder={language.InvPurChaseMaininvoiceStatus && language.InvPurChaseMaininvoiceStatus.message}
                                        optionFilterProp="children"
                                        style={{ width: '120px', margin: '12px 15px 0 0' }}
                                        value={this.state.useStatus}
                                        onChange={this.onChangeUseStatus}
                                        filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                    >
                                        <Option value="1">{languageCode === 'CN' ? "可用" : 'Available'}</Option>
                                        <Option value="2">{languageCode === 'CN' ? "待用" : 'Inactive'}</Option>
                                        <Option value="3">{languageCode === 'CN' ? "已发完" : 'Has been sent'}</Option>
                                    </Select>
                                    {language.InvPurChaseMainprefix && language.InvPurChaseMainprefix.descripts}：<Input placeholder={language.InvPurChaseMainprefix && language.InvPurChaseMainprefix.message} value={this.state.prefix} style={{ width: '120px', margin: '12px 15px 0 0' }} onChange={this.onChangePrefix} />
                                    <span style={{ display: 'inline-block', margin: '12px 15px 0 0' }}> <RangeDatePicker label={language.InvPurChaseMainpurchaseDate && language.InvPurChaseMainpurchaseDate.descripts} format='YYYY-MM-DD' width={260}
                                        startChange={this.onChangeStDate} endChange={this.onChangeEndDate} /></span>
                                    {/*开始日期: < DatePicker   style={{width: '150px', marginRight: '30px'}}  format="YYYY-MM-DD"  onChange={this.onChangeStDate} />
                                    结束日期：< DatePicker   style={{width: '150px', marginRight: '30px'}}  format="YYYY-MM-DD"  onChange={this.onChangeEndDate} />*/}
                                    <Button type="primary" className="margiRight16" onClick={this.handleQueryBack} style={{ margin: '12px 15px 0 0' }} >{language.InvPurChaseMainquery && language.InvPurChaseMainquery.descripts}</Button>
                                    <Button type="primary" onClick={this.handleAdd} style={{ margin: '12px 15px 0 0' }} >{language.InvPurChaseMainnewly && language.InvPurChaseMainnewly.descripts}</Button>
                                    <Button type="primary" onClick={this.recipientAdd} style={{ margin: '12px 15px 0 0' }} >领取</Button>
                                </Col>
                            </Row>
                        </div>
                        <div style={{ background: '#f0f2f5', height: '10px' }}></div>
                        <div style={{ padding: 24 }}>
                            <Table
                                style={{ height: store.getState().tableHeight.y + 65 + 'px' }}
                                dataSource={this.state.data}
                                columns={columns}
                                rowClassName="editable-row"
                                pagination={false}
                                scroll={{ x: 1000, y: store.getState().tableHeight.y }}
                                bordered
                                loading={this.state.loading}
                            />
                            <CommonPagination size="small" current={this.state.page} total={this.state.total} search='search'
                                onShowSizeChange={this.apponShowSizeChange} complete={true} dataSource={this.state.data}
                                onChange={this.appPageChange} />
                            <ColumnAuthoritysModel
                                clientWidth='800px'
                                compontName='purchList'
                                configType="C"
                                onRef={this.onColumnRef}
                                reloadData={() => { this.tableList() }} />
                            {/* 分页: total--总条数  defaultCurrent--默认的当前页 hideOnSinglePage--只有一页时隐藏分页器 
                            <Pagination
                                size="small"
                                showQuickJumper
                                showSizeChanger
                                defaultCurrent={1}
                                total={this.state.total}
                                onChange={this.onChange}
                                onShowSizeChange={this.onShowSizeChange}
                                style={{textAlign: "right", marginTop: '13px'}}
                            />*/}
                        </div>
                    </div>

                    {/* InvoiceTypeModal弹框 */}
                    <InvPurChaseModal
                        onRef={this.onRef}
                        userInfo={this.state.userInfo}
                        flag={this.state.flag}
                        handelThis={this}
                        title={this.state.title}
                    />
                    <Form layout="vertical">
                        <Modal
                            visible={this.state.reVisible}
                            title="领取库存发票"
                            okText="确定"
                            onCancel={this.reCancel}
                            onOk={this.recipientInv}
                        >
                            <Form.Item label="医院">
                                {getFieldDecorator('hospID', {
                                    initialValue: undefined,
                                    rules: [{ required: true, message: '请选择医院' }]
                                })(
                                    <Select
                                        style={{ width: "100%" }}
                                        showSearch
                                        placeholder="请选择医院"
                                        allowClear
                                    >{this.state.hospList}</Select>
                                )}
                            </Form.Item>
                            <Form.Item label="开票点编码">
                                {getFieldDecorator('placeCode', {
                                    initialValue: "",
                                    rules: [{ required: true, message: '请输入开票点编码' }]
                                })(
                                    <Input placeholder="请输入开票点编码"/>
                                )}
                            </Form.Item>
                            <Form.Item label="开始时间">
                                {getFieldDecorator('startDate', {
                                    initialValue: startValue,
                                    rules: [{ required: true, message: '请选择开始时间' }]
                                })(
                                    <DatePicker
                                        style={{ width: "100%" }}
                                        format={dateFormat}
                                        disabledDate={this.disabledStartDate}
                                        onChange={this.onStartChange}
                                    />
                                )}
                            </Form.Item>
                            <Form.Item label="截止时间">
                                {getFieldDecorator('endDate', {
                                    initialValue: endValue,
                                    rules: [{ required: true,message: '请选择结束时间' }]
                                })(
                                    <DatePicker
                                        style={{ width: "100%" }}
                                        format={dateFormat}
                                        disabledDate={this.disabledEndDate}
                                        onChange={this.onEndChange}
                                    />
                                )}
                            </Form.Item>
                            <Form.Item label="购入人员">
                                {getFieldDecorator('userID', {
                                    initialValue: undefined,
                                    rules: [{ required: true, message: '请选择购入人员' }]
                                })(
                                    <Select
                                        style={{ width: "100%" }}
                                        showSearch
                                        placeholder="请选择购入人员"
                                        allowClear
                                    >{this.state.userReList}</Select>
                                )}
                            </Form.Item>
                        </Modal>
                    </Form>
                </div>
            </Spin>
        );
    }
}

const InvPurChaseMainForm = Form.create()(InvPurChaseMain);
export default InvPurChaseMainForm;