crm.jsx 44 KB

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