crmAll.jsx 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  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. 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. 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(pageNo) {
  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: pageNo || 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. paginationDate: this.state.paginationDate
  189. });
  190. }.bind(this),
  191. }).always(function () {
  192. this.setState({
  193. loading: false
  194. });
  195. }.bind(this));
  196. },
  197. getInitialState() {
  198. return {
  199. addressSearch: [],
  200. orgCodeUrl: [],
  201. companyLogoUrl: [],
  202. visible: false,
  203. releaseDate: [],
  204. visitModul:false,
  205. detailApi:'',
  206. followData:{},
  207. selectedRowKeys: [],
  208. selectedRows: [],
  209. loading: false,
  210. callnub:"0",
  211. modalVisible:false,
  212. pagination: {
  213. defaultCurrent: 1,
  214. defaultPageSize: 10,
  215. showQuickJumper: true,
  216. pageSize: 10,
  217. onChange: function(page) {
  218. this.loadData(page);
  219. }.bind(this),
  220. showTotal: function(total) {
  221. return '共' + total + '条数据';
  222. }
  223. },
  224. paginationDate: {
  225. defaultCurrent: 1,
  226. defaultPageSize: 10,
  227. showQuickJumper: true,
  228. pageSize: 10,
  229. onChange: function(page) {
  230. this.loadDatas(page);
  231. }.bind(this),
  232. showTotal: function(total) {
  233. return '共' + total + '条数据';
  234. }
  235. },
  236. columns: [{
  237. title: '客户名称',
  238. dataIndex: 'name',
  239. key: 'name',
  240. }, {
  241. title: '地区',
  242. dataIndex: 'diqu',
  243. key: 'diqu',
  244. }, {
  245. title: '联系人',
  246. dataIndex: 'contacts',
  247. key: 'contacts',
  248. },
  249. {
  250. title: '行业',
  251. dataIndex: 'industry',
  252. key: 'industry'
  253. },
  254. {
  255. title: '联系电话',
  256. dataIndex: 'contactMobile',
  257. key: 'contactMobile',
  258. },
  259. {
  260. title: '创建时间',
  261. dataIndex: 'createTime',
  262. key: 'createTime',
  263. }
  264. ],
  265. data: [],
  266. dataman: [],
  267. dataSource: [],
  268. visitArrList: [],
  269. columnsDate: [
  270. {
  271. title: '编号',
  272. dataIndex: 'serialNumber',
  273. key: 'serialNumber',
  274. }, {
  275. title: '名称',
  276. dataIndex: 'name',
  277. key: 'name',
  278. }, {
  279. title: '关键字',
  280. dataIndex: 'keyword',
  281. key: 'keyword',
  282. }, {
  283. title: '类型',
  284. dataIndex: 'category',
  285. key: 'category',
  286. render: text => { return getAchievementCategory(text); }
  287. },{
  288. title: '审核状态',
  289. dataIndex: 'auditStatus',
  290. key: 'auditStatus',
  291. render: text => { return getTechAuditStatus(text) }
  292. },
  293. {
  294. title: '是否精品',
  295. dataIndex: 'boutique',
  296. key: 'boutique',
  297. render: text => { return getboutique(text) }
  298. },
  299. {
  300. title: '发布时间',
  301. dataIndex: 'releaseDateFormattedDate',
  302. key: 'releaseDateFormattedDate',
  303. },{
  304. title: '录入时间',
  305. dataIndex: 'createTimeFormattedDate',
  306. key: 'createTimeFormattedDate',
  307. },
  308. ],
  309. dataSourceDate: [],
  310. };
  311. },
  312. componentWillMount() {
  313. //城市
  314. let Province = [];
  315. provinceList.map(function(item) {
  316. var id = String(item.id)
  317. Province.push(
  318. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  319. )
  320. });
  321. //行业
  322. let intentionalArr = [];
  323. industry.map(function(item) {
  324. intentionalArr.push(
  325. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  326. )
  327. });
  328. //会员等级
  329. let lvlArr = [];
  330. lvl.map(function(item) {
  331. lvlArr.push(
  332. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  333. )
  334. });
  335. //会员状态customerStatus
  336. let currentMemberArr = [];
  337. currentMember.map(function(item) {
  338. currentMemberArr.push(
  339. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  340. )
  341. });
  342. this.state.Provinces = Province;
  343. this.state.intentionalOption = intentionalArr;
  344. this.state.lvlArrOption = lvlArr;
  345. this.state.currentMemberArrOption = currentMemberArr;
  346. this.loadData();
  347. },
  348. search() {
  349. this.loadData();
  350. },
  351. reset() {
  352. this.state.nameSearch = '';
  353. this.state.addressSearch = [];
  354. this.state.dataGrade=undefined;
  355. this.state.follow=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();
  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.ispage);
  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. <Select placeholder="是否面谈客户" style={{ width: 120 }}
  788. value={this.state.follow}
  789. onChange={(e) => { this.setState({ follow: e }) }}>
  790. <Select.Option value="0" >否</Select.Option>
  791. <Select.Option value="1" >是</Select.Option>
  792. </Select>
  793. <RangePicker style={{marginRight:'10px'}}
  794. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  795. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  796. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  797. <Button type="primary" onClick={this.search}>搜索</Button>
  798. <Button onClick={this.reset}>重置</Button>
  799. </div>
  800. <div className="patent-table">
  801. <Spin spinning={this.state.loading}>
  802. <Table columns={this.state.columns}
  803. dataSource={this.state.dataSource}
  804. rowSelection={rowSelection}
  805. pagination={this.state.pagination}
  806. onRowClick={this.tableRowClick}
  807. />
  808. </Spin>
  809. </div>
  810. <Modal
  811. className="customeDetails"
  812. footer=''
  813. title="客户资料"
  814. width='1000px'
  815. visible={this.state.visitModul}
  816. onOk={this.visitOk}
  817. onCancel={this.visitCancel}
  818. >
  819. <Tabs onChange={this.callback} activeKey={this.state.callnub}>
  820. <TabPane tab="基本信息" key="0">
  821. <div>
  822. <Form layout="horizontal" onSubmit={this.newSubmit} id="demand-form">
  823. <Spin spinning={this.state.loading}>
  824. <div className="clearfix" >
  825. <FormItem className="half-item"
  826. {...formItemLayout}
  827. label="客户姓名"
  828. >
  829. <span>{this.state.identifyName}</span>
  830. </FormItem>
  831. <FormItem className="half-item"
  832. {...formItemLayout}
  833. label="资料所属人"
  834. >
  835. <span>{this.state.informationMaintainerName}</span>
  836. </FormItem>
  837. </div>
  838. <div className="clearfix" >
  839. <FormItem className="half-item"
  840. {...formItemLayout}
  841. label="行业">
  842. <Select placeholder="选择行业" value={this.state.industry} style={{width:'95%'}}
  843. onChange={(e)=>{this.setState({industry:e})}}>
  844. {
  845. industry.map(function (item) {
  846. return <Select.Option key={item.value} >{item.key}</Select.Option>
  847. })
  848. }
  849. </Select>
  850. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  851. </FormItem>
  852. <FormItem className="half-item"
  853. {...formItemLayout}
  854. label="社会属性"
  855. >
  856. <Select placeholder="客户社会属性" value={this.state.societyTag} style={{width:'95%'}}
  857. onChange={(e)=>{this.setState({societyTag:e})}}>
  858. {
  859. socialAttribute.map(function (item) {
  860. return <Select.Option key={item.value} >{item.key}</Select.Option>
  861. })
  862. }
  863. </Select>
  864. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  865. </FormItem>
  866. <FormItem className="half-item"
  867. {...formItemLayout}
  868. label="省-市-区"
  869. >
  870. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'95%'}}
  871. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  872. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  873. </FormItem>
  874. <FormItem className="half-item"
  875. {...formItemLayout}
  876. label="注册资本"
  877. >
  878. <Input placeholder="注册资本" style={{width:'90%'}} value={this.state.registeredCapital} onChange={(e) => {
  879. this.setState({ registeredCapital: e.target.value })}}/>万
  880. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  881. </FormItem>
  882. <div className='clearfix'>
  883. <FormItem
  884. labelCol={{ span:4 }}
  885. wrapperCol={{ span: 20 }}
  886. label="公司主营产品" >
  887. <Input type="textarea" rows={2} value={this.state.businessScope} style={{width:'95%'}}
  888. onChange={(e,pre) => { this.setState({ businessScope: e.target.value })}}/>
  889. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  890. </FormItem>
  891. </div>
  892. <div className='clearfix'>
  893. <FormItem
  894. labelCol={{ span:4 }}
  895. wrapperCol={{ span: 20 }}
  896. label="已有知识产权情况" >
  897. <Input type="textarea" rows={2} value={this.state.intellectualProperty} style={{width:'95%'}}
  898. onChange={(e,pre) => { this.setState({ intellectualProperty: e.target.value })}}/>
  899. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  900. </FormItem>
  901. </div>
  902. <FormItem className="half-item"
  903. {...formItemLayout}
  904. label="通信地址"
  905. >
  906. <Input placeholder="客户通信地址" value={this.state.postalAddress}
  907. onChange={(e,pre) => { this.setState({ postalAddress: e.target.value }) }}/>
  908. </FormItem>
  909. <FormItem className="half-item"
  910. {...formItemLayout}
  911. label="固定电话"
  912. >
  913. <Input placeholder="客户固定电话" value={this.state.contactsFixedTel}
  914. onChange={(e) => { this.setState({ contactsFixedTel: e.target.value }) }}/>
  915. </FormItem>
  916. <FormItem className="half-item"
  917. {...formItemLayout}
  918. label="客户传真"
  919. >
  920. <Input placeholder="客户传真" value={this.state.contactsFax}
  921. onChange={(e) => { this.setState({ contactsFax: e.target.value })}}/>
  922. </FormItem>
  923. <FormItem className="half-item"
  924. {...formItemLayout}
  925. label="企业人数"
  926. >
  927. <Input placeholder="单位规模" value={this.state.enterpriseScale} onChange={(e) => {
  928. this.setState({ enterpriseScale: e.target.value })}}/>
  929. </FormItem>
  930. <FormItem className="half-item"
  931. {...formItemLayout}
  932. label="法人名称"
  933. >
  934. <Input placeholder="法人名称" value={this.state.legalPerson} onChange={(e) => {
  935. this.setState({ legalPerson: e.target.value })}}/>
  936. </FormItem>
  937. <FormItem className="half-item"
  938. {...formItemLayout}
  939. label="法人身份证"
  940. >
  941. <Input placeholder="法人身份证" value={this.state.legalPersonIdCard} onChange={(e) => {
  942. this.setState({ legalPersonIdCard: e.target.value })}}/>
  943. </FormItem>
  944. <FormItem className="half-item"
  945. {...formItemLayout}
  946. label="主要联系人"
  947. >
  948. <Input placeholder="主要联系人" value={this.state.contacts} onChange={(e) => {
  949. this.setState({ contacts: e.target.value })}}/>
  950. </FormItem>
  951. <FormItem className="half-item"
  952. {...formItemLayout}
  953. label="主要联系人号码"
  954. >
  955. <Input placeholder="主要联系人号码" value={this.state.contactMobile} onChange={(e) => {
  956. this.setState({ contactMobile: e.target.value })}}/>
  957. </FormItem>
  958. <FormItem className="half-item"
  959. {...formItemLayout}
  960. label="法人电话"
  961. >
  962. <Input placeholder="法人电话" value={this.state.legalPersonTel} onChange={(e) => {
  963. this.setState({ legalPersonTel: e.target.value })}}/>
  964. </FormItem>
  965. <FormItem className="half-item"
  966. {...formItemLayout}
  967. label="法人电子邮箱"
  968. >
  969. <Input placeholder="法人电子邮箱" value={this.state.legalPersonEmail}
  970. onChange={(e) => {this.setState({legalPersonEmail: e.target.value })}}/>
  971. </FormItem>
  972. <FormItem className="half-item"
  973. {...formItemLayout}
  974. label="社会统一信用机构代码"
  975. >
  976. <Input placeholder="社会统一信用机构代码" value={this.state.orgCode} onChange={(e) => {
  977. this.setState({ orgCode: e.target.value })}}/>
  978. </FormItem>
  979. <div className='clearfix'>
  980. <FormItem
  981. labelCol={{ span:4 }}
  982. wrapperCol={{ span: 18 }}
  983. label="客户简介" >
  984. <Input type="textarea" rows={3} value={this.state.introduction}
  985. onChange={(e,pre) => { this.setState({ introduction: e.target.value })}}/>
  986. </FormItem>
  987. </div>
  988. <div className="clearfix pictures">
  989. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginLeft:'95px'}}
  990. labelCol={{ span: 8 }}
  991. wrapperCol={{ span: 10 }}
  992. label="机构证书(PIC)" >
  993. <PicturesWall
  994. fileList={this.getOrgCodeUrl}
  995. pictureUrl={this.state.orgCodeUrl} />
  996. <p>建议:图片要清晰。</p>
  997. </FormItem>
  998. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginTop:'20px'}}
  999. labelCol={{ span: 8 }}
  1000. wrapperCol={{ span: 10 }}
  1001. label="单位LOGO" >
  1002. <PicturesWall
  1003. fileList={this.getCompanyLogoUrl}
  1004. pictureUrl={this.state.companyLogoUrl} />
  1005. <p>建议:图片要清晰。</p>
  1006. </FormItem>
  1007. </div>
  1008. <div style={{fontSize:'18px',marginLeft:'50px',marginTop:'15px',marginBottom:'10px',color:"red",fontWeight:"bold"}}>签单客户信息完善</div>
  1009. <div className='clearfix' >
  1010. <FormItem className="half-item"
  1011. {...formItemLayout}
  1012. label="上年度销售额"
  1013. >
  1014. <Input ref='consul' placeholder="请输入上年度销售额" value={this.state.yearSalesAmount} style={{width:'95%'}}
  1015. onChange={(e) => {this.setState({yearSalesAmount: e.target.value })}}/>万
  1016. </FormItem>
  1017. <FormItem className="half-item"
  1018. {...formItemLayout}
  1019. label="上年度研发费用"
  1020. >
  1021. <Input ref='consul' placeholder="请输入上年度研发费用" value={this.state.lastYearResearchAmount} style={{width:'95%'}}
  1022. onChange={(e) => {this.setState({lastYearResearchAmount: e.target.value })}}/>万
  1023. </FormItem>
  1024. <FormItem className="half-item"
  1025. {...formItemLayout}
  1026. label="上年度总资产情况"
  1027. >
  1028. <Input ref='consul' placeholder="上年度总资产情况" value={this.state.assets} style={{width:'95%'}}
  1029. onChange={(e) => {this.setState({assets: e.target.value })}}/>万
  1030. </FormItem>
  1031. <FormItem className="half-item"
  1032. {...formItemLayout}
  1033. label="客户信用等级"
  1034. >
  1035. <Select placeholder="客户信用等级" value={this.state.creditRating}
  1036. onChange={(e)=>{this.setState({creditRating:e})}}>
  1037. {
  1038. slcRedit.map(function (item) {
  1039. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1040. })
  1041. }
  1042. </Select>
  1043. </FormItem>
  1044. <div className='clearfix'>
  1045. <FormItem
  1046. labelCol={{ span:4 }}
  1047. wrapperCol={{ span: 19 }}
  1048. label="核心技术" >
  1049. <Input type="textarea" rows={3} value={this.state.coreTechnology}
  1050. onChange={(e,pre) => { this.setState({ coreTechnology: e.target.value })}}/>
  1051. </FormItem>
  1052. </div>
  1053. <div className='clearfix'>
  1054. <FormItem
  1055. labelCol={{ span:4 }}
  1056. wrapperCol={{ span: 19 }}
  1057. label="企业资质情况" >
  1058. <Input type="textarea" rows={3} value={this.state.qualification} placeholder="请按如下格式填写:资质名称+获得时间+拥有人+发证机构"
  1059. onChange={(e,pre) => { this.setState({ qualification: e.target.value })}}/>
  1060. </FormItem>
  1061. </div>
  1062. <div className='clearfix'>
  1063. <FormItem
  1064. labelCol={{ span:4 }}
  1065. wrapperCol={{ span: 19 }}
  1066. label="客户已做项目" >
  1067. <Input type="textarea" rows={3} value={this.state.accomplishSituation} placeholder="请按如下格式填写:项目类型+主管部门+申报时间+立项情况+验收情况"
  1068. onChange={(e,pre) => { this.setState({ accomplishSituation: e.target.value })}}/>
  1069. </FormItem>
  1070. </div>
  1071. <div className='clearfix'>
  1072. <FormItem
  1073. labelCol={{ span:4 }}
  1074. wrapperCol={{ span: 19 }}
  1075. label="企业高企合作情况" >
  1076. <Input type="textarea" rows={3} value={this.state.cooperationSituation}
  1077. onChange={(e,pre) => { this.setState({ cooperationSituation: e.target.value })}}/>
  1078. </FormItem>
  1079. </div>
  1080. </div>
  1081. </div>
  1082. </Spin>
  1083. </Form>
  1084. </div>
  1085. </TabPane>
  1086. <TabPane tab="知识产权列表" key="1">
  1087. <Spin spinning={this.state.loading}>
  1088. <Table columns={this.state.columnsDate}
  1089. dataSource={this.state.dataSourceDate}
  1090. rowSelection={rowSelection}
  1091. pagination={this.state.paginationDate}
  1092. onRowClick={this.tableRowClickDate} />
  1093. </Spin>
  1094. </TabPane>
  1095. </Tabs>
  1096. </Modal>
  1097. <TechAchievementDesc
  1098. data={this.state.RowData}
  1099. detailApiUrl={this.props['data-detailApiUrl']}
  1100. achievementCategoryOption={this.state.achievementCategoryOption}
  1101. showDesc={this.state.showDesc}
  1102. uid={this.state.uid}
  1103. closeDesc={this.closeDesc}
  1104. loadDatas={this.loadDatas}
  1105. />
  1106. </div >
  1107. );
  1108. }
  1109. }));
  1110. export default IntentionCustomer;