myClient.jsx 105 KB

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