import React from 'react';
import { Icon, Modal, message, Spin, Button, Tabs, Input, Select, Form, DatePicker, Cascader, Upload } from 'antd';
import './userList.less';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
import moment from 'moment';
import { eduLevelList, auditStatusList, certifyStepList } from '../../dataDic.js'
import { beforeUploadFile } from '../../tools.js';
import { areaSelect } from '../../NewDicProvinceList'
const OrgCertify = Form.create()(React.createClass({
    getInitialState() {
        return {
            visible: false,
            loading: false,
            tabKey: "1",
            saveSign: "save",
            eduLvlOption: [],
            auditStatusOption: []
        };
    },
    loadData(uid) {
        this.state.data = [];
        this.setState({
            loading: true
        });
        $.ajax({
            method: window.showAuditStatus ? "get" : "post",
            dataType: "json",
            crossDomain: false,
            url: window.showAuditStatus ? globalConfig.context + "/api/admin/userCertify/orgDetail" : globalConfig.context + "/api/admin/orgDetail",
            data: {
                uid: uid
            },
            success: function (data) {
                let thisData = data.data;
                if (!thisData) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };
                    thisData = {};
                };
                this.setState({
                    id: thisData.id,
                    licenceAddress: [thisData.licenceProvince, thisData.licenceCity, thisData.licenceArea],
                    locationAddress: [thisData.locationProvince, thisData.locationCity, thisData.locationArea],
                    contacts: thisData.contacts,
                    contactMobile: thisData.contactMobile,
                    fixedTel: thisData.fixedTel,
                    qq: thisData.qq,
                    postalAddress: thisData.postalAddress,
                    postcode: thisData.postcode,
                    aftUsername: thisData.aftUsername,
                    unitName: thisData.unitName,
                    identityType: thisData.identityType, //组织性质
                    registeredCapital: thisData.registeredCapital, //注册资金
                    firstContacts: thisData.firstContacts,
                    firstMobile: thisData.firstMobile,
                    secondContacts: thisData.secondContacts,
                    secondMobile: thisData.secondMobile,
                    thirdContacts: thisData.thirdContacts,
                    thirdMobile: thisData.thirdMobile,
                    legalPerson: thisData.legalPerson,
                    legalPersonIdCard: thisData.legalPersonIdCard,
                    licenceNumber: thisData.licenceNumber,
                    licenceScanningUrl: thisData.licenceScanningUrl,
                    orgCode: thisData.orgCode,
                    orgCodeUrl: thisData.orgCodeUrl,
                    bankAccount: thisData.bankAccount,
                    banks: thisData.banks,
                    bankBranch: thisData.bankBranch,
                    bankCardNumber: thisData.bankCardNumber,
                    validationAmount: thisData.validationAmount, //打款金额
                    paymentDate: thisData.paymentDate,
                    paymentDateFormattedDate: thisData.paymentDateFormattedDate,
                    lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
                    auditStatus: thisData.auditStatus,
                    aid: thisData.aid,   //业务员ID
                    mid: thisData.mid  //客户经理ID
                });
                this.props.form.resetFields();
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
    },
    getAccountManagerList() {
        this.setState({
            loading: true
        });
        $.ajax({
            method: "get",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context + "/api/admin/userCertify/accountManager",
            success: function (data) {
                let theArr = [];
                if (!data.data) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };
                    return;
                };
                for (var item in data.data) {
                    theArr.push(