123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386 |
- import React from 'react';
- import { Icon, message, Input, Select, Button, Form } from 'antd';
- import './userList.less';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import { edulvlArr, auditStatusList } from '../../dataDic.js'
- import { addressInit } from '../../tools.js';
- const OrgCertify = Form.create()(React.createClass({
- getInitialState() {
- return {
- visible: false,
- loading: false
- };
- },
- loadData() {
- this.state.data = [];
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/orgDetail",
- data: {
- uid: this.props.uid
- },
- success: function (data) {
- if (data.error.length || !data.data) {
- message.warning(data.error[0].message);
- return;
- }
- addressInit('licenceProvince', 'licenceCity', 'licenceArea',
- data.data.licenceProvince, data.data.licenceCity, data.data.licenceArea);
- addressInit('locationProvince', 'locationCity', 'locationArea',
- data.data.locationProvince, data.data.locationCity, data.data.locationArea);
- this.setState({
- id: data.data.id,
- contacts: data.data.contacts,
- contactMobile: data.data.contactMobile,
- fixedTel: data.data.fixedTel,
- qq: data.data.qq,
- postalAddress: data.data.postalAddress,
- postcode: data.data.postcode,
- aftUsername: data.data.aftUsername,
- unitName: data.data.unitName,
- identityType: data.data.identityType, //组织性质
- registeredCapital: data.data.registeredCapital, //注册资金
- legalPerson: data.data.contacts,
- legalPersonIdCard: data.data.contacts,
- licenceNumber: data.data.licenceNumber,
- licenceScanningUrl: data.data.licenceScanningUrl,
- orgCode: data.data.orgCode,
- orgCodeUrl: data.data.orgCodeUrl,
- bankAccount: data.data.bankAccount,
- banks: data.data.banks,
- bankBranch: data.data.bankBranch,
- bankCardNumber: data.data.bankCardNumber,
- validationAmount: data.data.validationAmount, //打款金额
- lastYearTaxReportUrl: data.data.contacts,
- auditStatus: data.data.contacts,
- process: data.data.contacts
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- handleSubmit(e) {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/updateOrgDetail",
- data: {
- id: this.state.id,
- username: values.username,
- sex: values.sex,
- idNumber: values.idNumber,
- aftUsername: values.aftUsername,
- contactMobile: values.contactMobile,
- bankName: values.bankName,
- bankAccount: values.bankAccount,
- bankCardNumber: values.bankCardNumber,
- amountMoney: values.amountMoney,
- auditStatus: values.auditStatus,
- process: values.process
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('保存成功!');
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this)).always(function () {
- this.setState({
- visible: false,
- });
- this.props.closeDesc(false);
- }.bind(this));
- }
- });
- },
- componentDidMount() {
- addressInit('licenceProvince', 'licenceCity', 'licenceArea');
- addressInit('locationProvince', 'locationCity', 'locationArea');
- this.loadData();
- },
- componentWillReceiveProps(nextProps) {
- if (nextProps.uid !== this.props.uid) {
- this.loadData();
- };
- },
- render() {
- const { getFieldDecorator } = this.props.form;
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 4 },
- wrapperCol: { span: 12 },
- };
- return (
- <Form horizontal onSubmit={this.handleSubmit} className="person-form">
- <FormItem
- {...formItemLayout}
- label="公司名称"
- >
- {getFieldDecorator('unitName', {
- initialValue: this.state.unitName || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="认证名称"
- >
- {getFieldDecorator('aftUsername', {
- initialValue: this.state.aftUsername || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="身份类型"
- >
- {getFieldDecorator('identityType', {
- initialValue: this.state.identityType
- })(
- <Select placeholder="身份类型" style={{ width: 200 }}
- onChange={(e) => { this.state.identityType = e }}>
- {
- edulvlArr.map(function (item, i) {
- return <Select.Option key={i} value={item} >{item}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="联系人"
- >
- {getFieldDecorator('contacts', {
- initialValue: this.state.contacts || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="联系人电话"
- >
- {getFieldDecorator('contactMobile', {
- initialValue: this.state.contactMobile || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="法人"
- >
- {getFieldDecorator('legalPerson', {
- initialValue: this.state.contacts || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="法人身份证号"
- >
- {getFieldDecorator('legalPersonIdCard', {
- initialValue: this.state.contactMobile || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="注册资金"
- >
- {getFieldDecorator('registeredCapital', {
- initialValue: this.state.registeredCapital || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="营业执照编号"
- >
- {getFieldDecorator('licenceNumber', {
- initialValue: this.state.licenceNumber || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="营业执照所在地"
- >
- {getFieldDecorator('licenceAddress')(
- <div>
- <select id="licenceProvince" name="licenceProvince"></select>
- <select id="licenceCity" name="licenceCity"></select>
- <select id="licenceArea" name="licenceArea"></select>
- </div>
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="营业执照图片"
- >
- <div className="idcard-img clearfix">
- {this.state.licenceScanningUrl ? <div>
- <div className="idcard-imgbox">
- <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
- onClick={(e) => { window.open(e.target.src) }} />
- </div>
- </div> : <div>未上传</div>}
- </div>
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="组织机构代码"
- >
- {getFieldDecorator('orgCode', {
- initialValue: this.state.orgCode || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="组织机构代码证图片"
- >
- <div className="idcard-img clearfix">
- {this.state.orgCodeUrl ? <div>
- <div className="idcard-imgbox">
- <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
- onClick={(e) => { window.open(e.target.src) }} />
- </div>
- </div> : <div>未上传</div>}
- </div>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="上年度纳税报表"
- >
- <div className="idcard-img clearfix">
- {this.state.lastYearTaxReportUrl ? <div>
- <div className="idcard-imgbox">
- <img src={globalConfig.context + '/open/writeImage?path=' + this.state.lastYearTaxReportUrl} alt="点击查看大图"
- onClick={(e) => { window.open(e.target.src) }} />
- </div>
- </div> : <div>未上传</div>}
- </div>
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="开户银行"
- >
- {getFieldDecorator('contactMobile', {
- initialValue: this.state.contactMobile || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="开户银行支行"
- >
- {getFieldDecorator('contactMobile', {
- initialValue: this.state.contactMobile || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="银行卡号"
- >
- {getFieldDecorator('contactMobile', {
- initialValue: this.state.contactMobile || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="开户行所在地"
- >
- {getFieldDecorator('locationAddress')(
- <div>
- <select id="locationProvince" name="locationProvince"></select>
- <select id="locationCity" name="locationCity"></select>
- <select id="locationArea" name="locationArea"></select>
- </div>
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="打款金额"
- >
- {getFieldDecorator('validationAmount', {
- initialValue: this.state.validationAmount || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="认证状态"
- >
- {getFieldDecorator('auditStatus', {
- initialValue: this.state.auditStatus || null
- })(
- <Select placeholder="选择认证状态" style={{ width: 200 }}
- onChange={(e) => { this.state.auditStatus = e }}>
- {
- auditStatusList.map(function (item, i) {
- return <Select.Option key={i} value={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="认证步骤"
- >
- {getFieldDecorator('process', {
- initialValue: this.state.process || null
- })(
- <Input />
- )}
- </FormItem>
- <FormItem wrapperCol={{ span: 12, offset: 4 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- </FormItem>
- </Form >
- );
- },
- }));
- export default OrgCertify;
|