individualCustomer.jsx 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076
  1. import React from 'react';
  2. import { Radio, Icon, Button,AutoComplete, Cascader, Input, Select, Tabs, Spin, Popconfirm, Popover, Table, Switch, message, DatePicker, Modal, Upload, Form, Row, Col } 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. import { citySelect, provinceList, areaSelect } from '../../../areaList';
  8. import {getProvinceList} from '../../../addressList';
  9. const { Column, ColumnGroup } = Table;
  10. const TabPane = Tabs.TabPane;
  11. import CustomerDetail from './myClientDesc.jsx';
  12. import { socialAttribute, industry, newFollow, auditStatusL, lvl, currentMember, cityArr, statuslist, customerStatus, intentionalService, sex } from '../../../dataDic.js';
  13. import { getCompanyIntention, splitUrl, getAuditStatus, getSocialAttribute, getStatuslist, getIndustry, getContactType, getfllowSituation, beforeUploadFile, getWhether, getcityArr, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '../../../tools.js';
  14. const monthFormat = 'YYYY/MM';
  15. //图片组件
  16. const PicturesWall = React.createClass({
  17. getInitialState() {
  18. return {
  19. previewVisible: false,
  20. previewImage: '',
  21. fileList: [],
  22. }
  23. },
  24. handleCancel() {
  25. this.setState({ previewVisible: false })
  26. },
  27. handlePreview(file) {
  28. this.setState({
  29. previewImage: file.url || file.thumbUrl,
  30. previewVisible: true,
  31. });
  32. },
  33. handleChange(info) {
  34. let fileList = info.fileList;
  35. this.setState({ fileList });
  36. this.props.fileList(fileList);
  37. },
  38. componentWillReceiveProps(nextProps) {
  39. this.state.fileList = nextProps.pictureUrl;
  40. },
  41. render() {
  42. const { previewVisible, previewImage, fileList } = this.state;
  43. const uploadButton = (
  44. <div>
  45. <Icon type="plus" />
  46. <div className="ant-upload-text">点击上传</div>
  47. </div>
  48. );
  49. return(
  50. <div style={{display:"inline-block"}}>
  51. <Upload
  52. action={globalConfig.context + "/api/admin/customer/uploadCustomerImg"}
  53. data={{ 'sign': '' }}
  54. listType="picture-card"
  55. fileList={fileList}
  56. onPreview={this.handlePreview}
  57. onChange={this.handleChange} >
  58. {fileList.length >= 1 ? null : uploadButton}
  59. </Upload>
  60. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  61. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  62. </Modal>
  63. </div>
  64. );
  65. }
  66. });
  67. const IndividualCustomer = Form.create()(React.createClass({
  68. loadData(pageNo) {
  69. this.setState({
  70. loading: true,
  71. ispage:pageNo,
  72. });
  73. $.ajax({
  74. method: "post",
  75. dataType: "json",
  76. crossDomain: false,
  77. url: globalConfig.context + '/api/admin/customer/listPrivatePersonalCustomer',
  78. data: {
  79. pageNo: pageNo || 1,
  80. pageSize: this.state.pagination.pageSize,
  81. type: this.state.typeSearch, //名称1
  82. name: this.state.nameSearch,
  83. province: !(this.state.addressSearch).length ? this.state.provinceSearch : this.state.addressSearch[0],
  84. city: !(this.state.addressSearch).length ? '' : this.state.addressSearch[1],
  85. status: this.state.statusSearch,
  86. industry: this.state.industrySearch,
  87. businessAudit: this.state.serviceCertificationSearch,
  88. auditStatus: this.state.userCertificationSearch,
  89. currentMemberStatus: this.state.currentMemberStatusSearch,
  90. lvl: this.state.lvlSearch,
  91. listed: this.state.listedSearch, //是否上市
  92. highTechZone: this.state.highTechZoneSearch, //是否高新
  93. consultant: this.state.consultant,
  94. startDate: this.state.releaseDate[0],
  95. endDate: this.state.releaseDate[1],
  96. isMember: this.state.isMemberSearch,
  97. international: this.state.internationalSearch,
  98. celebrity: this.state.celebritySearch,
  99. expert: this.state.expertSearch,
  100. industry: this.state.industrySearch
  101. },
  102. success: function(data) {
  103. let theArr = [];
  104. if(data.error.length || data.data.list == "") {
  105. if(data.error && data.error.length) {
  106. message.warning(data.error[0].message);
  107. };
  108. } else {
  109. for(let i = 0; i < data.data.list.length; i++) {
  110. let thisdata = data.data.list[i];
  111. theArr.push({
  112. key: i,
  113. id: thisdata.uid,
  114. type: thisdata.type,
  115. name: thisdata.name,
  116. status: thisdata.status,
  117. contacts: thisdata.contacts,
  118. contactMobile: thisdata.contactMobile,
  119. industry: thisdata.industry,
  120. createTime: thisdata.createTime,
  121. businessAudit: thisdata.businessAudit,
  122. auditStatus: thisdata.auditStatus,
  123. lvl: thisdata.lvl,
  124. isMember: thisdata.isMember,
  125. societyTag: thisdata.societyTag,
  126. currentMemberStatus: thisdata.currentMemberStatus,
  127. international: thisdata.international,
  128. listed: thisdata.listed,
  129. international: thisdata.international,
  130. expert: thisdata.expert,
  131. celebrity: thisdata.celebrity,
  132. consultant: thisdata.consultant,
  133. highTechZone: thisdata.highTechZone,
  134. locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city || '' + '-' + thisdata.area : '--'
  135. });
  136. };
  137. this.state.pagination.current = data.data.pageNo;
  138. this.state.pagination.total = data.data.totalCount;
  139. };
  140. if(data.data&&data.data.list&&!data.data.list.length){
  141. this.state.pagination.current=0;
  142. this.state.pagination.total=0;
  143. }
  144. this.setState({
  145. dataSource: theArr,
  146. pagination: this.state.pagination,
  147. selectedRowKeys:[]
  148. });
  149. }.bind(this),
  150. }).always(function() {
  151. this.setState({
  152. loading: false
  153. });
  154. }.bind(this));
  155. },
  156. //点击出现函数
  157. setModal2VisibleOk(e) {
  158. this.setState({
  159. modal2Visible: true
  160. });
  161. },
  162. //点击消失函数
  163. setModal2Visiblecancel(e) {
  164. this.setState({
  165. modal2Visible: false
  166. });
  167. },
  168. handleOk(e) {
  169. this.setState({
  170. visible: false,
  171. });
  172. },
  173. handleCancel(e) {
  174. this.setState({
  175. visible: false,
  176. });
  177. },
  178. getInitialState() {
  179. return {
  180. yearMonth: undefined,
  181. addressSearch: [],
  182. positiveIdUrl: [],
  183. headPortraitUrl: [],
  184. oppositeIdUrl: [],
  185. visible: false,
  186. searchMore: true,
  187. releaseDate: [],
  188. releaseDate: [],
  189. selectedRowKeys: [],
  190. selectedRows: [],
  191. loading: false,
  192. pagination: {
  193. defaultCurrent: 1,
  194. defaultPageSize: 10,
  195. showQuickJumper: true,
  196. pageSize: 10,
  197. onChange: function(page) {
  198. this.loadData(page);
  199. }.bind(this),
  200. showTotal: function(total) {
  201. return '共' + total + '条数据';
  202. }
  203. },
  204. paginations: {
  205. defaultCurrent: 1,
  206. defaultPageSize: 10,
  207. showQuickJumper: true,
  208. pageSize: 10,
  209. onChange: function(page) {
  210. this.loadVisit(page);
  211. }.bind(this),
  212. showTotal: function(total) {
  213. return '共' + total + '条数据';
  214. }
  215. },
  216. paginationsy: {
  217. defaultCurrent: 1,
  218. defaultPageSize: 10,
  219. showQuickJumper: true,
  220. pageSize: 10,
  221. onChange: function(page) {
  222. this.loadBfVisit(page, false);
  223. }.bind(this),
  224. showTotal: function(total) {
  225. return '共' + total + '条数据';
  226. }
  227. },
  228. paginationt: {
  229. defaultCurrent: 1,
  230. defaultPageSize: 10,
  231. showQuickJumper: true,
  232. pageSize: 10,
  233. onChange: function(page) {
  234. this.BusinessList(page, false);
  235. }.bind(this),
  236. showTotal: function(total) {
  237. return '共' + total + '条数据';
  238. }
  239. },
  240. //业务意向列表
  241. intentionList: [{
  242. title: '业务名称',
  243. dataIndex: 'businessGlossoryId',
  244. key: 'businessGlossoryId',
  245. render: (text, record, index) => {
  246. return <Select placeholder="选择业务名称" disabled={record.id?true:false} value={record.businessGlossoryId} onChange={(e) => { record.businessGlossoryId = e; this.setState({ data: this.state.data }); }}>
  247. {
  248. intentionalService.map(function (item) {
  249. return <Select.Option key={item.value} >{item.key}</Select.Option>
  250. })
  251. }
  252. </Select>
  253. }
  254. },
  255. {
  256. title: '最新进度',
  257. dataIndex: 'followSituation',
  258. key: 'followSituation',
  259. render: (text, record, index) => {
  260. return <Select placeholder="选择最新进度" value={record.followSituation} onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
  261. {
  262. newFollow.map(function (item) {
  263. return <Select.Option key={item.value} >{item.key}</Select.Option>
  264. })
  265. }
  266. </Select>
  267. }
  268. }, {
  269. title: '最新状态',
  270. dataIndex: 'customerStatus',
  271. key: 'customerStatus',
  272. render: (text, record, index) => {
  273. return <Select value={record.customerStatus} placeholder="选择最新状态" onChange={(e) => { record.customerStatus = e; this.setState({ data: this.state.data }); }}>
  274. {
  275. customerStatus.map(function (item) {
  276. return <Select.Option key={item.value} >{item.key}</Select.Option>
  277. })
  278. }
  279. </Select>
  280. }
  281. }, {
  282. title: '跟进说明',
  283. dataIndex: 'remarks',
  284. key: 'remarks',
  285. render: (text, record, index) => {
  286. return <Input value={record.remarks} placeholder="跟进说明"
  287. onChange={(e) => { record.remarks = e.target.value; this.setState({ data: this.state.data }); }}
  288. style={{width:'120px'}}/>
  289. }
  290. }, {
  291. title: '操作',
  292. dataIndex: 'rrr',
  293. key: 'rrr',
  294. render: (text, record, index) => {
  295. return <div>
  296. <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record,index)}} okText="删除" cancelText="不删除">
  297. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
  298. </Popconfirm>
  299. </div>
  300. }
  301. }
  302. ],
  303. businessIntentionList: [{
  304. title: '意向时间',
  305. dataIndex: 'createTime',
  306. key: 'createTime'
  307. }, {
  308. title: '客户姓名',
  309. dataIndex: 'identifyName',
  310. key: 'identifyName'
  311. }, {
  312. title: '业务名',
  313. dataIndex: 'businessName',
  314. key: 'businessName'
  315. }, {
  316. title: '营销员',
  317. dataIndex: 'adminName',
  318. key: 'adminName'
  319. }, {
  320. title: '业务意向进度',
  321. dataIndex: 'followSituation',
  322. key: 'followSituation',
  323. render: text => { return getfllowSituation(text) }
  324. }, {
  325. title: '客户状态',
  326. dataIndex: 'customerStatus',
  327. key: 'customerStatus',
  328. render: text => { return getcustomerStatue(text) }
  329. }, {
  330. title: '操作',
  331. dataIndex: 'ooo',
  332. key: 'ooo',
  333. render: (text, record) => { return(<Button onClick={(e)=>{this.businessIntentionDetails(record)}}>查看</Button>) }
  334. }],
  335. businessFollowList: [{
  336. title: '跟进时间',
  337. dataIndex: 'followTime',
  338. key: 'followTime',
  339. }, {
  340. title: '营销员',
  341. dataIndex: 'adminName',
  342. key: 'adminName',
  343. }, {
  344. title: '业务意向进度',
  345. dataIndex: 'followSituation',
  346. key: 'followSituation',
  347. render: text => { return getfllowSituation(text) }
  348. }, {
  349. title: '客户状态',
  350. dataIndex: 'customerStatus',
  351. key: 'customerStatus',
  352. render: text => { return getcustomerStatue(text) }
  353. },
  354. {
  355. title: '拜访方式',
  356. dataIndex: 'contactType',
  357. key: 'contactType',
  358. render: text => { return getContactType(text) }
  359. }, {
  360. title: '联系人',
  361. dataIndex: 'contacts',
  362. key: 'contacts',
  363. },
  364. {
  365. title: '联系电话',
  366. dataIndex: 'contactMobile',
  367. key: 'contactMobile',
  368. }, {
  369. title: '操作',
  370. dataIndex: 'ooo',
  371. key: 'ooo',
  372. render: (text, record) => { return(<Button onClick={(e)=>{this.businessFollowDetails(record)}}>查看</Button>) }
  373. }
  374. ],
  375. visitsList: [{
  376. title: '拜访时间',
  377. dataIndex: 'followTime',
  378. key: 'followTime'
  379. }, {
  380. title: '客户姓名',
  381. dataIndex: 'identifyName',
  382. key: 'identifyName'
  383. }, {
  384. title: '拜访方式',
  385. dataIndex: 'contactType',
  386. key: 'contactType',
  387. render: text => { return getContactType(text) }
  388. }, {
  389. title: '联系人',
  390. dataIndex: 'contacts',
  391. key: 'contacts'
  392. }, {
  393. title: '联系电话',
  394. dataIndex: 'contactMobile',
  395. key: 'contactMobile'
  396. }, {
  397. title: '拜访人',
  398. dataIndex: 'adminName',
  399. key: 'adminName'
  400. }, {
  401. title: '拜访说明',
  402. dataIndex: 'result',
  403. key: 'result',
  404. render: text => {
  405. return <span style={{width:'150px',display:'inline-block',overflow:'hidden'}}>{text}</span>
  406. }
  407. }, {
  408. title: '操作',
  409. dataIndex: 'ttt',
  410. key: 'ttt',
  411. render: (text, record, index) => {
  412. return <div>
  413. <Popconfirm title="是否删除?" onConfirm={(e)=>{this.visitDelet(record)}} okText="删除" cancelText="不删除">
  414. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}} onClick={(e)=>{e.stopPropagation()}}>删除</Button>
  415. </Popconfirm>
  416. </div>
  417. }
  418. }],
  419. ContactsLists: [{
  420. title: '姓名',
  421. dataIndex: 'name',
  422. key: 'name',
  423. render: (text, record, index) => {
  424. return <Input value={record.name} placeholder="姓名" key={record.id}
  425. onChange={(e) => { record.name = e.target.value;
  426. this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  427. }
  428. }, {
  429. title: '联系人部门',
  430. dataIndex: 'depatrment',
  431. key: 'depatrment',
  432. render: (text, record, index) => {
  433. return <Input value={record.depatrment} placeholder="联系人部门" key={record.id}
  434. onChange={(e) => { record.depatrment = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  435. }
  436. }, {
  437. title: '联系人职务',
  438. dataIndex: 'position',
  439. key: 'position',
  440. render: (text, record, index) => {
  441. return <Input value={record.position} placeholder="联系人职务" key={record.id}
  442. onChange={(e) => { record.position = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  443. }
  444. }, {
  445. title: '主要联系人',
  446. dataIndex: 'major',
  447. width:100,
  448. key: 'major',
  449. render:(text) => {
  450. return text?'是':"否"
  451. }
  452. },{
  453. title: '手机号码',
  454. dataIndex: 'mobile',
  455. key: 'mobile',
  456. render: (text, record, index) => {
  457. return <Input value={record.mobile} placeholder="手机号码" key={record.id}
  458. onChange={(e) => { record.mobile = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  459. }
  460. }, {
  461. title: '微信',
  462. dataIndex: 'wechat',
  463. key: 'wechat',
  464. render: (text, record, index) => {
  465. return <Input value={record.wechat} placeholder="微信" key={record.id}
  466. onChange={(e) => { record.wechat = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  467. }
  468. }, {
  469. title: '联系人QQ',
  470. dataIndex: 'qq',
  471. key: 'qq',
  472. render: (text, record, index) => {
  473. return <Input value={record.qq} placeholder="联系人QQ" key={record.id}
  474. onChange={(e) => { record.qq = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  475. }
  476. }, {
  477. title: '电子邮箱',
  478. dataIndex: 'email',
  479. key: 'email',
  480. render: (text, record, index) => {
  481. return <Input value={record.email} placeholder="电子邮箱" key={record.id}
  482. onChange={(e) => { record.email = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  483. }
  484. },
  485. {
  486. title: '操作',
  487. dataIndex: 'dels',
  488. key: 'dels',
  489. render: (text, record, index) => {
  490. return <div>{adminData.isSuperAdmin ?
  491. <Popconfirm title="是否删除?" onConfirm={(e)=>{this.confirmDelet(record)}} okText="删除" cancelText="不删除">
  492. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
  493. </Popconfirm>
  494. :''}
  495. {record.name?<Button style={{marginRight:'10px',color:'#ffffff',background:'green',border:'none'}} onClick={(e)=>{e.stopPropagation(),this.mainContact(record)}}>设为主要联系人</Button>:''}
  496. </div>
  497. }
  498. }
  499. ],
  500. columnsman: [{
  501. title: '姓名',
  502. dataIndex: 'name',
  503. key: 'name'
  504. }, {
  505. title: '手机号码',
  506. dataIndex: 'mobile',
  507. key: 'mobile'
  508. }],
  509. columns: [{
  510. title: '客户姓名',
  511. dataIndex: 'name',
  512. key: 'name',
  513. }, {
  514. title: '地区',
  515. dataIndex: 'locationProvince',
  516. key: 'locationProvince',
  517. },
  518. {
  519. title: '联系电话',
  520. dataIndex: 'contactMobile',
  521. key: 'contactMobile',
  522. },
  523. {
  524. title: '行业',
  525. dataIndex: 'industry',
  526. key: 'industry',
  527. },
  528. {
  529. title: '社会性质',
  530. dataIndex: 'societyTag',
  531. key: 'societyTag',
  532. render: text => { return getSocialAttribute(text) }
  533. },
  534. {
  535. title: '创建时间',
  536. dataIndex: 'createTime',
  537. key: 'createTime',
  538. },
  539. {
  540. title: '业务认证',
  541. dataIndex: 'businessAudit',
  542. key: 'businessAudit',
  543. render: text => { return getCertification(text) }
  544. },
  545. {
  546. title: '实名认证',
  547. dataIndex: 'auditStatus',
  548. key: 'auditStatus',
  549. render: text => { return getAuditStatus(text) }
  550. },
  551. {
  552. title: '是否专家',
  553. dataIndex: 'expert',
  554. key: 'expert',
  555. render: text => { return getWhether(text) }
  556. },
  557. {
  558. title: '是否会员',
  559. dataIndex: 'isMember',
  560. key: 'isMember',
  561. render: text => { return getWhether(text) }
  562. },
  563. {
  564. title: '是否国际',
  565. dataIndex: 'international',
  566. key: 'international',
  567. render: text => { return getWhether(text) }
  568. },
  569. {
  570. title: '会员等级',
  571. dataIndex: 'lvl',
  572. key: 'lvl',
  573. render: text => { return getLvl(text) }
  574. },
  575. {
  576. title: '会员状态',
  577. dataIndex: 'currentMemberStatus',
  578. key: 'currentMemberStatus',
  579. render: text => { return getCurrentMember(text) }
  580. },
  581. {
  582. title: '客户状态',
  583. dataIndex: 'status',
  584. key: 'status',
  585. render: text => { return getStatuslist(text) }
  586. },
  587. {
  588. title: '操作',
  589. dataIndex: 'abc',
  590. key: 'abc',
  591. render: (text, record, index) => {
  592. return <div>
  593. <Button onClick={(e) =>{ e.stopPropagation(), this.visit(record)}} type="primary">拜访</Button>
  594. </div>
  595. }
  596. }
  597. ],
  598. data: [],
  599. dataman: [],
  600. dataSource: [],
  601. visitArrList: [],
  602. searchTime: [, ]
  603. };
  604. },
  605. //选择主要联系人
  606. mainContact(record){
  607. this.setState({
  608. loading: true
  609. });
  610. $.ajax({
  611. method: "get",
  612. dataType: "json",
  613. crossDomain: false,
  614. url: globalConfig.context + "/api/admin/customer/updateMainContact",
  615. data: {
  616. uid:this.state.rowId,
  617. ocbId: record.id
  618. }
  619. }).done(function(data) {
  620. if(!data.error.length) {
  621. message.success('设为主要联系人成功!');
  622. this.setState({
  623. loading: false,
  624. });
  625. } else {
  626. message.warning(data.error[0].message);
  627. };
  628. this.contactLists(this.state.rowId);
  629. }.bind(this));
  630. },
  631. //更多操作
  632. ModalOperation() {
  633. this.setState({
  634. visible: true,
  635. });
  636. },
  637. //tab2获取联系人详情
  638. contactLists(ids) {
  639. this.setState({
  640. loading: true
  641. });
  642. $.ajax({
  643. method: "get",
  644. dataType: "json",
  645. crossDomain: false,
  646. url: globalConfig.context + '/api/admin/customer/findCustomerContacts',
  647. data: {
  648. uid: ids, //名称1
  649. },
  650. success: function(data) {
  651. let theArr = [];
  652. if(data.error.length || data.data.list == "") {
  653. if(data.error && data.error.length) {
  654. message.warning(data.error[0].message);
  655. };
  656. } else {
  657. for(let i = 0; i < data.data.length; i++) {
  658. let thisdata = data.data[i];
  659. theArr.push({
  660. id: thisdata.id,
  661. name: thisdata.name,
  662. mobile: thisdata.mobile,
  663. email: thisdata.email,
  664. qq: thisdata.qq,
  665. wechat: thisdata.wechat,
  666. depatrment: thisdata.depatrment,
  667. position: thisdata.position,
  668. major:thisdata.major
  669. });
  670. };
  671. };
  672. this.setState({
  673. contactList: theArr,
  674. });
  675. }.bind(this),
  676. }).always(function() {
  677. this.setState({
  678. loading: false
  679. });
  680. }.bind(this));
  681. },
  682. //刷新新增拜访记录刷新
  683. deletelist(e) {
  684. $.ajax({
  685. method: "get",
  686. dataType: "json",
  687. url: globalConfig.context + '/api/admin/customer/toAddFollow',
  688. data: {
  689. uid: e,
  690. },
  691. success: function(data) {
  692. let listArr = [];
  693. let thedata = data.data;
  694. if(!thedata) {
  695. if(data.error && data.error.length) {
  696. message.warning(data.error[0].message);
  697. };
  698. thedata = {};
  699. };
  700. for(let i = 0; i < data.data.userBusinessList.length; i++) {
  701. let thisdata = data.data.userBusinessList[i];
  702. listArr.push({
  703. id: thisdata.id,
  704. businessGlossoryId: String(thisdata.businessGlossoryId),
  705. followSituation: String(thisdata.followSituation),
  706. customerStatus: String(thisdata.customerStatus),
  707. remarks: thisdata.remarks,
  708. });
  709. };
  710. this.setState({
  711. contacts: thedata.contacts,
  712. uid: thedata.uid,
  713. data: listArr,
  714. identifyName: thedata.identifyName,
  715. followTime: thedata.followTime,
  716. businessGlossoryId: thedata.businessGlossoryId,
  717. followSituation: thedata.followSituation,
  718. customerStatus: thedata.customerStatus,
  719. remarks: thedata.remarks,
  720. });
  721. }.bind(this),
  722. }).always(function() {
  723. this.setState({
  724. loading: false
  725. });
  726. }.bind(this));
  727. },
  728. //进入新增拜访记录
  729. visit(e) {
  730. this.state.keys = true;
  731. this.getNewWoman(e.id);
  732. this.deletelist(e.id)
  733. this.setState({
  734. result: '',
  735. contactType: undefined,
  736. visitModul: true,
  737. loading: true
  738. });
  739. },
  740. //拜访记录删除
  741. visitDelet(e) {
  742. this.setState({
  743. loading: true
  744. });
  745. $.ajax({
  746. method: "get",
  747. dataType: "json",
  748. crossDomain: false,
  749. url: globalConfig.context + "/api/admin/customer/deleteFollow",
  750. data: {
  751. followId: e.followId, //删除的ID
  752. }
  753. }).done(function(data) {
  754. if(!data.error.length) {
  755. message.success('删除成功!');
  756. this.setState({
  757. loading: false,
  758. });
  759. } else {
  760. message.warning(data.error[0].message);
  761. };
  762. this.loadVisit();
  763. }.bind(this));
  764. },
  765. //进入修改拜访记录
  766. visitModify(e) {
  767. this.setState({
  768. visitModul: true,
  769. loading: true
  770. });
  771. $.ajax({
  772. method: "get",
  773. dataType: "json",
  774. url: globalConfig.context + '/api/admin/customer/toUpdateFollow',
  775. data: {
  776. followId: e,
  777. },
  778. success: function(data) {
  779. let theArr = [];
  780. let thedata = data.data;
  781. if(!thedata) {
  782. if(data.error && data.error.length) {
  783. message.warning(data.error[0].message);
  784. };
  785. thedata = {};
  786. };
  787. for(let i = 0; i < data.data.userBusinessList.length; i++) {
  788. let thisdata = data.data.userBusinessList[i];
  789. theArr.push({
  790. id: thisdata.id,
  791. businessGlossoryId: String(thisdata.businessGlossoryId),
  792. followSituation: String(thisdata.followSituation),
  793. customerStatus: String(thisdata.customerStatus),
  794. remarks: thisdata.remarks,
  795. });
  796. };
  797. this.setState({
  798. followIds: thedata.followId,
  799. contacts: thedata.contacts,
  800. uid: thedata.uid,
  801. data: theArr,
  802. nub: thedata.contactMobile,
  803. result: thedata.result,
  804. contactType: parseInt(thedata.contactType),
  805. identifyName: thedata.identifyName,
  806. followTime: thedata.followTime,
  807. businessGlossoryId: thedata.businessGlossoryId,
  808. followSituation: thedata.followSituation,
  809. customerStatus: thedata.customerStatus,
  810. adminName: thedata.adminName,
  811. });
  812. }.bind(this),
  813. }).always(function() {
  814. this.setState({
  815. loading: false
  816. });
  817. }.bind(this));
  818. },
  819. //列表删除功能
  820. delectRow() {
  821. let deletedIds;
  822. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  823. let rowItem = this.state.selectedRows[idx];
  824. if(rowItem.id) {
  825. deletedIds = rowItem.id;
  826. };
  827. };
  828. this.setState({
  829. selectedRowKeys: [],
  830. });
  831. $.ajax({
  832. method: "get",
  833. dataType: "json",
  834. crossDomain: false,
  835. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  836. data: {
  837. uid: deletedIds, //删除的ID
  838. }
  839. }).done(function(data) {
  840. if(!data.error.length) {
  841. message.success('删除成功!');
  842. this.setState({
  843. loading: false,
  844. });
  845. } else {
  846. message.warning(data.error[0].message);
  847. };
  848. this.loadData(this.state.ispage);
  849. }.bind(this));
  850. },
  851. //转交
  852. changeAssigner() {
  853. if(this.state.theTypes){
  854. this.setState({
  855. selectedRowKeys: [],
  856. });
  857. let changeIds;
  858. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  859. let rowItem = this.state.selectedRows[idx];
  860. if(rowItem.id) {
  861. changeIds = rowItem.id;
  862. };
  863. };
  864. $.ajax({
  865. method: "get",
  866. dataType: "json",
  867. crossDomain: false,
  868. url: globalConfig.context + "/api/admin/customer/transferToOther",
  869. data: {
  870. uid: changeIds, //这一行数据的ID
  871. aid: this.state.theTypes, //指定转交人的ID
  872. }
  873. }).done(function(data) {
  874. if(!data.error.length) {
  875. message.success('转交成功!');
  876. this.setState({
  877. auto:'',
  878. loading: false,
  879. });
  880. } else {
  881. message.warning(data.error[0].message);
  882. };
  883. this.loadData(this.state.ispage);
  884. }.bind(this));
  885. }else{
  886. message.warning('请输入转交人姓名')
  887. }
  888. },
  889. //转为公共客户
  890. changeRow() {
  891. let deletedIds;
  892. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  893. let rowItem = this.state.selectedRows[idx];
  894. if(rowItem.id) {
  895. deletedIds = rowItem.id;
  896. };
  897. };
  898. this.setState({
  899. selectedRowKeys: [],
  900. });
  901. $.ajax({
  902. method: "get",
  903. dataType: "json",
  904. crossDomain: false,
  905. url: globalConfig.context + "/api/admin/customer/transferToPublic",
  906. data: {
  907. uid: deletedIds,
  908. }
  909. }).done(function(data) {
  910. if(!data.error.length) {
  911. message.success('已转为公共客户!');
  912. this.setState({
  913. loading: false,
  914. });
  915. } else {
  916. message.warning(data.error[0].message);
  917. };
  918. this.loadData(this.state.ispage);
  919. }.bind(this));
  920. },
  921. getHeadPortraitUrl(e) {
  922. this.setState({ headPortraitUrl: e });
  923. },
  924. getPositiveIdUrl(e) {
  925. this.setState({ positiveIdUrl: e });
  926. },
  927. getOppositeIdUrl(e) {
  928. this.setState({ oppositeIdUrl: e });
  929. },
  930. componentWillMount() {
  931. let areaArr= getProvinceList();
  932. let Citys=citySelect(areaArr);
  933. let Areas=areaSelect(areaArr);
  934. this.setState({
  935. City: Citys,
  936. Area: Areas
  937. });
  938. //城市
  939. let Province = [];
  940. areaArr.map(function(item) {
  941. var id = String(item.id)
  942. Province.push(
  943. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  944. )
  945. });
  946. //行业
  947. let intentionalArr = [];
  948. industry.map(function(item) {
  949. intentionalArr.push(
  950. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  951. )
  952. });
  953. //会员等级
  954. let lvlArr = [];
  955. lvl.map(function(item) {
  956. lvlArr.push(
  957. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  958. )
  959. });
  960. //会员状态customerStatus
  961. let currentMemberArr = [];
  962. currentMember.map(function(item) {
  963. currentMemberArr.push(
  964. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  965. )
  966. });
  967. //客户状态
  968. let customerStatusArr = [];
  969. customerStatus.map(function(item) {
  970. customerStatusArr.push(
  971. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  972. )
  973. });
  974. this.state.Provinces = Province;
  975. this.state.intentionalOption = intentionalArr;
  976. this.state.lvlArrOption = lvlArr;
  977. this.state.currentMemberArrOption = currentMemberArr;
  978. this.state.customerStatusArrOption = customerStatusArr;
  979. this.loadData();
  980. },
  981. //新建
  982. addClick() {
  983. this.state.RowData = {};
  984. this.setState({
  985. showDesc: true,
  986. });
  987. },
  988. newmodal(e) {
  989. if(e) {
  990. this.tableRowClick();
  991. }
  992. },
  993. closeDesc(e, s) {
  994. this.state.showDesc = e;
  995. if(s) {
  996. this.loadData(this.state.ispage);
  997. };
  998. },
  999. search() {
  1000. this.loadData();
  1001. },
  1002. reset() {
  1003. this.state.isMemberSearch = undefined;
  1004. this.state.internationalSearch = undefined;
  1005. this.state.celebritySearch = undefined;
  1006. this.state.expertSearch = undefined;
  1007. this.state.industrySearch = undefined;
  1008. this.state.typeSearch = undefined; //名称1
  1009. this.state.nameSearch = '';
  1010. this.state.addressSearch = [];
  1011. this.state.provinceSearch = undefined;
  1012. this.state.citySearch = undefined;
  1013. this.state.statusSearch = undefined;
  1014. this.state.contactsSearch = undefined;
  1015. this.state.contactMobileSearch = undefined;
  1016. this.state.industrySearch = undefined;
  1017. this.state.serviceCertificationSearch = undefined;
  1018. this.state.userCertificationSearch = undefined;
  1019. this.state.currentMemberStatusSearch = undefined;
  1020. this.state.lvlSearch = undefined;
  1021. this.state.listedSearch = undefined;
  1022. this.state.highTechZoneSearch = undefined;
  1023. this.state.releaseDate[0] = undefined;
  1024. this.state.releaseDate[1] = undefined;
  1025. this.loadData();
  1026. },
  1027. searchSwitch() {
  1028. this.setState({
  1029. searchMore: !this.state.searchMore
  1030. });
  1031. },
  1032. //详情保存函数
  1033. detailsSubmint() {
  1034. this.setState({
  1035. modal5Visible: false,
  1036. })
  1037. },
  1038. //整行点击
  1039. tableRowClick(record, index) {
  1040. this.state.RowData = record;
  1041. this.detailsModalOk(record);
  1042. this.loadInformation(record.id)
  1043. this.httpAccount(record.id);
  1044. this.loadBfVisit(1, record.id);
  1045. this.BusinessList(1, record.id);
  1046. this.contactLists(record.id);
  1047. this.setState({
  1048. callnub:'1',
  1049. selectedRowKeys: [],
  1050. rowId: record.id,
  1051. })
  1052. },
  1053. VisitRowClick(record, index) {
  1054. this.state.keys = false;
  1055. this.state.RowData = record;
  1056. this.visitModify(record.followId);
  1057. this.setState({
  1058. selectedRowKeys: [],
  1059. delectId: record.followId,
  1060. })
  1061. },
  1062. //基本信息提交
  1063. newSubmit(e) {
  1064. e.preventDefault();
  1065. if(!this.state.industry) {
  1066. message.warning('请选择行业');
  1067. return false;
  1068. };
  1069. if(!this.state.societyTag) {
  1070. message.warning('请选择社会性质');
  1071. return false;
  1072. };
  1073. if(!this.state.ProvinceCity[1]) {
  1074. message.warning('请选择地区');
  1075. return false;
  1076. };
  1077. var reg=/^[1-9]\d*$|^0$/;
  1078. if(this.state.consultationPrice){
  1079. if(this.state.consultationPrice.length>6) {
  1080. message.warning('咨询费用不超过6位数');
  1081. this.refs.consul.focus();
  1082. return false;
  1083. };
  1084. if(!reg.test(this.state.consultationPrice)){
  1085. message.warning('咨询费用只能输入数字');
  1086. this.refs.consul.focus();
  1087. return false;
  1088. }
  1089. }
  1090. this.state.data = [];
  1091. this.setState({
  1092. selectedRowKeys: [],
  1093. });
  1094. this.props.form.validateFields((err, values) => {
  1095. let theorgCodeUrl = [];
  1096. if(this.state.headPortraitUrl.length) {
  1097. let picArr = [];
  1098. this.state.headPortraitUrl.map(function(item) {
  1099. if ( item.response && item.response.data && item.response.data.length ){
  1100. picArr.push(item.response.data);
  1101. }
  1102. });
  1103. theorgCodeUrl = picArr.join(",");
  1104. };
  1105. let thecompanyLogoUrl = [];
  1106. if(this.state.positiveIdUrl.length) {
  1107. let picArr = [];
  1108. this.state.positiveIdUrl.map(function(item) {
  1109. if ( item.response && item.response.data && item.response.data.length ){
  1110. picArr.push(item.response.data);
  1111. }
  1112. });
  1113. thecompanyLogoUrl = picArr.join(",");
  1114. };
  1115. let thecompanyLogoUrls = [];
  1116. if(this.state.oppositeIdUrl.length) {
  1117. let picArr = [];
  1118. this.state.oppositeIdUrl.map(function(item) {
  1119. if ( item.response && item.response.data && item.response.data.length ){
  1120. picArr.push(item.response.data);
  1121. }
  1122. });
  1123. thecompanyLogoUrls = picArr.join(",");
  1124. };
  1125. if(!err) {
  1126. let years = [];
  1127. let yearMonth = this.state.yearMonth != undefined ? new Date(this.state.yearMonth).toLocaleDateString() : '';
  1128. years = yearMonth.split('/');
  1129. this.setState({
  1130. loading: true
  1131. });
  1132. $.ajax({
  1133. method: "post",
  1134. dataType: "json",
  1135. url: globalConfig.context + '/api/admin/customer/updatePersonalCustomer',
  1136. data: {
  1137. id: this.state.InformationId,
  1138. uid: this.state.InformationUid,
  1139. societyTag: this.state.societyTag,
  1140. identifyName: this.state.identifyName,
  1141. industry: this.state.industry,
  1142. dateOfBirthYear: years[0], //出生年
  1143. dateOfBirthMonth: years[1], //出生月
  1144. province: (this.state.ProvinceCity)[0], //省-
  1145. city: (this.state.ProvinceCity)[1], //市
  1146. area: (this.state.ProvinceCity)[2], //区
  1147. sex: this.state.sex,
  1148. expert: this.state.expert,
  1149. celebrity: this.state.celebrity,
  1150. consultant: this.state.consultant,
  1151. international: this.state.international,
  1152. fixedTel: this.state.fixedTel,
  1153. consultationPrice:this.state.consultationPrice?this.state.consultationPrice:0,
  1154. qq: this.state.qq,
  1155. contacts: this.state.contacts,
  1156. contactMobile: this.state.contactMobile,
  1157. idNumber: this.state.idNumber,
  1158. email: this.state.email,
  1159. isMember: this.state.isMember,
  1160. postalAddress: this.state.postalAddress,
  1161. introduction: this.state.introduction,
  1162. positiveIdUrl: thecompanyLogoUrl.length!=0?thecompanyLogoUrl:'',
  1163. oppositeIdUrl: thecompanyLogoUrls!=0?thecompanyLogoUrls:'',
  1164. headPortraitUrl: theorgCodeUrl!=0?theorgCodeUrl:'',
  1165. investment: this.state.investment,
  1166. professionalTitle: this.state.professionalTitle,
  1167. workUnit: this.state.workUnit,
  1168. education: this.state.education,
  1169. graduateSchool: this.state.graduateSchool,
  1170. majorCategory: this.state.majorCategory,
  1171. qualification: this.state.qualification,
  1172. businessAudit: this.state.businessAudit,
  1173. auditStatus: this.state.auditStatus,
  1174. }
  1175. }).done(function(data) {
  1176. this.setState({
  1177. loading: false
  1178. });
  1179. if(!data.error.length) {
  1180. message.success('保存成功!');
  1181. this.detailsModal()
  1182. this.loadData(this.state.ispage);
  1183. } else {
  1184. message.warning(data.error[0].message);
  1185. }
  1186. }.bind(this));
  1187. }
  1188. })
  1189. },
  1190. //点击整行查看详情
  1191. //查看基本详情基本信息
  1192. loadInformation(record) {
  1193. $.ajax({
  1194. method: "get",
  1195. dataType: "json",
  1196. crossDomain: false,
  1197. url: globalConfig.context + '/api/admin/customer/findPersonalCustomerDetail',
  1198. data: {
  1199. uid: record
  1200. },
  1201. success: function(data) {
  1202. let thisData = data.data;
  1203. if(!thisData) {
  1204. if(data.error && data.error.length) {
  1205. message.warning(data.error[0].message);
  1206. };
  1207. thisData = {};
  1208. };
  1209. let ProvinceCityArr = [];
  1210. let ProvinceS = thisData.province; //getprovince
  1211. let citys = thisData.city;
  1212. let Areas = thisData.area;
  1213. ProvinceCityArr.push(ProvinceS, citys, Areas);
  1214. let month = thisData.dateOfBirthYear ? thisData.dateOfBirthYear + '/' + thisData.dateOfBirthMonth : false;
  1215. this.setState({
  1216. InformationId: thisData.id,
  1217. InformationUid: thisData.uid,
  1218. identifyName: thisData.identifyName,
  1219. listed: thisData.listed,
  1220. highTechZone: thisData.highTechZone,
  1221. headPortraitUrl: thisData.headPortraitUrl ? splitUrl(thisData.headPortraitUrl, ',', globalConfig.avatarHost + '/upload') : [],
  1222. positiveIdUrl: thisData.positiveIdUrl ? splitUrl(thisData.positiveIdUrl, ',', globalConfig.avatarHost + '/upload') : [],
  1223. oppositeIdUrl: thisData.oppositeIdUrl ? splitUrl(thisData.oppositeIdUrl, ',', globalConfig.avatarHost + '/upload') : [],
  1224. dataInformation: thisData,
  1225. idNumber: thisData.idNumber,
  1226. contacts: thisData.contacts,
  1227. contactMobile: thisData.contactMobile,
  1228. ProvinceCity: ProvinceCityArr,
  1229. industry: thisData.industry ? String(thisData.industry) : undefined,
  1230. societyTag: thisData.societyTag,
  1231. sex: thisData.sex,
  1232. yearMonth: month,
  1233. postalAddress: thisData.postalAddress,
  1234. fixedTel: thisData.fixedTel,
  1235. consultationPrice:thisData.consultationPrice,
  1236. email: thisData.email,
  1237. qq: thisData.qq,
  1238. introduction: thisData.introduction,
  1239. expert: thisData.expert,
  1240. celebrity: thisData.celebrity,
  1241. consultant: thisData.consultant,
  1242. international: thisData.international,
  1243. investment: thisData.investment,
  1244. professionalTitle: thisData.professionalTitle,
  1245. workUnit: thisData.workUnit,
  1246. education: thisData.education,
  1247. graduateSchool: thisData.graduateSchool,
  1248. majorCategory: thisData.majorCategory,
  1249. qualification: thisData.qualification,
  1250. businessAudit: thisData.businessAudit,
  1251. auditStatus: thisData.auditStatus ? String(thisData.auditStatus) : undefined,
  1252. });
  1253. }.bind(this),
  1254. }).always(function() {
  1255. this.setState({
  1256. loading: false
  1257. });
  1258. }.bind(this));
  1259. },
  1260. //tab3账户信息请求数据
  1261. httpAccount(record) {
  1262. this.RowClick;
  1263. $.ajax({
  1264. method: "get",
  1265. dataType: "json",
  1266. crossDomain: false,
  1267. url: globalConfig.context + '/api/admin/customer/findUserAccountDetail',
  1268. data: {
  1269. uid: record
  1270. },
  1271. success: function(data) {
  1272. let thisData = data.data;
  1273. if(!thisData) {
  1274. if(data.error && data.error.length) {
  1275. message.warning(data.error[0].message);
  1276. };
  1277. thisData = {};
  1278. };
  1279. let sourcecustomer = ''
  1280. switch(String(thisData.source)) {
  1281. case '0':
  1282. sourcecustomer = '注册客户'
  1283. break;
  1284. case '1':
  1285. sourcecustomer = '录入客户'
  1286. break;
  1287. }
  1288. this.setState({
  1289. Accountuid: thisData.id,
  1290. mobile: thisData.mobile,
  1291. nickname: thisData.nickname,
  1292. email: thisData.email,
  1293. type: getcustomerTyp(String(thisData.type)),
  1294. source: sourcecustomer,
  1295. isMember: thisData.isMember,
  1296. currentMemberStatus: String(thisData.currentMemberStatus),
  1297. lvl: String(thisData.lvl),
  1298. status: String(thisData.status),
  1299. createTimes: thisData.createTimes,
  1300. });
  1301. }.bind(this),
  1302. }).always(function() {
  1303. this.setState({
  1304. loading: false
  1305. });
  1306. }.bind(this));
  1307. },
  1308. detailsModalOk(e) {
  1309. this.setState({ modal5Visible: true }); //需要一个请求数据
  1310. },
  1311. //点击消失函数
  1312. detailsModal(e) {
  1313. this.setState({
  1314. modal5Visible: false
  1315. });
  1316. },
  1317. //拜访modul函数
  1318. visitOk(e) {
  1319. this.setState({
  1320. visitModul: false
  1321. });
  1322. this.loadVisit()
  1323. },
  1324. visitCancel(e) {
  1325. this.setState({
  1326. visitModul: false
  1327. });
  1328. },
  1329. //拜访保存函数
  1330. visitSubmit(e) {
  1331. e.preventDefault();
  1332. let GlossoryId=false;
  1333. this.state.data.map(function(item) {
  1334. if(!item.businessGlossoryId||!item.followSituation||!item.customerStatus) {
  1335. GlossoryId = true
  1336. }
  1337. })
  1338. if(this.state.contactType == undefined) {
  1339. message.warning('请选择拜访方式')
  1340. return false;
  1341. };
  1342. if(this.state.keys) {
  1343. if(this.state.lastName == undefined) {
  1344. message.warning('请选择联系人')
  1345. return false;
  1346. }
  1347. };
  1348. this.setState({
  1349. selectedRowKeys: [],
  1350. });
  1351. if(GlossoryId) {
  1352. message.warning("业务名称/最新进度/最新状态不能为空!")
  1353. return false;
  1354. };
  1355. this.setState({
  1356. loading: true
  1357. });
  1358. let contactsId = '';
  1359. if(this.state.keys) {
  1360. let conts = this.state.lastName;
  1361. contactsId = this.state.contactsIdArr[conts].id;
  1362. }
  1363. //新增
  1364. $.ajax({
  1365. method: "post",
  1366. dataType: "json",
  1367. url: this.state.keys ? globalConfig.context + '/api/admin/customer/addFollow' : globalConfig.context + '/api/admin/customer/updateFollow',
  1368. data: this.state.keys ? {
  1369. userBusinessList: JSON.stringify(this.state.data),
  1370. uid: this.state.uid,
  1371. ocbId: contactsId,
  1372. contactType: this.state.contactType,
  1373. result: this.state.result,
  1374. followTime: this.state.followTime,
  1375. } : {
  1376. followId: this.state.followIds,
  1377. userBusinessList: JSON.stringify(this.state.data),
  1378. uid: this.state.uid,
  1379. contactType: this.state.contactType,
  1380. result: this.state.result,
  1381. followTime: this.state.followTime,
  1382. }
  1383. }).done(function(data) {
  1384. this.setState({
  1385. loading: false
  1386. });
  1387. if(!data.error.length) {
  1388. message.success('保存成功!');
  1389. this.loadVisit(); //
  1390. this.loadData(this.state.ispage);
  1391. this.visitCancel();
  1392. } else {
  1393. message.warning(data.error[0].message);
  1394. }
  1395. }.bind(this));
  1396. },
  1397. //当选择联系人的列表变化时,则执行
  1398. hundleName(e) {
  1399. let changNub = this.state.telNum[e];
  1400. this.setState({
  1401. nub: this.state.telNum[e],
  1402. lastName: e,
  1403. });
  1404. },
  1405. //添加新业务及单位客户详情新增
  1406. addNew() {
  1407. this.state.data.push({
  1408. customerStatus: undefined,
  1409. businessGlossoryId: undefined,
  1410. followSituation: undefined,
  1411. remarks: '',
  1412. });
  1413. this.setState({
  1414. data: this.state.data
  1415. })
  1416. },
  1417. //tab2新增联系人
  1418. addcontact() {
  1419. this.state.contactList.push({
  1420. id: null,
  1421. name: '',
  1422. mobile: '',
  1423. email: '',
  1424. qq: '',
  1425. wechat: '',
  1426. depatrment: '',
  1427. position: '',
  1428. });
  1429. this.setState({
  1430. contactList: this.state.contactList
  1431. })
  1432. },
  1433. //tab5进入修改时
  1434. //进入修改时
  1435. listFollowUp(e) {
  1436. $.ajax({
  1437. method: "get",
  1438. dataType: "json",
  1439. crossDomain: false,
  1440. url: globalConfig.context + "/api/admin/customer/toUpdateFollowOneBusiness",
  1441. data: {
  1442. ufbId: e
  1443. },
  1444. success: function(data) {
  1445. let thedata = data.data;
  1446. if(!thedata) {
  1447. if(data.error && data.error.length) {
  1448. message.warning(data.error[0].message);
  1449. };
  1450. thedata = {};
  1451. };
  1452. this.setState({
  1453. businessGlossoryIds: thedata.businessGlossoryId,
  1454. followSituations: thedata.followSituation,
  1455. customerStatuss: thedata.customerStatus,
  1456. followTimes: thedata.followTime,
  1457. createTimes: thedata.createTime,
  1458. identifyNames: thedata.identifyName,
  1459. contactTypes: parseInt(thedata.contactType),
  1460. results: thedata.result,
  1461. remarkss: thedata.remarks,
  1462. adminNames: thedata.adminName,
  1463. contactss: thedata.contacts,
  1464. contactMobiles: thedata.contactMobile,
  1465. ufbId: thedata.ufbId,
  1466. followIds: thedata.followId,
  1467. });
  1468. }.bind(this),
  1469. }).always(function() {
  1470. this.setState({
  1471. loading: false
  1472. });
  1473. }.bind(this));
  1474. },
  1475. //修改密码Modul
  1476. modifyPassworld() {
  1477. this.setState({
  1478. passworldModul: true
  1479. });
  1480. },
  1481. passworldOk(e) {
  1482. this.setState({
  1483. passworldModul: false
  1484. });
  1485. },
  1486. passworldCancel(e) {
  1487. this.setState({
  1488. passworldModul: false
  1489. });
  1490. },
  1491. //修改密码保存
  1492. passworldSubmit(e) {
  1493. e.preventDefault();
  1494. this.passworldCancel()
  1495. },
  1496. //新增联系人
  1497. addcontactModulOK() {
  1498. this.setState({
  1499. addcontactModul: false
  1500. });
  1501. },
  1502. addcontactModulcancel() {
  1503. this.setState({
  1504. addcontactModul: false
  1505. });
  1506. },
  1507. //点击新增详情
  1508. newContacts() {
  1509. this.state.newsex = undefined;
  1510. this.state.newname = '';
  1511. this.state.newmobile = '';
  1512. this.state.newwechat = '';
  1513. this.state.newqq = '';
  1514. this.state.newdepatrment = '';
  1515. this.state.newposition = '';
  1516. this.state.newemail = '';
  1517. this.setState({
  1518. uids: this.state.uid,
  1519. addcontactModul: true
  1520. });
  1521. },
  1522. //新增联系人保存函数
  1523. submitcontactman(e) {
  1524. e.preventDefault();
  1525. this.setState({
  1526. loading: true
  1527. })
  1528. $.ajax({
  1529. method: "post",
  1530. dataType: "json",
  1531. crossDomain: false,
  1532. url: globalConfig.context + "/api/admin/customer/addOneContact",
  1533. data: {
  1534. uid: this.state.uids,
  1535. name: this.state.newname,
  1536. mobile: this.state.newmobile,
  1537. email: this.state.newemail,
  1538. wechat: this.state.newwechat,
  1539. depatrment: this.state.newdepatrment,
  1540. position: this.state.newposition,
  1541. sex: this.state.newsex,
  1542. qq: this.state.newqq
  1543. },
  1544. success: function(data) {
  1545. if(!data.error.length) {
  1546. this.addcontactModulOK()
  1547. this.getNewWoman(this.state.uids)
  1548. this.setState({
  1549. loading: false,
  1550. })
  1551. } else {
  1552. message.warning(data.error[0].message);
  1553. };
  1554. }.bind(this)
  1555. });
  1556. },
  1557. //获取联系人下拉框
  1558. getNewWoman(ids) {
  1559. this.state.data = []
  1560. $.ajax({
  1561. method: "get",
  1562. dataType: "json",
  1563. crossDomain: false,
  1564. url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
  1565. data: {
  1566. uid: ids,
  1567. },
  1568. success: function(data) {
  1569. let theArr = [];
  1570. let thedata = data.data;
  1571. if(!thedata) {
  1572. if(data.error && data.error.length) {
  1573. message.warning(data.error[0].message);
  1574. };
  1575. thedata = {};
  1576. };
  1577. var telNum = [];
  1578. var contactIds = [];
  1579. thedata.map(function(item, index) {
  1580. contactIds.push(thedata[index].id);
  1581. telNum.push(thedata[index].mobile);
  1582. });
  1583. for(let item in data.data) {
  1584. let theData = data.data[item];
  1585. theArr.push(
  1586. <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
  1587. );
  1588. };
  1589. this.setState({
  1590. contactsIdArr: thedata,
  1591. telNum: telNum,
  1592. orderStatusOption: theArr,
  1593. });
  1594. }.bind(this),
  1595. }).always(function() {
  1596. this.setState({
  1597. deletId: ids,
  1598. loading: false
  1599. });
  1600. }.bind(this));
  1601. },
  1602. //拜访意向服务列表单个删除
  1603. intentionDelet(e, index) {
  1604. if(!this.state.keys) {
  1605. let detId = this.state.followIds;
  1606. if(e.id) {
  1607. this.setState({
  1608. selectedRowKeys: [],
  1609. });
  1610. $.ajax({
  1611. method: "get",
  1612. dataType: "json",
  1613. crossDomain: false,
  1614. url: globalConfig.context + "/api/admin/customer/deleteFollowOneBusiness",
  1615. data: {
  1616. ufbId: e.id
  1617. }
  1618. }).done(function(data) {
  1619. if(!data.error.length) {
  1620. message.success('删除成功');
  1621. this.setState({
  1622. loading: false,
  1623. });
  1624. } else {
  1625. message.warning(data.error[0].message);
  1626. };
  1627. this.visitModify(detId);
  1628. }.bind(this));
  1629. } else {
  1630. this.visitModify(detId);
  1631. }
  1632. } else {
  1633. let deteluserBusinessList = (this.state.data).splice(index, 1)
  1634. this.setState({
  1635. selectedRowKeys: [],
  1636. });
  1637. }
  1638. },
  1639. //tab5意向业务
  1640. //意向业务查看列表单个详情
  1641. businessIntentionDetails(e) {
  1642. $.ajax({
  1643. method: "get",
  1644. dataType: "json",
  1645. crossDomain: false,
  1646. url: globalConfig.context + '/api/admin/customer/toUpdateBusiness',
  1647. data: {
  1648. businessId: e.businessId
  1649. },
  1650. success: function(data) {
  1651. let thisData = data.data;
  1652. if(!thisData) {
  1653. if(data.error && data.error.length) {
  1654. message.warning(data.error[0].message);
  1655. };
  1656. thisData = {};
  1657. };
  1658. this.setState({
  1659. businessGlossoryId: thisData.businessGlossoryId,
  1660. identifyName: thisData.identifyName,
  1661. uid: thisData.uid,
  1662. businessId: thisData.businessId,
  1663. followSituation: thisData.followSituation,
  1664. customerStatus: thisData.customerStatus,
  1665. createTime: thisData.createTime,
  1666. followTime: thisData.followTime,
  1667. adminName: thisData.adminName,
  1668. remarks: thisData.remarks,
  1669. result: thisData.result,
  1670. });
  1671. }.bind(this),
  1672. }).always(function() {
  1673. this.loadVisit();
  1674. this.setState({
  1675. loading: false
  1676. });
  1677. }.bind(this));
  1678. this.setState({
  1679. businessModul: true
  1680. })
  1681. },
  1682. //查看跟进记录列表
  1683. loadVisit(pageNo) {
  1684. this.setState({
  1685. loading: true
  1686. });
  1687. $.ajax({
  1688. method: "get",
  1689. dataType: "json",
  1690. crossDomain: false,
  1691. url: globalConfig.context + '/api/admin/customer/listFollowHistory',
  1692. data: {
  1693. pageNo: pageNo || 1,
  1694. pageSize: this.state.paginations.pageSize,
  1695. uid: this.state.rowId, //名称1
  1696. businessGlossoryId: this.state.businessGlossoryId,
  1697. },
  1698. success: function(data) {
  1699. let theArr = [];
  1700. if(data.error.length || data.data.list == "") {
  1701. if(data.error && data.error.length) {
  1702. message.warning(data.error[0].message);
  1703. };
  1704. } else {
  1705. for(let i = 0; i < data.data.list.length; i++) {
  1706. let thisdata = data.data.list[i];
  1707. theArr.push({
  1708. followId: thisdata.followId,
  1709. followTime: thisdata.followTime,
  1710. identifyName: thisdata.identifyName,
  1711. contacts: thisdata.contacts,
  1712. contactMobile: thisdata.contactMobile,
  1713. result: thisdata.result,
  1714. ufbId: thisdata.ufbId,
  1715. adminName: thisdata.adminName,
  1716. followSituation: thisdata.followSituation,
  1717. customerStatus: thisdata.customerStatus,
  1718. contactType: thisdata.contactType
  1719. });
  1720. };
  1721. this.state.paginations.current = data.data.pageNo;
  1722. this.state.paginations.total = data.data.totalCount;
  1723. };
  1724. this.setState({
  1725. visitArrList: theArr,
  1726. paginations: this.state.paginations
  1727. });
  1728. }.bind(this),
  1729. }).always(function() {
  1730. this.setState({
  1731. loading: false
  1732. });
  1733. }.bind(this));
  1734. },
  1735. //tab3拜访记录
  1736. loadBfVisit(pageNo, ids) {
  1737. this.setState({
  1738. loading: true
  1739. });
  1740. $.ajax({
  1741. method: "get",
  1742. dataType: "json",
  1743. crossDomain: false,
  1744. url: globalConfig.context + '/api/admin/customer/listFollowHistory',
  1745. data: {
  1746. pageNo: pageNo || 1,
  1747. pageSize: this.state.paginationsy.pageSize,
  1748. uid: ids ? ids : this.state.rowId, //名称1
  1749. },
  1750. success: function(data) {
  1751. let theArr = [];
  1752. if(data.error.length || data.data.list == "") {
  1753. if(data.error && data.error.length) {
  1754. message.warning(data.error[0].message);
  1755. };
  1756. } else {
  1757. for(let i = 0; i < data.data.list.length; i++) {
  1758. let thisdata = data.data.list[i];
  1759. theArr.push({
  1760. followId: thisdata.followId,
  1761. followTime: thisdata.followTime,
  1762. identifyName: thisdata.identifyName,
  1763. contacts: thisdata.contacts,
  1764. contactMobile: thisdata.contactMobile,
  1765. result: thisdata.result,
  1766. ufbId: thisdata.ufbId,
  1767. adminName: thisdata.adminName,
  1768. followSituation: thisdata.followSituation,
  1769. customerStatus: thisdata.customerStatus,
  1770. contactType: thisdata.contactType
  1771. });
  1772. };
  1773. this.state.paginationsy.current = data.data.pageNo;
  1774. this.state.paginationsy.total = data.data.totalCount;
  1775. };
  1776. this.setState({
  1777. visitArrList: theArr,
  1778. paginationsy: this.state.paginationsy
  1779. });
  1780. }.bind(this),
  1781. }).always(function() {
  1782. this.setState({
  1783. loading: false
  1784. });
  1785. }.bind(this));
  1786. },
  1787. businessIntentionOk() {
  1788. this.setState({
  1789. businessGlossoryId: '',
  1790. businessModul: false
  1791. })
  1792. },
  1793. businessIntentionCancel() {
  1794. this.setState({
  1795. businessGlossoryId: '',
  1796. businessModul: false
  1797. })
  1798. },
  1799. //业务跟进查看跟多
  1800. businessFollowDetails(e) {
  1801. this.listFollowUp(e.ufbId)
  1802. this.setState({
  1803. businessFollowModul: true
  1804. })
  1805. },
  1806. businessFollowOk(e) {
  1807. this.setState({
  1808. businessFollowModul: false
  1809. })
  1810. },
  1811. businessFollowCancel(e) {
  1812. this.setState({
  1813. businessFollowModul: false
  1814. })
  1815. },
  1816. //tab2联系人保存
  1817. contactSave(e) {
  1818. e.preventDefault();
  1819. let err = '';
  1820. let contactArr = this.state.contactList;
  1821. contactArr.map(function(item) {
  1822. if(!item.name) {
  1823. err = '客户姓名不能为空!';
  1824. }
  1825. if(!item.mobile) {
  1826. err = '手机号码不能为空!';
  1827. }
  1828. return err;
  1829. })
  1830. if(err) {
  1831. message.warning(err)
  1832. return false;
  1833. };
  1834. $.ajax({
  1835. url: globalConfig.context + '/api/admin/customer/updateCustomerContacts',
  1836. method: 'post',
  1837. data: {
  1838. uid: this.state.rowId,
  1839. contactList: JSON.stringify(this.state.contactList)
  1840. }
  1841. }).done(function(data) {
  1842. this.setState({
  1843. loading: false
  1844. });
  1845. if(!data.error.length) {
  1846. message.success('保存成功!');
  1847. this.detailsModal()
  1848. this.loadData(this.state.ispage);
  1849. } else {
  1850. message.warning(data.error[0].message);
  1851. }
  1852. }.bind(this));
  1853. },
  1854. //详情tab切换数据处理
  1855. callback(e) {
  1856. if(e == '1') {
  1857. this.loadInformation(this.state.rowId)
  1858. }
  1859. if(e == '2') {
  1860. this.contactLists(this.state.rowId)
  1861. }
  1862. if(e == '3') {
  1863. this.httpAccount(this.state.rowId)
  1864. }
  1865. if(e == '4') {
  1866. this.loadBfVisit(1, this.state.rowId);
  1867. }
  1868. if(e == '5') {
  1869. this.BusinessList(1, this.state.rowId);
  1870. }
  1871. if(e == '6') {
  1872. }
  1873. if(e == '7') {
  1874. }
  1875. if(e == '8') {
  1876. }
  1877. if(e == '9') {
  1878. }
  1879. this.setState({
  1880. callnub: e,
  1881. })
  1882. },
  1883. //账户信息保存
  1884. accountSave(e) {
  1885. e.preventDefault();
  1886. this.state.data = [];
  1887. this.setState({
  1888. selectedRowKeys: [],
  1889. });
  1890. this.setState({
  1891. loading: true
  1892. });
  1893. $.ajax({
  1894. method: "post",
  1895. dataType: "json",
  1896. url: globalConfig.context + '/api/admin/customer/updateUserAccount',
  1897. data: {
  1898. id: this.state.Accountuid,
  1899. mobile: this.state.mobile,
  1900. nickname: this.state.nickname,
  1901. email: this.state.email,
  1902. isMember: this.state.isMember,
  1903. currentMemberStatus: this.state.currentMemberStatus,
  1904. lvl: this.state.lvl,
  1905. status: this.state.status,
  1906. }
  1907. }).done(function(data) {
  1908. this.setState({
  1909. loading: false
  1910. });
  1911. if(!data.error.length) {
  1912. message.success('保存成功!');
  1913. this.detailsModal();
  1914. this.loadData(this.state.ispage);
  1915. } else {
  1916. message.warning(data.error[0].message);
  1917. }
  1918. }.bind(this));
  1919. },
  1920. //tab2删除
  1921. confirmDelet(e) {
  1922. this.setState({
  1923. loading: true
  1924. });
  1925. if(e.id) {
  1926. $.ajax({
  1927. method: "get",
  1928. dataType: "json",
  1929. crossDomain: false,
  1930. url: globalConfig.context + "/api/admin/customer/deleteOneContact",
  1931. data: {
  1932. ocbId: e.id, //删除的ID
  1933. }
  1934. }).done(function(data) {
  1935. if(!data.error.length) {
  1936. message.success('删除成功!');
  1937. this.setState({
  1938. loading: false,
  1939. });
  1940. } else {
  1941. message.warning(data.error[0].message);
  1942. };
  1943. this.contactLists(this.state.rowId);
  1944. }.bind(this));
  1945. } else {
  1946. this.contactLists(this.state.rowId);
  1947. }
  1948. },
  1949. //tab5业务意向
  1950. BusinessList(pageNo, uids) {
  1951. this.setState({
  1952. loading: true
  1953. });
  1954. $.ajax({
  1955. method: "post",
  1956. dataType: "json",
  1957. crossDomain: false,
  1958. url: globalConfig.context + '/api/admin/customer/listBusiness',
  1959. data: {
  1960. pageNo: pageNo || 1,
  1961. pageSize: this.state.paginationt.pageSize,
  1962. uid: uids ? uids : this.state.rowId
  1963. },
  1964. success: function(data) {
  1965. let theArr = [];
  1966. if(data.error.length || data.data.list == "") {
  1967. if(data.error && data.error.length) {
  1968. message.warning(data.error[0].message);
  1969. };
  1970. } else {
  1971. for(let i = 0; i < data.data.list.length; i++) {
  1972. let thisdata = data.data.list[i];
  1973. theArr.push({
  1974. key: i,
  1975. businessId: thisdata.businessId,
  1976. businessName: thisdata.businessName,
  1977. identifyName: thisdata.identifyName,
  1978. followSituation: thisdata.followSituation,
  1979. customerStatus: thisdata.customerStatus,
  1980. adminName: thisdata.adminName,
  1981. createTime: thisdata.createTime
  1982. });
  1983. };
  1984. this.state.paginationt.current = data.data.pageNo;
  1985. this.state.paginationt.total = data.data.totalCount;
  1986. };
  1987. this.setState({
  1988. dataBusiness: theArr,
  1989. paginationt: this.state.paginationt
  1990. });
  1991. }.bind(this),
  1992. }).always(function() {
  1993. this.setState({
  1994. loading: false
  1995. });
  1996. }.bind(this));
  1997. },
  1998. //指定转交人自动补全
  1999. supervisor(e){
  2000. $.ajax({
  2001. method: "get",
  2002. dataType: "json",
  2003. crossDomain: false,
  2004. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  2005. data:{
  2006. adminName:e
  2007. },
  2008. success: function (data) {
  2009. let thedata=data.data;
  2010. if (!thedata) {
  2011. if (data.error && data.error.length) {
  2012. message.warning(data.error[0].message);
  2013. };
  2014. thedata = {};
  2015. };
  2016. this.setState({
  2017. customerArr:thedata,
  2018. });
  2019. }.bind(this),
  2020. }).always(function () {
  2021. this.setState({
  2022. loading: false
  2023. });
  2024. }.bind(this));
  2025. },
  2026. //上级主管输入框失去焦点是判断客户是否存在
  2027. selectAuto(value,options){
  2028. this.setState({
  2029. auto:value
  2030. })
  2031. },
  2032. blurChange(e){
  2033. let theType='';
  2034. let contactLists=this.state.customerArr||[];
  2035. if (e) {
  2036. contactLists.map(function (item) {
  2037. if (item.name == e.toString()) {
  2038. theType = item.id;
  2039. }
  2040. });
  2041. }
  2042. this.setState({
  2043. theTypes:theType
  2044. })
  2045. },
  2046. //值改变时请求客户名称
  2047. httpChange(e){
  2048. if(e.length>=1){
  2049. this.supervisor(e);
  2050. }
  2051. this.setState({
  2052. auto:e
  2053. })
  2054. },
  2055. componentWillReceiveProps(nextProps) {
  2056. if(!this.props.visible && nextProps.visible) {
  2057. if(nextProps.data && nextProps.data.id) {
  2058. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  2059. };
  2060. this.state.data = {};
  2061. this.state.positiveIdUrl = [];
  2062. this.state.oppositeIdUrl = [];
  2063. this.state.headPortraitUrl = [];
  2064. };
  2065. },
  2066. render() {
  2067. const FormItem = Form.Item
  2068. const rowSelection = {
  2069. selectedRowKeys: this.state.selectedRowKeys,
  2070. onChange: (selectedRowKeys, selectedRows) => {
  2071. this.setState({
  2072. selectedRows: selectedRows.slice(-1),
  2073. selectedRowKeys: selectedRowKeys.slice(-1)
  2074. });
  2075. },
  2076. onSelect: (recordt, selected, selectedRows) => {
  2077. this.setState({
  2078. recordt: recordt.id
  2079. })
  2080. },
  2081. };
  2082. const hasSelected = this.state.selectedRowKeys.length > 0;
  2083. const { RangePicker, MonthPicker } = DatePicker;
  2084. const { getFieldDecorator } = this.props.form;
  2085. const formItemLayout = {
  2086. labelCol: { span: 8 },
  2087. wrapperCol: { span: 14 },
  2088. };
  2089. const theInformation = this.state.dataInformation || {}
  2090. const contactsOption = "";
  2091. const formItemLayput = {
  2092. labelCol: { span: 10 },
  2093. wrapperCol: { span: 14 },
  2094. };
  2095. const contacts = this.state.contacts || '';
  2096. const dataSources=this.state.customerArr || [];
  2097. const options = dataSources.map((group) =>
  2098. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  2099. )
  2100. return(
  2101. <div className="user-content" >
  2102. <div className="content-title">
  2103. <span>我的个人客户</span>
  2104. </div>
  2105. <div className="user-search">
  2106. <Input placeholder="公司名称"
  2107. value={this.state.nameSearch}
  2108. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  2109. <Select placeholder="省"
  2110. style={{ width: 80 }}
  2111. value={this.state.provinceSearch}
  2112. onChange={(e) => {this.setState({ provinceSearch: e});}}>
  2113. {this.state.Provinces}
  2114. </Select>
  2115. <span style={{marginRight:'10px'}}>
  2116. <Cascader options={this.state.City} value={this.state.addressSearch} placeholder="选择城市"
  2117. onChange={(e,pre) => { this.setState({ addressSearch: e }) }} />
  2118. </span>
  2119. <Button type="primary" onClick={this.search}>搜索</Button>
  2120. <Button onClick={this.reset}>重置</Button>
  2121. <Button onClick={() => { window.open(globalConfig.context + '/api/admin/customer/downloadTemplate?type=0')}} style={{display:'none'}}>下载批量导入模板</Button>
  2122. <Upload
  2123. name="file"
  2124. action={globalConfig.context + "/api/admin/customer/uploadExcel"}
  2125. beforeUpload={beforeUploadFile}
  2126. showUploadList={false}
  2127. onChange={(info) => {
  2128. if (info.file.status !== 'uploading') {
  2129. console.log(info.file, info.fileList);
  2130. }
  2131. if (info.file.status === 'done') {
  2132. if (!info.file.response.error.length) {
  2133. message.success(`${info.file.name} 文件上传成功!`);
  2134. this.loadData();
  2135. } else {
  2136. message.warning(info.file.response.error[0].message);
  2137. return;
  2138. };
  2139. } else if (info.file.status === 'error') {
  2140. message.error(`${info.file.name} 文件上传失败。`);
  2141. };
  2142. }} >
  2143. <Button style={{display:'none'}}>上传批量内容</Button>
  2144. </Upload>
  2145. {adminData.isSuperAdmin?<Button style={{ marginRight:'10px' ,marginLeft:'10px'}} type='danger'
  2146. disabled={!hasSelected}
  2147. onClick={this.delectRow}>删除<Icon type="minus" />
  2148. </Button>:''
  2149. }
  2150. <AutoComplete
  2151. className="certain-category-search"
  2152. dropdownClassName="certain-category-search-dropdown"
  2153. dropdownMatchSelectWidth={false}
  2154. dropdownStyle={{ width: 120 }}
  2155. style={{ width: '120px',marginLeft:'10px'}}
  2156. dataSource={options}
  2157. placeholder="输入转交人姓名"
  2158. value={this.state.auto}
  2159. onChange={this.httpChange}
  2160. filterOption={true}
  2161. onBlur={this.blurChange}
  2162. onSelect={this.selectAuto}
  2163. disabled={!hasSelected}
  2164. >
  2165. <Input />
  2166. </AutoComplete>
  2167. <Button type="primary" onClick={this.changeAssigner} disabled={!hasSelected} >转交</Button>
  2168. <Button type="primary"
  2169. disabled={!hasSelected}
  2170. onClick={this.changeRow}>转为公共客户<Icon /></Button>
  2171. {/*<Button style={{marginRight:'10px'}} type="primary"
  2172. disabled
  2173. onClick={this.delectRow}>锁定
  2174. </Button>
  2175. <Button style={{marginRight:'10px'}} type="primary"
  2176. disabled
  2177. onClick={this.delectRow}>激活
  2178. </Button>
  2179. */}
  2180. <Button type="primary" className="addButton" onClick={this.addClick}>新增客户<Icon type="plus" /></Button>
  2181. <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  2182. <div className='clearfix' style={{marginTop:'5px'}}>
  2183. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  2184. <RangePicker
  2185. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  2186. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  2187. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  2188. <Select placeholder="账户状态"
  2189. style={{ width: 100 }}
  2190. value={this.state.statusSearch}
  2191. onChange={(e) => { this.setState({ statusSearch: e }) }}>
  2192. <Select.Option value="0" >正常</Select.Option>
  2193. <Select.Option value="2" >锁定</Select.Option>
  2194. </Select>
  2195. <Select placeholder="行业"
  2196. style={{ width: 100 }}
  2197. value={this.state.industrySearch}
  2198. onChange={(e) => { this.setState({ industrySearch: e }) }}>
  2199. {this.state.intentionalOption}
  2200. </Select>
  2201. <span>认证:</span>
  2202. <Select placeholder="业务认证"
  2203. style={{ width: 100 }}
  2204. value={this.state.serviceCertificationSearch}
  2205. onChange={(e) => { this.setState({ serviceCertificationSearch: e }) }}>
  2206. <Select.Option value="0" >未认证</Select.Option>
  2207. <Select.Option value="1" >已认证</Select.Option>
  2208. </Select>
  2209. <Select placeholder="实名认证"
  2210. style={{ width: 100 }}
  2211. value={this.state.userCertificationSearch}
  2212. onChange={(e) => { this.setState({ userCertificationSearch: e }) }}>
  2213. {
  2214. auditStatusL.map(function (item) {
  2215. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2216. })
  2217. }
  2218. </Select>
  2219. <span>专家:</span>
  2220. <Select placeholder="专家"
  2221. style={{ width: 60 }}
  2222. value={this.state.expertSearch}
  2223. onChange={(e) => { this.setState({ expertSearch: e }) }}>
  2224. <Select.Option value="0" >否</Select.Option>
  2225. <Select.Option value="1" >是</Select.Option>
  2226. </Select>
  2227. <span>明星:</span>
  2228. <Select placeholder="明星"
  2229. style={{ width: 60 }}
  2230. value={this.state.celebritySearch}
  2231. onChange={(e) => { this.setState({ celebritySearch: e }) }}>
  2232. <Select.Option value="0" >否</Select.Option>
  2233. <Select.Option value="1" >是</Select.Option>
  2234. </Select>
  2235. <span>国际:</span>
  2236. <Select placeholder="国际"
  2237. style={{ width: 60 }}
  2238. value={this.state.internationalSearch}
  2239. onChange={(e) => { this.setState({ internationalSearch: e }) }}>
  2240. <Select.Option value="0" >否</Select.Option>
  2241. <Select.Option value="1" >是</Select.Option>
  2242. </Select>
  2243. <span>会员:</span>
  2244. <Select placeholder="会员等级"
  2245. style={{ width: 100 }}
  2246. value={this.state.lvlSearch}
  2247. onChange={(e) => { this.setState({ lvlSearch: e }) }}>
  2248. {this.state.lvlArrOption}
  2249. </Select>
  2250. <Select placeholder="会员状态"
  2251. style={{ width: 100 }}
  2252. value={this.state.currentMemberStatusSearch}
  2253. onChange={(e) => { this.setState({ currentMemberStatusSearch: e }) }}>
  2254. {this.state.currentMemberArrOption}
  2255. </Select>
  2256. </div>
  2257. </div>
  2258. </div>
  2259. <div className="patent-table">
  2260. <Spin spinning={this.state.loading}>
  2261. <Table columns={this.state.columns}
  2262. dataSource={this.state.dataSource}
  2263. rowSelection={rowSelection}
  2264. pagination={this.state.pagination}
  2265. onRowClick={this.tableRowClick}
  2266. />
  2267. </Spin>
  2268. </div>
  2269. <CustomerDetail
  2270. data={this.state.RowData}
  2271. showDesc={this.state.showDesc}
  2272. closeDesc={this.closeDesc}
  2273. newmodal={this.newmodal}
  2274. />
  2275. <Modal
  2276. className="customeDetails"
  2277. title="个人客户详情"
  2278. width='1300px'
  2279. visible={this.state.modal5Visible}
  2280. onOk={this.detailsModal}
  2281. onCancel={this.detailsModal}
  2282. footer=''
  2283. >
  2284. <Tabs onChange={this.callback} activeKey={this.state.callnub}>
  2285. <TabPane tab="基本信息" key="1">
  2286. <Form horizontal onSubmit={this.newSubmit} id="demand-form">
  2287. <Spin spinning={this.state.loading}>
  2288. <div className="clearfix" >
  2289. <FormItem className="half-item"
  2290. {...formItemLayout}
  2291. label="客户姓名"
  2292. >
  2293. <span>{this.state.identifyName}</span>
  2294. </FormItem>
  2295. </div>
  2296. <div className="clearfix" >
  2297. <FormItem className="half-item"
  2298. {...formItemLayout}
  2299. label="行业">
  2300. <Select placeholder="选择行业" value={this.state.industry} style={{width:'300px'}}
  2301. onChange={(e)=>{this.setState({industry:e})}}>
  2302. {
  2303. industry.map(function (item) {
  2304. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2305. })
  2306. }
  2307. </Select>
  2308. <span style={{color:'red',marginLeft:'15px'}}>*</span>
  2309. </FormItem>
  2310. <FormItem className="half-item"
  2311. {...formItemLayout}
  2312. label="社会属性"
  2313. >
  2314. <Select placeholder="客户社会属性" value={this.state.societyTag} style={{width:'300px'}}
  2315. onChange={(e)=>{this.setState({societyTag:e})}}>
  2316. {
  2317. socialAttribute.map(function (item) {
  2318. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2319. })
  2320. }
  2321. </Select>
  2322. <span style={{color:'red',marginLeft:'15px'}}>*</span>
  2323. </FormItem>
  2324. <FormItem className="half-item"
  2325. {...formItemLayout}
  2326. label="省-市-区"
  2327. >
  2328. <Cascader options={this.state.Area} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'300px'}}
  2329. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  2330. <span style={{color:'red',marginLeft:'15px'}}>*</span>
  2331. </FormItem>
  2332. <FormItem className="half-item"
  2333. {...formItemLayout}
  2334. label="出生日期"
  2335. >
  2336. {!this.state.yearMonth?<MonthPicker placeholder="选择出生年月" value={this.state.yearMonth||null} onChange={(time) => {this.setState({yearMonth: time});}}/>
  2337. :<MonthPicker value={moment(this.state.yearMonth, monthFormat)} format={monthFormat} onChange={(time) => {this.setState({yearMonth: time});}}/>
  2338. }
  2339. </FormItem>
  2340. <FormItem className="half-item"
  2341. {...formItemLayout}
  2342. label="身份证号码"
  2343. >
  2344. <Input placeholder="身份证号码" value={this.state.idNumber} onChange={(e) => {
  2345. this.setState({ idNumber: e.target.value })}}/>
  2346. </FormItem>
  2347. <FormItem className="half-item"
  2348. {...formItemLayout}
  2349. label="主要联系人"
  2350. >
  2351. <Input placeholder="主要联系人" value={this.state.contacts} onChange={(e) => {
  2352. this.setState({ contacts: e.target.value })}}/>
  2353. </FormItem>
  2354. <FormItem className="half-item"
  2355. {...formItemLayout}
  2356. label="主要联系人号码"
  2357. >
  2358. <Input placeholder="主要联系人号码" value={this.state.contactMobile} onChange={(e) => {
  2359. this.setState({ contactMobile: e.target.value })}}/>
  2360. </FormItem>
  2361. <div className="clearfix">
  2362. <FormItem className="half-item"
  2363. {...formItemLayout}
  2364. label="职称名字"
  2365. >
  2366. <Input placeholder="职称名字" value={this.state.professionalTitle} onChange={(e) => {
  2367. this.setState({ professionalTitle: e.target.value })}}/>
  2368. </FormItem>
  2369. <FormItem className="half-item"
  2370. {...formItemLayout}
  2371. label="就业单位"
  2372. >
  2373. <Input placeholder="就业单位" value={this.state.workUnit} onChange={(e) => {
  2374. this.setState({ workUnit: e.target.value })}}/>
  2375. </FormItem>
  2376. <FormItem className="half-item"
  2377. {...formItemLayout}
  2378. label="学历"
  2379. >
  2380. <Input placeholder="学历" value={this.state.education} onChange={(e) => {
  2381. this.setState({ education: e.target.value })}}/>
  2382. </FormItem>
  2383. <FormItem className="half-item"
  2384. {...formItemLayout}
  2385. label="毕业院校"
  2386. >
  2387. <Input placeholder="学历" value={this.state.graduateSchool} onChange={(e) => {
  2388. this.setState({ graduateSchool: e.target.value })}}/>
  2389. </FormItem>
  2390. <FormItem className="half-item"
  2391. {...formItemLayout}
  2392. label="专业类别"
  2393. >
  2394. <Input placeholder="专业类别" value={this.state.majorCategory} onChange={(e) => {
  2395. this.setState({ majorCategory: e.target.value })}}/>
  2396. </FormItem>
  2397. <FormItem className="half-item"
  2398. {...formItemLayout}
  2399. label="职业资格"
  2400. >
  2401. <Input placeholder="职业资格" value={this.state.qualification} onChange={(e) => {
  2402. this.setState({ qualification: e.target.value })}}/>
  2403. </FormItem>
  2404. <FormItem className="half-item"
  2405. {...formItemLayout}
  2406. label="通信地址"
  2407. >
  2408. <Input placeholder="客户通信地址" value={this.state.postalAddress}
  2409. onChange={(e,pre) => { this.setState({ postalAddress: e.target.value }) }}/>
  2410. </FormItem>
  2411. <FormItem className="half-item"
  2412. {...formItemLayout}
  2413. label="固定电话"
  2414. >
  2415. <Input placeholder="客户固定电话" value={this.state.fixedTel}
  2416. onChange={(e) => { this.setState({ fixedTel: e.target.value }) }}/>
  2417. </FormItem>
  2418. <FormItem className="half-item"
  2419. {...formItemLayout}
  2420. label="客户QQ"
  2421. >
  2422. <Input placeholder="客户QQ" value={this.state.qq}
  2423. onChange={(e) => { this.setState({ qq: e.target.value })}}/>
  2424. </FormItem>
  2425. <FormItem className="half-item"
  2426. {...formItemLayout}
  2427. label="电子邮箱"
  2428. >
  2429. <Input placeholder="客户电子邮箱" value={this.state.email}
  2430. onChange={(e) => {this.setState({email: e.target.value })}}/>
  2431. </FormItem>
  2432. <FormItem className="half-item"
  2433. {...formItemLayout}
  2434. label="咨询费用"
  2435. >
  2436. <Input ref='consul' placeholder="请输入咨询费用" value={this.state.consultationPrice}
  2437. onChange={(e) => {this.setState({consultationPrice: e.target.value })}}/>
  2438. </FormItem>
  2439. </div>
  2440. <div className="clearfix">
  2441. <FormItem className="half-item"
  2442. {...formItemLayout}
  2443. label="业务认证"
  2444. >
  2445. <Radio.Group value={this.state.businessAudit} onChange={(e) => {
  2446. this.setState({ businessAudit: e.target.value })
  2447. }}>
  2448. <Radio value={0}>未认证</Radio>
  2449. <Radio value={1}>已认证</Radio>
  2450. </Radio.Group>
  2451. </FormItem>
  2452. <FormItem className="half-item"
  2453. {...formItemLayout}
  2454. label="国际化"
  2455. >
  2456. <Radio.Group value={this.state.international} onChange={(e) => {
  2457. this.setState({ international: e.target.value })
  2458. }}>
  2459. <Radio value={0}>否</Radio>
  2460. <Radio value={1}>是</Radio>
  2461. </Radio.Group>
  2462. </FormItem>
  2463. <FormItem className="half-item"
  2464. {...formItemLayout}
  2465. label="性别"
  2466. >
  2467. <Radio.Group value={this.state.sex} onChange={(e) => {
  2468. this.setState({sex:e.target.value})
  2469. }}>
  2470. <Radio value={'男'}>男</Radio>
  2471. <Radio value={'女'}>女</Radio>
  2472. </Radio.Group>
  2473. </FormItem>
  2474. </div>
  2475. <div className='clearfix'>
  2476. <FormItem
  2477. labelCol={{ span:4 }}
  2478. wrapperCol={{ span: 18 }}
  2479. label="客户简介" >
  2480. <Input type="textarea" rows={4} value={this.state.introduction}
  2481. onChange={(e,pre) => { this.setState({ introduction: e.target.value })}}/>
  2482. </FormItem>
  2483. </div>
  2484. <div className="clearfix pictures">
  2485. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px',marginLeft:'60px'}}
  2486. labelCol={{ span: 8 }}
  2487. wrapperCol={{ span: 10 }}
  2488. label="身份证正面" >
  2489. <PicturesWall
  2490. fileList={this.getPositiveIdUrl}
  2491. pictureUrl={this.state.positiveIdUrl} />
  2492. <p>建议:图片要清晰。</p>
  2493. </FormItem>
  2494. <FormItem style={{display:'inline-block',width:'350px',marginTop:'20px'}}
  2495. labelCol={{ span: 8 }}
  2496. wrapperCol={{ span: 10 }}
  2497. label="身份证反面" >
  2498. <PicturesWall
  2499. fileList={this.getOppositeIdUrl}
  2500. pictureUrl={this.state.oppositeIdUrl} />
  2501. <p>建议:图片要清晰。</p>
  2502. </FormItem>
  2503. <FormItem style={{display:'inline-block' ,width:'350px',marginTop:'20px'}}
  2504. labelCol={{ span: 8 }}
  2505. wrapperCol={{ span: 10 }}
  2506. label="客户照片" >
  2507. <PicturesWall
  2508. fileList={this.getHeadPortraitUrl}
  2509. pictureUrl={this.state.headPortraitUrl} />
  2510. <p>建议:图片要清晰。</p>
  2511. </FormItem>
  2512. </div>
  2513. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'146px',marginBottom:'30px'}}>保存</Button>
  2514. <Button className="set-submit" type="ghost" onClick={this.detailsModal}>取消</Button>
  2515. </div>
  2516. </Spin>
  2517. </Form>
  2518. </TabPane>
  2519. <TabPane tab="联系人信息" key="2">
  2520. <div className="clearfix" >
  2521. <Button className="ContactsList" type="primary" onClick={this.addcontact}>新增</Button>
  2522. </div>
  2523. <div className="clearfix">
  2524. <Spin spinning={this.state.loading}>
  2525. <Form horizontal id="demand-form" onSubmit={this.contactSave} >
  2526. <Table
  2527. pagination={false}
  2528. columns={this.state.ContactsLists}
  2529. dataSource={this.state.contactList}
  2530. />
  2531. <div className="clearfix">
  2532. <Button type="primary" htmlType="submit" style={{fontSize:'16px',margin:'20px 25px 40px 120px'}}>保存</Button>
  2533. <Button type="ghost" onClick={this.detailsModal} style={{fontSize:'18px'}}>取消</Button>
  2534. </div>
  2535. </Form>
  2536. </Spin>
  2537. </div>
  2538. </TabPane>
  2539. <TabPane tab="账户信息" key="3">
  2540. <div className="clearfix">
  2541. <Form horizontal id="demand-form" onSubmit={this.accountSave} >
  2542. <Spin spinning={this.state.loading} >
  2543. <FormItem className="half-item"
  2544. {...formItemLayout}
  2545. label="注册手机号" >
  2546. <Input value={this.state.mobile} disabled onChange={(e) => { this.setState({ mobile: e.target.value }); }} style={{width:'200px',marginRight:'50px'}}/>
  2547. <Button onClick={this.modifyPassworld}>修改密码</Button>
  2548. </FormItem>
  2549. <FormItem className="half-item"
  2550. {...formItemLayout}
  2551. label="注册用户名" >
  2552. <Input value={this.state.nickname} onChange={(e) => { this.setState({ nickname: e.target.value }); }} />
  2553. </FormItem>
  2554. <FormItem className="half-item"
  2555. {...formItemLayout}
  2556. label="注册邮箱" >
  2557. <Input value={this.state.email} onChange={(e) => { this.setState({ email: e.target.value }); }} />
  2558. </FormItem>
  2559. <div className="clearfix">
  2560. <FormItem className="half-item"
  2561. {...formItemLayout}
  2562. label="客户来源" >
  2563. <span>{this.state.source}</span>
  2564. </FormItem>
  2565. <FormItem className="half-item"
  2566. {...formItemLayout}
  2567. label="客户类型" >
  2568. <span>{this.state.type}</span>
  2569. </FormItem>
  2570. <FormItem className="half-item"
  2571. {...formItemLayout}
  2572. label="创建时间" >
  2573. <span>{this.state.createTimes}</span>
  2574. </FormItem>
  2575. <FormItem className="half-item"
  2576. {...formItemLayout}
  2577. label="账户状态"
  2578. >
  2579. <Select placeholder="账户状态" value={this.state.status} onChange={(e) => { this.setState({ status: e }); }} >
  2580. {
  2581. statuslist.map(function (item) {
  2582. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2583. })
  2584. }
  2585. </Select>
  2586. </FormItem>
  2587. </div>
  2588. <div className="clearfix">
  2589. <FormItem className="half-item"
  2590. {...formItemLayout}
  2591. label="会员"
  2592. >
  2593. <Radio.Group value={this.state.isMember} onChange={(e) => {
  2594. this.setState({ isMember: e.target.value })
  2595. }}>
  2596. <Radio value={0}>否</Radio>
  2597. <Radio value={1}>是</Radio>
  2598. </Radio.Group>
  2599. </FormItem>
  2600. <FormItem className="half-item"
  2601. {...formItemLayout}
  2602. label="会员等级"
  2603. >
  2604. <Select placeholder="客户状态" value={this.state.lvl} onChange={(e) => { this.setState({ lvl: e }); }} >
  2605. {
  2606. lvl.map(function (item) {
  2607. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2608. })
  2609. }
  2610. </Select>
  2611. </FormItem>
  2612. <FormItem className="half-item"
  2613. {...formItemLayout}
  2614. label="会员状态"
  2615. >
  2616. <Select placeholder="会员状态" value={this.state.currentMemberStatus} onChange={(e) => { this.setState({ currentMemberStatus: e }); }} >
  2617. {
  2618. currentMember.map(function (item) {
  2619. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2620. })
  2621. }
  2622. </Select>
  2623. </FormItem>
  2624. </div>
  2625. <div className="clearfix">
  2626. <Button className='saveBtn' type="primary" htmlType="submit">保存</Button>
  2627. <Button type="ghost" onClick={this.detailsModal}>取消</Button>
  2628. </div>
  2629. </Spin>
  2630. </Form>
  2631. </div>
  2632. </TabPane>
  2633. <TabPane tab="客户拜访" key="4">
  2634. <div className="clearfix">
  2635. <Spin spinning={this.state.loading}>
  2636. <Table
  2637. pagination={false}
  2638. columns={this.state.visitsList}
  2639. dataSource={this.state.visitArrList}
  2640. onRowClick={this.VisitRowClick}
  2641. />
  2642. </Spin>
  2643. </div>
  2644. </TabPane>
  2645. <TabPane tab="业务意向" key="5">
  2646. <div className="clearfix">
  2647. <Spin spinning={this.state.loading}>
  2648. <Table
  2649. pagination={this.state.paginationt}
  2650. columns={this.state.businessIntentionList}
  2651. dataSource={this.state.dataBusiness}
  2652. />
  2653. </Spin>
  2654. </div>
  2655. </TabPane>
  2656. <TabPane tab="业务订单" key="6">
  2657. </TabPane>
  2658. <TabPane tab="技术需求" key="7">
  2659. </TabPane>
  2660. <TabPane tab="技术成果" key="8">
  2661. </TabPane>
  2662. <TabPane tab="技术专家" key="9">
  2663. </TabPane>
  2664. </Tabs>
  2665. </Modal>
  2666. <Modal
  2667. className="customeDetails"
  2668. footer=''
  2669. title="拜访详情"
  2670. width='1000px'
  2671. visible={this.state.visitModul}
  2672. onOk={this.visitOk}
  2673. onCancel={this.visitCancel}
  2674. >
  2675. <Form horizontal id="demand-form" onSubmit={this.visitSubmit}>
  2676. <Spin spinning={this.state.loading}>
  2677. <div className="clearfix">
  2678. <FormItem className="half-item"
  2679. {...formItemLayout}
  2680. label="拜访方式" >
  2681. <Radio.Group value={this.state.contactType} onChange={(e) => {
  2682. this.setState({ contactType: e.target.value })
  2683. }}>
  2684. <Radio value={0}>外出</Radio>
  2685. <Radio value={1}>电话</Radio>
  2686. <Radio value={2}>QQ</Radio>
  2687. <Radio value={3}>微信</Radio>
  2688. <Radio value={4}>邮箱</Radio>
  2689. </Radio.Group>
  2690. </FormItem>
  2691. <FormItem className="half-item"
  2692. {...formItemLayout}
  2693. >
  2694. <Button type="primary" onClick={this.newContacts} style={{marginLeft:'100px',display:this.state.keys?'inline-block':'none'}}>添加新联系人</Button>
  2695. </FormItem>
  2696. <div className="clearfix">
  2697. <FormItem className="half-item"
  2698. {...formItemLayout}
  2699. label="客户姓名"
  2700. >
  2701. <span>{this.state.identifyName}</span>
  2702. </FormItem>
  2703. <FormItem className="half-item"
  2704. {...formItemLayout}
  2705. label="拜访人"
  2706. >
  2707. <span>{this.state.adminName}</span>
  2708. </FormItem>
  2709. <FormItem className="half-item"
  2710. {...formItemLayout}
  2711. label="当前联系人"
  2712. >
  2713. <span>{this.state.contacts}</span>
  2714. </FormItem>
  2715. {this.state.contacts?<span></span>:
  2716. <FormItem className="half-item"
  2717. {...formItemLayout}
  2718. label="联系人"
  2719. >
  2720. <Select placeholder="选择联系人" style={{ width: 140 }}
  2721. value={this.state.lastName}
  2722. onChange={this.hundleName}>
  2723. {this.state.orderStatusOption}
  2724. </Select>
  2725. </FormItem>
  2726. }
  2727. <FormItem className="half-item"
  2728. {...formItemLayout}
  2729. label="拜访时间"
  2730. >
  2731. <span>{this.state.followTime}</span>
  2732. </FormItem>
  2733. <FormItem className="half-item"
  2734. {...formItemLayout}
  2735. label="联系电话"
  2736. >
  2737. <span>{this.state.nub}</span>
  2738. </FormItem>
  2739. </div>
  2740. <div className="clearfix">
  2741. <FormItem
  2742. labelCol={{ span: 4 }}
  2743. wrapperCol={{ span: 16 }}
  2744. label="拜访备注" >
  2745. <Input type="textarea" rows={4} value={this.state.result}
  2746. onChange={(e)=>{this.setState({result:e.target.value})}}/>
  2747. </FormItem>
  2748. </div>
  2749. <div className="clearfix">
  2750. <div style={{fontSize:'18px',marginLeft:'100px',marginTop:'15px',marginBottom:'10px'}}>业务意向<Button onClick={this.addNew} style={{marginLeft:'420px',background:'green',color:'#ffffff'}}>添加新业务</Button></div>
  2751. <div className="clearfix" style={{paddingLeft:'50px',paddingRight:'50px'}}>
  2752. <Spin spinning={this.state.loading}>
  2753. <Table
  2754. rowKey={record => record.id}
  2755. pagination={false}
  2756. columns={this.state.intentionList}
  2757. dataSource={this.state.data}
  2758. />
  2759. </Spin>
  2760. </div>
  2761. </div>
  2762. </div>
  2763. <Button type="primary" size="large" htmlType="submit" style={{margin:'15px 35px 35px 120px'}}>保存</Button>
  2764. <Button size="large" onClick={this.visitCancel}>取消</Button>
  2765. </Spin>
  2766. </Form>
  2767. </Modal>
  2768. <Modal
  2769. footer=''
  2770. title="修改密码"
  2771. width='600px'
  2772. visible={this.state.passworldModul}
  2773. onOk={this.passworldOk}
  2774. onCancel={this.passworldCancel}
  2775. >
  2776. <div className="clearfix">
  2777. <Form horizontal id="demand-form" onSubmit={this.passworldSubmit}>
  2778. <Spin spinning={this.state.loading}>
  2779. <div className="clearfix">
  2780. <FormItem className="half-item"
  2781. {...formItemLayout}
  2782. label="原密码" >
  2783. <Input type="password" value={this.state.companyNamet1} onChange={(e) => { this.setState({ companyNamet1: e.target.value }); }} required="required" />
  2784. </FormItem>
  2785. </div>
  2786. <div className="clearfix">
  2787. <FormItem className="half-item"
  2788. {...formItemLayout}
  2789. label="新密码" >
  2790. <Input type="password" value={this.state.companyName1} onChange={(e) => { this.setState({ companyName1: e.target.value }); }} required="required" />
  2791. </FormItem>
  2792. </div>
  2793. <div className="clearfix">
  2794. <FormItem className="half-item"
  2795. {...formItemLayout}
  2796. label="确认密码" >
  2797. <Input type="password" value={this.state.companyNam1} onChange={(e) => { this.setState({ companyNam1: e.target.value }); }} required="required" />
  2798. </FormItem>
  2799. </div>
  2800. <Button type="primary" size="large" htmlType="submit" style={{margin:'15px 15px 20px 95px'}}>保存</Button>
  2801. <Button size="large" onClick={this.passworldCancel}>取消</Button>
  2802. </Spin>
  2803. </Form>
  2804. </div>
  2805. </Modal>
  2806. <Modal
  2807. footer=''
  2808. width='800px'
  2809. title="新增联系人"
  2810. visible={this.state.addcontactModul}
  2811. onOk={this.addcontactModulOK}
  2812. onCancel={this.addcontactModulcancel}
  2813. >
  2814. <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
  2815. <Spin spinning={this.state.loading}>
  2816. <Row>
  2817. <FormItem
  2818. labelCol={{ span: 3 }}
  2819. wrapperCol={{ span: 14 }}
  2820. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  2821. <Radio.Group value={this.state.newsex} onChange={(e) => {
  2822. this.setState({ newsex: e.target.value })
  2823. }}>
  2824. <Radio value='男'>男</Radio>
  2825. <Radio value='女'>女</Radio>
  2826. </Radio.Group>
  2827. </FormItem>
  2828. </Row>
  2829. <Row style={{ paddingLeft:'50px' }}>
  2830. <Col span={2}><span style={{color:'red'}}>*</span>姓名:</Col>
  2831. <Col span={8}>
  2832. <Input value={this.state.newname} required="required"
  2833. onChange={(e) => { this.setState({ newname: e.target.value }) }} />
  2834. </Col>
  2835. <Col span={2} style={{ marginLeft: '50px' }}><span style={{color:'red'}}>*</span>手机:</Col>
  2836. <Col span={8}>
  2837. <Input value={this.state.newmobile} required="required"
  2838. onChange={(e) => { this.setState({ newmobile: e.target.value }) }} />
  2839. </Col>
  2840. </Row>
  2841. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  2842. <Col span={2}>微信:</Col>
  2843. <Col span={8}>
  2844. <Input value={this.state.newwechat}
  2845. onChange={(e) => { this.setState({ newwechat: e.target.value }) }} />
  2846. </Col>
  2847. <Col span={2} style={{ marginLeft: '50px' }}>Q Q:</Col>
  2848. <Col span={8}>
  2849. <Input value={this.state.newqq}
  2850. onChange={(e) => { this.setState({ newqq: e.target.value }) }} />
  2851. </Col>
  2852. </Row>
  2853. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  2854. <Col span={2}>部门:</Col>
  2855. <Col span={8}>
  2856. <Input value={this.state.newdepatrment}
  2857. onChange={(e) => { this.setState({ newdepatrment: e.target.value }) }} />
  2858. </Col>
  2859. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  2860. <Col span={8}>
  2861. <Input value={this.state.newposition}
  2862. onChange={(e) => { this.setState({ newposition: e.target.value }) }} />
  2863. </Col>
  2864. </Row>
  2865. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  2866. <Col span={2}>邮箱:</Col>
  2867. <Col span={8}>
  2868. <Input value={this.state.newemail}
  2869. onChange={(e) => { this.setState({ newemail: e.target.value }) }} />
  2870. </Col>
  2871. </Row>
  2872. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  2873. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  2874. <Button className="set-submit" type="ghost" onClick={this.addcontactModulcancel} id='change_rem'>取消</Button>
  2875. </Row>
  2876. </Spin>
  2877. </Form>
  2878. </Modal>
  2879. <Modal
  2880. footer=''
  2881. title="业务意向详情"
  2882. width='1000px'
  2883. visible={this.state.businessModul}
  2884. onOk={this.businessIntentionOk}
  2885. onCancel={this.businessIntentionCancel}
  2886. >
  2887. <div className="clearfix">
  2888. <Form horizontal id="demand-form" onSubmit={this.passworldSubmit}>
  2889. <Spin spinning={this.state.loading}>
  2890. <div className="clearfix">
  2891. <FormItem className="half-item"
  2892. {...formItemLayout}
  2893. label="意向业务名称" >
  2894. <span>{getCompanyIntention(this.state.businessGlossoryId)}</span>
  2895. </FormItem>
  2896. <FormItem className="half-item"
  2897. {...formItemLayout}
  2898. label="意向时间" >
  2899. <span>{this.state.createTime}</span>
  2900. </FormItem>
  2901. <FormItem className="half-item"
  2902. {...formItemLayout}
  2903. label="客户姓" >
  2904. <span>{this.state.identifyName}</span>
  2905. </FormItem>
  2906. <FormItem className="half-item"
  2907. {...formItemLayout}
  2908. label="营销员" >
  2909. <span>{this.state.adminName}</span>
  2910. </FormItem>
  2911. <FormItem className="half-item"
  2912. {...formItemLayout}
  2913. label="意向业务进度" >
  2914. <span>{getfllowSituation(this.state.followSituation)}</span>
  2915. </FormItem>
  2916. <FormItem className="half-item"
  2917. {...formItemLayout}
  2918. label="业务客户状态" >
  2919. <span>{getcustomerStatue(this.state.customerStatus)}</span>
  2920. </FormItem>
  2921. </div>
  2922. <div className="clearfix">
  2923. <FormItem className="half-item"
  2924. {...formItemLayout}
  2925. label="业务意向说明" >
  2926. <span>{this.state.remarks}</span>
  2927. </FormItem>
  2928. </div>
  2929. <div className="clearfix">
  2930. <div style={{fontSize:'18px',lineHeight:'24px',marginBottom:'10px'}}>业务跟进</div>
  2931. <div className="clearfix">
  2932. <Spin spinning={this.state.loading}>
  2933. <Table
  2934. pagination={this.state.paginations}
  2935. columns={this.state.businessFollowList}
  2936. dataSource={this.state.visitArrList}
  2937. />
  2938. </Spin>
  2939. </div>
  2940. </div>
  2941. </Spin>
  2942. </Form>
  2943. </div>
  2944. </Modal>
  2945. <Modal
  2946. footer=''
  2947. title="业务跟进详情"
  2948. width='600px'
  2949. visible={this.state.businessFollowModul}
  2950. onOk={this.businessFollowOk}
  2951. onCancel={this.businessFollowCancel}
  2952. >
  2953. <div className="clearfix">
  2954. <Form horizontal id="demand-form" onSubmit={this.passworldSubmit}>
  2955. <Spin spinning={this.state.loading}>
  2956. <div className="clearfix">
  2957. <FormItem className="half-item"
  2958. {...formItemLayout}
  2959. label="意向业务名称" >
  2960. <span>{getCompanyIntention(this.state.businessGlossoryIds)}</span>
  2961. </FormItem>
  2962. <FormItem className="half-item"
  2963. {...formItemLayout}
  2964. label="意向时间" >
  2965. <span>{this.state.createTimes}</span>
  2966. </FormItem>
  2967. <FormItem className="half-item"
  2968. {...formItemLayout}
  2969. label="客户姓名" >
  2970. <span>{this.state.identifyNames}</span>
  2971. </FormItem>
  2972. <FormItem className="half-item"
  2973. {...formItemLayout}
  2974. label="营销员" >
  2975. <span>{this.state.adminNames}</span>
  2976. </FormItem>
  2977. <FormItem className="half-item"
  2978. {...formItemLayout}
  2979. label="意向业务进度" >
  2980. <span>{getfllowSituation(this.state.followSituations)}</span>
  2981. </FormItem>
  2982. <FormItem className="half-item"
  2983. {...formItemLayout}
  2984. label="业务客户状态" >
  2985. <span>{getcustomerStatue(this.state.customerStatuss)}</span>
  2986. </FormItem>
  2987. </div>
  2988. <div className="clearfix">
  2989. <FormItem className="half-item"
  2990. {...formItemLayout}
  2991. label="业务意向说明" >
  2992. <span>{this.state.remarkss}</span>
  2993. </FormItem>
  2994. </div>
  2995. <div className="clearfix">
  2996. <div style={{fontSize:'18px',lineHeight:'30px'}}>拜访情况</div>
  2997. <FormItem className="half-item"
  2998. {...formItemLayout}
  2999. label="拜访方式" >
  3000. <span>{getContactType(this.state.contactTypes)}</span>
  3001. </FormItem>
  3002. <FormItem className="half-item"
  3003. {...formItemLayout}
  3004. label="联系人" >
  3005. <span>{this.state.contactss}</span>
  3006. </FormItem>
  3007. <FormItem className="half-item"
  3008. {...formItemLayout}
  3009. label="联系电话" >
  3010. <span>{this.state.contactMobiles}</span>
  3011. </FormItem>
  3012. <FormItem className="half-item"
  3013. {...formItemLayout}
  3014. label="拜访时间" >
  3015. <span>{this.state.followTimes}</span>
  3016. </FormItem>
  3017. <FormItem className="half-item"
  3018. {...formItemLayout}
  3019. label="拜访人" >
  3020. <span>{this.state.adminNames}</span>
  3021. </FormItem>
  3022. <div className="clearfix">
  3023. <FormItem className="half-item"
  3024. {...formItemLayout}
  3025. label="拜访备注" >
  3026. <span>{this.state.results}</span>
  3027. </FormItem>
  3028. </div>
  3029. </div>
  3030. </Spin>
  3031. </Form>
  3032. </div>
  3033. </Modal>
  3034. </div >
  3035. );
  3036. }
  3037. }));
  3038. export default IndividualCustomer;