basicPerson.jsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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 monthFormat = 'YYYY/MM';
  11. //图片组件
  12. const Basic = React.createClass({
  13. getInitialState() {
  14. return {
  15. loading: false,
  16. orgCodeUrl: [],
  17. companyLogoUrl: [],
  18. headPortraitUrl: [],
  19. positiveIdUrl: [],
  20. oppositeIdUrl: []
  21. }
  22. },
  23. loadInformation(record) {
  24. this.setState({
  25. loading: true
  26. });
  27. $.ajax({
  28. method: "get",
  29. dataType: "json",
  30. crossDomain: false,
  31. url: globalConfig.context + '/api/admin/customer/findPersonalCustomerDetail',
  32. data: {
  33. uid: record
  34. },
  35. success: function(data) {
  36. let thisData = data.data;
  37. if(!thisData) {
  38. if(data.error && data.error.length) {
  39. message.warning(data.error[0].message);
  40. };
  41. thisData = {};
  42. };
  43. let ProvinceS = thisData.province, //getprovince
  44. citys = thisData.city,
  45. Areas = thisData.area,
  46. ProvinceCity = getProvince(ProvinceS, citys, Areas),
  47. month = thisData.dateOfBirthYear ? thisData.dateOfBirthYear + '/' + thisData.dateOfBirthMonth : '';
  48. this.setState({
  49. headPortraitUrl: thisData.headPortraitUrl ? splitUrl(thisData.headPortraitUrl, ',', globalConfig.avatarHost + '/upload') : [],
  50. positiveIdUrl: thisData.positiveIdUrl ? splitUrl(thisData.positiveIdUrl, ',', globalConfig.avatarHost + '/upload') : [],
  51. oppositeIdUrl: thisData.oppositeIdUrl ? splitUrl(thisData.oppositeIdUrl, ',', globalConfig.avatarHost + '/upload') : [],
  52. ProvinceCity: ProvinceCity,
  53. month:month,
  54. basicData:thisData
  55. });
  56. }.bind(this),
  57. }).always(function() {
  58. this.setState({
  59. loading: false
  60. });
  61. }.bind(this));
  62. },
  63. //图片
  64. getOrgCodeUrl(e) {
  65. this.setState({
  66. orgCodeUrl: e
  67. });
  68. },
  69. getCompanyLogoUrl(e) {
  70. this.setState({
  71. companyLogoUrl: e
  72. });
  73. },
  74. //取消
  75. detailsModal() {
  76. this.props.closeDetail(false, false)
  77. },
  78. getHeadPortraitUrl(e) {
  79. this.setState({ headPortraitUrl: e });
  80. },
  81. getPositiveIdUrl(e) {
  82. this.setState({ positiveIdUrl: e });
  83. },
  84. getOppositeIdUrl(e) {
  85. this.setState({ oppositeIdUrl: e });
  86. },
  87. componentWillMount() {
  88. this.loadInformation(this.props.data.id)
  89. },
  90. componentWillReceiveProps(nextProps) {
  91. if(nextProps.data && nextProps.basicState) {
  92. this.loadInformation(nextProps.data.id)
  93. }
  94. },
  95. render() {
  96. const formItemLayout = {
  97. labelCol: {
  98. span: 8
  99. },
  100. wrapperCol: {
  101. span: 14
  102. },
  103. };
  104. const basicData = this.state.basicData ||[];
  105. return(
  106. <div>
  107. <Form layout="horizontal" onSubmit={this.newSubmit} id="demand-form">
  108. <Spin spinning={this.state.loading}>
  109. <div className="clearfix" >
  110. <FormItem className="half-item"
  111. {...formItemLayout}
  112. label="客户姓名"
  113. >
  114. <span>{basicData.identifyName}</span>
  115. </FormItem>
  116. </div>
  117. <div className="clearfix" >
  118. <FormItem className="half-item"
  119. {...formItemLayout}
  120. label="行业">
  121. <span>{getIndustry(basicData.industry)}</span>
  122. </FormItem>
  123. <FormItem className="half-item"
  124. {...formItemLayout}
  125. label="社会属性"
  126. >
  127. <span>{getSocialAttribute(basicData.societyTag)}</span>
  128. </FormItem>
  129. <FormItem className="half-item"
  130. {...formItemLayout}
  131. label="省-市-区"
  132. >
  133. <span>{this.state.ProvinceCity}</span>
  134. </FormItem>
  135. <FormItem className="half-item"
  136. {...formItemLayout}
  137. label="出生日期"
  138. >
  139. <span>{this.state.month}</span>
  140. </FormItem>
  141. <FormItem className="half-item"
  142. {...formItemLayout}
  143. label="身份证号码"
  144. >
  145. <span>{basicData.idNumber}</span>
  146. </FormItem>
  147. <FormItem className="half-item"
  148. {...formItemLayout}
  149. label="主要联系人"
  150. >
  151. <span>{basicData.contacts}</span>
  152. </FormItem>
  153. <FormItem className="half-item"
  154. {...formItemLayout}
  155. label="主要联系人号码"
  156. >
  157. <span>{basicData.contactMobile}</span>
  158. </FormItem>
  159. <div className="clearfix">
  160. <FormItem className="half-item"
  161. {...formItemLayout}
  162. label="职称名字"
  163. >
  164. <span>{basicData.professionalTitle}</span>
  165. </FormItem>
  166. <FormItem className="half-item"
  167. {...formItemLayout}
  168. label="就业单位"
  169. >
  170. <span>{basicData.workUnit}</span>
  171. </FormItem>
  172. <FormItem className="half-item"
  173. {...formItemLayout}
  174. label="学历"
  175. >
  176. <span>{basicData.education}</span>
  177. </FormItem>
  178. <FormItem className="half-item"
  179. {...formItemLayout}
  180. label="毕业院校"
  181. >
  182. <span>{basicData.graduateSchool}</span>
  183. </FormItem>
  184. <FormItem className="half-item"
  185. {...formItemLayout}
  186. label="专业类别"
  187. >
  188. <span>{basicData.majorCategory}</span>
  189. </FormItem>
  190. <FormItem className="half-item"
  191. {...formItemLayout}
  192. label="职业资格"
  193. >
  194. <span>{basicData.qualification}</span>
  195. </FormItem>
  196. <FormItem className="half-item"
  197. {...formItemLayout}
  198. label="通信地址"
  199. >
  200. <span>{basicData.postalAddress}</span>
  201. </FormItem>
  202. <FormItem className="half-item"
  203. {...formItemLayout}
  204. label="固定电话"
  205. >
  206. <span>{basicData.fixedTel}</span>
  207. </FormItem>
  208. <FormItem className="half-item"
  209. {...formItemLayout}
  210. label="客户QQ"
  211. >
  212. <span>{basicData.qq}</span>
  213. </FormItem>
  214. <FormItem className="half-item"
  215. {...formItemLayout}
  216. label="电子邮箱"
  217. >
  218. <span>{basicData.email}</span>
  219. </FormItem>
  220. <FormItem className="half-item"
  221. {...formItemLayout}
  222. label="咨询费用"
  223. >
  224. <span>{basicData.consultationPrice}</span>
  225. </FormItem>
  226. </div>
  227. <div className="clearfix">
  228. <FormItem className="half-item"
  229. {...formItemLayout}
  230. label="性别"
  231. >
  232. <span>{basicData.sex}</span>
  233. </FormItem>
  234. </div>
  235. <div className='clearfix'>
  236. <FormItem
  237. labelCol={{ span:4 }}
  238. wrapperCol={{ span: 18 }}
  239. label="客户简介" >
  240. <span>{basicData.introduction}</span>
  241. </FormItem>
  242. </div>
  243. <div className="clearfix pictures">
  244. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginLeft:'95px'}}
  245. labelCol={{ span: 8 }}
  246. wrapperCol={{ span: 10 }}
  247. label="身份证正面" >
  248. <div className="clearfix">
  249. <Upload className="demandDetailShow-upload"
  250. listType="picture-card"
  251. fileList={this.state.positiveIdUrl}
  252. onPreview={(file) => {
  253. this.setState({
  254. previewImage: file.url || file.thumbUrl,
  255. previewVisible: true,
  256. });
  257. }} >
  258. </Upload>
  259. <Modal maskClosable={false} footer={null}
  260. visible={this.state.previewVisible}
  261. onCancel={() => { this.setState({ previewVisible: false }) }}>
  262. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  263. </Modal>
  264. </div>
  265. </FormItem>
  266. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px'}}
  267. labelCol={{ span: 8 }}
  268. wrapperCol={{ span: 10 }}
  269. label="身份证反面" >
  270. <div className="clearfix">
  271. <Upload className="demandDetailShow-upload"
  272. listType="picture-card"
  273. fileList={this.state.oppositeIdUrl}
  274. onPreview={(file) => {
  275. this.setState({
  276. previewImage: file.url || file.thumbUrl,
  277. previewVisible: true,
  278. });
  279. }} >
  280. </Upload>
  281. <Modal maskClosable={false} footer={null}
  282. visible={this.state.previewVisible}
  283. onCancel={() => { this.setState({ previewVisible: false }) }}>
  284. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  285. </Modal>
  286. </div>
  287. </FormItem>
  288. <FormItem style={{display:'inline-block' ,width:'350px',marginTop:'20px'}}
  289. labelCol={{ span: 8 }}
  290. wrapperCol={{ span: 10 }}
  291. label="客户照片" >
  292. <div className="clearfix">
  293. <Upload className="demandDetailShow-upload"
  294. listType="picture-card"
  295. fileList={this.state.headPortraitUrl}
  296. onPreview={(file) => {
  297. this.setState({
  298. previewImage: file.url || file.thumbUrl,
  299. previewVisible: true,
  300. });
  301. }} >
  302. </Upload>
  303. <Modal maskClosable={false} footer={null}
  304. visible={this.state.previewVisible}
  305. onCancel={() => { this.setState({ previewVisible: false }) }}>
  306. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  307. </Modal>
  308. </div>
  309. </FormItem>
  310. </div>
  311. </div>
  312. </Spin>
  313. </Form>
  314. </div>
  315. )
  316. }
  317. })
  318. export default Basic;