/* @author:李霆 @update:2018/05/29 @descript:复制粘贴,拿起来就是干!! */ import React from 'react'; import { Radio, Icon, Button, AutoComplete, Cascader, layout, Input, Select, Tabs, Spin, Popconfirm, Popover, Table, Switch, message, DatePicker, Modal, Upload, Form, Row, Col, TimePicker } from 'antd'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import moment from 'moment'; import './unit.less'; import { citySelect, provinceList, areaSelect } from '@/NewDicProvinceList'; import { socialAttribute, industry, newFollow, auditStatusL, lvl, currentMember, cityArr, statuslist, customerStatus, intentionalService, sex } from '@/dataDic.js'; import { getCompanyIntention, splitUrl, getIndustry, getStatuslist, getAuditStatus, getContactType, getSocialAttribute, getfllowSituation, beforeUploadFile, getWhether, getcityArr, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '@/tools.js'; const FormItem = Form.Item; //图片组件 const PicturesWall = React.createClass({ getInitialState() { return { previewVisible: false, previewImage: '', fileList: [] }; }, handleCancel() { this.setState({ previewVisible: false }); }, handlePreview(file) { this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true }); }, handleChange(info) { let fileList = info.fileList; this.setState({ fileList }); this.props.fileList(fileList); }, componentWillReceiveProps(nextProps) { this.state.fileList = nextProps.pictureUrl; }, render() { const { previewVisible, previewImage, fileList } = this.state; const uploadButton = (
点击上传
); return (
{fileList.length >= 1 ? null : uploadButton} example
); } }); const Unit = React.createClass({ getInitialState() { return { loading: false, orgCodeUrl: [], companyLogoUrl: [] }; }, loadInformation(record) { this.setState({ loading:true }) $.ajax({ method: 'get', dataType: 'json', url: globalConfig.context + '/api/admin/customer/findOrganizationCustomerDetail', data: { uid: record }, success: function(data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); } thisData = {}; } let ProvinceCityArr = []; let ProvinceS = thisData.locationProvince; //getprovince let citys = thisData.locationCity; let Areas = thisData.locationArea; ProvinceCityArr.push(ProvinceS, citys, Areas); this.setState({ InformationId: thisData.id, InformationUid: thisData.uid, identifyName: thisData.identifyName, listed: thisData.listed, highTechZone: thisData.highTechZone, orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [], companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [], dataInformation: thisData, ProvinceCity: ProvinceCityArr[0] != null ? ProvinceCityArr : undefined, contacts: thisData.contacts, contactMobile: thisData.contactMobile, industry: String(thisData.industry) == 'null' ? undefined : String(thisData.industry), international: thisData.international, societyTag: thisData.societyTag || undefined, introduction: thisData.introduction, postalAddress: thisData.postalAddress, contactsFixedTel: thisData.contactsFixedTel, contactsFax: thisData.contactsFax, registeredCapital: thisData.registeredCapital, enterpriseScale: thisData.enterpriseScale, legalPerson: thisData.legalPerson, legalPersonIdCard: thisData.legalPersonIdCard, legalPersonTel: thisData.legalPersonTel, legalPersonEmail: thisData.legalPersonEmail, businessScope: thisData.businessScope, orgCode: thisData.orgCode, investment: thisData.investment, auditStatus: thisData.auditStatus ? String(thisData.auditStatus) : undefined, businessAudit: thisData.businessAudit, listed: thisData.listed, highTechZone: thisData.highTechZone }); }.bind(this) }).always( function() { this.setState({ loading: false }); }.bind(this) ); }, //图片 getOrgCodeUrl(e) { this.setState({ orgCodeUrl: e }); }, getCompanyLogoUrl(e) { this.setState({ companyLogoUrl: e }); }, //基本信息提交 newSubmit(e) { e.preventDefault(); if(!this.state.identifyName){ message.warning('请填写单位名称!'); return; } if (!this.state.industry) { message.warning('请选择行业!'); return false; } if (!this.state.societyTag) { message.warning('请选择社会性质!'); return false; } if (!this.state.ProvinceCity[1]) { message.warning('请选择地区!'); return false; } if (isNaN(this.state.registeredCapital)) { message.warning('注册资本只能输入数字!'); return false; } if (isNaN(this.state.enterpriseScale)) { message.warning('单位规模只能输入数字!'); return false; } this.setState({ selectedRowKeys: [] }); let theorgCodeUrl = []; if (this.state.orgCodeUrl.length) { let picArr = []; this.state.orgCodeUrl.map(function(item) { if (item.response && item.response.data && item.response.data.length) { picArr.push(item.response.data); } }); theorgCodeUrl = picArr.join(','); } let thecompanyLogoUrl = []; if (this.state.companyLogoUrl.length) { let picArr = []; this.state.companyLogoUrl.map(function(item) { if (item.response && item.response.data && item.response.data.length) { picArr.push(item.response.data); } }); thecompanyLogoUrl = picArr.join(','); } this.setState({ loading: true }); $.ajax({ method: 'post', dataType: 'json', url: globalConfig.context + '/api/admin/customer/updateOrganizationCustomer', data: { id: this.state.InformationId, uid: this.state.InformationUid, societyTag: this.state.societyTag, identifyName: this.state.identifyName, //单位名称 introduction: this.state.introduction, unitName: this.state.unitName, industry: this.state.industry, locationProvince: this.state.ProvinceCity[0], //省- locationCity: this.state.ProvinceCity[1], //市 locationArea: this.state.ProvinceCity[2], //区 postalAddress: this.state.postalAddress, contactsFixedTel: this.state.contactsFixedTel, contactsFax: this.state.contactsFax, registeredCapital: this.state.registeredCapital ? this.state.registeredCapital : 0, enterpriseScale: this.state.enterpriseScale ? this.state.enterpriseScale : 0, legalPerson: this.state.legalPerson, legalPersonIdCard: this.state.legalPersonIdCard, legalPersonTel: this.state.legalPersonTel, legalPersonEmail: this.state.legalPersonEmail, highTechZone: this.state.highTechZone, listed: this.state.listed, contacts: this.state.contacts, contactMobile: this.state.contactMobile, international: this.state.international, orgCode: this.state.orgCode, businessScope: this.state.businessScope, introduction: this.state.introduction, companyLogoUrl: thecompanyLogoUrl != 0 ? thecompanyLogoUrl : '', orgCodeUrl: theorgCodeUrl != 0 ? theorgCodeUrl : '', businessAudit: this.state.businessAudit, auditStatus: this.state.auditStatus } }).done( function(data) { this.setState({ loading: false }); if (!data.error.length) { message.success('保存成功!'); this.loadInformation() } else { message.warning(data.error[0].message); } }.bind(this) ); }, componentWillMount() { this.loadInformation(); }, componentWillReceiveProps(nextProps) { }, render() { return (

单位资料

{ this.setState({ identifyName: e.target.value }); }} placeholder="请输入单位名称" /> *
* * { this.setState({ ProvinceCity: e }); }} /> * { this.setState({ postalAddress: e.target.value }); }} /> { this.setState({ contactsFixedTel: e.target.value }); }} /> { this.setState({ contactsFax: e.target.value }); }} /> { this.setState({ registeredCapital: e.target.value }); }} /> { this.setState({ enterpriseScale: e.target.value }); }} /> { this.setState({ legalPerson: e.target.value }); }} /> { this.setState({ legalPersonIdCard: e.target.value }); }} /> { this.setState({ legalPersonTel: e.target.value }); }} /> { this.setState({ legalPersonEmail: e.target.value }); }} /> { this.setState({ orgCode: e.target.value }); }} /> { this.setState({ highTechZone: e.target.value }); }} > { this.setState({ listed: e.target.value }); }} >

图片建议:图片要清晰。

图片建议:图片要清晰。

{ this.setState({ businessScope: e.target.value }); }} /> { this.setState({ introduction: e.target.value }); }} />
); } }); export default Unit;