myClient.jsx 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506
  1. import React from 'react';
  2. import { Radio, Icon, Button, Input, Select, Tabs,Spin,Popconfirm, Table, Switch, message, DatePicker, Modal, Upload,Form ,Row,Col,TimePicker} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import './myClient.less';
  7. const { Column, ColumnGroup } = Table;
  8. const TabPane = Tabs.TabPane;
  9. import TechAchievementDesc from './myClientDesc.jsx';
  10. import { achievementCategoryList, techAuditStatusList,cityArr,tag,customerStatus,intentionalService,newFollow ,contact,sex} from '../../dataDic.js';
  11. import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn,getcustomerStatueOn} from '../../tools.js';
  12. import BatchImport from './batchImport';
  13. //图片组件
  14. const PicturesWall = React.createClass({
  15. getInitialState() {
  16. return {
  17. previewVisible: false,
  18. previewImage: '',
  19. fileList: [],
  20. }
  21. },
  22. handleCancel() {
  23. this.setState({ previewVisible: false })
  24. },
  25. handlePreview(file) {
  26. this.setState({
  27. previewImage: file.url || file.thumbUrl,
  28. previewVisible: true,
  29. });
  30. },
  31. handleChange(info) {
  32. let fileList = info.fileList;
  33. this.setState({ fileList });
  34. this.props.fileList(fileList);
  35. },
  36. componentWillReceiveProps(nextProps) {
  37. this.state.fileList = nextProps.pictureUrl;
  38. },
  39. render() {
  40. const { previewVisible, previewImage, fileList } = this.state;
  41. const uploadButton = (
  42. <div>
  43. <Icon type="plus" />
  44. <div className="ant-upload-text">点击上传</div>
  45. </div>
  46. );
  47. return (
  48. <div className="clearfix">
  49. <Upload
  50. action={globalConfig.context + "/api/admin/customer/attachmentUpload"}
  51. data={{ 'sign': this.props.pictureSign }}
  52. listType="picture-card"
  53. fileList={fileList}
  54. onPreview={this.handlePreview}
  55. onChange={this.handleChange} >
  56. {fileList.length >= 5 ? null : uploadButton}
  57. </Upload>
  58. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  59. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  60. </Modal>
  61. </div>
  62. );
  63. }
  64. });
  65. const AchievementList = Form.create()(React.createClass({
  66. loadData(pageNo, apiUrl) {
  67. this.state.data = [];
  68. this.setState({
  69. loading: true
  70. });
  71. $.ajax({
  72. method: "post",
  73. dataType: "json",
  74. crossDomain: false,
  75. url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
  76. data: {
  77. pageNo: pageNo || 1,
  78. pageSize: this.state.pagination.pageSize,
  79. companyName: this.state.companyNamet, //名称1
  80. customerType: this.state.customerTypet, //客户类型1
  81. locationProvince:this.state.locationProvincet,//地区
  82. customerStatus:this.state.customerStatust,//客户状态1
  83. contactName:this.state.contactNamet,//联系人姓名1
  84. contactTel:this.state.contactTelt,//联系人手机
  85. companyIntention:this.state.companyIntentiont,//意向服务
  86. followSituation:this.state.followSituationt,//最新跟进进度
  87. },
  88. success: function (data) {
  89. let theArr = [];
  90. let ad;
  91. if (data.error.length || data.data.list=="") {
  92. if (data.error && data.error.length) {
  93. message.warning(data.error[0].message);
  94. };
  95. } else {
  96. ad=data.data.list[0].aid;
  97. for (let i = 0; i < data.data.list.length; i++) {
  98. let thisdata = data.data.list[i];
  99. let intentionText=thisdata._companyIntention.split("-");
  100. let intentionstring=intentionText.slice("0","1").join('-')
  101. theArr.push({
  102. key: i,
  103. id: thisdata.id,
  104. companyName:thisdata.companyName,//公司名称
  105. _shareType:thisdata._shareType,//客户类型
  106. locationProvince:thisdata.locationProvince,//地区
  107. contactName:thisdata.contactName, //联系人姓名
  108. telNum:thisdata.telNum,//手机号
  109. _customerStatus:thisdata._customerStatus,//客户状态
  110. _companyIntention:intentionstring,//意向服务
  111. _followSituation:thisdata._followSituation,//最新跟进
  112. customerStatus:thisdata.customerStatus,//客户状态
  113. companyIntention:thisdata.companyIntention,//意向服务
  114. followSituation:thisdata.followSituation,//最新跟进
  115. adminName:thisdata.adminName, //跟进人
  116. followDate:thisdata.followDate,
  117. _customerType:thisdata._customerType,//客户类型
  118. });
  119. };
  120. this.state.pagination.current = data.data.pageNo;
  121. this.state.pagination.total = data.data.totalCount;
  122. };
  123. this.setState({
  124. aid:ad,
  125. dataSource: theArr,
  126. pagination: this.state.pagination
  127. });
  128. }.bind(this),
  129. }).always(function () {
  130. this.setState({
  131. loading: false
  132. });
  133. }.bind(this));
  134. },
  135. //点击+号进行两次查询,这个是查询联系人的函数
  136. getNewWoman(index) {
  137. this.state.data = []
  138. $.ajax({
  139. method: "post",
  140. dataType: "json",
  141. crossDomain: false,
  142. url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
  143. data:{
  144. cid:index
  145. },
  146. success: function (data) {
  147. let theArr = [];
  148. let thedata=data.data;
  149. var email=[];
  150. var telNum=[];
  151. var watch=[];
  152. var qq=[];
  153. var contactIds=[];
  154. thedata.map(function (item,index) {
  155. watch.push(thedata[index].wechat);
  156. qq.push(thedata[index].qq);
  157. email.push(thedata[index].email);
  158. contactIds.push(thedata[index].id);
  159. telNum.push(thedata[index].telNum);
  160. theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)
  161. });
  162. var lastName= thedata[thedata.length-1].name;
  163. var nub=thedata[thedata.length-1].telNum;
  164. var kid=thedata[thedata.length-1].id;
  165. var contacts='电话';
  166. this.setState({
  167. idt:thedata[0].id,
  168. kid:kid,
  169. contactIds:contactIds,
  170. contacts:contacts,
  171. nub:nub,
  172. telNum:telNum,
  173. email:email,
  174. watch:watch,
  175. qq:qq,
  176. lastName:lastName,
  177. orderStatusOption: theArr,
  178. technicalPictureUrl: thedata.sign ? splitUrl(thedata.sign, ',', globalConfig.avatarHost + '/upload') : [],
  179. });
  180. }.bind(this),
  181. }).always(function () {
  182. this.setState({
  183. loading: false
  184. });
  185. }.bind(this));
  186. },
  187. //在添加联系记录页面,选择联系方式查看号码
  188. contacts(e){
  189. let conts='';
  190. if(e==0){
  191. conts='电话'
  192. this.state.nub=this.state.changNub
  193. }
  194. if(e==1){
  195. conts='邮件'
  196. this.state.nub=this.state.changEmail
  197. }
  198. if(e==2){
  199. conts='微信'
  200. this.state.nub=this.state.changWatch
  201. }
  202. if(e==3){
  203. conts='QQ'
  204. this.state.nub=this.state.changQq
  205. }
  206. this.setState({
  207. conts:conts,
  208. contacts: e,
  209. });
  210. },
  211. //通过ID查询这一条的信息
  212. Detailload(deletedIds,record){
  213. this.RowClick;
  214. $.ajax({
  215. method: "post",
  216. dataType: "json",
  217. crossDomain: false,
  218. url: globalConfig.context + '/api/admin/customer/findCustomerDetails',
  219. data: {
  220. id: deletedIds
  221. },
  222. success: function (data) {
  223. let thisData = data.data;
  224. if (!thisData) {
  225. if (data.error && data.error.length) {
  226. message.warning(data.error[0].message);
  227. };
  228. thisData = {};
  229. };
  230. //意向服务多选
  231. // let companyArr=[];
  232. // let companyString=thisData.companyIntention;
  233. // companyArr=companyString.split(",") ;
  234. let creatMent=thisData.createTime.substr(10,9);
  235. let createYear=thisData.createTime.substr(0,10);
  236. let followSituationTxt=getfllowSituation(thisData.followSituation.toString());
  237. this.setState({
  238. locationProvince:thisData.locationProvince,
  239. addId:thisData.id,
  240. creatMent:creatMent,
  241. createYear:createYear,
  242. addCid:thisData.cid,
  243. datak: thisData,
  244. companyIndustry:thisData.companyIndustry,
  245. adress:thisData.adress,
  246. followSituation:followSituationTxt,
  247. customerStatus:thisData.customerStatus.toString(),
  248. companyIntention:thisData.companyIntention,
  249. _followSituation:thisData._followSituation,
  250. _customerStatus:thisData._customerStatus,
  251. _companyIntention:thisData._companyIntention,
  252. cid:thisData.cid,
  253. customerType:thisData.customerType,
  254. companyName:thisData.companyName,
  255. adminName:thisData.adminName
  256. });
  257. if (thisData.ownerId) {
  258. this.getContactsList(thisData.ownerId);
  259. };
  260. }.bind(this),
  261. }).always(function () {
  262. this.setState({
  263. loading: false
  264. });
  265. }.bind(this));
  266. },
  267. //点击出现函数
  268. //点击消失函数
  269. setModal1Visiblecancel(e) {
  270. this.setState({
  271. modal1Visible:false
  272. });
  273. this.reset();
  274. },
  275. //点击添加跟进记录,点击最新跟进下的+号,将会查询出很多数据,展示在列表里面,
  276. setModal1VisibleOk(e) {
  277. this.setState({modal1Visible:true});
  278. let deletedIds;
  279. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  280. let rowItem = this.state.selectedRows[idx];
  281. if (rowItem.id) {
  282. deletedIds=rowItem.id;
  283. };
  284. };
  285. this.setState({
  286. remarks:'',
  287. selectedRowKeys: [],
  288. });
  289. this.Detailload(deletedIds);
  290. this.getNewWoman(deletedIds);
  291. },
  292. //点击出现函数
  293. setModal2VisibleOk(e) {
  294. this.setState({
  295. modal2Visible:true
  296. });
  297. this.state.hotst=undefined;
  298. this.state.hott=undefined;
  299. this.state.paymentIdt='';
  300. this.state.entIdt='';
  301. this.state.payt='';
  302. this.state.paymt='';
  303. this.state.paytIdtt='';
  304. this.state.paentIdt='';
  305. this.state.payIdt='';
  306. this.state.emailst='';
  307. },
  308. //点击消失函数
  309. setModal2Visiblecancel(e) {
  310. this.setState({
  311. modal2Visible:false
  312. });
  313. },
  314. //点击消失函数
  315. setModal3Visiblecancel(e) {
  316. this.setState({
  317. modal3Visible:false
  318. });
  319. },
  320. rescordlist(deletedIds){
  321. this.setState({
  322. selectedRowKeys:[],
  323. });
  324. this.state.data = [];
  325. $.ajax({
  326. method: "get",
  327. dataType: "json",
  328. crossDomain: false,
  329. url:globalConfig.context + '/api/admin/customer/listFollowUpRecord',
  330. data: {
  331. customerId:deletedIds
  332. },
  333. success: function (data) {
  334. let theArr = [];
  335. let theWomanID=[];
  336. let theFollowID=[];
  337. if (!data.data) {
  338. if (data.error && data.error.length) {
  339. message.warning(data.error[0].message);
  340. };
  341. } else {
  342. data.data.map(function (item,index) {
  343. theWomanID.push(data.data[index].contactId);
  344. });
  345. data.data.map(function (item,index) {
  346. theFollowID.push(data.data[index].followId);
  347. });
  348. for (let i = 0; i < data.data.length; i++) {
  349. let thisdata = data.data[i];
  350. theArr.push({
  351. key:i,
  352. _followDate:thisdata._followDate,//跟进时间
  353. adminName:thisdata.adminName,//跟进人
  354. contactName:thisdata.contactName, //联系人姓名
  355. contactId:thisdata.contactId, //联系人ID
  356. contactInfo:thisdata.contactInfo,//联系信息
  357. _customerStatus:thisdata._customerStatus,//客户状态
  358. _followSituation:thisdata._followSituation,//最新跟进
  359. followResult:thisdata.followResult,//跟进结果
  360. attachment:thisdata.attachment,//附件地址
  361. });
  362. };
  363. };
  364. this.setState({//导出数据
  365. datahistory: theArr,
  366. theWomanID:theWomanID,
  367. theFollowID:theFollowID,
  368. });
  369. }.bind(this),
  370. }).always(function () {
  371. this.setState({
  372. loading: false
  373. });
  374. }.bind(this));
  375. },
  376. //点击查看跟进记录,点击最新跟进的第一个按钮(跟进状态)执行的函数,将会出现很多跟进列表
  377. setModal3VisibleOk(e) {
  378. this.setState({ modal3Visible:true });
  379. this.state.data = [];
  380. this.setState({
  381. loading: true
  382. });
  383. let deletedIds=this.state.rowId;
  384. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  385. let rowItem = this.state.selectedRows[idx];
  386. if (rowItem.id) {
  387. deletedIds=rowItem.id;
  388. };
  389. };
  390. this.rescordlist(deletedIds)
  391. },
  392. //删除历史记录
  393. onDelete(index){
  394. let deleteID=this.state.theFollowID[index];
  395. $.ajax({
  396. method: "get",
  397. dataType: "json",
  398. crossDomain: false,
  399. url: globalConfig.context + "/api/admin/customer/deleteFollowUpRecord",
  400. data: {
  401. followId:deleteID,//删除的ID
  402. }
  403. }).done(function (data) {
  404. if (!data.error.length) {
  405. message.success('删除成功!');
  406. this.setModal3Visiblecancel();
  407. this.setModal3VisibleOk();
  408. this.setState({
  409. loading: false,
  410. });
  411. } else {
  412. message.warning(data.error[0].message);
  413. };
  414. this.loadData();
  415. }.bind(this));
  416. },
  417. //点击消失函数
  418. setModal4Visiblecancel(e) {
  419. this.setState({
  420. modal4Visible:false
  421. });
  422. },
  423. //点击客户的名字,进行详情的查询
  424. setModal4Visible(e,index) {
  425. this.setState({ modal4Visible:true });
  426. let changeIds=this.state.datahistory[index].contactId;
  427. $.ajax({
  428. method: "get",
  429. dataType: "json",
  430. crossDomain: false,
  431. url:globalConfig.context + '/api/admin/customer/findContactDetail',
  432. data: {
  433. contactId:changeIds
  434. },
  435. success: function (data) {
  436. let theArr = [];
  437. let theDate=data.data;
  438. if (!data.data) {
  439. if (data.error && data.error.length) {
  440. message.warning(data.error[0].message);
  441. };
  442. } else {
  443. for (let i = 0; i < data.data.length; i++) {
  444. let thisdata = data.data[i];
  445. theArr.push({
  446. key:i,
  447. name:name,//联系人姓名
  448. sex:sex,//联系人性别
  449. mobile:mobile,//座机号
  450. telNum:telNum,//手机号
  451. email:email,//邮箱
  452. qq:qq,//qq
  453. wechat:wechat,//微信号
  454. depatrment:depatrment,//部门
  455. customerPosition:customerPosition,//职位
  456. });
  457. };
  458. };
  459. this.setState({//导出数据
  460. theDate:theDate,
  461. name:theDate.name,//联系人姓名
  462. sex:theDate.sex,//联系人性别
  463. mobile:theDate.mobile,//座机号
  464. telNum:theDate.telNum,//手机号
  465. email:theDate.email,//邮箱
  466. qq:theDate.qq,//qq
  467. wechat:theDate.wechat,//微信号
  468. depatrment:theDate.depatrment,//部门
  469. customerPosition:theDate.customerPosition,//职位
  470. companyName:theDate.companyName,//公司
  471. });
  472. }.bind(this),
  473. }).always(function () {
  474. this.setState({
  475. loading: false
  476. });
  477. }.bind(this));
  478. },
  479. //点击消失函数
  480. setModal5Visiblecancel(e) {
  481. this.setState({
  482. modal5Visible:false
  483. });
  484. },
  485. setModal6Visiblecancel(e) {
  486. this.setState({
  487. modal6Visible:false
  488. });
  489. },
  490. setModal8Visiblecancel(e) {
  491. this.setState({
  492. modal8Visible:false
  493. });
  494. },
  495. //点击名称时获取列表
  496. setModal5VisibleOk(e) {
  497. this.setState({ modal5Visible:true }); //需要一个请求数据
  498. this.Detailload(e.id);
  499. },
  500. //历史记录查看更多,还是历史记录接口
  501. setModal6VisibleOk(e) {
  502. this.setState({ modal6Visible:true }); //需要一个请求数据
  503. },
  504. getPictureUrl(e) {
  505. this.setState({pictureUrl: e });
  506. },
  507. //查看所有的联系人setModal7VisibleOk
  508. contactList(index) {
  509. $.ajax({
  510. method: "post",
  511. dataType: "json",
  512. crossDomain: false,
  513. url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
  514. data:{
  515. cid:index
  516. },
  517. success: function (data) {
  518. let theArr = [];
  519. let thedata=data.data;
  520. let cidArr=[];
  521. for (let i = 0; i < data.data.length; i++) {
  522. cidArr.push({
  523. i:thedata[i].cid,
  524. })
  525. }
  526. for (let i = 0; i < data.data.length; i++) {
  527. let thisdata = data.data[i];
  528. theArr.push({
  529. cid:thisdata.cid,//客户的ID
  530. id:thisdata.id,//联系人ID
  531. contactName:thisdata.name,//联系人姓名
  532. sex:thisdata.sex,//联系人性别
  533. mobile:thisdata.mobile,//座机号
  534. telNum:thisdata.telNum,//手机号
  535. email:thisdata.email,//邮箱
  536. qq:thisdata.qq,//qq
  537. wechat:thisdata.wechat,//微信号
  538. depatrment:thisdata.depatrment,//部门
  539. customerPosition:thisdata.customerPosition,//职位
  540. });
  541. };
  542. this.setState({
  543. information: theArr,
  544. cidArr:cidArr,
  545. });
  546. }.bind(this),
  547. }).always(function () {
  548. this.setState({
  549. loading: false
  550. });
  551. }.bind(this));
  552. },
  553. //修改联系人列表数据
  554. setModal8VisibleOk(e) {
  555. this.setState({ modal8Visible:true }); //需要一个请求数据
  556. let deletedIds=this.state.rowId;
  557. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  558. let rowItem = this.state.selectedRows[idx];
  559. if (rowItem.id) {
  560. deletedIds=rowItem.id;
  561. };
  562. };
  563. },
  564. changefollow(e){
  565. e.preventDefault();
  566. $.ajax({
  567. method: "post",
  568. dataType: "json",
  569. crossDomain: false,
  570. url: globalConfig.context + "/api/admin/customer/updateContacter",
  571. data: {
  572. id:this.state.id,//联系人ID
  573. cid:this.state.cid,//客户的ID
  574. name:this.state.name,//客户名
  575. sex:this.state.sex,//性别
  576. mobile:this.state.mobile,//座机号
  577. telNum:this.state.telNum,//手机号
  578. email:this.state.email,//邮箱
  579. qq:this.state.qq,//qq
  580. wechat:this.state.wechat,//微信号
  581. depatrment:this.state.depatrment,//部门
  582. customerPosition:this.state.customerPosition,//职位
  583. primaryFlg:this.state.primaryFlg,//是否是主要联系人
  584. }
  585. }).done(function (data) {
  586. if (!data.error.length) {
  587. message.success('修改成功!');
  588. this.setState({
  589. loading: false,
  590. });
  591. this.setModal8Visiblecancel()
  592. } else {
  593. message.warning(data.error[0].message);
  594. };
  595. this.Detailload(this.state.rowId);
  596. this.contactList(this.state.rowId);
  597. this.loadData();
  598. }.bind(this));
  599. },
  600. informationRowClick(index){
  601. this.setModal8VisibleOk()
  602. $.ajax({
  603. method: "get",
  604. dataType: "json",
  605. crossDomain: false,
  606. url:globalConfig.context + '/api/admin/customer/findContactDetail',
  607. data: {
  608. contactId:index.id
  609. },
  610. success: function (data) {
  611. let theArr = [];
  612. let theDate=data.data;
  613. if (!data.data) {
  614. if (data.error && data.error.length) {
  615. message.warning(data.error[0].message);
  616. };
  617. } else {
  618. for (let i = 0; i < data.data.length; i++) {
  619. let thisdata = data.data[i];
  620. theArr.push({
  621. key:i,
  622. primaryFlg:primaryFlg,
  623. name:name,//联系人姓名
  624. sex:sex,//联系人性别
  625. mobile:mobile,//座机号
  626. telNum:telNum,//手机号
  627. email:email,//邮箱
  628. qq:qq,//qq
  629. wechat:wechat,//微信号
  630. depatrment:depatrment,//部门
  631. customerPosition:customerPosition,//职位
  632. });
  633. };
  634. };
  635. this.setState({//导出数据
  636. primaryFlg:theDate.primaryFlg,
  637. thaDate:theDate,
  638. cid:theDate.cid,//客户ID
  639. id:theDate.id,//联系人ID
  640. name:theDate.name,//联系人姓名
  641. sex:theDate.sex,//联系人性别
  642. mobile:theDate.mobile,//座机号
  643. telNum:theDate.telNum,//手机号
  644. email:theDate.email,//邮箱
  645. qq:theDate.qq,//qq
  646. wechat:theDate.wechat,//微信号
  647. depatrment:theDate.depatrment,//部门
  648. customerPosition:theDate.customerPosition,//职位
  649. companyName:theDate.companyName,//公司
  650. });
  651. }.bind(this),
  652. }).always(function () {
  653. this.setState({
  654. loading: false
  655. });
  656. }.bind(this));
  657. },
  658. componentWillReceiveProps(nextProps) {
  659. if (!this.props.visible && nextProps.visible) {
  660. if (nextProps.data && nextProps.data.id) {
  661. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  662. };
  663. this.state.technicalPictureUrl = [];
  664. };
  665. },
  666. //添加一条跟进记录,点击保存按钮进行添加
  667. addFollowSubmit(e) {
  668. e.preventDefault();
  669. this.state.data = []
  670. this.setState({
  671. selectedRowKeys: [],
  672. });
  673. let deletedIds=this.state.addId;
  674. this.props.form.validateFields((err, values) => {
  675. if (!err) {
  676. this.setState({
  677. loading: true
  678. });
  679. let custype=values._shareType;
  680. let customerTypechange="";
  681. switch(custype){
  682. case "个人客户":customerTypechange=0;break;
  683. case "公司客户":customerTypechange=1;break;
  684. }
  685. let customerStatus= getcustomerStatueOn(this.state.customerStatus);
  686. let followSituation= getfllowSituationOn(this.state.followSituation);
  687. //图片转换
  688. let thetechnicalPictureUrl = [];
  689. if (this.state.technicalPictureUrl.length) {
  690. let picArr = [];
  691. this.state.technicalPictureUrl.map(function (item) {
  692. picArr.push(item.response.data);
  693. });
  694. thetechnicalPictureUrl = picArr.join(",");
  695. };
  696. let yearMonth = new Date(this.state.createYear).toLocaleDateString();
  697. let yearString = yearMonth.split('/').join('-');
  698. let pjstringY='';
  699. let days = new Date(this.state.creatMent);
  700. let hours = days.getHours().length==1?"0"+days.getHours():days.getHours();
  701. let minutes = days.getMinutes().length==1?"0"+days.getMinutes():days.getMinutes();
  702. let seconds = days.getSeconds().length==1?"0"+days.getSeconds():days.getSeconds();
  703. if(this.state.creatMent.length==9){
  704. pjstringY=this.state.creatMent
  705. }else{
  706. pjstringY=hours+':'+minutes+':'+seconds
  707. }
  708. $.ajax({
  709. method: "POST",
  710. dataType: "json",
  711. crossDomain: false,
  712. url:globalConfig.context + '/api/admin/customer/addFollowUpRecord',
  713. data: {
  714. id: this.state.addCid,//编号id
  715. cuid:this.state.idt,//联系人ID
  716. followDates:yearString+' '+pjstringY,
  717. followResult:values.remarks,//跟进结果
  718. attachment:"",//附件地址
  719. customerStatus:this.state.customerStatus,//跟进客户状态
  720. followSituation:this.state.followSituation.length==1?this.state.followSituation:followSituation,//跟进进度
  721. contactInfo:(this.state.conts?this.state.conts:"电话")+"-"+(this.state.nub?this.state.nub:""),
  722. sign:thetechnicalPictureUrl
  723. }
  724. }).done(function (data) {
  725. this.setState({
  726. loading: false
  727. });
  728. if (!data.error.length) {
  729. message.success('保存成功!');
  730. this.setModal1Visiblecancel()
  731. } else {
  732. message.warning(data.error[0].message);
  733. }
  734. this.rescordlist(this.state.rowId);
  735. }.bind(this));
  736. }
  737. })
  738. },
  739. //当选择联系人的列表变化时,则执行
  740. hundleName(e){
  741. let changNub=this.state.telNum[e];
  742. let changEmail=this.state.email[e];
  743. let changWatch=this.state.watch[e];
  744. let changQq=this.state.qq[e];
  745. let kid=this.state.contactIds[e];
  746. this.setState({
  747. kid:kid,
  748. contacts:'电话',
  749. nub:this.state.telNum[e],
  750. lastName: e,
  751. changNub:changNub,
  752. changEmail:changEmail,
  753. changWatch:changWatch,
  754. changQq:changQq
  755. });
  756. },
  757. //所有资料修改保存提交,点击保存按钮进行更新
  758. handleSubmit(e) {
  759. e.preventDefault();
  760. this.state.data=[]
  761. let deletedIds;
  762. let adminName;
  763. let customerStatus;
  764. let companyIntention;
  765. let followSituation;
  766. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  767. let rowItem = this.state.selectedRows[idx];
  768. if (rowItem.id) {
  769. deletedIds=rowItem.id;
  770. adminName=rowItem.adminName;
  771. customerStatus=rowItem.customerStatus;
  772. companyIntention=rowItem.companyIntention;
  773. followSituation=rowItem.followSituation;
  774. };
  775. };
  776. this.props.form.validateFields((err, values) => {
  777. if (!err) {
  778. this.setState({
  779. loading: true
  780. });
  781. let custype=values._customerType;
  782. let customerTypechange="";
  783. switch(custype){
  784. case "个人客户":customerTypechange=0;break;
  785. case "公司客户":customerTypechange=1;break;
  786. case "团体单位":customerTypechange=2;break;
  787. }
  788. let companyIntentions= getCompanyIntentionOn(values.companyIntention);
  789. let followSituations= getfllowSituationOn(values.followSituation);
  790. let becompanyIntentions=getCompanyIntentionOn();
  791. let city=getcityArr(values.locationProvince);
  792. //let companyMore = [];
  793. const theDatak = this.state.datak || {};
  794. //意向服务多选
  795. // if (this.state.companyIntention.length) {
  796. // let companyList = [];
  797. // this.state.companyIntention.map(function (item) {
  798. // companyList.push(item);
  799. // });
  800. // companyMore = companyList.join(",");
  801. // };
  802. $.ajax({
  803. method: "POST",
  804. dataType: "json",
  805. crossDomain: false,
  806. url:globalConfig.context + '/api/admin/customer/updateCustomer',
  807. data: {
  808. id: this.state.cid,//编号id
  809. customerType:this.state.customerType,//客户信息 1
  810. companyName: this.state.companyName,//公司名称 1
  811. companyIndustry: this.state.companyIndustry,//公司行业
  812. tag: theDatak.tag,
  813. locationProvince:this.state.locationProvince ,//省份1
  814. adress: this.state.adress,//详细地址1
  815. remarks: values.remarks,//备注1
  816. companyIntention:this.state.companyIntention,//公司意向
  817. followSituation:theDatak.followSituation,//最新跟进1
  818. customerStatus:this.state.customerStatus,//客户状态1
  819. beforeAdminName:this.state.adminName,
  820. }
  821. }).done(function (data) {
  822. this.setState({
  823. loading: false
  824. });
  825. if (!data.error.length) {
  826. message.success('修改成功!');
  827. this.setModal5Visiblecancel();
  828. } else {
  829. message.warning(data.error[0].message);
  830. }
  831. this.Detailload(this.state.rowId);
  832. this.loadData()
  833. }.bind(this));
  834. }
  835. })
  836. },
  837. submitcontactman(e){
  838. let deletedIds;
  839. this.state.data=[];
  840. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  841. let rowItem = this.state.selectedRows[idx];
  842. if (rowItem.id) {
  843. deletedIds=rowItem.id
  844. }
  845. };
  846. if(!deletedIds){
  847. deletedIds=this.state.cid
  848. }
  849. this.setState({
  850. selectedRowKeys: [],
  851. });
  852. e.preventDefault();
  853. this.props.form.validateFields((err, values) => {
  854. if (!err) {
  855. this.setState({
  856. loading: true
  857. });
  858. $.ajax({
  859. method: "POST",
  860. dataType: "json",
  861. crossDomain: false,
  862. url: globalConfig.context + '/api/admin/customer/addContacter',
  863. data: {
  864. cid: deletedIds,//编号id
  865. sex:this.state.hott,//性别
  866. primaryFlg:this.state.hotst,//是否是主要联系人
  867. name:this.state.paymentIdt,//联系人姓名
  868. mobile:this.state.paymt,//座机
  869. telNum:this.state.payt,//电话
  870. qq:this.state.entIdt,//qq
  871. wechat:this.state.payIdt,//微信
  872. customerPosition:this.state.paentIdt,//职位
  873. depatrment:this.state.paytIdtt,//部门
  874. email:this.state.emailst,//邮箱
  875. }
  876. }).done(function (data) {
  877. this.setState({
  878. loading: false
  879. });
  880. if (!data.error.length) {
  881. message.success('保存成功!');
  882. this.setModal2Visiblecancel()
  883. } else {
  884. message.warning(data.error[0].message);
  885. }
  886. this.Detailload(this.state.rowId);
  887. this.getNewWoman(this.state.rowId);
  888. this.contactList(this.state.rowId);
  889. //this.loadData();
  890. }.bind(this));
  891. }
  892. });
  893. },
  894. getTechnicalPictureUrl(e) {
  895. this.setState({ technicalPictureUrl: e });
  896. },
  897. //新建联系人modal框显示
  898. showModal(){
  899. this.setState({
  900. visible: true,
  901. });
  902. },
  903. //指定转交人的点击函数
  904. showModa(){
  905. this.setState({
  906. visible: true,
  907. });
  908. let changeIds;
  909. let adminName;
  910. let customerStatus;
  911. let companyIntention;
  912. let followSituation;
  913. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  914. let rowItem = this.state.selectedRows[idx];
  915. if (rowItem.id) {
  916. changeIds=rowItem.id;
  917. adminName=rowItem.adminName;
  918. customerStatus=rowItem.customerStatus;
  919. companyIntention=rowItem.companyIntention;
  920. followSituation=rowItem.followSituation;
  921. };
  922. };
  923. $.ajax({
  924. method: "post",
  925. dataType: "json",
  926. crossDomain: false,
  927. url: globalConfig.context + "/api/admin/customer/findAdmin",
  928. data: {
  929. id: changeIds,//这一行数据的ID
  930. beforeCompanyIntention:companyIntention,//意向服务
  931. beforeCustomerStatus:customerStatus,//客户状态
  932. beforeFollowSituation:followSituation,//最新跟进状态
  933. beforeAdminName:adminName,//跟进人
  934. }
  935. }).done(function (data) {
  936. if (data.error && data.error.length) {
  937. message.warning(data.error[0].message);
  938. } else {
  939. let theAssigne = [];
  940. if (!data.data) {
  941. if (data.error && data.error.length) {
  942. message.warning(data.error[0].message);
  943. };
  944. } else {
  945. for (let i = 0; i < data.data.length; i++) {
  946. let thisdata = data.data[i];
  947. //处理数据 进行循环
  948. theAssigne.push({
  949. key: thisdata.name,
  950. id: thisdata.id,
  951. ids: thisdata.cid,
  952. mobile:thisdata.mobile,
  953. adminName: thisdata.beforeAdminName,
  954. customerStatus: thisdata.beforeCustomerStatus,
  955. companyIntention: thisdata.beforeCompanyIntention,
  956. followSituation: thisdata.beforeFollowSituation,
  957. });
  958. };
  959. };
  960. this.setState({
  961. dataman: theAssigne,
  962. });
  963. }
  964. }.bind(this));
  965. },
  966. //选择了指定人之后的保存点击函数,需要修改函数
  967. changeAssigner() {
  968. this.setState({
  969. visible: false,
  970. });
  971. let changeId;
  972. let changeIds;
  973. let adminName;
  974. let beforeAdminName;
  975. let customerStatus;
  976. let companyIntention;
  977. let followSituation;
  978. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  979. let rowItem = this.state.selectedRows[idx];
  980. if (rowItem.id) {
  981. changeId=rowItem.id;
  982. beforeAdminName=rowItem.adminName;
  983. adminName=rowItem.key;
  984. customerStatus=rowItem.customerStatus;
  985. companyIntention=rowItem.companyIntention;
  986. followSituation=rowItem.followSituation;
  987. changeIds=rowItem.ids;
  988. };
  989. };
  990. $.ajax({
  991. method: "post",
  992. dataType: "json",
  993. crossDomain: false,
  994. url: globalConfig.context + "/api/admin/customer/transferCustomer",
  995. data: {
  996. id: changeIds,//这一行数据的ID
  997. aid:changeId,//指定转交人的ID
  998. beforeCompanyIntention:companyIntention,//意向服务
  999. beforeCustomerStatus:customerStatus,//客户状态
  1000. beforeFollowSituation:followSituation,//最新跟进状态
  1001. beforeAdminName:beforeAdminName,//之前的跟进人
  1002. adminName:adminName,//转交的跟进人
  1003. }
  1004. }).done(function (data) {
  1005. if (!data.error.length) {
  1006. message.success('转交成功!');
  1007. this.setState({
  1008. loading: false,
  1009. });
  1010. } else {
  1011. message.warning(data.error[0].message);
  1012. };
  1013. this.loadData();
  1014. }.bind(this));
  1015. },
  1016. handleOk(e){
  1017. this.setState({
  1018. visible: false,
  1019. });
  1020. },
  1021. handleCancel(e){
  1022. this.setState({
  1023. visible: false,
  1024. });
  1025. },
  1026. //点击公司名称,进行弹出框动作,同时进行资料详情查询
  1027. getInitialState() {
  1028. return {
  1029. technicalPictureUrl: [],
  1030. modal1Visible: false,
  1031. modal2Visible: false,
  1032. visible: false ,
  1033. searchMore: true,
  1034. searchType: 0,
  1035. validityPeriodDate: [],
  1036. releaseDate: [],
  1037. selectedRowKeys: [],
  1038. selectedRows: [],
  1039. loading: false,
  1040. pagination: {
  1041. defaultCurrent: 1,
  1042. defaultPageSize: 10,
  1043. showQuickJumper: true,
  1044. pageSize: 10,
  1045. onChange: function (page) {
  1046. this.loadData(page);
  1047. }.bind(this),
  1048. showTotal: function (total) {
  1049. return '共' + total + '条数据';
  1050. }
  1051. },
  1052. contactInformation:[
  1053. {
  1054. title: '姓名',
  1055. dataIndex: 'contactName',
  1056. key: 'contactName'
  1057. },{
  1058. title: '性别',
  1059. dataIndex: 'sex',
  1060. key: 'sex',
  1061. render: text => { return getsex(text); }
  1062. },
  1063. {
  1064. title: '手机号码',
  1065. dataIndex: 'telNum',
  1066. key: 'telNum'
  1067. },{
  1068. title: '座机号',
  1069. dataIndex: 'mobile',
  1070. key: 'mobile'
  1071. },{
  1072. title: 'QQ号码',
  1073. dataIndex: 'qq',
  1074. key: 'qq'
  1075. },{
  1076. title: '邮箱号',
  1077. dataIndex: 'email',
  1078. key: 'email'
  1079. },{
  1080. title: '微信',
  1081. dataIndex: 'wechat',
  1082. key: 'wechat'
  1083. },
  1084. ],
  1085. addFollow:[
  1086. {
  1087. title: '时间',
  1088. dataIndex: '_followDate',
  1089. key: '_followDate'
  1090. },{
  1091. title: '客户',
  1092. dataIndex: 'contactName',
  1093. key: 'contactName',
  1094. },
  1095. {
  1096. title: '跟进人',
  1097. dataIndex: 'adminName',
  1098. key: 'adminName'
  1099. },{
  1100. title: '联系方式',
  1101. dataIndex: 'contactInfo',
  1102. key: 'contactInfo'
  1103. },{
  1104. title: '客户状态',
  1105. dataIndex: '_customerStatus',
  1106. key: '_customerStatus'
  1107. },{
  1108. title: '跟进结果',
  1109. dataIndex: '_followSituation',
  1110. key: '_followSituation'
  1111. },{
  1112. title: '备注',
  1113. dataIndex: 'remarks',
  1114. key: 'remarks'
  1115. },
  1116. ],
  1117. achievement:[
  1118. {
  1119. title: '编号',
  1120. dataIndex: 'contactName',
  1121. key: 'contactName'
  1122. },{
  1123. title: '成果名称',
  1124. dataIndex: 'sex',
  1125. key: 'sex',
  1126. render: text => { return getsex(text); }
  1127. },
  1128. {
  1129. title: '关键字',
  1130. dataIndex: 'telNum',
  1131. key: 'telNum'
  1132. },{
  1133. title: '类型',
  1134. dataIndex: 'mobile',
  1135. key: 'mobile'
  1136. },{
  1137. title: '所有人名称',
  1138. dataIndex: 'qq',
  1139. key: 'qq'
  1140. },{
  1141. title: '审核状态',
  1142. dataIndex: 'email11',
  1143. key: 'email11'
  1144. },{
  1145. title: '是否精品',
  1146. dataIndex: 'wechat323',
  1147. key: 'wechat323'
  1148. },{
  1149. title: '首页展示',
  1150. dataIndex: 'email33',
  1151. key: 'email33'
  1152. },{
  1153. title: '发布时间',
  1154. dataIndex: 'wechat211',
  1155. key: 'wechat211'
  1156. },
  1157. ],
  1158. demand:[
  1159. {
  1160. title: '编号',
  1161. dataIndex: 'contactName',
  1162. key: 'contactName'
  1163. },{
  1164. title: '需求名称',
  1165. dataIndex: 'sex',
  1166. key: 'sex',
  1167. render: text => { return getsex(text); }
  1168. },
  1169. {
  1170. title: '是否精品',
  1171. dataIndex: 'telNum',
  1172. key: 'telNum'
  1173. },{
  1174. title: '首页展示',
  1175. dataIndex: 'mobile',
  1176. key: 'mobile'
  1177. },{
  1178. title: '关键字',
  1179. dataIndex: 'qq',
  1180. key: 'qq'
  1181. },{
  1182. title: '需求类型',
  1183. dataIndex: 'email44',
  1184. key: 'email44'
  1185. },{
  1186. title: '信息来源',
  1187. dataIndex: 'wechat',
  1188. key: 'wechat'
  1189. },{
  1190. title: '雇主名称',
  1191. dataIndex: 'email12',
  1192. key: 'email12'
  1193. },{
  1194. title: '审核状态',
  1195. dataIndex: 'wechat33',
  1196. key: 'wechat33'
  1197. },{
  1198. title: '需求状态',
  1199. dataIndex: 'email23',
  1200. key: 'email23'
  1201. },{
  1202. title: '有效期限',
  1203. dataIndex: 'wechat212',
  1204. key: 'wechat212'
  1205. },{
  1206. title: '发布时间',
  1207. dataIndex: 'wechat44',
  1208. key: 'wechat44'
  1209. },
  1210. ],
  1211. operationLog:[
  1212. {
  1213. title: '操作员姓名',
  1214. dataIndex: 'operatorName',
  1215. key: 'operatorName'
  1216. },{
  1217. title: '操作类型',
  1218. dataIndex: 'operatorType',
  1219. key: 'operatorType',
  1220. },
  1221. {
  1222. title: '操作时间',
  1223. dataIndex: 'operatorTime',
  1224. key: 'operatorTime'
  1225. },{
  1226. title: '修改前客户状态',
  1227. dataIndex: 'beforeCustomerStatus',
  1228. key: 'beforeCustomerStatus'
  1229. },{
  1230. title: '修改后客户状态',
  1231. dataIndex: 'afterCustomerStatus',
  1232. key: 'afterCustomerStatus'
  1233. },{
  1234. title: '修改前客户意向',
  1235. dataIndex: 'beforeCustomerIntention',
  1236. key: 'beforeCustomerIntention'
  1237. },{
  1238. title: '修改后客户意向',
  1239. dataIndex: 'afterCustomerIntention',
  1240. key: 'afterCustomerIntention'
  1241. },{
  1242. title: '修改前跟进进度',
  1243. dataIndex: 'beforeFollowSituation',
  1244. key: 'beforeFollowSituation'
  1245. },{
  1246. title: '修改后跟进进度',
  1247. dataIndex: 'afterFollowSituation',
  1248. key: 'afterFollowSituation'
  1249. },{
  1250. title: '修改前跟进人',
  1251. dataIndex: 'beforeAdminName',
  1252. key: 'beforeAdminName'
  1253. },{
  1254. title: '修改后跟进人',
  1255. dataIndex: 'afterAdminName',
  1256. key: 'afterAdminName'
  1257. },
  1258. ],
  1259. columnsman:[{
  1260. title: '姓名',
  1261. dataIndex: 'key',
  1262. key: 'key'
  1263. },{
  1264. title: '手机号码',
  1265. dataIndex: 'mobile',
  1266. key: 'mobile'
  1267. }
  1268. ],
  1269. columns: [
  1270. {
  1271. title: '公司名称',
  1272. dataIndex: 'companyName',
  1273. key: 'companyName',
  1274. }, {
  1275. title: '客户类型',
  1276. dataIndex: '_customerType',
  1277. key: '_customerType'
  1278. // render: text => { return getcustomerTyp(text); }
  1279. }, {
  1280. title: '地区',
  1281. dataIndex: 'locationProvince',
  1282. key: 'locationProvince',
  1283. render: text => { return getcityArr(text); }
  1284. }, {
  1285. title: '联系人姓名',
  1286. dataIndex: 'contactName',
  1287. key: 'contactName',
  1288. },
  1289. {
  1290. title: '手机号',
  1291. dataIndex: 'telNum',
  1292. key:'telNum',
  1293. },
  1294. {
  1295. title: '客户状态',
  1296. dataIndex: '_customerStatus',
  1297. key: '_customerStatus'
  1298. //render: text => { return getcustomerStatue(text) }
  1299. },
  1300. {
  1301. title: '意向服务',
  1302. dataIndex: '_companyIntention',
  1303. key: '_companyIntention',
  1304. },
  1305. {
  1306. title: '最新跟进',
  1307. dataIndex: '_followSituation',
  1308. key: '_followSituation',
  1309. },
  1310. {
  1311. title: '跟单人',
  1312. dataIndex: 'adminName',
  1313. key: 'adminName',
  1314. },
  1315. {
  1316. title: '时间',
  1317. dataIndex: 'followDate',
  1318. key: 'followDate',
  1319. }
  1320. ],
  1321. dataSource: [],
  1322. searchTime: [,]
  1323. };
  1324. },
  1325. componentWillMount() {
  1326. let theArr = [];
  1327. customerStatus.map(function (item) {
  1328. theArr.push(
  1329. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1330. )
  1331. });
  1332. let auditArr = [];
  1333. cityArr.map(function (item) {
  1334. auditArr.push(
  1335. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1336. )
  1337. });
  1338. let intentionalArr = [];
  1339. intentionalService.map(function (item) {
  1340. intentionalArr.push(
  1341. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1342. )
  1343. });
  1344. let newArr = [];
  1345. newFollow.map(function (item) {
  1346. newArr.push(
  1347. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1348. )
  1349. });
  1350. this.state.customerStatuarr = theArr;
  1351. this.state.auditStatusOption = auditArr;
  1352. this.state.intentionalOption = intentionalArr;
  1353. this.state.newOption = newArr;
  1354. this.loadData();
  1355. },
  1356. tableRowClick(record, index) {
  1357. this.state.RowData = record;
  1358. this.setModal5VisibleOk(record);
  1359. this.contactList(record.id);
  1360. this.rescordlist(record.id);
  1361. this.findCustomerHistory(record.id);
  1362. this.historyList(record.id);
  1363. this.setState({
  1364. rowId:record.id ,
  1365. before_customerStatus:record._customerStatus,
  1366. before_companyIntention:record._companyIntention,
  1367. before_followSituation:record._followSituation
  1368. })
  1369. },
  1370. //删除功能,已经完成
  1371. delectRow() {
  1372. let deletedIds;
  1373. let adminName;
  1374. let customerStatus;
  1375. let companyIntention;
  1376. let followSituation;
  1377. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1378. let rowItem = this.state.selectedRows[idx];
  1379. if (rowItem.id) {
  1380. deletedIds=rowItem.id;
  1381. adminName=rowItem.adminName;
  1382. customerStatus=rowItem.customerStatus;
  1383. companyIntention=rowItem.companyIntention;
  1384. followSituation=rowItem.followSituation;
  1385. };
  1386. };
  1387. this.state.data = []
  1388. this.setState({
  1389. selectedRowKeys: [],
  1390. });
  1391. $.ajax({
  1392. method: "post",
  1393. dataType: "json",
  1394. crossDomain: false,
  1395. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  1396. data: {
  1397. id: deletedIds,//删除的ID
  1398. beforeCustomerStatus:customerStatus,
  1399. beforeCompanyIntention:companyIntention,
  1400. beforeFollowSituation:followSituation,
  1401. beforeAdminName:adminName
  1402. }
  1403. }).done(function (data) {
  1404. if (!data.error.length) {
  1405. message.success('删除成功!');
  1406. this.setState({
  1407. loading: false,
  1408. });
  1409. } else {
  1410. message.warning(data.error[0].message);
  1411. };
  1412. this.loadData();
  1413. }.bind(this));
  1414. },
  1415. //删除功能
  1416. delectRowFollow() {
  1417. let deletedIds;
  1418. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1419. let rowItem = this.state.selectedRows[idx];
  1420. if (rowItem.id) {
  1421. deletedIds=rowItem.id;
  1422. };
  1423. };
  1424. this.state.data = []
  1425. this.setState({
  1426. selectedRowKeys: [],
  1427. });
  1428. $.ajax({
  1429. method: "post",
  1430. dataType: "json",
  1431. crossDomain: false,
  1432. url: globalConfig.context + "/api/admin/customer/deleteContacter",
  1433. data: {
  1434. contactId: deletedIds,//删除的ID
  1435. }
  1436. }).done(function (data) {
  1437. if (!data.error.length) {
  1438. message.success('删除成功!');
  1439. this.setState({
  1440. loading: false,
  1441. });
  1442. } else {
  1443. message.warning(data.error[0].message);
  1444. };
  1445. this.loadData();
  1446. }.bind(this));
  1447. },
  1448. //列表历史记录查询不带单选的
  1449. findCustomerHistory(cid){
  1450. $.ajax({
  1451. method: "get",
  1452. dataType: "json",
  1453. crossDomain: false,
  1454. url: globalConfig.context + "/api/admin/customer/findCustomerHistory",
  1455. data: {
  1456. customerId: cid,//这一行数据的ID
  1457. }
  1458. }).done(function (data) {
  1459. if (data.error && data.error.length) {
  1460. message.warning(data.error[0].message);
  1461. } else {
  1462. let theAssigne = [];
  1463. if (!data.data) {
  1464. if (data.error && data.error.length) {
  1465. message.warning(data.error[0].message);
  1466. };
  1467. }
  1468. this.setState({
  1469. dataRowhistory: data.data,
  1470. });
  1471. }
  1472. }.bind(this));
  1473. },
  1474. //历史记录列表查询
  1475. historyList(cid){
  1476. this.state.data = [];
  1477. this.setState({
  1478. loading: true
  1479. });
  1480. $.ajax({
  1481. method: "get",
  1482. dataType: "json",
  1483. crossDomain: false,
  1484. url:globalConfig.context + '/api/admin/customer/listCustomerLog',
  1485. data: {
  1486. customerId:cid
  1487. },
  1488. success: function (data) {
  1489. let theArr = [];
  1490. if (!data.data) {
  1491. if (data.error && data.error.length) {
  1492. message.warning(data.error[0].message);
  1493. };
  1494. } else {
  1495. for (let i = 0; i < data.data.length; i++) {
  1496. let thisdata = data.data[i];
  1497. // let intentionText=thisdata.beforeCustomerIntention.split(",");
  1498. // let intentionstring=intentionText.slice("0","2").join('-')
  1499. //console.log(intentionstring)
  1500. // let afterIntentionText=thisdata.afterCustomerIntention.split(",");
  1501. // let afterIntentionstring=afterIntentionText.slice("0","2").join('-')
  1502. theArr.push({
  1503. key:i,
  1504. operatorName:thisdata.operatorName,//操作员姓名
  1505. operatorType:thisdata.operatorType,//操作类型
  1506. operatorTime:thisdata.operatorTime, //操作时间
  1507. beforeCustomerStatus:thisdata.beforeCustomerStatus, //修改前客户状态
  1508. afterCustomerStatus:thisdata.afterCustomerStatus,//修改后客户状态
  1509. beforeCustomerIntention:thisdata.beforeCustomerIntention,//修改前客户意向
  1510. afterCustomerIntention:thisdata.afterCustomerIntention,//修改后客户意向
  1511. beforeFollowSituation:thisdata.beforeFollowSituation,//修改前跟进进度
  1512. afterFollowSituation:thisdata.afterFollowSituation,//修改后跟进进度
  1513. beforeAdminName:thisdata.beforeAdminName,//修改前跟进人
  1514. afterAdminName:thisdata.afterAdminName,//修改后跟进人
  1515. });
  1516. };
  1517. };
  1518. this.setState({//导出数据
  1519. Logrecord: theArr,
  1520. });
  1521. }.bind(this),
  1522. }).always(function () {
  1523. this.setState({
  1524. loading: false
  1525. });
  1526. }.bind(this));
  1527. },
  1528. //转为公共客户功能
  1529. callback(e){
  1530. if(e==1){
  1531. this.Detailload(this.state.rowId)
  1532. this.getNewWoman(this.state.rowId);
  1533. }
  1534. if(e==2){
  1535. this.rescordlist(this.state.rowId)
  1536. }
  1537. if(e==3){
  1538. this.Detailload(this.state.rowId)
  1539. }
  1540. if(e==4){
  1541. this.findCustomerHistory(this.state.rowId)
  1542. this.historyList(this.state.rowId)
  1543. }
  1544. },
  1545. changeRow() {
  1546. let deletedIds;
  1547. let customerStatus;
  1548. let companyIntention;
  1549. let followSituation;
  1550. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1551. let rowItem = this.state.selectedRows[idx];
  1552. if (rowItem.id) {
  1553. deletedIds=rowItem.id;
  1554. customerStatus=rowItem.customerStatus;
  1555. companyIntention=rowItem.companyIntention;
  1556. followSituation=rowItem.followSituation;
  1557. };
  1558. };
  1559. this.setState({
  1560. selectedRowKeys: [],
  1561. });
  1562. $.ajax({
  1563. method: "post",
  1564. dataType: "json",
  1565. crossDomain: false,
  1566. url: globalConfig.context + "/api/admin/customer/transferToPublic",
  1567. data: {
  1568. aid:this.state.aid,
  1569. id: deletedIds,
  1570. beforeCompanyIntention:companyIntention,//意向服务
  1571. beforeCustomerStatus:customerStatus,//客户状态
  1572. beforeFollowSituation:followSituation,//最新跟进状态
  1573. }
  1574. }).done(function (data) {
  1575. if (!data.error.length) {
  1576. message.success('已转为公共客户!');
  1577. this.setState({
  1578. loading: false,
  1579. });
  1580. } else {
  1581. message.warning(data.error[0].message);
  1582. };
  1583. this.loadData();
  1584. }.bind(this));
  1585. },
  1586. addClick() {
  1587. this.state.RowData = {};
  1588. this.setState({
  1589. showDesc: true
  1590. });
  1591. },
  1592. closeDesc(e, s) {
  1593. this.state.showDesc = e;
  1594. if (s) {
  1595. this.loadData();
  1596. };
  1597. },
  1598. search() {
  1599. this.loadData();
  1600. },
  1601. reset() {
  1602. this.state.companyNamet='';
  1603. this.state.customerTypet = undefined;
  1604. this.state.id = undefined;
  1605. this.state.shareTypet = undefined;
  1606. this.state.companyIntentiont = undefined;
  1607. this.state.followSituationt = undefined;
  1608. this.state.locationProvincet = undefined;
  1609. this.state.customerStatust = undefined;
  1610. this.state.contactNamet = undefined;
  1611. this.state.contactTelt = undefined;
  1612. this.state.contactNamet = undefined;
  1613. this.state.releaseDatet = [];
  1614. this.loadData();
  1615. },
  1616. searchSwitch() {
  1617. this.setState({
  1618. searchMore: !this.state.searchMore
  1619. });
  1620. },
  1621. //快速新增联系人
  1622. addContant(){
  1623. this.setModal2VisibleOk()
  1624. this.state.hotst=undefined;
  1625. this.state.hott=undefined;
  1626. this.state.paymentIdt='';
  1627. this.state.entIdt='';
  1628. this.state.payt='';
  1629. this.state.paymt='';
  1630. this.state.paytIdtt='';
  1631. this.state.paentIdt='';
  1632. this.state.payIdt='';
  1633. this.state.emailst='';
  1634. },
  1635. //添加跟进记录没单选的情况下
  1636. addcord(){
  1637. var addcord=this.state.rowId
  1638. this.setState({modal1Visible:true});
  1639. this.setState({
  1640. remarks:''
  1641. });
  1642. this.Detailload(addcord);
  1643. this.getNewWoman(addcord)
  1644. },
  1645. render() {
  1646. const FormItem = Form.Item
  1647. const rowSelection = {
  1648. selectedRowKeys: this.state.selectedRowKeys,
  1649. onChange: (selectedRowKeys, selectedRows) => {
  1650. this.setState({
  1651. selectedRows: selectedRows.slice(-1),
  1652. selectedRowKeys: selectedRowKeys.slice(-1)
  1653. });
  1654. }
  1655. };
  1656. const hasSelected = this.state.selectedRowKeys.length > 0;
  1657. const { RangePicker } = DatePicker;
  1658. const theData = this.props.data || {};
  1659. const { getFieldDecorator } = this.props.form;
  1660. const formItemLayout = {
  1661. labelCol: { span: 8 },
  1662. wrapperCol: { span: 14 },
  1663. };
  1664. const theDatak = this.state.datak || {};
  1665. const theDatat = this.state.data || {};
  1666. const theDatahistory=this.state.dataRowhistory || {};
  1667. const contactsOption="";
  1668. const formItemLayput = {
  1669. labelCol: { span: 10 },
  1670. wrapperCol: { span: 14 },
  1671. };
  1672. return (
  1673. <div className="user-content" >
  1674. <div className="content-title">
  1675. <span>客户管理</span>
  1676. <div className="patent-addNew clearfix" style={{marginRight:"22px"}}>
  1677. <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>
  1678. </div>
  1679. </div>
  1680. <div className="user-search">
  1681. <Input placeholder="公司名称"
  1682. value={this.state.companyNamet}
  1683. onChange={(e) => { this.setState({ companyNamet: e.target.value }); }} />
  1684. <Select placeholder="客户类型" style={{ width: 120 }}
  1685. value={this.state.customerTypet }
  1686. onChange={(e) => { this.setState({ customerTypet : e }) }}>
  1687. <Select.Option value="0" >个人客户</Select.Option>
  1688. <Select.Option value="1" >公司客户</Select.Option>
  1689. <Select.Option value="2" >团体单位</Select.Option>
  1690. </Select>
  1691. <Select placeholder="意向服务"
  1692. style={{ width: 160 }}
  1693. value={this.state.companyIntentiont}
  1694. onChange={(e) => { this.setState({ companyIntentiont: e }) }}>
  1695. {this.state.intentionalOption}
  1696. </Select>
  1697. <Select placeholder="跟进进度"
  1698. style={{ width: 160 }}
  1699. value={this.state.followSituationt}
  1700. onChange={(e) => { this.setState({ followSituationt: e }) }}>
  1701. {this.state.newOption}
  1702. </Select>
  1703. <Select placeholder="地区"
  1704. style={{ width: 160 }}
  1705. value={this.state.locationProvincet}
  1706. onChange={(e) => { this.setState({ locationProvincet: e }) }}>
  1707. {this.state.auditStatusOption}
  1708. </Select>
  1709. <Select placeholder="客户状态" style={{ width: 120 }}
  1710. value={this.state.customerStatust}
  1711. onChange={(e) => { this.setState({customerStatust: e }) }}>
  1712. {this.state.customerStatuarr}
  1713. </Select>
  1714. <Button type="primary" onClick={this.search}>搜索</Button>
  1715. <Button onClick={this.reset}>重置</Button>
  1716. <Button onClick={this.setModal3VisibleOk} style={{marginRight:'10px'}} disabled={!hasSelected}>查看跟进记录</Button>
  1717. <Button type="primary" onClick={this.setModal1VisibleOk} disabled={!hasSelected}>添加跟进记录</Button>
  1718. <Button type="primary" onClick={this.showModa} disabled={!hasSelected}>指定转交人</Button>
  1719. <Modal
  1720. footer=''
  1721. title="选择指定人"
  1722. visible={this.state.visible}
  1723. onOk={this.handleOk}
  1724. onCancel={this.handleCancel}
  1725. >
  1726. <Spin spinning={this.state.loading}>
  1727. <Table
  1728. columns={this.state.columnsman}
  1729. rowSelection={rowSelection}
  1730. dataSource={this.state.dataman}
  1731. />
  1732. <FormItem wrapperCol={{ span: 12, offset: 12 }}>
  1733. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
  1734. <Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
  1735. </FormItem>
  1736. </Spin>
  1737. </Modal>
  1738. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  1739. disabled={!hasSelected}
  1740. onClick={this.changeRow}>转为公共客户<Icon /></Button>
  1741. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  1742. disabled={!hasSelected}
  1743. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  1744. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1745. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1746. <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
  1747. value={this.state.contactNamet}
  1748. onChange={(e) => { this.setState({ contactNamet: e.target.value }); }} />
  1749. <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
  1750. value={this.state.contactTelt }
  1751. onChange={(e) => { this.setState({ contactTelt: e.target.value }); }} />
  1752. </div>
  1753. </div>
  1754. <div className="patent-table">
  1755. <Spin spinning={this.state.loading}>
  1756. <Table columns={this.state.columns}
  1757. dataSource={this.state.dataSource}
  1758. rowSelection={rowSelection}
  1759. pagination={this.state.pagination}
  1760. onRowClick={this.tableRowClick}
  1761. />
  1762. </Spin>
  1763. </div>
  1764. <Modal
  1765. style={{left:'500px'}}
  1766. footer=''
  1767. title="客户详细信息"
  1768. width='400px'
  1769. visible={this.state.modal4Visible}
  1770. onOk={this.setModal4Visiblecancel}
  1771. onCancel={this.setModal4Visiblecancel}
  1772. >
  1773. <Form horizontal onSubmit={this.submitcontact} id="demand-form">
  1774. <Spin spinning={this.state.loading}>
  1775. <div className='clearfix'>
  1776. <FormItem className="half-item"
  1777. {...formItemLayput}
  1778. label="所属公司" >
  1779. <span>{this.state.companyName}</span>
  1780. </FormItem>
  1781. <FormItem className="half-item"
  1782. {...formItemLayput}
  1783. label="性别" >
  1784. <span>{getsex(this.state.sex)}</span>
  1785. </FormItem>
  1786. <FormItem className="half-item"
  1787. {...formItemLayput}
  1788. label="姓名" >
  1789. <span>{this.state.name}</span>
  1790. </FormItem>
  1791. <FormItem className="half-item"
  1792. {...formItemLayput}
  1793. label="QQ号" >
  1794. <span>{this.state.qq}</span>
  1795. </FormItem>
  1796. <FormItem className="half-item"
  1797. {...formItemLayput}
  1798. label="手机号" >
  1799. <span>{this.state.telNum}</span>
  1800. </FormItem>
  1801. <FormItem className="half-item"
  1802. {...formItemLayput}
  1803. label="部门" >
  1804. <span>{this.state.depatrment}</span>
  1805. </FormItem>
  1806. <FormItem className="half-item"
  1807. {...formItemLayput}
  1808. label="职位" >
  1809. <span>{this.state.customerPosition}</span>
  1810. </FormItem>
  1811. <FormItem className="half-item"
  1812. {...formItemLayput}
  1813. label="微信号" >
  1814. <span>{this.state.wechat}</span>
  1815. </FormItem>
  1816. </div>
  1817. </Spin>
  1818. </Form>
  1819. </Modal>
  1820. <Modal
  1821. footer=''
  1822. title="历史记录列表"
  1823. width='800px'
  1824. visible={this.state.modal3Visible}
  1825. onOk={this.setModal3Visiblecancel}
  1826. onCancel={this.setModal3Visiblecancel}
  1827. >
  1828. <Spin spinning={this.state.loading}>
  1829. <Table dataSource={this.state.datahistory} >
  1830. <Column
  1831. title="时间"
  1832. dataIndex="_followDate"
  1833. key="_followDate"
  1834. />
  1835. <Column
  1836. title="客户"
  1837. dataIndex="contactName"
  1838. key="contactName"
  1839. render={(text, record,index) => (
  1840. <a href="#" onClick={() => this.setModal4Visible(true,index)}>{text}</a>
  1841. )}
  1842. />
  1843. <Column
  1844. title="跟进人"
  1845. dataIndex="adminName"
  1846. key="adminName"
  1847. />
  1848. <Column
  1849. title="联系方式"
  1850. dataIndex="contactInfo"
  1851. key="contactInfo"
  1852. />
  1853. <Column
  1854. title="最新跟进状态"
  1855. dataIndex="_followSituation"
  1856. key="_followSituation"
  1857. />
  1858. <Column
  1859. title="跟进结果"
  1860. dataIndex="followResult"
  1861. key="followResult"
  1862. render={(text, record) => (
  1863. <div>
  1864. <a href="#" onClick={this.setModal6VisibleOk}>{text}</a>
  1865. </div>
  1866. )}
  1867. />
  1868. <Column
  1869. title="删除记录"
  1870. key="del"
  1871. render={(text, record, index) => (
  1872. <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
  1873. <a href="#" style={{color:"#f00"}}>删除</a>
  1874. </Popconfirm>
  1875. )}
  1876. />
  1877. </Table>
  1878. </Spin>
  1879. </Modal>
  1880. <Modal
  1881. className="followrecord"
  1882. style={{zIndex:'120'}}
  1883. footer=''
  1884. title="新增跟进记录"
  1885. width='1000px'
  1886. visible={this.state.modal1Visible}
  1887. onOk={this.setModal1Visiblecancel}
  1888. onCancel={this.setModal1Visiblecancel}
  1889. >
  1890. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  1891. <Spin spinning={this.state.loading}>
  1892. <div className="user-search">
  1893. <div className="clearfix">
  1894. <FormItem className="half-item"
  1895. {...formItemLayout}
  1896. label="客户公司名称:" >
  1897. <span>{theDatak.companyName}</span>
  1898. </FormItem>
  1899. </div>
  1900. <FormItem className="half-item"
  1901. {...formItemLayout}
  1902. label="最新联系人:" >
  1903. <Select placeholder="选择联系人" style={{ width: 140 }}
  1904. value={this.state.lastName}
  1905. onChange={this.hundleName}>
  1906. {this.state.orderStatusOption}
  1907. </Select>
  1908. <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theDatat.customerTyp)}
  1909. <Button type="primary" onClick={this.setModal2VisibleOk}>添加</Button>
  1910. </span>
  1911. </FormItem>
  1912. <FormItem className="half-item"
  1913. {...formItemLayout}
  1914. label="联系方式" >
  1915. <Select placeholder="选择方式" style={{width:'100px'}} value={this.state.contacts}
  1916. onChange={this.contacts}>
  1917. <Select.Option value="0">电话</Select.Option>
  1918. <Select.Option value="1">邮件</Select.Option>
  1919. <Select.Option value="2">微信</Select.Option>
  1920. <Select.Option value="3">QQ</Select.Option>
  1921. </Select>
  1922. <span style={{marginLeft:'20px'}}>{this.state.nub}</span>
  1923. </FormItem>
  1924. <FormItem className="half-item"
  1925. {...formItemLayout}
  1926. label="最近跟进时间:" >
  1927. <span>{theDatak.createTime}</span>
  1928. </FormItem>
  1929. <div>
  1930. <FormItem className="half-item"
  1931. {...formItemLayout}
  1932. label="最新跟进时间" >
  1933. <DatePicker placeholder="更新日期" value={moment(this.state.createYear,'YYYY-MM-DD')} onChange={(time) => {this.setState({createYear: time});}}/>
  1934. <TimePicker placeholder="更新时间" value={moment(this.state.creatMent, 'HH:mm:ss')} onChange={(time) => { this.setState({creatMent: time}); }}/>
  1935. </FormItem>
  1936. </div>
  1937. <FormItem className="half-item"
  1938. {...formItemLayout}
  1939. label="客户状态:" >
  1940. <span>{this.state._customerStatus}</span>
  1941. </FormItem>
  1942. <FormItem className="half-item"
  1943. {...formItemLayout}
  1944. label="最新客户状态" >
  1945. <Select placeholder="选择客户状态" style={{width:'200px'}} value={this.state.customerStatus} onChange={(e) => { this.setState({customerStatus: e}); }}>
  1946. {
  1947. customerStatus.map(function (item) {
  1948. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1949. })
  1950. }
  1951. </Select>
  1952. </FormItem>
  1953. <FormItem className="half-item"
  1954. {...formItemLayout}
  1955. label="跟进状态:" >
  1956. <span>{this.state._followSituation}</span>
  1957. </FormItem>
  1958. <FormItem className="half-item"
  1959. {...formItemLayout}
  1960. label="最新跟进状态" >
  1961. <Select placeholder="选择跟进状态" style={{width:'200px'}} value={this.state.followSituation} onChange={(e) => { this.setState({followSituation: e}); }}>
  1962. {
  1963. newFollow.map(function (item) {
  1964. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1965. })
  1966. }
  1967. </Select>
  1968. </FormItem>
  1969. <div className="clearfix">
  1970. <FormItem
  1971. labelCol={{ span: 4 }}
  1972. wrapperCol={{ span: 18 }}
  1973. label="跟进结果" >
  1974. {getFieldDecorator('remarks', {
  1975. initialValue: this.state.remarks
  1976. })(
  1977. <Input type="textarea" rows={4} />
  1978. )}
  1979. </FormItem>
  1980. </div>
  1981. <div className="clearfix">
  1982. <FormItem
  1983. labelCol={{ span: 4 }}
  1984. wrapperCol={{ span: 18 }}
  1985. label="技术图片" >
  1986. <PicturesWall
  1987. pictureSign="customer_sys_file"
  1988. fileList={this.getTechnicalPictureUrl}
  1989. pictureUrl={this.state.technicalPictureUrl} />
  1990. <p>图片建议:图片要清晰。</p>
  1991. </FormItem>
  1992. </div>
  1993. <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.addFollowSubmit}>保存</Button>
  1994. <Button className="set-submit" type="ghost" onClick={this.setModal1Visiblecancel} id='change_rem'>取消</Button>
  1995. </div>
  1996. </Spin>
  1997. </Form >
  1998. </Modal>
  1999. <Modal
  2000. className="customeDetails"
  2001. style={{zIndex:'100'}}
  2002. footer=''
  2003. title="客户详情"
  2004. width='1200px'
  2005. visible={this.state.modal5Visible}
  2006. onOk={this.setModal5Visiblecancel}
  2007. onCancel={this.setModal5Visiblecancel}
  2008. >
  2009. <Tabs defaultActiveKey="1" onChange={this.callback}>
  2010. <TabPane tab="基本资料" key="1">
  2011. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  2012. <Spin spinning={this.state.loading}>
  2013. <div className="clearfix">
  2014. <p style={{marginLeft:'50px',marginBottom:'20px',marginTop:'10px',fontSize:'18px'}}>公司资料</p>
  2015. </div>
  2016. <div className="clearfix">
  2017. <FormItem className="half-item"
  2018. {...formItemLayout}
  2019. label="公司名称" >
  2020. <Input type="text" value={this.state.companyName} onChange={(e) => { this.setState({companyName: e.target.value }); }}/>
  2021. </FormItem>
  2022. <FormItem className="half-item"
  2023. {...formItemLayout}
  2024. label="地区" >
  2025. <Select placeholder="选择地区" style={{ width: 160 }} value={this.state.locationProvince} onChange={(e) => { this.setState({locationProvince: e }); }}>
  2026. {
  2027. cityArr.map(function (item) {
  2028. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2029. })
  2030. }
  2031. </Select>
  2032. </FormItem>
  2033. </div>
  2034. <FormItem className="half-item"
  2035. {...formItemLayout}
  2036. label="公司行业" >
  2037. <Input type="text" value={this.state.companyIndustry} onChange={(e) => { this.setState({companyIndustry: e.target.value }); }}/>
  2038. </FormItem>
  2039. <FormItem className="half-item"
  2040. {...formItemLayout}
  2041. label="详细地址" >
  2042. <Input type="text" value={this.state.adress} onChange={(e) => { this.setState({adress: e.target.value }); }}/>
  2043. </FormItem>
  2044. <FormItem className="half-item"
  2045. {...formItemLayout}
  2046. label="客户状态" >
  2047. <Select placeholder="选择客户状态" style={{ width: 120 }}
  2048. value={getcustomerStatue(this.state.customerStatus)}
  2049. onChange={(e) => { this.setState({customerStatus: e }) }}>
  2050. {this.state.customerStatuarr}
  2051. </Select>
  2052. </FormItem>
  2053. <FormItem className="half-item" style={{marginLeft:'96px'}}
  2054. labelCol={{ span: 4 }}
  2055. wrapperCol={{ span: 18 }}
  2056. label="意向服务" >
  2057. <Select placeholder="选择意向服务" style={{width:'200px'}} value={this.state.companyIntention} onChange={(e) => { this.setState({companyIntention: e}); }}>
  2058. {
  2059. intentionalService.map(function (item) {
  2060. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2061. })
  2062. }
  2063. </Select>
  2064. </FormItem>
  2065. <FormItem className="half-item"
  2066. {...formItemLayout}
  2067. label="客户来源" >
  2068. <span>{this.state.laiyuan}</span>
  2069. </FormItem>
  2070. <FormItem className="half-item"
  2071. {...formItemLayout}
  2072. label="标签" >
  2073. <span>{theDatak.tag}</span>
  2074. </FormItem>
  2075. <FormItem className="half-item"
  2076. {...formItemLayout}
  2077. label="最新跟进" >
  2078. <span>{this.state._followSituation}</span>
  2079. </FormItem>
  2080. <div className="clearfix">
  2081. <FormItem
  2082. labelCol={{ span: 4 }}
  2083. wrapperCol={{ span: 18 }}
  2084. label="备注" >
  2085. <span>{theDatak.remarks}</span>
  2086. </FormItem>
  2087. </div>
  2088. <FormItem wrapperCol={{ span: 12, offset: 4 }} style={{marginTop:'25px'}}>
  2089. <Button className="set-submit" type="primary" htmlType="submit" style={{marginRight:"40px"}}>保存</Button>
  2090. <Button className="set-submit" type="ghost" onClick={this.setModal5Visiblecancel}>取消</Button>
  2091. </FormItem>
  2092. <div className="clearfix">
  2093. <p style={{marginLeft:'50px',marginBottom:'20px',marginTop:'10px',fontSize:'18px'}}>联系人<Button type="primary" onClick={this.addContant} style={{marginLeft:'20px'}}>快速新增联系人</Button></p>
  2094. </div>
  2095. <div className="clearfix" style={{marginBottom:'100px'}}>
  2096. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2097. columns={this.state.contactInformation}
  2098. dataSource={this.state.information}
  2099. onRowClick={this.informationRowClick}
  2100. />
  2101. </div>
  2102. </Spin>
  2103. </Form>
  2104. </TabPane>
  2105. <TabPane tab="跟进记录" key="2">
  2106. <Button type="primary" onClick={this.addcord} style={{marginLeft:"75px"}}>添加跟进记录</Button>
  2107. <div className="clearfix" style={{marginBottom:'100px'}}>
  2108. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2109. columns={this.state.addFollow}
  2110. dataSource={this.state.datahistory}
  2111. />
  2112. </div>
  2113. </TabPane>
  2114. <TabPane tab="业务操作" key="3">
  2115. <div style={{marginLeft:"50px",fontSize:'18px'}}>科技成果</div>
  2116. <div className="clearfix">
  2117. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2118. columns={this.state.achievement}
  2119. dataSource={this.state.achievementrecord}
  2120. />
  2121. </div>
  2122. <div style={{marginLeft:"50px",marginTop:'20px',fontSize:'18px'}}>科技需求</div>
  2123. <div className="clearfix" style={{marginBottom:'100px'}}>
  2124. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2125. columns={this.state.demand}
  2126. dataSource={this.state.demandrecord}
  2127. />
  2128. </div>
  2129. </TabPane>
  2130. <TabPane tab="历史记录" key="4">
  2131. <Form horizontal id="demand-form">
  2132. <Spin spinning={this.state.loading}>
  2133. <div className="clearfix">
  2134. <FormItem className="half-item"
  2135. {...formItemLayout}
  2136. label="注册账号" >
  2137. <span>{theDatahistory.customerName}</span>
  2138. </FormItem>
  2139. </div>
  2140. <FormItem className="half-item"
  2141. {...formItemLayout}
  2142. label="录入时间" >
  2143. <span>{theDatahistory.createTime}</span>
  2144. </FormItem>
  2145. <FormItem className="half-item"
  2146. {...formItemLayout}
  2147. label="跟单人" >
  2148. <span>{theDatahistory.adminName}</span>
  2149. </FormItem>
  2150. <FormItem className="half-item"
  2151. {...formItemLayout}
  2152. label="跟进次数" >
  2153. <span>{theDatahistory.followCount}</span>
  2154. </FormItem>
  2155. <FormItem className="half-item"
  2156. {...formItemLayout}
  2157. label="当前客户状态持续时间" >
  2158. <span>{theDatahistory.diffDate}</span>
  2159. </FormItem>
  2160. <FormItem className="half-item"
  2161. {...formItemLayout}
  2162. label="最后跟进联系人" >
  2163. <span>{theDatahistory.contactName}</span>
  2164. </FormItem>
  2165. <FormItem className="half-item"
  2166. {...formItemLayout}
  2167. label="最后跟进时间" >
  2168. <span>{theDatahistory.followDate}</span>
  2169. </FormItem>
  2170. <FormItem className="half-item"
  2171. {...formItemLayout}
  2172. label="最后客户状态" >
  2173. <span>{getcustomerStatue(theDatahistory.customerStatus)}</span>
  2174. </FormItem>
  2175. <FormItem className="half-item"
  2176. {...formItemLayout}
  2177. label="最后跟进状态" >
  2178. <span>{getfllowSituation(theDatahistory.followSituation)}</span>
  2179. </FormItem>
  2180. <FormItem className="half-item"
  2181. {...formItemLayout}
  2182. label="操作日志" >
  2183. <span>查看列表<Switch defaultChecked={false} onChange={this.searchSwitch} style={{marginLeft:'10px'}}/></span>
  2184. </FormItem>
  2185. <FormItem className="half-item" style={{marginBottom:'50px'}}
  2186. {...formItemLayout}
  2187. label="最后修改时间" >
  2188. <span>{theDatahistory.operatorTime}</span>
  2189. </FormItem>
  2190. <div className="search-more clearfix" style={this.state.searchMore ? { display: 'none' } : {}}>
  2191. <Table style={{background:'none',textAlign:'center'}} className="tabcolor"
  2192. columns={this.state.operationLog}
  2193. dataSource={this.state.Logrecord}
  2194. bordered
  2195. />
  2196. </div>
  2197. </Spin>
  2198. </Form>
  2199. </TabPane>
  2200. </Tabs>
  2201. </Modal>
  2202. <Modal
  2203. className="newContacts"
  2204. style={{zIndex:'300'}}
  2205. footer=''
  2206. width='800px'
  2207. title="新增联系人"
  2208. visible={this.state.modal2Visible}
  2209. onOk={this.setModal2Visiblecancel}
  2210. onCancel={this.setModal2Visiblecancel}
  2211. >
  2212. <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
  2213. <Spin spinning={this.state.loading}>
  2214. <Row>
  2215. <FormItem
  2216. labelCol={{ span: 4 }}
  2217. wrapperCol={{ span: 14 }}
  2218. label="是否是主要联系人:" style={{marginRight:'10px'}}>
  2219. <Radio.Group value={this.state.hotst} onChange={(e) => {
  2220. this.setState({ hotst: e.target.value })
  2221. }}>
  2222. <Radio value={0}>是</Radio>
  2223. <Radio value={1}>否</Radio>
  2224. </Radio.Group>
  2225. </FormItem>
  2226. <FormItem
  2227. labelCol={{ span: 4 }}
  2228. wrapperCol={{ span: 14 }}
  2229. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  2230. <Radio.Group value={this.state.hott} onChange={(e) => {
  2231. this.setState({ hott: e.target.value })
  2232. }}>
  2233. <Radio value={0}>男</Radio>
  2234. <Radio value={1}>女</Radio>
  2235. </Radio.Group>
  2236. </FormItem>
  2237. </Row>
  2238. <Row style={{ paddingLeft:'50px' }}>
  2239. <Col span={2}>姓名:</Col>
  2240. <Col span={8}>
  2241. <Input value={this.state.paymentIdt}
  2242. onChange={(e) => { this.setState({ paymentIdt: e.target.value }) }} />
  2243. </Col>
  2244. <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
  2245. <Col span={8}>
  2246. <Input value={this.state.entIdt}
  2247. onChange={(e) => { this.setState({ entIdt: e.target.value }) }} />
  2248. </Col>
  2249. </Row>
  2250. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  2251. <Col span={2}>手机号:</Col>
  2252. <Col span={8}>
  2253. <Input value={this.state.payt}
  2254. onChange={(e) => { this.setState({ payt: e.target.value }) }} />
  2255. </Col>
  2256. <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
  2257. <Col span={8}>
  2258. <Input value={this.state.paymt}
  2259. onChange={(e) => { this.setState({ paymt: e.target.value }) }} />
  2260. </Col>
  2261. </Row>
  2262. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  2263. <Col span={2}>部门:</Col>
  2264. <Col span={8}>
  2265. <Input value={this.state.paytIdtt}
  2266. onChange={(e) => { this.setState({ paytIdtt: e.target.value }) }} />
  2267. </Col>
  2268. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  2269. <Col span={8}>
  2270. <Input value={this.state.paentIdt}
  2271. onChange={(e) => { this.setState({ paentIdt: e.target.value }) }} />
  2272. </Col>
  2273. </Row>
  2274. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  2275. <Col span={2}>微信号:</Col>
  2276. <Col span={8}>
  2277. <Input value={this.state.payIdt}
  2278. onChange={(e) => { this.setState({ payIdt: e.target.value }) }} />
  2279. </Col>
  2280. <Col span={2} style={{ marginLeft: '50px' }}>邮箱:</Col>
  2281. <Col span={8}>
  2282. <Input value={this.state.emailst}
  2283. onChange={(e) => { this.setState({ emailst: e.target.value }) }} />
  2284. </Col>
  2285. </Row>
  2286. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  2287. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  2288. <Button className="set-submit" type="ghost" onClick={this.setModal2Visiblecancel} id='change_rem'>取消</Button>
  2289. </Row>
  2290. </Spin>
  2291. </Form>
  2292. </Modal>
  2293. <Modal
  2294. width="600px"
  2295. footer=''
  2296. title="联系人详细信息"
  2297. visible={this.state.modal8Visible}
  2298. onOk={this.setModal8Visiblecancel}
  2299. onCancel={this.setModal8Visiblecancel}>
  2300. <div style={{paddingRight:"50px"}}>
  2301. <FormItem className="half-item"
  2302. {...formItemLayout}
  2303. label="姓名" >
  2304. {getFieldDecorator('name', {
  2305. initialValue: this.state.name
  2306. })(
  2307. <Input onChange={(e) => { this.setState({ name: e.target.value }) }}/>
  2308. )}
  2309. </FormItem>
  2310. <FormItem className="half-item"
  2311. {...formItemLayout}
  2312. label="性别" >
  2313. {getFieldDecorator('sex', {
  2314. initialValue: this.state.sex
  2315. })(
  2316. <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
  2317. <Radio value="0">男</Radio>
  2318. <Radio value="1">女</Radio>
  2319. </Radio.Group>
  2320. )}
  2321. </FormItem>
  2322. <FormItem
  2323. labelCol={{ span: 6 }}
  2324. wrapperCol={{ span: 14 }}
  2325. label="是否是主要联系人:" style={{marginLeft:"65px"}}>
  2326. {getFieldDecorator('primaryFlg', {
  2327. initialValue: this.state.primaryFlg
  2328. })(
  2329. <Radio.Group onChange={(e) => {this.setState({primaryFlg: e.target.value });}}>
  2330. <Radio value={0}>是</Radio>
  2331. <Radio value={1}>否</Radio>
  2332. </Radio.Group>
  2333. )}
  2334. </FormItem>
  2335. <FormItem className="half-item"
  2336. {...formItemLayout}
  2337. label="手机号码" >
  2338. {getFieldDecorator('telNum', {
  2339. initialValue: this.state.telNum
  2340. })(
  2341. <Input onChange={(e) => { this.setState({ telNum: e.target.value }) }}/>
  2342. )}
  2343. </FormItem>
  2344. <FormItem className="half-item"
  2345. {...formItemLayout}
  2346. label="座机号" >
  2347. {getFieldDecorator('mobile', {
  2348. initialValue: this.state.mobile
  2349. })(
  2350. <Input onChange={(e) => { this.setState({ mobile: e.target.value }) }}/>
  2351. )}
  2352. </FormItem>
  2353. <FormItem className="half-item"
  2354. {...formItemLayout}
  2355. label="QQ号码" >
  2356. {getFieldDecorator('qq', {
  2357. initialValue: this.state.qq
  2358. })(
  2359. <Input onChange={(e) => { this.setState({ qq: e.target.value }) }}/>
  2360. )}
  2361. </FormItem>
  2362. <FormItem className="half-item"
  2363. {...formItemLayout}
  2364. label="邮箱号" >
  2365. {getFieldDecorator('email', {
  2366. initialValue: this.state.email
  2367. })(
  2368. <Input onChange={(e) => { this.setState({ email: e.target.value }) }}/>
  2369. )}
  2370. </FormItem>
  2371. <FormItem className="half-item"
  2372. {...formItemLayout}
  2373. label="微信" >
  2374. {getFieldDecorator('wechat', {
  2375. initialValue: this.state.wechat
  2376. })(
  2377. <Input onChange={(e) => { this.setState({ wechat: e.target.value }) }}/>
  2378. )}
  2379. </FormItem>
  2380. <FormItem className="half-item"
  2381. {...formItemLayout}
  2382. label="部门" >
  2383. {getFieldDecorator('depatrment', {
  2384. initialValue: this.state.depatrment
  2385. })(
  2386. <Input onChange={(e) => { this.setState({ depatrment: e.target.value }) }}/>
  2387. )}
  2388. </FormItem>
  2389. <FormItem className="half-item"
  2390. {...formItemLayout}
  2391. label="职位" >
  2392. {getFieldDecorator('customerPosition', {
  2393. initialValue: this.state.customerPosition
  2394. })(
  2395. <Input onChange={(e) => { this.setState({ customerPosition: e.target.value }); }}/>
  2396. )}
  2397. </FormItem>
  2398. </div>
  2399. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  2400. <Button className="set-submit" type="primary" htmlType="submit" onClick={this.changefollow} style={{marginRight:"50px"}}>保存</Button>
  2401. <Button className="set-submit" type="ghost" onClick={this.setModal8Visiblecancel}>取消</Button>
  2402. </FormItem>
  2403. </Modal>
  2404. <Modal
  2405. footer=''
  2406. title="更多详情"
  2407. visible={this.state.modal6Visible}
  2408. onOk={this.setModal6Visiblecancel}
  2409. onCancel={this.setModal6Visiblecancel}>
  2410. <Spin spinning={this.state.loading}>
  2411. <div className="clearfix">
  2412. <FormItem
  2413. labelCol={{ span: 5 }}
  2414. wrapperCol={{ span: 18 }}
  2415. label="跟进结果" >
  2416. <span>{}</span>
  2417. </FormItem>
  2418. </div>
  2419. <FormItem
  2420. labelCol={{ span: 5 }}
  2421. wrapperCol={{ span: 18 }}
  2422. label="附件" >
  2423. <div className="clearfix">
  2424. <Upload className="demandDetailShow-upload"
  2425. listType="picture-card"
  2426. fileList={this.state.attachment}
  2427. onPreview={(file) => {
  2428. this.setState({
  2429. previewImage: file.url || file.thumbUrl,
  2430. previewVisible: true,
  2431. });
  2432. }} >
  2433. </Upload>
  2434. <Modal maskClosable={false} footer={null}
  2435. visible={this.state.previewVisible}
  2436. onCancel={() => { this.setState({ previewVisible: false }) }}>
  2437. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  2438. </Modal>
  2439. </div>
  2440. </FormItem>
  2441. </Spin>
  2442. </Modal>
  2443. <TechAchievementDesc
  2444. data={this.state.RowData}
  2445. detailApiUrl={this.props['data-detailApiUrl']}
  2446. achievementCategoryOption={this.state.achievementCategoryOption}
  2447. showDesc={this.state.showDesc}
  2448. closeDesc={this.closeDesc} />
  2449. </div >
  2450. );
  2451. }
  2452. }));
  2453. export default AchievementList;