basic.jsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. import React from 'react';
  2. 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';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import { citySelect, provinceList, areaSelect ,getProvince} from '@/NewDicProvinceList';
  7. import { socialAttribute, industry, newFollow, auditStatusL, lvl, currentMember, cityArr, statuslist, customerStatus, intentionalService, sex } from '@/dataDic.js';
  8. import { getCompanyIntention, splitUrl, getIndustry, getStatuslist, getAuditStatus, getContactType, getSocialAttribute, getfllowSituation, beforeUploadFile, getWhether, getcityArr, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '@/tools.js';
  9. const FormItem = Form.Item;
  10. const Basic = React.createClass({
  11. getInitialState() {
  12. return {
  13. loading: false,
  14. orgCodeUrl: [],
  15. companyLogoUrl: [],
  16. }
  17. },
  18. loadInformation(record) {
  19. $.ajax({
  20. method: "get",
  21. dataType: "json",
  22. url: globalConfig.context + '/api/admin/customer/findOrganizationCustomerDetail',
  23. data: {
  24. uid: record
  25. },
  26. success: function(data) {
  27. let thisData = data.data;
  28. if(!thisData) {
  29. if(data.error && data.error.length) {
  30. message.warning(data.error[0].message);
  31. };
  32. thisData = {};
  33. };
  34. let ProvinceS = thisData.locationProvince, //getprovince
  35. citys = thisData.locationCity,
  36. Areas = thisData.locationArea,
  37. ProvinceCity = getProvince(ProvinceS, citys, Areas);
  38. this.setState({
  39. orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
  40. companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
  41. ProvinceCity: ProvinceCity,
  42. basicData:thisData
  43. });
  44. }.bind(this),
  45. }).always(function() {
  46. this.setState({
  47. loading: false
  48. });
  49. }.bind(this));
  50. },
  51. //图片
  52. getOrgCodeUrl(e) {
  53. this.setState({
  54. orgCodeUrl: e
  55. });
  56. },
  57. getCompanyLogoUrl(e) {
  58. this.setState({
  59. companyLogoUrl: e
  60. });
  61. },
  62. //取消
  63. detailsModal() {
  64. this.props.closeDetail(false, false)
  65. },
  66. componentWillMount(){
  67. this.loadInformation(this.props.data.id)
  68. },
  69. componentWillReceiveProps(nextProps) {
  70. if(nextProps.data&&nextProps.basicState){
  71. this.loadInformation(nextProps.data.id)
  72. }
  73. },
  74. render() {
  75. const basicData = this.state.basicData || [];
  76. return(
  77. <div>
  78. <Form layout="horizontal" onSubmit={this.newSubmit} id="demand-form">
  79. <Spin spinning={this.state.loading}>
  80. <div className="clearfix" style={{paddingLeft:'60px'}}>
  81. <FormItem className="half-item"
  82. labelCol={{ span: 4 }}
  83. wrapperCol={{ span: 18 }}
  84. label="客户名称"
  85. >
  86. <span>{basicData.identifyName}</span>
  87. </FormItem>
  88. </div>
  89. <div className="clearfix" style={{paddingLeft:'60px'}}>
  90. <FormItem className="half-item"
  91. labelCol={{ span: 4 }}
  92. wrapperCol={{ span: 18 }}
  93. label="行业">
  94. <span>{getIndustry(basicData.industry)}</span>
  95. </FormItem>
  96. <FormItem className="half-item"
  97. labelCol={{ span: 4 }}
  98. wrapperCol={{ span: 18 }}
  99. label="社会属性"
  100. >
  101. <span>{getSocialAttribute(basicData.societyTag)}</span>
  102. </FormItem>
  103. <FormItem className="half-item"
  104. labelCol={{ span: 4 }}
  105. wrapperCol={{ span: 18 }}
  106. label="省-市-区"
  107. >
  108. <span>{this.state.ProvinceCity}</span>
  109. </FormItem>
  110. <FormItem className="half-item"
  111. labelCol={{ span: 4 }}
  112. wrapperCol={{ span: 18 }}
  113. label="通信地址"
  114. >
  115. <span>{basicData.postalAddress}</span>
  116. </FormItem>
  117. <FormItem className="half-item"
  118. labelCol={{ span: 4 }}
  119. wrapperCol={{ span: 18 }}
  120. label="固定电话"
  121. >
  122. <span>{basicData.contactsFixedTel}</span>
  123. </FormItem>
  124. <FormItem className="half-item"
  125. labelCol={{ span: 4 }}
  126. wrapperCol={{ span: 18 }}
  127. label="客户传真"
  128. >
  129. <span>{basicData.contactsFax}</span>
  130. </FormItem>
  131. <FormItem className="half-item"
  132. labelCol={{ span: 4 }}
  133. wrapperCol={{ span: 18 }}
  134. label="注册资本"
  135. >
  136. <span>{basicData.registeredCapital}</span>
  137. </FormItem>
  138. <FormItem className="half-item"
  139. labelCol={{ span: 4 }}
  140. wrapperCol={{ span: 18 }}
  141. label="单位规模"
  142. >
  143. <span>{basicData.enterpriseScale}</span>
  144. </FormItem>
  145. <FormItem className="half-item"
  146. labelCol={{ span: 4 }}
  147. wrapperCol={{ span: 18 }}
  148. label="法人名称"
  149. >
  150. <span>{basicData.legalPerson}</span>
  151. </FormItem>
  152. <FormItem className="half-item"
  153. labelCol={{ span: 4 }}
  154. wrapperCol={{ span: 18 }}
  155. label="身份证号码"
  156. >
  157. <span>{basicData.legalPersonIdCard}</span>
  158. </FormItem>
  159. <FormItem className="half-item"
  160. labelCol={{ span: 4 }}
  161. wrapperCol={{ span: 18 }}
  162. label="主要联系人"
  163. >
  164. <span>{basicData.contacts}</span>
  165. </FormItem>
  166. <FormItem className="half-item"
  167. labelCol={{ span: 4 }}
  168. wrapperCol={{ span: 18 }}
  169. label="主要联系人号码"
  170. >
  171. <span>{basicData.contactMobile}</span>
  172. </FormItem>
  173. <FormItem className="half-item"
  174. labelCol={{ span: 4 }}
  175. wrapperCol={{ span: 18 }}
  176. label="法人电话"
  177. >
  178. <span>{basicData.legalPersonTel}</span>
  179. </FormItem>
  180. <FormItem className="half-item"
  181. labelCol={{ span: 4 }}
  182. wrapperCol={{ span: 18 }}
  183. label="电子邮箱"
  184. >
  185. <span>{basicData.legalPersonEmail}</span>
  186. </FormItem>
  187. <FormItem className="half-item"
  188. labelCol={{ span: 4 }}
  189. wrapperCol={{ span: 18 }}
  190. label="机构代码"
  191. >
  192. <span>{basicData.orgCode}</span>
  193. </FormItem>
  194. <div className="clearfix pictures">
  195. <FormItem
  196. labelCol={{ span: 4 }}
  197. wrapperCol={{ span: 18 }}
  198. label="机构证(PIC)" >
  199. <div className="clearfix">
  200. <Upload className="demandDetailShow-upload"
  201. listType="picture-card"
  202. fileList={this.state.orgCodeUrl}
  203. onPreview={(file) => {
  204. this.setState({
  205. previewImage: file.url || file.thumbUrl,
  206. previewVisible: true,
  207. });
  208. }} >
  209. </Upload>
  210. <Modal maskClosable={false} footer={null}
  211. visible={this.state.previewVisible}
  212. onCancel={() => { this.setState({ previewVisible: false }) }}>
  213. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  214. </Modal>
  215. </div>
  216. </FormItem>
  217. <FormItem
  218. labelCol={{ span: 4 }}
  219. wrapperCol={{ span: 18 }}
  220. label="单位logo" >
  221. <div className="clearfix">
  222. <Upload className="demandDetailShow-upload"
  223. listType="picture-card"
  224. fileList={this.state.companyLogoUrl}
  225. onPreview={(file) => {
  226. this.setState({
  227. previewImage: file.url || file.thumbUrl,
  228. previewVisible: true,
  229. });
  230. }} >
  231. </Upload>
  232. <Modal maskClosable={false} footer={null}
  233. visible={this.state.previewVisible}
  234. onCancel={() => { this.setState({ previewVisible: false }) }}>
  235. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  236. </Modal>
  237. </div>
  238. </FormItem>
  239. </div>
  240. <div className="clearfix">
  241. <FormItem
  242. labelCol={{ span: 2 }}
  243. wrapperCol={{ span: 18 }}
  244. label="业务范围" >
  245. <span>{basicData.businessScope}</span>
  246. </FormItem>
  247. <FormItem
  248. labelCol={{ span: 2 }}
  249. wrapperCol={{ span: 18 }}
  250. label="单位简介" >
  251. <span>{basicData.introduction}</span>
  252. </FormItem>
  253. </div>
  254. </div>
  255. </Spin>
  256. </Form>
  257. </div>
  258. )
  259. }
  260. })
  261. export default Basic;