publicCustomer.jsx 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  1. import React from 'react';
  2. import {
  3. Button, Cascader, Input, Select, Tag,
  4. Spin, Table, message, Form, Col, Tabs, Modal, Icon, AutoComplete
  5. } from 'antd';
  6. import ajax from 'jquery/src/ajax/xhr.js';
  7. import $ from 'jquery/src/ajax';
  8. import {areaSelect, citySelect, provinceList } from '@/NewDicProvinceList';
  9. import { ShowModal, onReplace } from '../../../../tools.js'
  10. import { socialAttribute, customerSource } from '@/dataDic.js';
  11. import Outbound from '../../NEW/components/outbound';
  12. import ShowModalDiv from "@/showModal.jsx";
  13. import { ChooseList } from "../../../order/orderNew/chooseList";
  14. import TextArea from "antd/es/input/TextArea";
  15. const QueryCustomer = React.createClass({
  16. loadData(pageNo, apiUrl) {
  17. // 新需求 除湖南和内蒙古外 不让其他省操作
  18. if (adminData.province != "21" && adminData.province != "11") {
  19. return
  20. }
  21. this.setState({
  22. loading: true,
  23. ispage: pageNo,
  24. });
  25. let api = apiUrl ? apiUrl : this.props.ApiUrl;
  26. $.ajax({
  27. method: "post",
  28. dataType: "json",
  29. crossDomain: false,
  30. url: globalConfig.context + api,
  31. data: {
  32. pageNo: pageNo || 1,
  33. pageSize: this.state.pagination.pageSize,
  34. name: this.state.nameSearch,
  35. province: !this.state.addressSearch.length
  36. ? this.state.provinceSearch
  37. : this.state.addressSearch[0],
  38. city: !this.state.addressSearch.length
  39. ? ""
  40. : this.state.addressSearch[1],
  41. sort: this.state.sort
  42. },
  43. success: function (data) {
  44. ShowModal(this);
  45. let theArr = [];
  46. if (data.error.length || data.data.list == "") {
  47. if (data.error && data.error.length) {
  48. message.warning(data.error[0].message);
  49. }
  50. } else {
  51. for (let i = 0; i < data.data.list.length; i++) {
  52. let thisdata = data.data.list[i];
  53. theArr.push({
  54. key: i,
  55. id: thisdata.uid,
  56. name: thisdata.name,
  57. contacts: thisdata.contacts,
  58. contactMobile: thisdata.contactMobile,
  59. signBills: thisdata.signBills,
  60. createTime:
  61. thisdata.createTime && thisdata.createTime.split(" ")[0],
  62. transferTime:
  63. thisdata.transferTime && thisdata.transferTime.split(" ")[0],
  64. locationProvince: thisdata.province
  65. ? (thisdata.province || '') + (thisdata.city ? "-" + thisdata.city : '') + (thisdata.area ? "-" + thisdata.area : '')
  66. : "--",
  67. myUser: thisdata.myUser
  68. });
  69. }
  70. this.state.pagination.current = data.data.pageNo;
  71. this.state.pagination.total = data.data.totalCount;
  72. }
  73. if (data.data && data.data.list && !data.data.list.length) {
  74. this.state.pagination.current = 0;
  75. this.state.pagination.total = 0;
  76. }
  77. this.setState({
  78. dataSource: theArr,
  79. pagination: this.state.pagination,
  80. selectedRowKeys: [],
  81. });
  82. }.bind(this),
  83. }).always(
  84. function () {
  85. this.setState({
  86. loading: false,
  87. });
  88. }.bind(this)
  89. );
  90. },
  91. getInitialState() {
  92. return {
  93. verification: false,
  94. businessScope: [],
  95. cooperationProjects: [],
  96. selectCooperationProjects: [],
  97. sort: 0,
  98. addressSearch: [],
  99. dataSource: [],
  100. loading: false,
  101. selectedRowKeys: [],
  102. selectedRows: [],
  103. selectedData: [],
  104. pagination: {
  105. defaultCurrent: 1,
  106. defaultPageSize: 10,
  107. showQuickJumper: true,
  108. pageSize: 10,
  109. onChange: function (page) {
  110. this.loadData(page);
  111. }.bind(this),
  112. showTotal: function (total) {
  113. return '共' + total + '条数据';
  114. }
  115. },
  116. columns: [{
  117. title: '客户名称',
  118. dataIndex: 'name',
  119. key: 'name',
  120. render: (text, record, index) =>
  121. onReplace(text)
  122. },
  123. {
  124. title: '地区',
  125. dataIndex: 'locationProvince',
  126. key: 'locationProvince',
  127. },
  128. // {
  129. // title: '联系人',
  130. // dataIndex: 'contacts',
  131. // key: 'contacts',
  132. // },{
  133. // title: '联系电话',
  134. // dataIndex: 'contactMobile',
  135. // key: 'contactss',
  136. // },
  137. {
  138. title: '创建时间',
  139. dataIndex: 'createTime',
  140. key: 'createTime',
  141. },
  142. {
  143. title: '转换时间',
  144. dataIndex: 'transferTime',
  145. key: 'transferTime',
  146. width: 500,
  147. render: (text, record) => {
  148. return <div>
  149. <span style={{ marginRight: 20 }}>{text}</span>
  150. {!this.props.intentionState &&
  151. <Outbound
  152. type="public"
  153. uid={record.id}
  154. />}
  155. </div>
  156. }
  157. },
  158. {
  159. title: '操作',
  160. dataIndex: 'abc',
  161. key: 'abc',
  162. width: 250,
  163. render: (text, record, index) => {
  164. return <div>
  165. <Button onClick={(e) => { e.stopPropagation(), this.receive(record) }} type="primary">领取</Button>
  166. <Button
  167. onClick={(e) => {
  168. e.stopPropagation(),
  169. this.rTips(record)
  170. }}
  171. style={{ marginLeft: 10 }}
  172. type="primary">领取为私有渠道信息</Button>
  173. </div>
  174. }
  175. }
  176. ],
  177. natureOptions: [{
  178. value: 1,
  179. label: "政府机构"
  180. }, {
  181. value: 2,
  182. label: "科研院所"
  183. }, {
  184. value: 3,
  185. label: "高等院校"
  186. }, {
  187. value: 4,
  188. label: "社会团体"
  189. }, {
  190. value: 5,
  191. label: "企业",
  192. children: [{
  193. value: 1,
  194. label: "国企",
  195. children: [{
  196. value: 1,
  197. label: "上市公司",
  198. }, {
  199. value: 0,
  200. label: "非上市公司",
  201. }]
  202. }, {
  203. value: 2,
  204. label: "央企",
  205. children: [{
  206. value: 1,
  207. label: "上市公司",
  208. }, {
  209. value: 0,
  210. label: "非上市公司",
  211. }]
  212. }, {
  213. value: 3,
  214. label: "私企",
  215. children: [{
  216. value: 1,
  217. label: "上市公司",
  218. }, {
  219. value: 0,
  220. label: "非上市公司",
  221. }]
  222. }, {
  223. value: 4,
  224. label: "合资企业(含港澳台)",
  225. children: [{
  226. value: 1,
  227. label: "上市公司",
  228. }, {
  229. value: 0,
  230. label: "非上市公司",
  231. }]
  232. }, {
  233. value: 5,
  234. label: "外资控股",
  235. children: [{
  236. value: 1,
  237. label: "上市公司",
  238. }, {
  239. value: 0,
  240. label: "非上市公司",
  241. }]
  242. }]
  243. }, {
  244. value: 0,
  245. label: "其他组织"
  246. }]
  247. }
  248. },
  249. handleClose(removedTag) {
  250. let businessScope = this.state.businessScope.filter(tag => { return tag !== removedTag });
  251. this.setState({ businessScope });
  252. },
  253. handleCloseCooperation(removedTag) {
  254. let selectCooperationProjects = this.state.selectCooperationProjects.filter(tag => { return tag.value !== removedTag.value });
  255. this.setState({ selectCooperationProjects });
  256. },
  257. showInput() {
  258. let str = this.state.businessScope.join('/')
  259. this.setState({
  260. inputVisible: true,
  261. inputValue: str
  262. });
  263. },
  264. handleInputConfirm() {
  265. let inputValue = this.state.inputValue;
  266. let arr = inputValue.split('/');
  267. let lv = true;
  268. for (let i of arr) {
  269. if (!i.replace(/\s+/g, '')) {
  270. message.warning("请填写关键词且不为空");
  271. return;
  272. }
  273. if (i.length > 16) {
  274. message.warning('单个标签字数不能超过16个字符')
  275. lv = false;
  276. return;
  277. }
  278. }
  279. if (lv) {
  280. arr = Array.from(new Set(arr));
  281. arr = arr.filter(v => v);
  282. this.setState({
  283. businessScope: arr,
  284. inputVisible: false,
  285. inputValue: '',
  286. });
  287. }
  288. },
  289. //加载(自动补全)
  290. supervisor(value) {
  291. $.ajax({
  292. method: "get",
  293. dataType: "json",
  294. crossDomain: false,
  295. url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
  296. data: {
  297. businessName: value
  298. },
  299. success: function (data) {
  300. let thedata = data.data;
  301. if (data.error.length === 0) {
  302. this.setState({
  303. cooperationProjects: thedata,
  304. });
  305. } else {
  306. message.warning(data.error[0].message);
  307. }
  308. }.bind(this),
  309. }).always(
  310. function () {
  311. }.bind(this)
  312. );
  313. },
  314. onSelect(value) {
  315. let arr = this.state.cooperationProjects.filter(v => v.id === value);
  316. let arr1 = this.state.selectCooperationProjects.filter(v => v.value === value);
  317. if (arr.length > 0) {
  318. if (arr1.length > 0) {
  319. message.warning('选项已存在');
  320. } else {
  321. this.state.selectCooperationProjects.push({
  322. label: arr[0].bname,
  323. value: arr[0].id,
  324. })
  325. this.setState({
  326. selectCooperationProjects: this.state.selectCooperationProjects
  327. })
  328. }
  329. }
  330. },
  331. // 查询客户补充完整
  332. receive(e) {
  333. this.setState({
  334. loading: true,
  335. selectedRowKeys: [],
  336. });
  337. $.ajax({
  338. method: "get",
  339. dataType: "json",
  340. crossDomain: false,
  341. url: globalConfig.context + "/api/admin/customer/checkUser",
  342. data: {
  343. id: e.id || e.uid,
  344. }
  345. }).done(function (data) {
  346. if (!data.error.length) {
  347. let obj = data.data
  348. let selectCooperationProjects = !!obj.intendedProject ? obj.intendedProject.split(',') : []
  349. if (selectCooperationProjects.length > 0) {
  350. selectCooperationProjects = selectCooperationProjects.map((item) => {
  351. return { label: item }
  352. })
  353. }
  354. let nature = [];
  355. if (!!obj.nature) {
  356. nature.push(obj.nature);
  357. }
  358. if (!!obj.enterpriseNature) {
  359. nature.push(obj.enterpriseNature);
  360. }
  361. if (!!obj.listedNature) {
  362. nature.push(obj.listedNature);
  363. }
  364. this.setState({
  365. loading: false,
  366. verification: true,
  367. verificationMyUser: e.myUser,
  368. id: obj.id,
  369. name: obj.name,
  370. orgCode: obj.orgCode,
  371. ProvinceCity: [obj.province, obj.city, obj.area],
  372. // content: e.myUser == 1 ? obj.contacts : '',
  373. position: obj.position,
  374. // telnum: e.myUser == 1 ? obj.contactMobile : '',
  375. businessScope: !!obj.businessScope ? obj.businessScope.split(',') : [],
  376. selectCooperationProjects: selectCooperationProjects,
  377. level: obj.level,
  378. nature,
  379. natureOther: obj.natureOther,
  380. });
  381. } else {
  382. message.warning(data.error[0].message);
  383. };
  384. }.bind(this));
  385. },
  386. /*单个领取(旧)*/
  387. receives(e) {
  388. this.setState({
  389. loading: true,
  390. selectedRowKeys: [],
  391. });
  392. $.ajax({
  393. method: "get",
  394. dataType: "json",
  395. crossDomain: false,
  396. url: globalConfig.context + "/api/admin/customer/receiveCustomer",
  397. data: {
  398. uid: e.id,
  399. }
  400. }).done(function (data) {
  401. if (!data.error.length) {
  402. message.success(e.signBills == 1 ? '领取成功!客户为签单客户,请在【签单单位客户】列表中查询' : '领取成功!客户为私有客户,请在【私有单位客户】列表中查询');
  403. this.setState({
  404. loading: false,
  405. });
  406. } else {
  407. message.warning(data.error[0].message);
  408. };
  409. this.loadData(this.state.ispage);
  410. }.bind(this));
  411. },
  412. rTips(e) {
  413. let _this = this;
  414. Modal.confirm({
  415. title: "温馨提示",
  416. content: (
  417. <span style={{ color: "red" }}>
  418. <p>名称中含“协会”“商会”等名称为渠道信息!</p>
  419. <p>您是否确定将客户信息,领取为“私有渠道”信息,领取后,该信息即成为渠道信息不可再修改!!!</p>
  420. <p>领取成功后,您可以通过:渠道管理-渠道列表-私有渠道,查询到此条信息</p>
  421. </span>
  422. ),
  423. onOk() {
  424. _this.receiveNew(e)
  425. },
  426. onCancel() { },
  427. });
  428. },
  429. /*领取为私有渠道信息*/
  430. receiveNew(e) {
  431. this.setState({
  432. loading: true,
  433. selectedRowKeys: [],
  434. });
  435. $.ajax({
  436. method: "post",
  437. dataType: "json",
  438. crossDomain: false,
  439. url: globalConfig.context + "/api/admin/customer/receiveAsChannel",
  440. data: {
  441. uid: e.id,
  442. }
  443. }).done(function (data) {
  444. if (!data.error.length) {
  445. message.success('领取成功!');
  446. this.setState({
  447. loading: false,
  448. })
  449. } else {
  450. message.warning(data.error[0].message);
  451. };
  452. this.loadData(this.state.ispage);
  453. }.bind(this));
  454. },
  455. closeDesc(e) {
  456. this.state.visitModul = e;
  457. },
  458. search() {
  459. this.loadData();
  460. },
  461. reset() {
  462. this.state.nameSearch = '';
  463. this.state.provinceSearch = undefined;
  464. this.state.addressSearch = [];
  465. this.state.sort = 0
  466. this.loadData()
  467. },
  468. componentWillReceiveProps(nextProps) {
  469. if (nextProps.ApiUrl != this.props.ApiUrl) {
  470. this.state.nameSearch = '';
  471. this.state.provinceSearch = undefined;
  472. this.state.addressSearch = [];
  473. this.loadData(null, nextProps.ApiUrl);
  474. };
  475. },
  476. componentWillMount() {
  477. //城市
  478. let Province = [];
  479. provinceList.map(function (item) {
  480. var id = String(item.id)
  481. Province.push(
  482. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  483. )
  484. });
  485. this.state.Provinces = Province;
  486. this.loadData();
  487. },
  488. changeList(arr) {
  489. const newArr = [];
  490. this.state.columns.forEach(item => {
  491. arr.forEach(val => {
  492. if (val === item.title) {
  493. newArr.push(item);
  494. }
  495. });
  496. });
  497. this.setState({
  498. changeList: newArr
  499. });
  500. },
  501. // 补充客户并领取
  502. handleSubmit(e) {
  503. e.preventDefault();
  504. this.props.form.validateFields((err, values) => {
  505. let re = new RegExp("^[\u4e00-\u9fa5]");
  506. // if (!re.test(values.name)) {
  507. // message.warning('公司名称必须以汉字开头!')
  508. // return
  509. // }
  510. // if (!re.test(values.name.charAt(values.name.length - 1))) {
  511. // message.warning('公司名称必须以汉字结尾!')
  512. // return
  513. // }
  514. if (values.name.length > 64) {
  515. message.warning('公司名称字数不超过64个!')
  516. return false;
  517. };
  518. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  519. if (regu.test(values.name)) {
  520. message.warning('公司名称不能存在特殊符号或空格!')
  521. return false;
  522. }
  523. if (!/^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(values.orgCode)) {
  524. message.warning('请输入正确的统一社会信用代码!')
  525. return
  526. }
  527. if (!!values.content && !/.*[\u4e00-\u9fa5]+.*$/.test(values.content)) {
  528. message.error("请填写正确的联系人,且至少包含一个汉字");
  529. return false;
  530. }
  531. if (!!values.content && /.*[\u4e00-\u9fa5]+.*$/.test(values.position)) {
  532. message.error("请填写正确的职位,且至少包含一个汉字");
  533. return false;
  534. }
  535. if (!values.ProvinceCity[1]) {
  536. message.warning('请选择地区');
  537. return false;
  538. };
  539. if (!!values.content && values.content.length > 32) {
  540. message.warning('联系人字数不超过32个')
  541. return false;
  542. };
  543. if (!!values.telnum && values.telnum.length > 13) {
  544. message.warning('电话号码字数不超过13个')
  545. return false;
  546. };
  547. if (this.state.businessScope.length === 0) {
  548. message.warning('请选择主营产品')
  549. return false;
  550. }
  551. if (this.state.selectCooperationProjects.length === 0) {
  552. message.warning('请选择意向合作项目')
  553. return false;
  554. }
  555. if (!this.state.level && this.state.level != 0) {
  556. message.warning('请选择客户类型')
  557. return false;
  558. }
  559. if (!this.state.nature && this.state.nature != 0) {
  560. message.warning('请选择客户性质')
  561. return false;
  562. }
  563. if (this.state.nature == 0 && !this.state.natureOther) {
  564. message.warning('其他说明不能为空')
  565. return false;
  566. }
  567. let arr = [];
  568. for (let i of this.state.selectCooperationProjects) {
  569. arr.push(i.label)
  570. }
  571. if (!err) {
  572. this.setState({
  573. loading: true
  574. });
  575. let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
  576. let listedNature = undefined; // 上市 0=否,1=是
  577. if (this.state.nature.length >= 2) {
  578. enterpriseNature = this.state.nature[1];
  579. }
  580. if (this.state.nature.length >= 3) {
  581. listedNature = this.state.nature[2];
  582. }
  583. $.ajax({
  584. method: "POST",
  585. dataType: "json",
  586. crossDomain: false,
  587. url: globalConfig.context + '/api/admin/customer/updateAndReceiveCustomer',
  588. data: {
  589. id: this.state.id,
  590. orgCode: values.orgCode,
  591. contacts: values.content,
  592. contactMobile: values.telnum,
  593. societyTag: '0', //社会属性默认为 社会企业
  594. //source:values.customerSource,
  595. province: (values.ProvinceCity)[0],//省
  596. city: (values.ProvinceCity)[1],//市
  597. area: (values.ProvinceCity)[2],//区
  598. type: '1',
  599. intendedProject: arr.join(','),
  600. businessScope: this.state.businessScope.join(','),
  601. position: values.position,
  602. level: this.state.level,
  603. nature: this.state.nature[0],
  604. natureOther: this.state.natureOther,
  605. enterpriseNature,
  606. listedNature,
  607. }
  608. }).done(function (data) {
  609. this.setState({
  610. loading: false
  611. });
  612. if (!data.error.length) {
  613. message.success('领取成功!');
  614. this.loadData(this.state.ispage);
  615. this.handleModalClose();
  616. } else {
  617. message.warning(data.error[0].message);
  618. }
  619. }.bind(this));
  620. }
  621. });
  622. },
  623. handleModalClose() {
  624. this.setState({
  625. verification: false,
  626. id: undefined,
  627. name: undefined,
  628. orgCode: undefined,
  629. ProvinceCity: [],
  630. content: undefined,
  631. position: undefined,
  632. telnum: undefined,
  633. businessScope: [],
  634. selectCooperationProjects: [],
  635. level: undefined,
  636. nature: undefined,
  637. natureOther: undefined,
  638. })
  639. this.props.form.resetFields();
  640. },
  641. render() {
  642. const intentionState = this.props.intentionState;
  643. const { getFieldDecorator } = this.props.form;
  644. const formItemLayout = {
  645. labelCol: { span: 6 },
  646. wrapperCol: { span: 14 },
  647. };
  648. const FormItem = Form.Item;
  649. const { TabPane } = Tabs
  650. const rowSelection = {
  651. selectedRowKeys: this.state.selectedRowKeys,
  652. onChange: (selectedRowKeys, selectedRows) => {
  653. this.setState({
  654. selectedRows: selectedRows,
  655. selectedRowKeys: selectedRowKeys
  656. });
  657. },
  658. onSelect: (recordt, selected, selectedData) => {
  659. this.setState({
  660. selectedData: selectedData,
  661. recordt: recordt.id
  662. })
  663. },
  664. };
  665. return (
  666. <div className="user-content">
  667. <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
  668. <div className="content-title" style={{ marginBottom: 10 }}>
  669. <span style={{ fontWeight: 900, fontSize: 16 }}>{!intentionState ? "单位公共客户" : "个人公共客户"}</span>
  670. </div>
  671. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  672. <TabPane tab="搜索" key="1">
  673. <div className="user-search">
  674. <Input
  675. placeholder="客户名称"
  676. value={this.state.nameSearch}
  677. style={{ width: 150 }}
  678. onChange={(e) => {
  679. this.setState({ nameSearch: e.target.value });
  680. }}
  681. />
  682. <Select
  683. placeholder="省"
  684. style={{ width: 80 }}
  685. value={this.state.provinceSearch}
  686. onChange={(e) => {
  687. this.setState({ provinceSearch: e });
  688. }}
  689. >
  690. {this.state.Provinces}
  691. </Select>
  692. <span style={{ marginRight: "10px" }}>
  693. <Cascader
  694. options={citySelect()}
  695. value={this.state.addressSearch}
  696. placeholder="选择城市"
  697. onChange={(e, pre) => {
  698. this.setState({ addressSearch: e });
  699. }}
  700. />
  701. </span>
  702. <span>排序:</span>
  703. <Select style={{ width: 120 }} value={this.state.sort} onChange={e => { this.setState({ sort: e }) }} placeholder="选择排序">
  704. <Option value={0}>默认</Option>
  705. <Option value={1}>降序</Option>
  706. <Option value={2}>升序</Option>
  707. </Select>
  708. <Button type="primary" onClick={this.search}>
  709. 搜索
  710. </Button>
  711. <Button onClick={this.reset}>重置</Button>
  712. </div>
  713. </TabPane>
  714. <TabPane tab="更改表格显示数据" key="2">
  715. <div style={{ marginLeft: 10 }}>
  716. <ChooseList
  717. columns={this.state.columns}
  718. changeFn={this.changeList}
  719. changeList={this.state.changeList}
  720. top={55}
  721. margin={11}
  722. />
  723. </div>
  724. </TabPane>
  725. </Tabs>
  726. <div className="patent-table">
  727. <Spin spinning={this.state.loading}>
  728. <Table
  729. size="middle"
  730. columns={
  731. this.state.changeList
  732. ? this.state.changeList
  733. : this.state.columns
  734. }
  735. dataSource={this.state.dataSource}
  736. // rowSelection={rowSelection}
  737. pagination={this.state.pagination}
  738. />
  739. </Spin>
  740. </div>
  741. <Modal maskClosable={false}
  742. visible={this.state.verification}
  743. onCancel={this.handleModalClose}
  744. width='600px'
  745. title='客户信息'
  746. footer={null}
  747. className="admin-desc-content">
  748. <Spin spinning={this.state.loading}>
  749. <div>
  750. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
  751. <Spin spinning={this.state.loading}>
  752. <div>
  753. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>注意:请录入真实有效的客户信息</Col>
  754. <div className="clearfix">
  755. <FormItem className="mid-item"
  756. {...formItemLayout}
  757. label="公司名称" >
  758. {getFieldDecorator('name', {
  759. rules: [{ required: true, message: '此项为必填项!' }],
  760. initialValue: this.state.name
  761. })(
  762. <Input placeholder="公司名称" disabled />
  763. // <span style={{ display: 'flex', alignItems: 'center', position: 'relative' }}>
  764. // <Input placeholder="公司名称" value={this.state.name} />
  765. // {this.state.verification && <Icon type="check-circle" style={{
  766. // fontSize: 16,
  767. // color: '#30e031',
  768. // position: 'absolute',
  769. // right: '80px',
  770. // }} />}
  771. // <Button onClick={this.checkUserName} type="primary" style={{ marginLeft: '10px' }}>验证</Button>
  772. // </span>
  773. )}
  774. </FormItem>
  775. </div>
  776. <div className="clearfix">
  777. <FormItem
  778. {...formItemLayout}
  779. label="统一社会信用代码"
  780. >
  781. {getFieldDecorator('orgCode', {
  782. rules: [{ required: true, message: '此项为必填项!' }],
  783. initialValue: this.state.orgCode
  784. })(
  785. <Input placeholder="统一社会信用代码" />
  786. )}
  787. </FormItem>
  788. </div>
  789. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>如,科德集团则填写91430105670766451M</Col>
  790. <div className="clearfix">
  791. <FormItem
  792. {...formItemLayout}
  793. label="省-市-区"
  794. >
  795. {getFieldDecorator('ProvinceCity', {
  796. rules: [{ required: true, message: '此项为必填项!' }],
  797. initialValue: this.state.ProvinceCity
  798. })(
  799. <Cascader options={areaSelect()} placeholder="选择城市" />
  800. )}
  801. </FormItem>
  802. </div>
  803. <div className="clearfix">
  804. <FormItem className="mid-item"
  805. {...formItemLayout}
  806. label="联系人" >
  807. {getFieldDecorator('content', {
  808. rules: [{ required: this.state.verificationMyUser != 1, message: '此项为必填项!' }],
  809. initialValue: this.state.content
  810. })(
  811. <Input placeholder="联系人姓名" />
  812. )}
  813. </FormItem>
  814. </div>
  815. <div className="clearfix">
  816. <FormItem className="mid-item"
  817. {...formItemLayout}
  818. label="职位" >
  819. {getFieldDecorator('position', {
  820. rules: [{ required: this.state.verificationMyUser != 1, message: '此项为必填项!' }],
  821. initialValue: this.state.position
  822. })(
  823. <Input placeholder="联系人职位" />
  824. )}
  825. </FormItem>
  826. </div>
  827. <div className="clearfix">
  828. <FormItem className="mid-item"
  829. {...formItemLayout}
  830. label="联系电话" >
  831. {getFieldDecorator('telnum', {
  832. rules: [{ required: this.state.verificationMyUser != 1, message: '此项为必填项!' }],
  833. initialValue: this.state.telnum
  834. })(
  835. <Input placeholder="请填写手机号,仅填座机号时,请后续补充手机号" />
  836. )}
  837. </FormItem>
  838. </div>
  839. <div className="clearfix">
  840. <FormItem className="mid-item"
  841. {...formItemLayout}
  842. required
  843. label="主营产品" >
  844. <div>
  845. {this.state.businessScope.map((tag, index) => {
  846. const isLongTag = tag.length > 20;
  847. const tagElem = (
  848. <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
  849. {isLongTag ? `${tag.slice(0, 20)}...` : tag}
  850. </Tag>
  851. );
  852. return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
  853. })}
  854. {
  855. !this.state.inputVisible &&
  856. <Button
  857. size="small"
  858. type="primary"
  859. onClick={this.showInput}>
  860. + 新增主营产品
  861. </Button>
  862. }
  863. </div>
  864. {this.state.inputVisible && (<div>
  865. <TextArea
  866. style={{ width: '300px', height: '100px' }}
  867. value={this.state.inputValue}
  868. onChange={(e) => {
  869. this.setState({
  870. inputValue: e.target.value
  871. })
  872. }} />
  873. <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
  874. <div>
  875. <Button
  876. size="small"
  877. type="primary"
  878. onClick={this.handleInputConfirm}>
  879. 确定
  880. </Button>
  881. <Button
  882. size="small"
  883. style={{ marginLeft: '5px' }}
  884. onClick={() => {
  885. this.setState({
  886. inputVisible: false,
  887. inputValue: ''
  888. })
  889. }}>
  890. 取消
  891. </Button>
  892. </div>
  893. </div>)}
  894. </FormItem>
  895. </div>
  896. <div className="clearfix">
  897. <FormItem
  898. className="mid-item"
  899. {...formItemLayout}
  900. required
  901. label="意向合作项目" >
  902. <div>
  903. <div style={{ paddingBottom: this.state.selectCooperationProjects.length === 0 ? 0 : '10px' }}>
  904. {this.state.selectCooperationProjects.map((tag, index) => {
  905. const isLongTag = tag.label.length > 20;
  906. const tagElem = (
  907. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  908. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  909. </Tag>
  910. );
  911. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  912. })}
  913. </div>
  914. <div>
  915. <AutoComplete
  916. style={{ width: 200 }}
  917. onSearch={this.supervisor}
  918. onSelect={this.onSelect}
  919. placeholder="请输入关键字"
  920. >
  921. {
  922. this.state.cooperationProjects.map(function (item) {
  923. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  924. })
  925. }
  926. </AutoComplete>
  927. </div>
  928. </div>
  929. </FormItem>
  930. </div>
  931. <div className="clearfix">
  932. <FormItem
  933. className="mid-item"
  934. {...formItemLayout}
  935. required
  936. label="客户类型" >
  937. <Select
  938. placeholder="请选择客户类型"
  939. value={this.state.level}
  940. onChange={(e) => {
  941. this.setState({ level: e });
  942. }}
  943. >
  944. <Option value={0}>一般客户(一年以上预签)</Option>
  945. <Option value={1}>意向客户(半年内预签)</Option>
  946. <Option value={2}>重点客户(一个月内预签)</Option>
  947. </Select>
  948. </FormItem>
  949. </div>
  950. <div className="clearfix">
  951. <FormItem
  952. className="mid-item"
  953. {...formItemLayout}
  954. required
  955. label="客户性质" >
  956. {/* <Select
  957. placeholder="请选择客户性质"
  958. value={this.state.nature}
  959. onChange={(e) => {
  960. this.setState({ nature: e });
  961. }}
  962. >
  963. <Option value={1}>政府机构</Option>
  964. <Option value={2}>科研院所</Option>
  965. <Option value={3}>高等院校</Option>
  966. <Option value={4}>国有企业</Option>
  967. <Option value={5}>民营企业</Option>
  968. <Option value={6}>社会团体</Option>
  969. <Option value={0}>其他(请注明)</Option>
  970. </Select> */}
  971. <Cascader
  972. options={this.state.natureOptions}
  973. placeholder="请选择客户性质"
  974. value={this.state.nature}
  975. onChange={e => { this.setState({ nature: e }) }}
  976. />
  977. </FormItem>
  978. </div>
  979. {
  980. this.state.nature && this.state.nature.length && this.state.nature[0] === 0 ?
  981. <div className="clearfix">
  982. <FormItem
  983. className="mid-item"
  984. {...formItemLayout}
  985. required
  986. label="其他说明" >
  987. <Input
  988. placeholder="其他说明"
  989. value={this.state.natureOther}
  990. onChange={e => {
  991. this.setState({
  992. natureOther: e.target.value
  993. })
  994. }}
  995. />
  996. </FormItem>
  997. </div> : null
  998. }
  999. </div>
  1000. <FormItem wrapperCol={{ span: 12, offset: 6 }}>
  1001. <Button type="primary" htmlType="submit" style={{}}>领取客户</Button>
  1002. </FormItem>
  1003. </Spin>
  1004. </Form >
  1005. </div>
  1006. </Spin>
  1007. </Modal>
  1008. </div>
  1009. );
  1010. }
  1011. })
  1012. export default Form.create({})(QueryCustomer);