myClient.jsx 106 KB

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