crm.jsx 45 KB

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