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