crm.jsx 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  1. import React from 'react';
  2. import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message, DatePicker, Upload, Form ,Modal,Tabs,Card } from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import TechAchievementDesc from '@/manageCenter/achievement/crmAchievement.jsx';
  7. import { citySelect, provinceList ,areaSelect} from '@/NewDicProvinceList';
  8. import { socialAttribute, industry, auditStatusL, lvl, currentMember ,slcRedit,dataGrade} from '@/dataDic.js';
  9. import { getSocialAttribute, beforeUploadFile,splitUrl ,getSlcRedit,getDataGrade,getAchievementCategory,getTechAuditStatus,getboutique} from '@/tools.js';
  10. import './customer.less';
  11. const TabPane = Tabs.TabPane;
  12. //图片组件
  13. const PicturesWall = React.createClass({
  14. getInitialState() {
  15. return {
  16. previewVisible: false,
  17. previewImage: '',
  18. fileList: [],
  19. }
  20. },
  21. handleCancel() {
  22. this.setState({
  23. previewVisible: false
  24. })
  25. },
  26. handlePreview(file) {
  27. this.setState({
  28. previewImage: file.url || file.thumbUrl,
  29. previewVisible: true,
  30. });
  31. },
  32. handleChange(info) {
  33. let fileList = info.fileList;
  34. this.setState({
  35. fileList
  36. });
  37. this.props.fileList(fileList);
  38. },
  39. componentWillReceiveProps(nextProps) {
  40. this.state.fileList = nextProps.pictureUrl;
  41. },
  42. render() {
  43. const {
  44. previewVisible,
  45. previewImage,
  46. fileList
  47. } = this.state;
  48. const uploadButton = (
  49. <div>
  50. <Icon type="plus" />
  51. <div className="ant-upload-text">点击上传</div>
  52. </div>
  53. );
  54. return(
  55. <div style={{display:"inline-block"}}>
  56. <Upload
  57. action={globalConfig.context + "/api/admin/customer/uploadCustomerImg"}
  58. data={{ 'sign': '' }}
  59. listType="picture-card"
  60. fileList={fileList}
  61. onPreview={this.handlePreview}
  62. onChange={this.handleChange} >
  63. {fileList.length >= 1 ? null : uploadButton}
  64. </Upload>
  65. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  66. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  67. </Modal>
  68. </div>
  69. );
  70. }
  71. });
  72. const IntentionCustomer = Form.create()(React.createClass({
  73. loadData(pageNo, apiUrl) {
  74. this.setState({
  75. visitModul:false,
  76. loading: true,
  77. ispage:pageNo,
  78. modalVisible:false
  79. });
  80. $.ajax({
  81. method: "post",
  82. dataType: "json",
  83. crossDomain: false,
  84. url: globalConfig.context +"/api/admin/customer/listCustomerInformation",
  85. data: {
  86. pageNo: pageNo || 1,
  87. pageSize: this.state.pagination.pageSize,
  88. name: this.state.nameSearch,
  89. dataGrade: this.state.dataGrade,
  90. follow: this.state.follow,
  91. province: !(this.state.addressSearch).length ? this.state.provinceSearch : this.state.addressSearch[0],
  92. city: !(this.state.addressSearch).length ? '' : this.state.addressSearch[1],
  93. startDate: this.state.releaseDate[0],
  94. endDate: this.state.releaseDate[1],
  95. },
  96. success: function(data) {
  97. let theArr = [];
  98. if(data.error.length || data.data.list == "") {
  99. if(data.error && data.error.length) {
  100. message.warning(data.error[0].message);
  101. };
  102. } else {
  103. for(let i = 0; i < data.data.list.length; i++) {
  104. let thisdata = data.data.list[i];
  105. let diqu=(thisdata.province==null?"":thisdata.province)+(thisdata.city==null?"":"-"+thisdata.city)+(thisdata.area==null?"":"-"+thisdata.area);
  106. theArr.push({
  107. key: i,
  108. id: thisdata.id,//用户ID
  109. type:thisdata.type,//类型
  110. name: thisdata.name,//用户名称
  111. diqu: diqu,//省市区
  112. industry: thisdata.industry,//行业
  113. contacts: thisdata.contacts,//联系人
  114. contactMobile: thisdata.contactMobile,//联系人电话
  115. createTime: thisdata.createTime,//行业
  116. });
  117. };
  118. this.state.pagination.current = data.data.pageNo;
  119. this.state.pagination.total = data.data.totalCount;
  120. };
  121. if(data.data&&data.data.list&&!data.data.list.length){
  122. this.state.pagination.current=0
  123. this.state.pagination.total=0
  124. }
  125. this.setState({
  126. dataSource: theArr,
  127. pageNo: pageNo,
  128. pagination: this.state.pagination,
  129. selectedRowKeys:[]
  130. });
  131. }.bind(this),
  132. }).always(function() {
  133. this.setState({
  134. loading: false
  135. });
  136. }.bind(this));
  137. },
  138. loadDatas(pageNos) {
  139. this.setState({
  140. loading: true,
  141. });
  142. $.ajax({
  143. method: "get",
  144. dataType: "json",
  145. crossDomain: false,
  146. url: globalConfig.context + "/api/admin/achievement/listUserAchievement",
  147. data: {
  148. pageNo: pageNos || 1,
  149. pageSize: this.state.paginationDate.pageSize,
  150. uid:this.state.uid,
  151. },
  152. success: function (data) {
  153. let theArr = [];
  154. if (!data.data || !data.data.list) {
  155. if (data.error && data.error.length) {
  156. message.warning(data.error[0].message);
  157. };
  158. } else {
  159. for (let i = 0; i < data.data.list.length; i++) {
  160. let thisdata = data.data.list[i];
  161. theArr.push({
  162. key: i,
  163. id: thisdata.id,
  164. serialNumber: thisdata.serialNumber,
  165. dataCategory: thisdata.dataCategory,
  166. name: thisdata.name,
  167. keyword: thisdata.keyword,
  168. theName: thisdata.username || thisdata.ownerName,
  169. category: thisdata.category,
  170. ownerName: thisdata.username ? thisdata.username : thisdata.ownerName,
  171. ownerType: thisdata.ownerType,
  172. ownerMobile: thisdata.ownerMobile,
  173. status: thisdata.status,
  174. releaseDate: thisdata.releaseDate,
  175. releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
  176. auditStatus: thisdata.auditStatus,
  177. boutique: thisdata.boutique,
  178. hot: thisdata.hot,
  179. techBrokerId:thisdata.techBrokerId,
  180. createTimeFormattedDate: thisdata.createTimeFormattedDate,
  181. remark:thisdata.remark
  182. });
  183. };
  184. this.state.paginationDate.current = data.data.pageNo;
  185. this.state.paginationDate.total = data.data.totalCount;
  186. };
  187. this.setState({
  188. dataSourceDate: theArr,
  189. pageNos: pageNos,
  190. paginationDate: this.state.paginationDate
  191. });
  192. }.bind(this),
  193. }).always(function () {
  194. this.setState({
  195. loading: false
  196. });
  197. }.bind(this));
  198. },
  199. getInitialState() {
  200. return {
  201. addressSearch: [],
  202. orgCodeUrl: [],
  203. companyLogoUrl: [],
  204. visible: false,
  205. releaseDate: [],
  206. visitModul:false,
  207. detailApi:'',
  208. followData:{},
  209. selectedRowKeys: [],
  210. selectedRows: [],
  211. loading: false,
  212. callnub:"0",
  213. modalVisible:false,
  214. pagination: {
  215. defaultCurrent: 1,
  216. defaultPageSize: 10,
  217. showQuickJumper: true,
  218. pageSize: 10,
  219. onChange: function(page) {
  220. this.loadData(page);
  221. }.bind(this),
  222. showTotal: function(total) {
  223. return '共' + total + '条数据';
  224. }
  225. },
  226. paginationDate: {
  227. defaultCurrent: 1,
  228. defaultPageSize: 10,
  229. showQuickJumper: true,
  230. pageSize: 10,
  231. onChange: function(page) {
  232. this.loadDatas(page);
  233. }.bind(this),
  234. showTotal: function(total) {
  235. return '共' + total + '条数据';
  236. }
  237. },
  238. columns: [{
  239. title: '客户名称',
  240. dataIndex: 'name',
  241. key: 'name',
  242. }, {
  243. title: '地区',
  244. dataIndex: 'diqu',
  245. key: 'diqu',
  246. }, {
  247. title: '联系人',
  248. dataIndex: 'contacts',
  249. key: 'contacts',
  250. },
  251. {
  252. title: '行业',
  253. dataIndex: 'industry',
  254. key: 'industry'
  255. },
  256. {
  257. title: '联系电话',
  258. dataIndex: 'contactMobile',
  259. key: 'contactMobile',
  260. },
  261. {
  262. title: '创建时间',
  263. dataIndex: 'createTime',
  264. key: 'createTime',
  265. }
  266. ],
  267. data: [],
  268. dataman: [],
  269. dataSource: [],
  270. visitArrList: [],
  271. columnsDate: [
  272. {
  273. title: '编号',
  274. dataIndex: 'serialNumber',
  275. key: 'serialNumber',
  276. }, {
  277. title: '名称',
  278. dataIndex: 'name',
  279. key: 'name',
  280. }, {
  281. title: '关键字',
  282. dataIndex: 'keyword',
  283. key: 'keyword',
  284. }, {
  285. title: '类型',
  286. dataIndex: 'category',
  287. key: 'category',
  288. render: text => { return getAchievementCategory(text); }
  289. },{
  290. title: '审核状态',
  291. dataIndex: 'auditStatus',
  292. key: 'auditStatus',
  293. render: text => { return getTechAuditStatus(text) }
  294. },
  295. {
  296. title: '是否精品',
  297. dataIndex: 'boutique',
  298. key: 'boutique',
  299. render: text => { return getboutique(text) }
  300. },
  301. {
  302. title: '发布时间',
  303. dataIndex: 'releaseDateFormattedDate',
  304. key: 'releaseDateFormattedDate',
  305. },{
  306. title: '录入时间',
  307. dataIndex: 'createTimeFormattedDate',
  308. key: 'createTimeFormattedDate',
  309. },
  310. ],
  311. dataSourceDate: [],
  312. };
  313. },
  314. componentWillMount() {
  315. //城市
  316. let Province = [];
  317. provinceList.map(function(item) {
  318. var id = String(item.id)
  319. Province.push(
  320. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  321. )
  322. });
  323. //行业
  324. let intentionalArr = [];
  325. industry.map(function(item) {
  326. intentionalArr.push(
  327. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  328. )
  329. });
  330. //会员等级
  331. let lvlArr = [];
  332. lvl.map(function(item) {
  333. lvlArr.push(
  334. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  335. )
  336. });
  337. //会员状态customerStatus
  338. let currentMemberArr = [];
  339. currentMember.map(function(item) {
  340. currentMemberArr.push(
  341. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  342. )
  343. });
  344. this.state.Provinces = Province;
  345. this.state.intentionalOption = intentionalArr;
  346. this.state.lvlArrOption = lvlArr;
  347. this.state.currentMemberArrOption = currentMemberArr;
  348. this.loadData();
  349. },
  350. search() {
  351. this.loadData();
  352. },
  353. reset() {
  354. this.state.nameSearch = '';
  355. this.state.addressSearch = [];
  356. this.state.dataGrade=undefined;
  357. this.state.follow=undefined;
  358. this.state.provinceSearch = undefined;
  359. this.state.citySearch = undefined;
  360. this.state.releaseDate[0] = undefined;
  361. this.state.releaseDate[1] = undefined;
  362. this.loadData();
  363. },
  364. //列表详情
  365. details(id) {
  366. $.ajax({
  367. method: "get",
  368. dataType: "json",
  369. crossDomain: false,
  370. url: globalConfig.context +"/api/admin/customer/findOrganizationCustomerDetail",
  371. data: {
  372. uid:id
  373. },
  374. success: function(data) {
  375. let thisDetail= data.data;
  376. if(data.error.length || data.data.list == "") {
  377. if(data.error && data.error.length) {
  378. message.warning(data.error[0].message);
  379. };
  380. } else {
  381. let ProvinceCityArr = [];
  382. let ProvinceS = thisDetail.locationProvince; //省
  383. let citys = thisDetail.locationCity;//市
  384. let Areas = thisDetail.locationArea;//区
  385. ProvinceCityArr.push(ProvinceS, citys, Areas);
  386. this.setState({
  387. detailId:thisDetail.id,//详情ID
  388. identifyName:thisDetail.identifyName,//客户名称
  389. uid:thisDetail.uid,//客户ID
  390. societyTag:thisDetail.societyTag,//社会标签
  391. companyLogoUrl:thisDetail.companyLogoUrl? splitUrl(thisDetail.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],//公司LOGO
  392. introduction:thisDetail.introduction,//介绍
  393. industry:thisDetail.industry?thisDetail.industry.toString():"",//行业
  394. locationProvince:thisDetail.locationProvince,//省
  395. locationCity:thisDetail.locationCity,//市
  396. locationArea:thisDetail.locationArea,//区
  397. ProvinceCity: ProvinceCityArr[0]!=null?ProvinceCityArr:undefined,//省市区
  398. postalAddress:thisDetail.postalAddress,//通讯地址
  399. contactsFixedTel:thisDetail.contactsFixedTel,//固定电话
  400. contactsFax:thisDetail.contactsFax,//传真地址
  401. registeredCapital:thisDetail.registeredCapital,//注册资金
  402. enterpriseScale:thisDetail.enterpriseScale,//企业规模
  403. legalPerson:thisDetail.legalPerson,//法人
  404. legalPersonIdCard:thisDetail.legalPersonIdCard,//法人身份证
  405. legalPersonTel:thisDetail.legalPersonTel,//法人联系电话
  406. legalPersonEmail:thisDetail.legalPersonEmail,//法人联系邮箱
  407. highTechZone:thisDetail.highTechZone,//是否高新
  408. listed:thisDetail.listed,//是否高新
  409. international:thisDetail.international,//是否国际化
  410. orgCode:thisDetail.orgCode,//社会统一机构
  411. orgCodeUrl:thisDetail.orgCodeUrl? splitUrl(thisDetail.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],//社会统一机构地址
  412. businessScope:thisDetail.businessScope,//业务范围
  413. contacts:thisDetail.contacts,//主要联系人姓名
  414. contactMobile:thisDetail.contactMobile,//主要联系人电话
  415. investment:thisDetail.investment,//投资机构
  416. businessAudit:thisDetail.businessAudit,//业务认证
  417. auditStatus:thisDetail.auditStatus,//实名认证
  418. intellectualProperty:thisDetail.intellectualProperty,//已有知识产权情况
  419. yearSalesAmount:thisDetail.yearSalesAmount,//年度销售额
  420. lastYearResearchAmount:thisDetail.lastYearResearchAmount,//上年度研发费用
  421. assets:thisDetail.assets,//总资产
  422. qualification:thisDetail.qualification,//企业资质情况
  423. cooperationSituation:thisDetail.cooperationSituation,//企业与高校院所
  424. informationMaintainer:thisDetail.informationMaintainer,//资料维护人
  425. informationMaintainerName:thisDetail.informationMaintainerName,//资料维护人
  426. coreTechnology:thisDetail.coreTechnology,//核心技术
  427. accomplishSituation:thisDetail.accomplishSituation,//客户已完成项目情况
  428. creditRating:thisDetail.creditRating?thisDetail.creditRating.toString():"",//信用等级
  429. });
  430. }}.bind(this),
  431. }).always(function() {
  432. this.setState({
  433. loading: false
  434. });
  435. }.bind(this));
  436. },
  437. //基本信息提交
  438. newSubmit(e) {
  439. e.preventDefault();
  440. if(!this.state.industry) {
  441. message.warning('请选择行业');
  442. return false;
  443. };
  444. if(!this.state.societyTag) {
  445. message.warning('请选择社会属性');
  446. return false;
  447. };
  448. if(!this.state.ProvinceCity[1]) {
  449. message.warning('请选择地区');
  450. return false;
  451. };
  452. if(!this.state.registeredCapital) {
  453. message.warning('请填写注册资本');
  454. return false;
  455. };
  456. if(!this.state.businessScope) {
  457. message.warning('请填写公司主营产品');
  458. return false;
  459. };
  460. 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(this.state.pageNo);
  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.pageNo);
  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. <Select placeholder="是否面谈客户" style={{ width: 120 }}
  786. value={this.state.follow}
  787. onChange={(e) => { this.setState({ follow: e }) }}>
  788. <Select.Option value="0" >否</Select.Option>
  789. <Select.Option value="1" >是</Select.Option>
  790. </Select>
  791. <RangePicker style={{marginRight:'10px'}}
  792. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  793. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  794. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  795. <Button type="primary" onClick={this.search}>搜索</Button>
  796. <Button onClick={this.reset}>重置</Button>
  797. <AutoComplete
  798. className="certain-category-search"
  799. dropdownClassName="certain-category-search-dropdown"
  800. dropdownMatchSelectWidth={false}
  801. dropdownStyle={{ width: 120 }}
  802. style={{ width: '120px'}}
  803. dataSource={options}
  804. placeholder="输入转交人姓名"
  805. value={this.state.auto}
  806. onChange={this.httpChange}
  807. filterOption={true}
  808. onBlur={this.blurChange}
  809. onSelect={this.selectAuto}
  810. disabled={!hasSelected}
  811. >
  812. <Input />
  813. </AutoComplete>
  814. <Button type="primary" onClick={this.changeAssigner} disabled={!hasSelected} >转交</Button>
  815. </div>
  816. <div className="patent-table">
  817. <Spin spinning={this.state.loading}>
  818. <Table columns={this.state.columns}
  819. dataSource={this.state.dataSource}
  820. rowSelection={rowSelection}
  821. pagination={this.state.pagination}
  822. onRowClick={this.tableRowClick}
  823. />
  824. </Spin>
  825. </div>
  826. <Modal
  827. className="customeDetails"
  828. footer=''
  829. title="客户资料"
  830. width='1000px'
  831. visible={this.state.visitModul}
  832. onOk={this.visitOk}
  833. onCancel={this.visitCancel}
  834. >
  835. <Tabs onChange={this.callback} activeKey={this.state.callnub}>
  836. <TabPane tab="基本信息" key="0">
  837. <div>
  838. <Form layout="horizontal" onSubmit={this.newSubmit} id="demand-form">
  839. <Spin spinning={this.state.loading}>
  840. <div style={{fontSize:'18px',marginLeft:'50px',marginTop:'15px',marginBottom:'10px',color:"red",fontWeight:"bold"}}>基本信息</div>
  841. <div className="clearfix" >
  842. <FormItem className="half-item"
  843. {...formItemLayout}
  844. label="客户姓名"
  845. >
  846. <span>{this.state.identifyName}</span>
  847. </FormItem>
  848. <FormItem className="half-item"
  849. {...formItemLayout}
  850. label="资料所属人"
  851. >
  852. <span>{this.state.informationMaintainerName}</span>
  853. </FormItem>
  854. </div>
  855. <div className="clearfix" >
  856. <FormItem className="half-item"
  857. {...formItemLayout}
  858. label="企业行业">
  859. <Select placeholder="选择行业" value={this.state.industry} style={{width:'95%'}}
  860. onChange={(e)=>{this.setState({industry:e})}}>
  861. {
  862. industry.map(function (item) {
  863. return <Select.Option key={item.value} >{item.key}</Select.Option>
  864. })
  865. }
  866. </Select>
  867. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  868. </FormItem>
  869. <FormItem className="half-item"
  870. {...formItemLayout}
  871. label="社会属性"
  872. >
  873. <Select placeholder="客户社会属性" value={this.state.societyTag} style={{width:'95%'}}
  874. onChange={(e)=>{this.setState({societyTag:e})}}>
  875. {
  876. socialAttribute.map(function (item) {
  877. return <Select.Option key={item.value} >{item.key}</Select.Option>
  878. })
  879. }
  880. </Select>
  881. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  882. </FormItem>
  883. <FormItem className="half-item"
  884. {...formItemLayout}
  885. label="省-市-区"
  886. >
  887. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'95%'}}
  888. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  889. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  890. </FormItem>
  891. <FormItem className="half-item"
  892. {...formItemLayout}
  893. label="注册资本"
  894. >
  895. <Input placeholder="注册资本" style={{width:'90%'}} value={this.state.registeredCapital} onChange={(e) => {
  896. this.setState({ registeredCapital: e.target.value }) }} />万
  897. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  898. </FormItem>
  899. <div className='clearfix'>
  900. <FormItem
  901. labelCol={{ span:4 }}
  902. wrapperCol={{ span: 20 }}
  903. label="主营产品" >
  904. <Input type="textarea" rows={2} value={this.state.businessScope} style={{width:'95%'}}
  905. onChange={(e,pre) => { this.setState({ businessScope: e.target.value })}}/>
  906. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  907. </FormItem>
  908. </div>
  909. <div style={{fontSize:'18px',marginLeft:'50px',marginTop:'15px',marginBottom:'10px',color:"red",fontWeight:"bold"}}>企业资料</div>
  910. <FormItem className="half-item"
  911. {...formItemLayout}
  912. label="通信地址"
  913. >
  914. <Input placeholder="客户通信地址" value={this.state.postalAddress}
  915. onChange={(e,pre) => { this.setState({ postalAddress: e.target.value }) }}/>
  916. </FormItem>
  917. <FormItem className="half-item"
  918. {...formItemLayout}
  919. label="固定电话"
  920. >
  921. <Input placeholder="客户固定电话" value={this.state.contactsFixedTel}
  922. onChange={(e) => { this.setState({ contactsFixedTel: e.target.value }) }}/>
  923. </FormItem>
  924. <FormItem className="half-item"
  925. {...formItemLayout}
  926. label="客户传真"
  927. >
  928. <Input placeholder="客户传真" value={this.state.contactsFax}
  929. onChange={(e) => { this.setState({ contactsFax: e.target.value })}}/>
  930. </FormItem>
  931. <FormItem className="half-item"
  932. {...formItemLayout}
  933. label="企业人数"
  934. >
  935. <Input placeholder="单位规模" value={this.state.enterpriseScale} onChange={(e) => {
  936. this.setState({ enterpriseScale: e.target.value })}}/>
  937. </FormItem>
  938. <FormItem className="half-item"
  939. {...formItemLayout}
  940. label="法人名称"
  941. >
  942. <Input placeholder="法人名称" value={this.state.legalPerson} onChange={(e) => {
  943. this.setState({ legalPerson: e.target.value })}}/>
  944. </FormItem>
  945. <FormItem className="half-item"
  946. {...formItemLayout}
  947. label="法人身份证"
  948. >
  949. <Input placeholder="法人身份证" value={this.state.legalPersonIdCard} onChange={(e) => {
  950. this.setState({ legalPersonIdCard: e.target.value })}}/>
  951. </FormItem>
  952. <FormItem className="half-item"
  953. {...formItemLayout}
  954. label="联系人"
  955. >
  956. <Input placeholder="联系人名称" value={this.state.contacts} onChange={(e) => {
  957. this.setState({ contacts: e.target.value })}}/>
  958. </FormItem>
  959. <FormItem className="half-item"
  960. {...formItemLayout}
  961. label="联系人号码"
  962. >
  963. <Input placeholder="联系人号码" value={this.state.contactMobile} onChange={(e) => {
  964. this.setState({ contactMobile: e.target.value })}}/>
  965. </FormItem>
  966. <FormItem className="half-item"
  967. {...formItemLayout}
  968. label="法人电话"
  969. >
  970. <Input placeholder="法人电话" value={this.state.legalPersonTel} onChange={(e) => {
  971. this.setState({ legalPersonTel: e.target.value })}}/>
  972. </FormItem>
  973. <FormItem className="half-item"
  974. {...formItemLayout}
  975. label="法人邮箱"
  976. >
  977. <Input placeholder="法人电子邮箱" value={this.state.legalPersonEmail}
  978. onChange={(e) => {this.setState({legalPersonEmail: e.target.value })}}/>
  979. </FormItem>
  980. <FormItem className="half-item"
  981. {...formItemLayout}
  982. label="社会统一信用机构代码"
  983. >
  984. <Input placeholder="社会统一信用机构代码" value={this.state.orgCode} onChange={(e) => {
  985. this.setState({ orgCode: e.target.value })}}/>
  986. </FormItem>
  987. <div className='clearfix'>
  988. <FormItem
  989. labelCol={{ span:4 }}
  990. wrapperCol={{ span: 18 }}
  991. label="客户简介" >
  992. <Input type="textarea" rows={3} value={this.state.introduction}
  993. onChange={(e,pre) => { this.setState({ introduction: e.target.value })}}/>
  994. </FormItem>
  995. </div>
  996. <div className="clearfix pictures">
  997. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginLeft:'95px'}}
  998. labelCol={{ span: 8 }}
  999. wrapperCol={{ span: 10 }}
  1000. label="机构证书(PIC)" >
  1001. <PicturesWall
  1002. fileList={this.getOrgCodeUrl}
  1003. pictureUrl={this.state.orgCodeUrl} />
  1004. <p>建议:图片要清晰。</p>
  1005. </FormItem>
  1006. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginTop:'20px'}}
  1007. labelCol={{ span: 8 }}
  1008. wrapperCol={{ span: 10 }}
  1009. label="单位LOGO" >
  1010. <PicturesWall
  1011. fileList={this.getCompanyLogoUrl}
  1012. pictureUrl={this.state.companyLogoUrl} />
  1013. <p>建议:图片要清晰。</p>
  1014. </FormItem>
  1015. </div>
  1016. <div style={{fontSize:'18px',marginLeft:'50px',marginTop:'15px',marginBottom:'10px',color:"red",fontWeight:"bold"}}>重要资料</div>
  1017. <div className='clearfix' >
  1018. <FormItem className="half-item"
  1019. {...formItemLayout}
  1020. label="上年度销售额"
  1021. >
  1022. <Input ref='consul' placeholder="请输入上年度销售额" value={this.state.yearSalesAmount} style={{width:'95%'}}
  1023. onChange={(e) => {this.setState({yearSalesAmount: e.target.value })}}/>万
  1024. </FormItem>
  1025. <FormItem className="half-item"
  1026. {...formItemLayout}
  1027. label="上年度研发费用"
  1028. >
  1029. <Input ref='consul' placeholder="请输入上年度研发费用" value={this.state.lastYearResearchAmount} style={{width:'95%'}}
  1030. onChange={(e) => {this.setState({lastYearResearchAmount: e.target.value })}}/>万
  1031. </FormItem>
  1032. <FormItem className="half-item"
  1033. {...formItemLayout}
  1034. label="客户信用等级"
  1035. >
  1036. <Select placeholder="客户信用等级" value={this.state.creditRating}
  1037. onChange={(e)=>{this.setState({creditRating:e})}}>
  1038. {
  1039. slcRedit.map(function (item) {
  1040. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1041. })
  1042. }
  1043. </Select>
  1044. </FormItem>
  1045. <FormItem className="half-item"
  1046. {...formItemLayout}
  1047. label="上年度总资产情况"
  1048. >
  1049. <Input ref='consul' placeholder="上年度总资产情况" value={this.state.assets} style={{width:'95%'}}
  1050. onChange={(e) => {this.setState({assets: e.target.value })}}/>万
  1051. </FormItem>
  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.coreTechnology}
  1058. onChange={(e,pre) => { this.setState({ coreTechnology: 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.qualification} placeholder="请按如下格式填写:资质名称+获得时间+拥有人+发证机构"
  1067. onChange={(e,pre) => { this.setState({ qualification: 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.accomplishSituation} placeholder="请按如下格式填写:项目类型+主管部门+申报时间+立项情况+验收情况"
  1076. onChange={(e,pre) => { this.setState({ accomplishSituation: e.target.value })}}/>
  1077. </FormItem>
  1078. </div>
  1079. <div className='clearfix'>
  1080. <FormItem
  1081. labelCol={{ span:4 }}
  1082. wrapperCol={{ span: 19 }}
  1083. label="高企合作情况" >
  1084. <Input type="textarea" rows={3} value={this.state.cooperationSituation}
  1085. onChange={(e,pre) => { this.setState({ cooperationSituation: e.target.value })}}/>
  1086. </FormItem>
  1087. </div>
  1088. </div>
  1089. <Button className="setSubmit" type="primary" htmlType="submit">保存</Button>
  1090. <Button type="ghost" onClick={this.visitCancel}>取消</Button>
  1091. </div>
  1092. </Spin>
  1093. </Form>
  1094. </div>
  1095. </TabPane>
  1096. <TabPane tab="知识产权列表" key="1">
  1097. <Button type="primary" className="addButton" onClick={this.addClick}>发布成果<Icon type="plus" /></Button>
  1098. <Spin spinning={this.state.loading}>
  1099. <Table columns={this.state.columnsDate}
  1100. dataSource={this.state.dataSourceDate}
  1101. rowSelection={rowSelection}
  1102. pagination={this.state.paginationDate}
  1103. onRowClick={this.tableRowClickDate} />
  1104. </Spin>
  1105. </TabPane>
  1106. </Tabs>
  1107. </Modal>
  1108. <TechAchievementDesc
  1109. data={this.state.RowData}
  1110. detailApiUrl={this.props['data-detailApiUrl']}
  1111. achievementCategoryOption={this.state.achievementCategoryOption}
  1112. showDesc={this.state.showDesc}
  1113. uid={this.state.uid}
  1114. closeDesc={this.closeDesc}
  1115. loadDatas={this.loadDatas}
  1116. />
  1117. </div >
  1118. );
  1119. }
  1120. }));
  1121. export default IntentionCustomer;