individualCustomer.jsx 108 KB

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