crmAll.jsx 44 KB

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