crm.jsx 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. import React from 'react';
  2. import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message, DatePicker, Upload, Form ,Modal,Tabs} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import TechAchievementDesc from '@/manageCenter/achievement/crmAchievement.jsx';
  7. import { citySelect, provinceList ,areaSelect} from '@/NewDicProvinceList';
  8. import { socialAttribute, industry, auditStatusL, lvl, currentMember ,slcRedit,dataGrade} from '@/dataDic.js';
  9. import { getSocialAttribute, beforeUploadFile,splitUrl ,getSlcRedit,getDataGrade,getAchievementCategory,getTechAuditStatus,getboutique} from '@/tools.js';
  10. import './customer.less';
  11. const TabPane = Tabs.TabPane;
  12. //图片组件
  13. const PicturesWall = React.createClass({
  14. getInitialState() {
  15. return {
  16. previewVisible: false,
  17. previewImage: '',
  18. fileList: [],
  19. }
  20. },
  21. handleCancel() {
  22. this.setState({
  23. previewVisible: false
  24. })
  25. },
  26. handlePreview(file) {
  27. this.setState({
  28. previewImage: file.url || file.thumbUrl,
  29. previewVisible: true,
  30. });
  31. },
  32. handleChange(info) {
  33. let fileList = info.fileList;
  34. this.setState({
  35. fileList
  36. });
  37. this.props.fileList(fileList);
  38. },
  39. componentWillReceiveProps(nextProps) {
  40. this.state.fileList = nextProps.pictureUrl;
  41. },
  42. render() {
  43. const {
  44. previewVisible,
  45. previewImage,
  46. fileList
  47. } = this.state;
  48. const uploadButton = (
  49. <div>
  50. <Icon type="plus" />
  51. <div className="ant-upload-text">点击上传</div>
  52. </div>
  53. );
  54. return(
  55. <div style={{display:"inline-block"}}>
  56. <Upload
  57. action={globalConfig.context + "/api/admin/customer/uploadCustomerImg"}
  58. data={{ 'sign': '' }}
  59. listType="picture-card"
  60. fileList={fileList}
  61. onPreview={this.handlePreview}
  62. onChange={this.handleChange} >
  63. {fileList.length >= 1 ? null : uploadButton}
  64. </Upload>
  65. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  66. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  67. </Modal>
  68. </div>
  69. );
  70. }
  71. });
  72. const IntentionCustomer = Form.create()(React.createClass({
  73. loadData(pageNo, apiUrl) {
  74. this.setState({
  75. visitModul:false,
  76. loading: true,
  77. ispage:pageNo,
  78. modalVisible:false
  79. });
  80. $.ajax({
  81. method: "post",
  82. dataType: "json",
  83. crossDomain: false,
  84. url: globalConfig.context +"/api/admin/customer/listCustomerInformation",
  85. data: {
  86. pageNo: pageNo || 1,
  87. pageSize: this.state.pagination.pageSize,
  88. name: this.state.nameSearch,
  89. dataGrade: this.state.dataGrade,
  90. follow: this.state.follow,
  91. province: !(this.state.addressSearch).length ? this.state.provinceSearch : this.state.addressSearch[0],
  92. city: !(this.state.addressSearch).length ? '' : this.state.addressSearch[1],
  93. startDate: this.state.releaseDate[0],
  94. endDate: this.state.releaseDate[1],
  95. },
  96. success: function(data) {
  97. let theArr = [];
  98. if(data.error.length || data.data.list == "") {
  99. if(data.error && data.error.length) {
  100. message.warning(data.error[0].message);
  101. };
  102. } else {
  103. for(let i = 0; i < data.data.list.length; i++) {
  104. let thisdata = data.data.list[i];
  105. let diqu=(thisdata.province==null?"":thisdata.province)+(thisdata.city==null?"":"-"+thisdata.city)+(thisdata.area==null?"":"-"+thisdata.area);
  106. theArr.push({
  107. key: i,
  108. id: thisdata.id,//用户ID
  109. type:thisdata.type,//类型
  110. name: thisdata.name,//用户名称
  111. diqu: diqu,//省市区
  112. industry: thisdata.industry,//行业
  113. contacts: thisdata.contacts,//联系人
  114. contactMobile: thisdata.contactMobile,//联系人电话
  115. createTime: thisdata.createTime,//行业
  116. });
  117. };
  118. this.state.pagination.current = data.data.pageNo;
  119. this.state.pagination.total = data.data.totalCount;
  120. };
  121. if(data.data&&data.data.list&&!data.data.list.length){
  122. this.state.pagination.current=0
  123. this.state.pagination.total=0
  124. }
  125. this.setState({
  126. dataSource: theArr,
  127. pageNo: pageNo,
  128. pagination: this.state.pagination,
  129. selectedRowKeys:[]
  130. });
  131. }.bind(this),
  132. }).always(function() {
  133. this.setState({
  134. loading: false
  135. });
  136. }.bind(this));
  137. },
  138. loadDatas(pageNos) {
  139. this.setState({
  140. loading: true,
  141. });
  142. $.ajax({
  143. method: "get",
  144. dataType: "json",
  145. crossDomain: false,
  146. url: globalConfig.context + "/api/admin/achievement/listUserAchievement",
  147. data: {
  148. pageNo: pageNos || 1,
  149. pageSize: this.state.paginationDate.pageSize,
  150. uid:this.state.uid,
  151. },
  152. success: function (data) {
  153. let theArr = [];
  154. if (!data.data || !data.data.list) {
  155. if (data.error && data.error.length) {
  156. message.warning(data.error[0].message);
  157. };
  158. } else {
  159. for (let i = 0; i < data.data.list.length; i++) {
  160. let thisdata = data.data.list[i];
  161. theArr.push({
  162. key: i,
  163. id: thisdata.id,
  164. serialNumber: thisdata.serialNumber,
  165. dataCategory: thisdata.dataCategory,
  166. name: thisdata.name,
  167. keyword: thisdata.keyword,
  168. theName: thisdata.username || thisdata.ownerName,
  169. category: thisdata.category,
  170. ownerName: thisdata.username ? thisdata.username : thisdata.ownerName,
  171. ownerType: thisdata.ownerType,
  172. ownerMobile: thisdata.ownerMobile,
  173. status: thisdata.status,
  174. releaseDate: thisdata.releaseDate,
  175. releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
  176. auditStatus: thisdata.auditStatus,
  177. boutique: thisdata.boutique,
  178. hot: thisdata.hot,
  179. techBrokerId:thisdata.techBrokerId,
  180. createTimeFormattedDate: thisdata.createTimeFormattedDate,
  181. remark:thisdata.remark
  182. });
  183. };
  184. this.state.paginationDate.current = data.data.pageNo;
  185. this.state.paginationDate.total = data.data.totalCount;
  186. };
  187. this.setState({
  188. dataSourceDate: theArr,
  189. pageNos: pageNos,
  190. paginationDate: this.state.paginationDate
  191. });
  192. }.bind(this),
  193. }).always(function () {
  194. this.setState({
  195. loading: false
  196. });
  197. }.bind(this));
  198. },
  199. getInitialState() {
  200. return {
  201. addressSearch: [],
  202. orgCodeUrl: [],
  203. companyLogoUrl: [],
  204. visible: false,
  205. releaseDate: [],
  206. visitModul:false,
  207. detailApi:'',
  208. followData:{},
  209. selectedRowKeys: [],
  210. selectedRows: [],
  211. loading: false,
  212. callnub:"0",
  213. modalVisible:false,
  214. pagination: {
  215. defaultCurrent: 1,
  216. defaultPageSize: 10,
  217. showQuickJumper: true,
  218. pageSize: 10,
  219. onChange: function(page) {
  220. this.loadData(page);
  221. }.bind(this),
  222. showTotal: function(total) {
  223. return '共' + total + '条数据';
  224. }
  225. },
  226. paginationDate: {
  227. defaultCurrent: 1,
  228. defaultPageSize: 10,
  229. showQuickJumper: true,
  230. pageSize: 10,
  231. onChange: function(page) {
  232. this.loadDatas(page);
  233. }.bind(this),
  234. showTotal: function(total) {
  235. return '共' + total + '条数据';
  236. }
  237. },
  238. columns: [{
  239. title: '客户名称',
  240. dataIndex: 'name',
  241. key: 'name',
  242. }, {
  243. title: '地区',
  244. dataIndex: 'diqu',
  245. key: 'diqu',
  246. }, {
  247. title: '联系人',
  248. dataIndex: 'contacts',
  249. key: 'contacts',
  250. },
  251. {
  252. title: '行业',
  253. dataIndex: 'industry',
  254. key: 'industry'
  255. },
  256. {
  257. title: '联系电话',
  258. dataIndex: 'contactMobile',
  259. key: 'contactMobile',
  260. },
  261. {
  262. title: '创建时间',
  263. dataIndex: 'createTime',
  264. key: 'createTime',
  265. }
  266. ],
  267. data: [],
  268. dataman: [],
  269. dataSource: [],
  270. visitArrList: [],
  271. columnsDate: [
  272. {
  273. title: '编号',
  274. dataIndex: 'serialNumber',
  275. key: 'serialNumber',
  276. }, {
  277. title: '名称',
  278. dataIndex: 'name',
  279. key: 'name',
  280. }, {
  281. title: '关键字',
  282. dataIndex: 'keyword',
  283. key: 'keyword',
  284. }, {
  285. title: '类型',
  286. dataIndex: 'category',
  287. key: 'category',
  288. render: text => { return getAchievementCategory(text); }
  289. },{
  290. title: '审核状态',
  291. dataIndex: 'auditStatus',
  292. key: 'auditStatus',
  293. render: text => { return getTechAuditStatus(text) }
  294. },
  295. {
  296. title: '是否精品',
  297. dataIndex: 'boutique',
  298. key: 'boutique',
  299. render: text => { return getboutique(text) }
  300. },
  301. {
  302. title: '发布时间',
  303. dataIndex: 'releaseDateFormattedDate',
  304. key: 'releaseDateFormattedDate',
  305. },{
  306. title: '录入时间',
  307. dataIndex: 'createTimeFormattedDate',
  308. key: 'createTimeFormattedDate',
  309. },
  310. ],
  311. dataSourceDate: [],
  312. };
  313. },
  314. componentWillMount() {
  315. //城市
  316. let Province = [];
  317. provinceList.map(function(item) {
  318. var id = String(item.id)
  319. Province.push(
  320. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  321. )
  322. });
  323. //行业
  324. let intentionalArr = [];
  325. industry.map(function(item) {
  326. intentionalArr.push(
  327. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  328. )
  329. });
  330. //会员等级
  331. let lvlArr = [];
  332. lvl.map(function(item) {
  333. lvlArr.push(
  334. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  335. )
  336. });
  337. //会员状态customerStatus
  338. let currentMemberArr = [];
  339. currentMember.map(function(item) {
  340. currentMemberArr.push(
  341. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  342. )
  343. });
  344. this.state.Provinces = Province;
  345. this.state.intentionalOption = intentionalArr;
  346. this.state.lvlArrOption = lvlArr;
  347. this.state.currentMemberArrOption = currentMemberArr;
  348. this.loadData();
  349. },
  350. search() {
  351. this.loadData();
  352. },
  353. reset() {
  354. this.state.nameSearch = '';
  355. this.state.addressSearch = [];
  356. this.state.dataGrade=undefined;
  357. this.state.follow=undefined;
  358. this.state.provinceSearch = undefined;
  359. this.state.citySearch = undefined;
  360. this.state.releaseDate[0] = undefined;
  361. this.state.releaseDate[1] = undefined;
  362. this.loadData();
  363. },
  364. //列表详情
  365. details(id) {
  366. $.ajax({
  367. method: "get",
  368. dataType: "json",
  369. crossDomain: false,
  370. url: globalConfig.context +"/api/admin/customer/findOrganizationCustomerDetail",
  371. data: {
  372. uid:id
  373. },
  374. success: function(data) {
  375. let thisDetail= data.data;
  376. if(data.error.length || data.data.list == "") {
  377. if(data.error && data.error.length) {
  378. message.warning(data.error[0].message);
  379. };
  380. } else {
  381. let ProvinceCityArr = [];
  382. let ProvinceS = thisDetail.locationProvince; //省
  383. let citys = thisDetail.locationCity;//市
  384. let Areas = thisDetail.locationArea;//区
  385. ProvinceCityArr.push(ProvinceS, citys, Areas);
  386. this.setState({
  387. detailId:thisDetail.id,//详情ID
  388. identifyName:thisDetail.identifyName,//客户名称
  389. uid:thisDetail.uid,//客户ID
  390. societyTag:thisDetail.societyTag,//社会标签
  391. companyLogoUrl:thisDetail.companyLogoUrl? splitUrl(thisDetail.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],//公司LOGO
  392. introduction:thisDetail.introduction,//介绍
  393. industry:thisDetail.industry?thisDetail.industry.toString():"",//行业
  394. locationProvince:thisDetail.locationProvince,//省
  395. locationCity:thisDetail.locationCity,//市
  396. locationArea:thisDetail.locationArea,//区
  397. ProvinceCity: ProvinceCityArr[0]!=null?ProvinceCityArr:undefined,//省市区
  398. postalAddress:thisDetail.postalAddress,//通讯地址
  399. contactsFixedTel:thisDetail.contactsFixedTel,//固定电话
  400. contactsFax:thisDetail.contactsFax,//传真地址
  401. registeredCapital:thisDetail.registeredCapital,//注册资金
  402. enterpriseScale:thisDetail.enterpriseScale,//企业规模
  403. legalPerson:thisDetail.legalPerson,//法人
  404. legalPersonIdCard:thisDetail.legalPersonIdCard,//法人身份证
  405. legalPersonTel:thisDetail.legalPersonTel,//法人联系电话
  406. legalPersonEmail:thisDetail.legalPersonEmail,//法人联系邮箱
  407. highTechZone:thisDetail.highTechZone,//是否高新
  408. listed:thisDetail.listed,//是否高新
  409. international:thisDetail.international,//是否国际化
  410. orgCode:thisDetail.orgCode,//社会统一机构
  411. orgCodeUrl:thisDetail.orgCodeUrl? splitUrl(thisDetail.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],//社会统一机构地址
  412. businessScope:thisDetail.businessScope,//业务范围
  413. contacts:thisDetail.contacts,//主要联系人姓名
  414. contactMobile:thisDetail.contactMobile,//主要联系人电话
  415. investment:thisDetail.investment,//投资机构
  416. businessAudit:thisDetail.businessAudit,//业务认证
  417. auditStatus:thisDetail.auditStatus,//实名认证
  418. intellectualProperty:thisDetail.intellectualProperty,//已有知识产权情况
  419. yearSalesAmount:thisDetail.yearSalesAmount,//年度销售额
  420. lastYearResearchAmount:thisDetail.lastYearResearchAmount,//上年度研发费用
  421. assets:thisDetail.assets,//总资产
  422. qualification:thisDetail.qualification,//企业资质情况
  423. cooperationSituation:thisDetail.cooperationSituation,//企业与高校院所
  424. informationMaintainer:thisDetail.informationMaintainer,//资料维护人
  425. informationMaintainerName:thisDetail.informationMaintainerName,//资料维护人
  426. coreTechnology:thisDetail.coreTechnology,//核心技术
  427. accomplishSituation:thisDetail.accomplishSituation,//客户已完成项目情况
  428. creditRating:thisDetail.creditRating?thisDetail.creditRating.toString():"",//信用等级
  429. });
  430. }}.bind(this),
  431. }).always(function() {
  432. this.setState({
  433. loading: false
  434. });
  435. }.bind(this));
  436. },
  437. //基本信息提交
  438. newSubmit(e) {
  439. e.preventDefault();
  440. if(!this.state.industry) {
  441. message.warning('请选择行业');
  442. return false;
  443. };
  444. if(!this.state.societyTag) {
  445. message.warning('请选择社会属性');
  446. return false;
  447. };
  448. if(!this.state.ProvinceCity[1]) {
  449. message.warning('请选择地区');
  450. return false;
  451. };
  452. if(!this.state.registeredCapital) {
  453. message.warning('请填写注册资本');
  454. return false;
  455. };
  456. if(!this.state.businessScope) {
  457. message.warning('请填写公司主营产品');
  458. return false;
  459. };
  460. if(!this.state.intellectualProperty) {
  461. message.warning('请填写已有知识产权情况');
  462. return false;
  463. };
  464. var reg = /^[1-9]\d*$|^0$/;
  465. if(this.state.consultationPrice) {
  466. if(this.state.consultationPrice.length > 6) {
  467. message.warning('咨询费用不超过6位数');
  468. this.refs.consul.focus();
  469. return false;
  470. };
  471. if(!reg.test(this.state.consultationPrice)) {
  472. message.warning('咨询费用只能输入数字');
  473. this.refs.consul.focus();
  474. return false;
  475. }
  476. }
  477. this.state.data = [];
  478. this.setState({
  479. selectedRowKeys: [],
  480. });
  481. let theorgCodeUrl = [];
  482. if(this.state.orgCodeUrl.length) {
  483. let picArr = [];
  484. this.state.orgCodeUrl.map(function(item) {
  485. if(item.response && item.response.data && item.response.data.length) {
  486. picArr.push(item.response.data);
  487. }
  488. });
  489. theorgCodeUrl = picArr.join(",");
  490. };
  491. let thecompanyLogoUrl = [];
  492. if(this.state.companyLogoUrl.length) {
  493. let picArr = [];
  494. this.state.companyLogoUrl.map(function(item) {
  495. if(item.response && item.response.data && item.response.data.length) {
  496. picArr.push(item.response.data);
  497. }
  498. });
  499. thecompanyLogoUrl = picArr.join(",");
  500. };
  501. let years = [];
  502. let yearMonth = this.state.yearMonth != undefined ? new Date(this.state.yearMonth).toLocaleDateString() : '';
  503. years = yearMonth.split('/');
  504. this.setState({
  505. loading: true
  506. });
  507. $.ajax({
  508. method: "post",
  509. dataType: "json",
  510. url: globalConfig.context + '/api/admin/customer/updateOrganizationCustomer',
  511. data: {
  512. id:this.state.detailId,//详情ID
  513. identifyName:this.state.identifyName,//客户名称
  514. uid:this.state.uid,//客户ID
  515. societyTag:this.state.societyTag,//社会标签
  516. companyLogoUrl:thecompanyLogoUrl.length != 0 ? thecompanyLogoUrl : '',//公司LOGO
  517. introduction:this.state.introduction,//介绍
  518. industry:this.state.industry,//行业
  519. locationProvince:(this.state.ProvinceCity)[0],//省
  520. locationCity:(this.state.ProvinceCity)[1],//市
  521. locationArea:(this.state.ProvinceCity)[2],//区
  522. postalAddress:this.state.postalAddress,//通讯地址
  523. contactsFixedTel:this.state.contactsFixedTel,//固定电话
  524. contactsFax:this.state.contactsFax,//传真地址
  525. registeredCapital:this.state.registeredCapital,//注册资金
  526. enterpriseScale:this.state.enterpriseScale,//企业规模
  527. legalPerson:this.state.legalPerson,//法人
  528. legalPersonIdCard:this.state.legalPersonIdCard,//法人身份证
  529. legalPersonTel:this.state.legalPersonTel,//法人联系电话
  530. legalPersonEmail:this.state.legalPersonEmail,//法人联系邮箱
  531. highTechZone:this.state.highTechZone,//是否高新
  532. listed:this.state.listed,//是否高新
  533. international:this.state.international,//是否国际化
  534. orgCode:this.state.orgCode,//社会统一机构
  535. orgCodeUrl: theorgCodeUrl.length != 0 ? theorgCodeUrl : '',//社会统一机构地址
  536. businessScope:this.state.businessScope,//业务范围
  537. contacts:this.state.contacts,//主要联系人姓名
  538. contactMobile:this.state.contactMobile,//主要联系人电话
  539. investment:this.state.investment,//投资机构
  540. businessAudit:this.state.businessAudit,//业务认证
  541. auditStatus:this.state.auditStatus,//实名认证
  542. intellectualProperty:this.state.intellectualProperty,//已有知识产权情况
  543. yearSalesAmount:this.state.yearSalesAmount,//年度销售额
  544. lastYearResearchAmount:this.state.lastYearResearchAmount,//上年度研发费用
  545. assets:this.state.assets,//总资产
  546. qualification:this.state.qualification,//企业资质情况
  547. cooperationSituation:this.state.cooperationSituation,//企业与高校院所
  548. informationMaintainer:this.state.informationMaintainer,//资料维护人
  549. informationMaintainerName:this.state.informationMaintainerName,//资料维护人
  550. coreTechnology:this.state.coreTechnology,//核心技术
  551. accomplishSituation:this.state.accomplishSituation,//客户已完成项目情况
  552. creditRating:this.state.creditRating,//信用等级
  553. }
  554. }).done(function(data) {
  555. this.setState({
  556. loading: false
  557. });
  558. if(!data.error.length) {
  559. message.success('保存成功!');
  560. this.visitCancel();
  561. this.loadData(this.state.pageNo);
  562. } else {
  563. message.warning(data.error[0].message);
  564. }
  565. }.bind(this));
  566. },
  567. //整行点击
  568. tableRowClick(record, index) {
  569. this.state.visitModul=true;
  570. this.details(record.id);
  571. },
  572. //指定转交人自动补全
  573. supervisor(e){
  574. $.ajax({
  575. method: "get",
  576. dataType: "json",
  577. crossDomain: false,
  578. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  579. data:{
  580. adminName:e
  581. },
  582. success: function (data) {
  583. let thedata=data.data;
  584. if (!thedata) {
  585. if (data.error && data.error.length) {
  586. message.warning(data.error[0].message);
  587. };
  588. thedata = {};
  589. };
  590. this.setState({
  591. customerArr:thedata,
  592. });
  593. }.bind(this),
  594. }).always(function () {
  595. this.setState({
  596. loading: false
  597. });
  598. }.bind(this));
  599. },
  600. //输入转交人输入框失去焦点是判断客户是否存在
  601. selectAuto(value,options){
  602. this.setState({
  603. auto:value
  604. })
  605. },
  606. blurChange(e){
  607. let theType='';
  608. let contactLists=this.state.customerArr||[];
  609. if (e) {
  610. contactLists.map(function (item) {
  611. if (item.name == e.toString()) {
  612. theType = item.id;
  613. }
  614. });
  615. }
  616. this.setState({
  617. theTypes:theType
  618. })
  619. },
  620. //值改变时请求客户名称
  621. httpChange(e){
  622. if(e.length>=1){
  623. this.supervisor(e);
  624. }
  625. this.setState({
  626. auto:e
  627. })
  628. },
  629. //转交
  630. changeAssigner() {
  631. if(this.state.theTypes){
  632. this.setState({
  633. selectedRowKeys: [],
  634. });
  635. let id;
  636. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  637. let rowItem = this.state.selectedRows[idx];
  638. if(rowItem.id) {
  639. id=rowItem.id;
  640. };
  641. };
  642. $.ajax({
  643. method: "post",
  644. dataType: "json",
  645. crossDomain: false,
  646. url: globalConfig.context + "/api/admin/customer/updateInformationMaintainerr",
  647. data: {
  648. id: id, //客户ID
  649. aid: this.state.theTypes, //指定转交人的ID
  650. }
  651. }).done(function(data) {
  652. if(!data.error.length) {
  653. message.success('转交成功!');
  654. this.setState({
  655. auto:'',
  656. loading: false,
  657. });
  658. } else {
  659. message.warning(data.error[0].message);
  660. };
  661. this.loadData(this.state.pageNo);
  662. }.bind(this));
  663. }else{
  664. message.warning('请输入转交人姓名')
  665. }
  666. },
  667. //详情打开
  668. visitOk(e) {
  669. this.setState({
  670. visitModul: false
  671. });
  672. },
  673. //详情关闭
  674. visitCancel(e) {
  675. this.setState({
  676. visitModul: false,
  677. callnub:"0"
  678. });
  679. },
  680. getOrgCodeUrl(e) {
  681. this.setState({ orgCodeUrl: e });
  682. },
  683. getCompanyLogoUrl(e) {
  684. this.setState({ companyLogoUrl: e });
  685. },
  686. componentWillReceiveProps(nextProps) {
  687. if(nextProps.ApiUrl!=this.props.ApiUrl) {
  688. this.state.nameSearch = '';
  689. this.state.addressSearch = [];
  690. this.state.provinceSearch = undefined;
  691. this.state.citySearch = undefined;
  692. this.state.releaseDate[0] = undefined;
  693. this.state.releaseDate[1] = undefined;
  694. this.loadData(null,nextProps.ApiUrl);
  695. };
  696. },
  697. callback(e) {
  698. if(e == '0') {
  699. this.setState({
  700. callnub: e,
  701. })
  702. }
  703. if(e == '1') {
  704. this.setState({
  705. callnub: e,
  706. })
  707. this.loadDatas();
  708. }
  709. },
  710. //发布成果
  711. addClick() {
  712. this.state.RowData = {};
  713. this.setState({
  714. showDesc: true,
  715. });
  716. },
  717. //关闭发布成果
  718. closeDesc(e, s) {
  719. this.state.showDesc = e;
  720. if (s) {
  721. this.loadDatas();
  722. };
  723. },
  724. tableRowClickDate(record, index) {
  725. this.state.RowData = record;
  726. if(index!=undefined){
  727. this.setState({
  728. showDesc: true
  729. });
  730. }
  731. },
  732. render() {
  733. const {
  734. RangePicker,
  735. MonthPicker
  736. } = DatePicker;
  737. const formItemLayout = {
  738. labelCol: { span: 8 },
  739. wrapperCol: { span: 14 },
  740. };
  741. const FormItem = Form.Item;
  742. const rowSelection = {
  743. selectedRowKeys: this.state.selectedRowKeys,
  744. onChange: (selectedRowKeys, selectedRows) => {
  745. this.setState({
  746. modalVisible:false,
  747. selectedRows: selectedRows.slice(-1),
  748. selectedRowKeys: selectedRowKeys.slice(-1)
  749. });
  750. },
  751. onSelect: (recordt, selected, selectedRows) => {
  752. this.setState({
  753. modalVisible:false,
  754. recordt: recordt.id
  755. })
  756. },
  757. };
  758. const hasSelected = this.state.selectedRowKeys.length > 0;
  759. const dataSources=this.state.customerArr || [];
  760. const options = dataSources.map((group) =>
  761. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  762. )
  763. const intentionState = this.props.intentionState ||'';
  764. return(
  765. <div className="user-content" >
  766. <div className="content-title">
  767. <span>客户资料维护</span>
  768. </div>
  769. <div className="user-search">
  770. <Input placeholder="客户名称"
  771. value={this.state.nameSearch}
  772. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  773. <Select placeholder="省"
  774. style={{ width: 80 }}
  775. value={this.state.provinceSearch}
  776. onChange={(e) => {this.setState({ provinceSearch: e});}}>
  777. {this.state.Provinces}
  778. </Select>
  779. <span style={{marginRight:'10px'}}>
  780. <Cascader options={citySelect()} value={this.state.addressSearch} placeholder="选择城市"
  781. onChange={(e,pre) => { this.setState({ addressSearch: e }) }} />
  782. </span>
  783. <Select placeholder="选择资料质量" style={{ width: 120 }}
  784. value={this.state.dataGrade}
  785. onChange={(e) => { this.setState({ dataGrade: e }) }}>
  786. <Select.Option value="0" >有效资料</Select.Option>
  787. <Select.Option value="1" >优质资料</Select.Option>
  788. </Select>
  789. <Select placeholder="是否面谈客户" style={{ width: 120 }}
  790. value={this.state.follow}
  791. onChange={(e) => { this.setState({ follow: e }) }}>
  792. <Select.Option value="0" >否</Select.Option>
  793. <Select.Option value="1" >是</Select.Option>
  794. </Select>
  795. <RangePicker style={{marginRight:'10px'}}
  796. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  797. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  798. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  799. <Button type="primary" onClick={this.search}>搜索</Button>
  800. <Button onClick={this.reset}>重置</Button>
  801. <AutoComplete
  802. className="certain-category-search"
  803. dropdownClassName="certain-category-search-dropdown"
  804. dropdownMatchSelectWidth={false}
  805. dropdownStyle={{ width: 120 }}
  806. style={{ width: '120px'}}
  807. dataSource={options}
  808. placeholder="输入转交人姓名"
  809. value={this.state.auto}
  810. onChange={this.httpChange}
  811. filterOption={true}
  812. onBlur={this.blurChange}
  813. onSelect={this.selectAuto}
  814. disabled={!hasSelected}
  815. >
  816. <Input />
  817. </AutoComplete>
  818. <Button type="primary" onClick={this.changeAssigner} disabled={!hasSelected} >转交</Button>
  819. </div>
  820. <div className="patent-table">
  821. <Spin spinning={this.state.loading}>
  822. <Table columns={this.state.columns}
  823. dataSource={this.state.dataSource}
  824. rowSelection={rowSelection}
  825. pagination={this.state.pagination}
  826. onRowClick={this.tableRowClick}
  827. />
  828. </Spin>
  829. </div>
  830. <Modal
  831. className="customeDetails"
  832. footer=''
  833. title="客户资料"
  834. width='1000px'
  835. visible={this.state.visitModul}
  836. onOk={this.visitOk}
  837. onCancel={this.visitCancel}
  838. >
  839. <Tabs onChange={this.callback} activeKey={this.state.callnub}>
  840. <TabPane tab="基本信息" key="0">
  841. <div>
  842. <Form layout="horizontal" onSubmit={this.newSubmit} id="demand-form">
  843. <Spin spinning={this.state.loading}>
  844. <div className="clearfix" >
  845. <FormItem className="half-item"
  846. {...formItemLayout}
  847. label="客户姓名"
  848. >
  849. <span>{this.state.identifyName}</span>
  850. </FormItem>
  851. <FormItem className="half-item"
  852. {...formItemLayout}
  853. label="资料所属人"
  854. >
  855. <span>{this.state.informationMaintainerName}</span>
  856. </FormItem>
  857. </div>
  858. <div className="clearfix" >
  859. <FormItem className="half-item"
  860. {...formItemLayout}
  861. label="行业">
  862. <Select placeholder="选择行业" value={this.state.industry} style={{width:'95%'}}
  863. onChange={(e)=>{this.setState({industry:e})}}>
  864. {
  865. industry.map(function (item) {
  866. return <Select.Option key={item.value} >{item.key}</Select.Option>
  867. })
  868. }
  869. </Select>
  870. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  871. </FormItem>
  872. <FormItem className="half-item"
  873. {...formItemLayout}
  874. label="社会属性"
  875. >
  876. <Select placeholder="客户社会属性" value={this.state.societyTag} style={{width:'95%'}}
  877. onChange={(e)=>{this.setState({societyTag:e})}}>
  878. {
  879. socialAttribute.map(function (item) {
  880. return <Select.Option key={item.value} >{item.key}</Select.Option>
  881. })
  882. }
  883. </Select>
  884. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  885. </FormItem>
  886. <FormItem className="half-item"
  887. {...formItemLayout}
  888. label="省-市-区"
  889. >
  890. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'95%'}}
  891. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  892. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  893. </FormItem>
  894. <FormItem className="half-item"
  895. {...formItemLayout}
  896. label="注册资本"
  897. >
  898. <Input placeholder="注册资本" style={{width:'90%'}} value={this.state.registeredCapital} onChange={(e) => {
  899. this.setState({ registeredCapital: e.target.value })}}/>万
  900. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  901. </FormItem>
  902. <div className='clearfix'>
  903. <FormItem
  904. labelCol={{ span:4 }}
  905. wrapperCol={{ span: 20 }}
  906. label="公司主营产品" >
  907. <Input type="textarea" rows={2} value={this.state.businessScope} style={{width:'95%'}}
  908. onChange={(e,pre) => { this.setState({ businessScope: e.target.value })}}/>
  909. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  910. </FormItem>
  911. </div>
  912. <div className='clearfix'>
  913. <FormItem
  914. labelCol={{ span:4 }}
  915. wrapperCol={{ span: 20 }}
  916. label="已有知识产权情况" >
  917. <Input type="textarea" rows={2} value={this.state.intellectualProperty} style={{width:'95%'}}
  918. onChange={(e,pre) => { this.setState({ intellectualProperty: e.target.value })}}/>
  919. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  920. </FormItem>
  921. </div>
  922. <FormItem className="half-item"
  923. {...formItemLayout}
  924. label="通信地址"
  925. >
  926. <Input placeholder="客户通信地址" value={this.state.postalAddress}
  927. onChange={(e,pre) => { this.setState({ postalAddress: e.target.value }) }}/>
  928. </FormItem>
  929. <FormItem className="half-item"
  930. {...formItemLayout}
  931. label="固定电话"
  932. >
  933. <Input placeholder="客户固定电话" value={this.state.contactsFixedTel}
  934. onChange={(e) => { this.setState({ contactsFixedTel: e.target.value }) }}/>
  935. </FormItem>
  936. <FormItem className="half-item"
  937. {...formItemLayout}
  938. label="客户传真"
  939. >
  940. <Input placeholder="客户传真" value={this.state.contactsFax}
  941. onChange={(e) => { this.setState({ contactsFax: e.target.value })}}/>
  942. </FormItem>
  943. <FormItem className="half-item"
  944. {...formItemLayout}
  945. label="企业人数"
  946. >
  947. <Input placeholder="单位规模" value={this.state.enterpriseScale} onChange={(e) => {
  948. this.setState({ enterpriseScale: e.target.value })}}/>
  949. </FormItem>
  950. <FormItem className="half-item"
  951. {...formItemLayout}
  952. label="法人名称"
  953. >
  954. <Input placeholder="法人名称" value={this.state.legalPerson} onChange={(e) => {
  955. this.setState({ legalPerson: e.target.value })}}/>
  956. </FormItem>
  957. <FormItem className="half-item"
  958. {...formItemLayout}
  959. label="法人身份证"
  960. >
  961. <Input placeholder="法人身份证" value={this.state.legalPersonIdCard} onChange={(e) => {
  962. this.setState({ legalPersonIdCard: e.target.value })}}/>
  963. </FormItem>
  964. <FormItem className="half-item"
  965. {...formItemLayout}
  966. label="主要联系人"
  967. >
  968. <Input placeholder="主要联系人" value={this.state.contacts} onChange={(e) => {
  969. this.setState({ contacts: e.target.value })}}/>
  970. </FormItem>
  971. <FormItem className="half-item"
  972. {...formItemLayout}
  973. label="主要联系人号码"
  974. >
  975. <Input placeholder="主要联系人号码" value={this.state.contactMobile} onChange={(e) => {
  976. this.setState({ contactMobile: e.target.value })}}/>
  977. </FormItem>
  978. <FormItem className="half-item"
  979. {...formItemLayout}
  980. label="法人电话"
  981. >
  982. <Input placeholder="法人电话" value={this.state.legalPersonTel} onChange={(e) => {
  983. this.setState({ legalPersonTel: e.target.value })}}/>
  984. </FormItem>
  985. <FormItem className="half-item"
  986. {...formItemLayout}
  987. label="法人电子邮箱"
  988. >
  989. <Input placeholder="法人电子邮箱" value={this.state.legalPersonEmail}
  990. onChange={(e) => {this.setState({legalPersonEmail: e.target.value })}}/>
  991. </FormItem>
  992. <FormItem className="half-item"
  993. {...formItemLayout}
  994. label="社会统一信用机构代码"
  995. >
  996. <Input placeholder="社会统一信用机构代码" value={this.state.orgCode} onChange={(e) => {
  997. this.setState({ orgCode: e.target.value })}}/>
  998. </FormItem>
  999. <div className='clearfix'>
  1000. <FormItem
  1001. labelCol={{ span:4 }}
  1002. wrapperCol={{ span: 18 }}
  1003. label="客户简介" >
  1004. <Input type="textarea" rows={3} value={this.state.introduction}
  1005. onChange={(e,pre) => { this.setState({ introduction: e.target.value })}}/>
  1006. </FormItem>
  1007. </div>
  1008. <div className="clearfix pictures">
  1009. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginLeft:'95px'}}
  1010. labelCol={{ span: 8 }}
  1011. wrapperCol={{ span: 10 }}
  1012. label="机构证书(PIC)" >
  1013. <PicturesWall
  1014. fileList={this.getOrgCodeUrl}
  1015. pictureUrl={this.state.orgCodeUrl} />
  1016. <p>建议:图片要清晰。</p>
  1017. </FormItem>
  1018. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginTop:'20px'}}
  1019. labelCol={{ span: 8 }}
  1020. wrapperCol={{ span: 10 }}
  1021. label="单位LOGO" >
  1022. <PicturesWall
  1023. fileList={this.getCompanyLogoUrl}
  1024. pictureUrl={this.state.companyLogoUrl} />
  1025. <p>建议:图片要清晰。</p>
  1026. </FormItem>
  1027. </div>
  1028. <div style={{fontSize:'18px',marginLeft:'50px',marginTop:'15px',marginBottom:'10px',color:"red",fontWeight:"bold"}}>签单客户信息完善</div>
  1029. <div className='clearfix' >
  1030. <FormItem className="half-item"
  1031. {...formItemLayout}
  1032. label="上年度销售额"
  1033. >
  1034. <Input ref='consul' placeholder="请输入上年度销售额" value={this.state.yearSalesAmount} style={{width:'95%'}}
  1035. onChange={(e) => {this.setState({yearSalesAmount: e.target.value })}}/>万
  1036. </FormItem>
  1037. <FormItem className="half-item"
  1038. {...formItemLayout}
  1039. label="上年度研发费用"
  1040. >
  1041. <Input ref='consul' placeholder="请输入上年度研发费用" value={this.state.lastYearResearchAmount} style={{width:'95%'}}
  1042. onChange={(e) => {this.setState({lastYearResearchAmount: e.target.value })}}/>万
  1043. </FormItem>
  1044. <FormItem className="half-item"
  1045. {...formItemLayout}
  1046. label="上年度总资产情况"
  1047. >
  1048. <Input ref='consul' placeholder="上年度总资产情况" value={this.state.assets} style={{width:'95%'}}
  1049. onChange={(e) => {this.setState({assets: e.target.value })}}/>万
  1050. </FormItem>
  1051. <FormItem className="half-item"
  1052. {...formItemLayout}
  1053. label="客户信用等级"
  1054. >
  1055. <Select placeholder="客户信用等级" value={this.state.creditRating}
  1056. onChange={(e)=>{this.setState({creditRating:e})}}>
  1057. {
  1058. slcRedit.map(function (item) {
  1059. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1060. })
  1061. }
  1062. </Select>
  1063. </FormItem>
  1064. <div className='clearfix'>
  1065. <FormItem
  1066. labelCol={{ span:4 }}
  1067. wrapperCol={{ span: 19 }}
  1068. label="核心技术" >
  1069. <Input type="textarea" rows={3} value={this.state.coreTechnology}
  1070. onChange={(e,pre) => { this.setState({ coreTechnology: e.target.value })}}/>
  1071. </FormItem>
  1072. </div>
  1073. <div className='clearfix'>
  1074. <FormItem
  1075. labelCol={{ span:4 }}
  1076. wrapperCol={{ span: 19 }}
  1077. label="企业资质情况" >
  1078. <Input type="textarea" rows={3} value={this.state.qualification} placeholder="请按如下格式填写:资质名称+获得时间+拥有人+发证机构"
  1079. onChange={(e,pre) => { this.setState({ qualification: e.target.value })}}/>
  1080. </FormItem>
  1081. </div>
  1082. <div className='clearfix'>
  1083. <FormItem
  1084. labelCol={{ span:4 }}
  1085. wrapperCol={{ span: 19 }}
  1086. label="客户已做项目" >
  1087. <Input type="textarea" rows={3} value={this.state.accomplishSituation} placeholder="请按如下格式填写:项目类型+主管部门+申报时间+立项情况+验收情况"
  1088. onChange={(e,pre) => { this.setState({ accomplishSituation: e.target.value })}}/>
  1089. </FormItem>
  1090. </div>
  1091. <div className='clearfix'>
  1092. <FormItem
  1093. labelCol={{ span:4 }}
  1094. wrapperCol={{ span: 19 }}
  1095. label="企业高企合作情况" >
  1096. <Input type="textarea" rows={3} value={this.state.cooperationSituation}
  1097. onChange={(e,pre) => { this.setState({ cooperationSituation: e.target.value })}}/>
  1098. </FormItem>
  1099. </div>
  1100. </div>
  1101. <Button className="setSubmit" type="primary" htmlType="submit">保存</Button>
  1102. <Button type="ghost" onClick={this.visitCancel}>取消</Button>
  1103. </div>
  1104. </Spin>
  1105. </Form>
  1106. </div>
  1107. </TabPane>
  1108. <TabPane tab="知识产权列表" key="1">
  1109. <Button type="primary" className="addButton" onClick={this.addClick}>发布成果<Icon type="plus" /></Button>
  1110. <Spin spinning={this.state.loading}>
  1111. <Table columns={this.state.columnsDate}
  1112. dataSource={this.state.dataSourceDate}
  1113. rowSelection={rowSelection}
  1114. pagination={this.state.paginationDate}
  1115. onRowClick={this.tableRowClickDate} />
  1116. </Spin>
  1117. </TabPane>
  1118. </Tabs>
  1119. </Modal>
  1120. <TechAchievementDesc
  1121. data={this.state.RowData}
  1122. detailApiUrl={this.props['data-detailApiUrl']}
  1123. achievementCategoryOption={this.state.achievementCategoryOption}
  1124. showDesc={this.state.showDesc}
  1125. uid={this.state.uid}
  1126. closeDesc={this.closeDesc}
  1127. loadDatas={this.loadDatas}
  1128. />
  1129. </div >
  1130. );
  1131. }
  1132. }));
  1133. export default IntentionCustomer;