crmAll.jsx 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111
  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.provinceSearch = undefined;
  355. this.state.citySearch = undefined;
  356. this.state.releaseDate[0] = undefined;
  357. this.state.releaseDate[1] = undefined;
  358. this.loadData();
  359. },
  360. //列表详情
  361. details(id) {
  362. $.ajax({
  363. method: "get",
  364. dataType: "json",
  365. crossDomain: false,
  366. url: globalConfig.context +"/api/admin/customer/findOrganizationCustomerDetail",
  367. data: {
  368. uid:id
  369. },
  370. success: function(data) {
  371. let thisDetail= data.data;
  372. if(data.error.length || data.data.list == "") {
  373. if(data.error && data.error.length) {
  374. message.warning(data.error[0].message);
  375. };
  376. } else {
  377. let ProvinceCityArr = [];
  378. let ProvinceS = thisDetail.locationProvince; //省
  379. let citys = thisDetail.locationCity;//市
  380. let Areas = thisDetail.locationArea;//区
  381. ProvinceCityArr.push(ProvinceS, citys, Areas);
  382. this.setState({
  383. detailId:thisDetail.id,//详情ID
  384. identifyName:thisDetail.identifyName,//客户名称
  385. uid:thisDetail.uid,//客户ID
  386. societyTag:thisDetail.societyTag,//社会标签
  387. companyLogoUrl:thisDetail.companyLogoUrl? splitUrl(thisDetail.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],//公司LOGO
  388. introduction:thisDetail.introduction,//介绍
  389. industry:thisDetail.industry?thisDetail.industry.toString():"",//行业
  390. locationProvince:thisDetail.locationProvince,//省
  391. locationCity:thisDetail.locationCity,//市
  392. locationArea:thisDetail.locationArea,//区
  393. ProvinceCity: ProvinceCityArr[0]!=null?ProvinceCityArr:undefined,//省市区
  394. postalAddress:thisDetail.postalAddress,//通讯地址
  395. contactsFixedTel:thisDetail.contactsFixedTel,//固定电话
  396. contactsFax:thisDetail.contactsFax,//传真地址
  397. registeredCapital:thisDetail.registeredCapital,//注册资金
  398. enterpriseScale:thisDetail.enterpriseScale,//企业规模
  399. legalPerson:thisDetail.legalPerson,//法人
  400. legalPersonIdCard:thisDetail.legalPersonIdCard,//法人身份证
  401. legalPersonTel:thisDetail.legalPersonTel,//法人联系电话
  402. legalPersonEmail:thisDetail.legalPersonEmail,//法人联系邮箱
  403. highTechZone:thisDetail.highTechZone,//是否高新
  404. listed:thisDetail.listed,//是否高新
  405. international:thisDetail.international,//是否国际化
  406. orgCode:thisDetail.orgCode,//社会统一机构
  407. orgCodeUrl:thisDetail.orgCodeUrl? splitUrl(thisDetail.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],//社会统一机构地址
  408. businessScope:thisDetail.businessScope,//业务范围
  409. contacts:thisDetail.contacts,//主要联系人姓名
  410. contactMobile:thisDetail.contactMobile,//主要联系人电话
  411. investment:thisDetail.investment,//投资机构
  412. businessAudit:thisDetail.businessAudit,//业务认证
  413. auditStatus:thisDetail.auditStatus,//实名认证
  414. intellectualProperty:thisDetail.intellectualProperty,//已有知识产权情况
  415. yearSalesAmount:thisDetail.yearSalesAmount,//年度销售额
  416. lastYearResearchAmount:thisDetail.lastYearResearchAmount,//上年度研发费用
  417. assets:thisDetail.assets,//总资产
  418. qualification:thisDetail.qualification,//企业资质情况
  419. cooperationSituation:thisDetail.cooperationSituation,//企业与高校院所
  420. informationMaintainer:thisDetail.informationMaintainer,//资料维护人
  421. informationMaintainerName:thisDetail.informationMaintainerName,//资料维护人
  422. coreTechnology:thisDetail.coreTechnology,//核心技术
  423. accomplishSituation:thisDetail.accomplishSituation,//客户已完成项目情况
  424. creditRating:thisDetail.creditRating?thisDetail.creditRating.toString():"",//信用等级
  425. });
  426. }}.bind(this),
  427. }).always(function() {
  428. this.setState({
  429. loading: false
  430. });
  431. }.bind(this));
  432. },
  433. //基本信息提交
  434. newSubmit(e) {
  435. e.preventDefault();
  436. if(!this.state.industry) {
  437. message.warning('请选择行业');
  438. return false;
  439. };
  440. if(!this.state.societyTag) {
  441. message.warning('请选择社会属性');
  442. return false;
  443. };
  444. if(!this.state.ProvinceCity[1]) {
  445. message.warning('请选择地区');
  446. return false;
  447. };
  448. if(!this.state.registeredCapital) {
  449. message.warning('请填写注册资本');
  450. return false;
  451. };
  452. if(!this.state.businessScope) {
  453. message.warning('请填写公司主营产品');
  454. return false;
  455. };
  456. if(!this.state.intellectualProperty) {
  457. message.warning('请填写已有知识产权情况');
  458. return false;
  459. };
  460. var reg = /^[1-9]\d*$|^0$/;
  461. if(this.state.consultationPrice) {
  462. if(this.state.consultationPrice.length > 6) {
  463. message.warning('咨询费用不超过6位数');
  464. this.refs.consul.focus();
  465. return false;
  466. };
  467. if(!reg.test(this.state.consultationPrice)) {
  468. message.warning('咨询费用只能输入数字');
  469. this.refs.consul.focus();
  470. return false;
  471. }
  472. }
  473. this.state.data = [];
  474. this.setState({
  475. selectedRowKeys: [],
  476. });
  477. let theorgCodeUrl = [];
  478. if(this.state.orgCodeUrl.length) {
  479. let picArr = [];
  480. this.state.orgCodeUrl.map(function(item) {
  481. if(item.response && item.response.data && item.response.data.length) {
  482. picArr.push(item.response.data);
  483. }
  484. });
  485. theorgCodeUrl = picArr.join(",");
  486. };
  487. let thecompanyLogoUrl = [];
  488. if(this.state.companyLogoUrl.length) {
  489. let picArr = [];
  490. this.state.companyLogoUrl.map(function(item) {
  491. if(item.response && item.response.data && item.response.data.length) {
  492. picArr.push(item.response.data);
  493. }
  494. });
  495. thecompanyLogoUrl = picArr.join(",");
  496. };
  497. let years = [];
  498. let yearMonth = this.state.yearMonth != undefined ? new Date(this.state.yearMonth).toLocaleDateString() : '';
  499. years = yearMonth.split('/');
  500. this.setState({
  501. loading: true
  502. });
  503. $.ajax({
  504. method: "post",
  505. dataType: "json",
  506. url: globalConfig.context + '/api/admin/customer/updateOrganizationCustomer',
  507. data: {
  508. id:this.state.detailId,//详情ID
  509. identifyName:this.state.identifyName,//客户名称
  510. uid:this.state.uid,//客户ID
  511. societyTag:this.state.societyTag,//社会标签
  512. companyLogoUrl:thecompanyLogoUrl.length != 0 ? thecompanyLogoUrl : '',//公司LOGO
  513. introduction:this.state.introduction,//介绍
  514. industry:this.state.industry,//行业
  515. locationProvince:(this.state.ProvinceCity)[0],//省
  516. locationCity:(this.state.ProvinceCity)[1],//市
  517. locationArea:(this.state.ProvinceCity)[2],//区
  518. postalAddress:this.state.postalAddress,//通讯地址
  519. contactsFixedTel:this.state.contactsFixedTel,//固定电话
  520. contactsFax:this.state.contactsFax,//传真地址
  521. registeredCapital:this.state.registeredCapital,//注册资金
  522. enterpriseScale:this.state.enterpriseScale,//企业规模
  523. legalPerson:this.state.legalPerson,//法人
  524. legalPersonIdCard:this.state.legalPersonIdCard,//法人身份证
  525. legalPersonTel:this.state.legalPersonTel,//法人联系电话
  526. legalPersonEmail:this.state.legalPersonEmail,//法人联系邮箱
  527. highTechZone:this.state.highTechZone,//是否高新
  528. listed:this.state.listed,//是否高新
  529. international:this.state.international,//是否国际化
  530. orgCode:this.state.orgCode,//社会统一机构
  531. orgCodeUrl: theorgCodeUrl.length != 0 ? theorgCodeUrl : '',//社会统一机构地址
  532. businessScope:this.state.businessScope,//业务范围
  533. contacts:this.state.contacts,//主要联系人姓名
  534. contactMobile:this.state.contactMobile,//主要联系人电话
  535. investment:this.state.investment,//投资机构
  536. businessAudit:this.state.businessAudit,//业务认证
  537. auditStatus:this.state.auditStatus,//实名认证
  538. intellectualProperty:this.state.intellectualProperty,//已有知识产权情况
  539. yearSalesAmount:this.state.yearSalesAmount,//年度销售额
  540. lastYearResearchAmount:this.state.lastYearResearchAmount,//上年度研发费用
  541. assets:this.state.assets,//总资产
  542. qualification:this.state.qualification,//企业资质情况
  543. cooperationSituation:this.state.cooperationSituation,//企业与高校院所
  544. informationMaintainer:this.state.informationMaintainer,//资料维护人
  545. informationMaintainerName:this.state.informationMaintainerName,//资料维护人
  546. coreTechnology:this.state.coreTechnology,//核心技术
  547. accomplishSituation:this.state.accomplishSituation,//客户已完成项目情况
  548. creditRating:this.state.creditRating,//信用等级
  549. }
  550. }).done(function(data) {
  551. this.setState({
  552. loading: false
  553. });
  554. if(!data.error.length) {
  555. message.success('保存成功!');
  556. this.visitCancel();
  557. this.loadData();
  558. } else {
  559. message.warning(data.error[0].message);
  560. }
  561. }.bind(this));
  562. },
  563. //整行点击
  564. tableRowClick(record, index) {
  565. this.state.visitModul=true;
  566. this.details(record.id);
  567. },
  568. //指定转交人自动补全
  569. supervisor(e){
  570. $.ajax({
  571. method: "get",
  572. dataType: "json",
  573. crossDomain: false,
  574. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  575. data:{
  576. adminName:e
  577. },
  578. success: function (data) {
  579. let thedata=data.data;
  580. if (!thedata) {
  581. if (data.error && data.error.length) {
  582. message.warning(data.error[0].message);
  583. };
  584. thedata = {};
  585. };
  586. this.setState({
  587. customerArr:thedata,
  588. });
  589. }.bind(this),
  590. }).always(function () {
  591. this.setState({
  592. loading: false
  593. });
  594. }.bind(this));
  595. },
  596. //输入转交人输入框失去焦点是判断客户是否存在
  597. selectAuto(value,options){
  598. this.setState({
  599. auto:value
  600. })
  601. },
  602. blurChange(e){
  603. let theType='';
  604. let contactLists=this.state.customerArr||[];
  605. if (e) {
  606. contactLists.map(function (item) {
  607. if (item.name == e.toString()) {
  608. theType = item.id;
  609. }
  610. });
  611. }
  612. this.setState({
  613. theTypes:theType
  614. })
  615. },
  616. //值改变时请求客户名称
  617. httpChange(e){
  618. if(e.length>=1){
  619. this.supervisor(e);
  620. }
  621. this.setState({
  622. auto:e
  623. })
  624. },
  625. //转交
  626. changeAssigner() {
  627. if(this.state.theTypes){
  628. this.setState({
  629. selectedRowKeys: [],
  630. });
  631. let id;
  632. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  633. let rowItem = this.state.selectedRows[idx];
  634. if(rowItem.id) {
  635. id=rowItem.id;
  636. };
  637. };
  638. $.ajax({
  639. method: "post",
  640. dataType: "json",
  641. crossDomain: false,
  642. url: globalConfig.context + "/api/admin/customer/updateInformationMaintainerr",
  643. data: {
  644. id: id, //客户ID
  645. aid: this.state.theTypes, //指定转交人的ID
  646. }
  647. }).done(function(data) {
  648. if(!data.error.length) {
  649. message.success('转交成功!');
  650. this.setState({
  651. auto:'',
  652. loading: false,
  653. });
  654. } else {
  655. message.warning(data.error[0].message);
  656. };
  657. this.loadData(this.state.ispage);
  658. }.bind(this));
  659. }else{
  660. message.warning('请输入转交人姓名')
  661. }
  662. },
  663. //详情打开
  664. visitOk(e) {
  665. this.setState({
  666. visitModul: false
  667. });
  668. },
  669. //详情关闭
  670. visitCancel(e) {
  671. this.setState({
  672. visitModul: false,
  673. callnub:"0"
  674. });
  675. },
  676. getOrgCodeUrl(e) {
  677. this.setState({ orgCodeUrl: e });
  678. },
  679. getCompanyLogoUrl(e) {
  680. this.setState({ companyLogoUrl: e });
  681. },
  682. componentWillReceiveProps(nextProps) {
  683. if(nextProps.ApiUrl!=this.props.ApiUrl) {
  684. this.state.nameSearch = '';
  685. this.state.addressSearch = [];
  686. this.state.provinceSearch = undefined;
  687. this.state.citySearch = undefined;
  688. this.state.releaseDate[0] = undefined;
  689. this.state.releaseDate[1] = undefined;
  690. this.loadData(null,nextProps.ApiUrl);
  691. };
  692. },
  693. callback(e) {
  694. if(e == '0') {
  695. this.setState({
  696. callnub: e,
  697. })
  698. }
  699. if(e == '1') {
  700. this.setState({
  701. callnub: e,
  702. })
  703. this.loadDatas();
  704. }
  705. },
  706. //发布成果
  707. addClick() {
  708. this.state.RowData = {};
  709. this.setState({
  710. showDesc: true,
  711. });
  712. },
  713. //关闭发布成果
  714. closeDesc(e, s) {
  715. this.state.showDesc = e;
  716. if (s) {
  717. this.loadDatas();
  718. };
  719. },
  720. tableRowClickDate(record, index) {
  721. this.state.RowData = record;
  722. if(index!=undefined){
  723. this.setState({
  724. showDesc: true
  725. });
  726. }
  727. },
  728. render() {
  729. const {
  730. RangePicker,
  731. MonthPicker
  732. } = DatePicker;
  733. const formItemLayout = {
  734. labelCol: { span: 8 },
  735. wrapperCol: { span: 14 },
  736. };
  737. const FormItem = Form.Item;
  738. const rowSelection = {
  739. selectedRowKeys: this.state.selectedRowKeys,
  740. onChange: (selectedRowKeys, selectedRows) => {
  741. this.setState({
  742. modalVisible:false,
  743. selectedRows: selectedRows.slice(-1),
  744. selectedRowKeys: selectedRowKeys.slice(-1)
  745. });
  746. },
  747. onSelect: (recordt, selected, selectedRows) => {
  748. this.setState({
  749. modalVisible:false,
  750. recordt: recordt.id
  751. })
  752. },
  753. };
  754. const hasSelected = this.state.selectedRowKeys.length > 0;
  755. const dataSources=this.state.customerArr || [];
  756. const options = dataSources.map((group) =>
  757. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  758. )
  759. const intentionState = this.props.intentionState ||'';
  760. return(
  761. <div className="user-content" >
  762. <div className="content-title">
  763. <span>客户资料管理</span>
  764. </div>
  765. <div className="user-search">
  766. <Input placeholder="客户名称"
  767. value={this.state.nameSearch}
  768. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  769. <Select placeholder="省"
  770. style={{ width: 80 }}
  771. value={this.state.provinceSearch}
  772. onChange={(e) => {this.setState({ provinceSearch: e});}}>
  773. {this.state.Provinces}
  774. </Select>
  775. <span style={{marginRight:'10px'}}>
  776. <Cascader options={citySelect()} value={this.state.addressSearch} placeholder="选择城市"
  777. onChange={(e,pre) => { this.setState({ addressSearch: e }) }} />
  778. </span>
  779. <Select placeholder="选择资料质量" style={{ width: 120 }}
  780. value={this.state.dataGrade}
  781. onChange={(e) => { this.setState({ dataGrade: e }) }}>
  782. <Select.Option value="0" >有效资料</Select.Option>
  783. <Select.Option value="1" >优质资料</Select.Option>
  784. </Select>
  785. <RangePicker style={{marginRight:'10px'}}
  786. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  787. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  788. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  789. <Button type="primary" onClick={this.search}>搜索</Button>
  790. <Button onClick={this.reset}>重置</Button>
  791. </div>
  792. <div className="patent-table">
  793. <Spin spinning={this.state.loading}>
  794. <Table columns={this.state.columns}
  795. dataSource={this.state.dataSource}
  796. rowSelection={rowSelection}
  797. pagination={this.state.pagination}
  798. onRowClick={this.tableRowClick}
  799. />
  800. </Spin>
  801. </div>
  802. <Modal
  803. className="customeDetails"
  804. footer=''
  805. title="客户资料"
  806. width='1000px'
  807. visible={this.state.visitModul}
  808. onOk={this.visitOk}
  809. onCancel={this.visitCancel}
  810. >
  811. <Tabs onChange={this.callback} activeKey={this.state.callnub}>
  812. <TabPane tab="基本信息" key="0">
  813. <div>
  814. <Form layout="horizontal" onSubmit={this.newSubmit} id="demand-form">
  815. <Spin spinning={this.state.loading}>
  816. <div className="clearfix" >
  817. <FormItem className="half-item"
  818. {...formItemLayout}
  819. label="客户姓名"
  820. >
  821. <span>{this.state.identifyName}</span>
  822. </FormItem>
  823. <FormItem className="half-item"
  824. {...formItemLayout}
  825. label="资料所属人"
  826. >
  827. <span>{this.state.informationMaintainerName}</span>
  828. </FormItem>
  829. </div>
  830. <div className="clearfix" >
  831. <FormItem className="half-item"
  832. {...formItemLayout}
  833. label="行业">
  834. <Select placeholder="选择行业" value={this.state.industry} style={{width:'95%'}}
  835. onChange={(e)=>{this.setState({industry:e})}}>
  836. {
  837. industry.map(function (item) {
  838. return <Select.Option key={item.value} >{item.key}</Select.Option>
  839. })
  840. }
  841. </Select>
  842. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  843. </FormItem>
  844. <FormItem className="half-item"
  845. {...formItemLayout}
  846. label="社会属性"
  847. >
  848. <Select placeholder="客户社会属性" value={this.state.societyTag} style={{width:'95%'}}
  849. onChange={(e)=>{this.setState({societyTag:e})}}>
  850. {
  851. socialAttribute.map(function (item) {
  852. return <Select.Option key={item.value} >{item.key}</Select.Option>
  853. })
  854. }
  855. </Select>
  856. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  857. </FormItem>
  858. <FormItem className="half-item"
  859. {...formItemLayout}
  860. label="省-市-区"
  861. >
  862. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'95%'}}
  863. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  864. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  865. </FormItem>
  866. <FormItem className="half-item"
  867. {...formItemLayout}
  868. label="注册资本"
  869. >
  870. <Input placeholder="注册资本" style={{width:'90%'}} value={this.state.registeredCapital} onChange={(e) => {
  871. this.setState({ registeredCapital: e.target.value })}}/>万
  872. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  873. </FormItem>
  874. <div className='clearfix'>
  875. <FormItem
  876. labelCol={{ span:4 }}
  877. wrapperCol={{ span: 20 }}
  878. label="公司主营产品" >
  879. <Input type="textarea" rows={2} value={this.state.businessScope} style={{width:'95%'}}
  880. onChange={(e,pre) => { this.setState({ businessScope: e.target.value })}}/>
  881. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  882. </FormItem>
  883. </div>
  884. <div className='clearfix'>
  885. <FormItem
  886. labelCol={{ span:4 }}
  887. wrapperCol={{ span: 20 }}
  888. label="已有知识产权情况" >
  889. <Input type="textarea" rows={2} value={this.state.intellectualProperty} style={{width:'95%'}}
  890. onChange={(e,pre) => { this.setState({ intellectualProperty: e.target.value })}}/>
  891. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  892. </FormItem>
  893. </div>
  894. <FormItem className="half-item"
  895. {...formItemLayout}
  896. label="通信地址"
  897. >
  898. <Input placeholder="客户通信地址" value={this.state.postalAddress}
  899. onChange={(e,pre) => { this.setState({ postalAddress: e.target.value }) }}/>
  900. </FormItem>
  901. <FormItem className="half-item"
  902. {...formItemLayout}
  903. label="固定电话"
  904. >
  905. <Input placeholder="客户固定电话" value={this.state.contactsFixedTel}
  906. onChange={(e) => { this.setState({ contactsFixedTel: e.target.value }) }}/>
  907. </FormItem>
  908. <FormItem className="half-item"
  909. {...formItemLayout}
  910. label="客户传真"
  911. >
  912. <Input placeholder="客户传真" value={this.state.contactsFax}
  913. onChange={(e) => { this.setState({ contactsFax: e.target.value })}}/>
  914. </FormItem>
  915. <FormItem className="half-item"
  916. {...formItemLayout}
  917. label="企业人数"
  918. >
  919. <Input placeholder="单位规模" value={this.state.enterpriseScale} onChange={(e) => {
  920. this.setState({ enterpriseScale: e.target.value })}}/>
  921. </FormItem>
  922. <FormItem className="half-item"
  923. {...formItemLayout}
  924. label="法人名称"
  925. >
  926. <Input placeholder="法人名称" value={this.state.legalPerson} onChange={(e) => {
  927. this.setState({ legalPerson: e.target.value })}}/>
  928. </FormItem>
  929. <FormItem className="half-item"
  930. {...formItemLayout}
  931. label="法人身份证"
  932. >
  933. <Input placeholder="法人身份证" value={this.state.legalPersonIdCard} onChange={(e) => {
  934. this.setState({ legalPersonIdCard: e.target.value })}}/>
  935. </FormItem>
  936. <FormItem className="half-item"
  937. {...formItemLayout}
  938. label="主要联系人"
  939. >
  940. <Input placeholder="主要联系人" value={this.state.contacts} onChange={(e) => {
  941. this.setState({ contacts: e.target.value })}}/>
  942. </FormItem>
  943. <FormItem className="half-item"
  944. {...formItemLayout}
  945. label="主要联系人号码"
  946. >
  947. <Input placeholder="主要联系人号码" value={this.state.contactMobile} onChange={(e) => {
  948. this.setState({ contactMobile: e.target.value })}}/>
  949. </FormItem>
  950. <FormItem className="half-item"
  951. {...formItemLayout}
  952. label="法人电话"
  953. >
  954. <Input placeholder="法人电话" value={this.state.legalPersonTel} onChange={(e) => {
  955. this.setState({ legalPersonTel: e.target.value })}}/>
  956. </FormItem>
  957. <FormItem className="half-item"
  958. {...formItemLayout}
  959. label="法人电子邮箱"
  960. >
  961. <Input placeholder="法人电子邮箱" value={this.state.legalPersonEmail}
  962. onChange={(e) => {this.setState({legalPersonEmail: e.target.value })}}/>
  963. </FormItem>
  964. <FormItem className="half-item"
  965. {...formItemLayout}
  966. label="社会统一信用机构代码"
  967. >
  968. <Input placeholder="社会统一信用机构代码" value={this.state.orgCode} onChange={(e) => {
  969. this.setState({ orgCode: e.target.value })}}/>
  970. </FormItem>
  971. <div className='clearfix'>
  972. <FormItem
  973. labelCol={{ span:4 }}
  974. wrapperCol={{ span: 18 }}
  975. label="客户简介" >
  976. <Input type="textarea" rows={3} value={this.state.introduction}
  977. onChange={(e,pre) => { this.setState({ introduction: e.target.value })}}/>
  978. </FormItem>
  979. </div>
  980. <div className="clearfix pictures">
  981. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginLeft:'95px'}}
  982. labelCol={{ span: 8 }}
  983. wrapperCol={{ span: 10 }}
  984. label="机构证书(PIC)" >
  985. <PicturesWall
  986. fileList={this.getOrgCodeUrl}
  987. pictureUrl={this.state.orgCodeUrl} />
  988. <p>建议:图片要清晰。</p>
  989. </FormItem>
  990. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginTop:'20px'}}
  991. labelCol={{ span: 8 }}
  992. wrapperCol={{ span: 10 }}
  993. label="单位LOGO" >
  994. <PicturesWall
  995. fileList={this.getCompanyLogoUrl}
  996. pictureUrl={this.state.companyLogoUrl} />
  997. <p>建议:图片要清晰。</p>
  998. </FormItem>
  999. </div>
  1000. <div style={{fontSize:'18px',marginLeft:'50px',marginTop:'15px',marginBottom:'10px',color:"red",fontWeight:"bold"}}>签单客户信息完善(完善以下信息才能开单)</div>
  1001. <div className='clearfix' >
  1002. <FormItem className="half-item"
  1003. {...formItemLayout}
  1004. label="上年度销售额"
  1005. >
  1006. <Input ref='consul' placeholder="请输入上年度销售额" value={this.state.yearSalesAmount} style={{width:'95%'}}
  1007. onChange={(e) => {this.setState({yearSalesAmount: e.target.value })}}/>万
  1008. </FormItem>
  1009. <FormItem className="half-item"
  1010. {...formItemLayout}
  1011. label="上年度研发费用"
  1012. >
  1013. <Input ref='consul' placeholder="请输入上年度研发费用" value={this.state.lastYearResearchAmount} style={{width:'95%'}}
  1014. onChange={(e) => {this.setState({lastYearResearchAmount: e.target.value })}}/>万
  1015. </FormItem>
  1016. <FormItem className="half-item"
  1017. {...formItemLayout}
  1018. label="上年度总资产情况"
  1019. >
  1020. <Input ref='consul' placeholder="上年度总资产情况" value={this.state.assets} style={{width:'95%'}}
  1021. onChange={(e) => {this.setState({assets: e.target.value })}}/>万
  1022. </FormItem>
  1023. <FormItem className="half-item"
  1024. {...formItemLayout}
  1025. label="客户信用等级"
  1026. >
  1027. <Select placeholder="客户信用等级" value={this.state.creditRating}
  1028. onChange={(e)=>{this.setState({creditRating:e})}}>
  1029. {
  1030. slcRedit.map(function (item) {
  1031. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1032. })
  1033. }
  1034. </Select>
  1035. </FormItem>
  1036. <div className='clearfix'>
  1037. <FormItem
  1038. labelCol={{ span:4 }}
  1039. wrapperCol={{ span: 19 }}
  1040. label="核心技术" >
  1041. <Input type="textarea" rows={3} value={this.state.coreTechnology}
  1042. onChange={(e,pre) => { this.setState({ coreTechnology: e.target.value })}}/>
  1043. </FormItem>
  1044. </div>
  1045. <div className='clearfix'>
  1046. <FormItem
  1047. labelCol={{ span:4 }}
  1048. wrapperCol={{ span: 19 }}
  1049. label="企业资质情况" >
  1050. <Input type="textarea" rows={3} value={this.state.qualification} placeholder="请按如下格式填写:资质名称+获得时间+拥有人+发证机构"
  1051. onChange={(e,pre) => { this.setState({ qualification: e.target.value })}}/>
  1052. </FormItem>
  1053. </div>
  1054. <div className='clearfix'>
  1055. <FormItem
  1056. labelCol={{ span:4 }}
  1057. wrapperCol={{ span: 19 }}
  1058. label="客户已做项目" >
  1059. <Input type="textarea" rows={3} value={this.state.accomplishSituation} placeholder="请按如下格式填写:项目类型+主管部门+申报时间+立项情况+验收情况"
  1060. onChange={(e,pre) => { this.setState({ accomplishSituation: e.target.value })}}/>
  1061. </FormItem>
  1062. </div>
  1063. <div className='clearfix'>
  1064. <FormItem
  1065. labelCol={{ span:4 }}
  1066. wrapperCol={{ span: 19 }}
  1067. label="企业高企合作情况" >
  1068. <Input type="textarea" rows={3} value={this.state.cooperationSituation}
  1069. onChange={(e,pre) => { this.setState({ cooperationSituation: e.target.value })}}/>
  1070. </FormItem>
  1071. </div>
  1072. </div>
  1073. </div>
  1074. </Spin>
  1075. </Form>
  1076. </div>
  1077. </TabPane>
  1078. <TabPane tab="知识产权列表" key="1">
  1079. <Spin spinning={this.state.loading}>
  1080. <Table columns={this.state.columnsDate}
  1081. dataSource={this.state.dataSourceDate}
  1082. rowSelection={rowSelection}
  1083. pagination={this.state.paginationDate}
  1084. onRowClick={this.tableRowClickDate} />
  1085. </Spin>
  1086. </TabPane>
  1087. </Tabs>
  1088. </Modal>
  1089. <TechAchievementDesc
  1090. data={this.state.RowData}
  1091. detailApiUrl={this.props['data-detailApiUrl']}
  1092. achievementCategoryOption={this.state.achievementCategoryOption}
  1093. showDesc={this.state.showDesc}
  1094. uid={this.state.uid}
  1095. closeDesc={this.closeDesc}
  1096. loadDatas={this.loadDatas}
  1097. />
  1098. </div >
  1099. );
  1100. }
  1101. }));
  1102. export default IntentionCustomer;