publicCustomer.jsx 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  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. this.setState({
  355. loading: false,
  356. verification: true,
  357. id: obj.id,
  358. name: obj.name,
  359. orgCode: obj.orgCode,
  360. ProvinceCity: [obj.province, obj.city, obj.area],
  361. content: e.myUser == 1 ? obj.contacts : '',
  362. position: obj.position,
  363. telnum: e.myUser == 1 ? obj.contactMobile : '',
  364. businessScope: !!obj.businessScope ? obj.businessScope.split(',') : [],
  365. selectCooperationProjects: selectCooperationProjects,
  366. level: obj.level,
  367. nature: obj.nature,
  368. natureOther: obj.natureOther,
  369. });
  370. } else {
  371. message.warning(data.error[0].message);
  372. };
  373. }.bind(this));
  374. },
  375. /*单个领取(旧)*/
  376. receives(e) {
  377. this.setState({
  378. loading: true,
  379. selectedRowKeys: [],
  380. });
  381. $.ajax({
  382. method: "get",
  383. dataType: "json",
  384. crossDomain: false,
  385. url: globalConfig.context + "/api/admin/customer/receiveCustomer",
  386. data: {
  387. uid: e.id,
  388. }
  389. }).done(function (data) {
  390. if (!data.error.length) {
  391. message.success(e.signBills == 1 ? '领取成功!客户为签单客户,请在【签单单位客户】列表中查询' : '领取成功!客户为私有客户,请在【私有单位客户】列表中查询');
  392. this.setState({
  393. loading: false,
  394. });
  395. } else {
  396. message.warning(data.error[0].message);
  397. };
  398. this.loadData(this.state.ispage);
  399. }.bind(this));
  400. },
  401. rTips(e) {
  402. let _this = this;
  403. Modal.confirm({
  404. title: "温馨提示",
  405. content: (
  406. <span style={{ color: "red" }}>
  407. <p>名称中含“协会”“商会”等名称为渠道信息!</p>
  408. <p>您是否确定将客户信息,领取为“私有渠道”信息,领取后,该信息即成为渠道信息不可再修改!!!</p>
  409. <p>领取成功后,您可以通过:渠道管理-渠道列表-私有渠道,查询到此条信息</p>
  410. </span>
  411. ),
  412. onOk() {
  413. _this.receiveNew(e)
  414. },
  415. onCancel() { },
  416. });
  417. },
  418. /*领取为私有渠道信息*/
  419. receiveNew(e) {
  420. this.setState({
  421. loading: true,
  422. selectedRowKeys: [],
  423. });
  424. $.ajax({
  425. method: "post",
  426. dataType: "json",
  427. crossDomain: false,
  428. url: globalConfig.context + "/api/admin/customer/receiveAsChannel",
  429. data: {
  430. uid: e.id,
  431. }
  432. }).done(function (data) {
  433. if (!data.error.length) {
  434. message.success('领取成功!');
  435. this.setState({
  436. loading: false,
  437. })
  438. } else {
  439. message.warning(data.error[0].message);
  440. };
  441. this.loadData(this.state.ispage);
  442. }.bind(this));
  443. },
  444. closeDesc(e) {
  445. this.state.visitModul = e;
  446. },
  447. search() {
  448. this.loadData();
  449. },
  450. reset() {
  451. this.state.nameSearch = '';
  452. this.state.provinceSearch = undefined;
  453. this.state.addressSearch = [];
  454. this.state.sort = 0
  455. this.loadData()
  456. },
  457. componentWillReceiveProps(nextProps) {
  458. if (nextProps.ApiUrl != this.props.ApiUrl) {
  459. this.state.nameSearch = '';
  460. this.state.provinceSearch = undefined;
  461. this.state.addressSearch = [];
  462. this.loadData(null, nextProps.ApiUrl);
  463. };
  464. },
  465. componentWillMount() {
  466. //城市
  467. let Province = [];
  468. provinceList.map(function (item) {
  469. var id = String(item.id)
  470. Province.push(
  471. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  472. )
  473. });
  474. this.state.Provinces = Province;
  475. this.loadData();
  476. },
  477. changeList(arr) {
  478. const newArr = [];
  479. this.state.columns.forEach(item => {
  480. arr.forEach(val => {
  481. if (val === item.title) {
  482. newArr.push(item);
  483. }
  484. });
  485. });
  486. this.setState({
  487. changeList: newArr
  488. });
  489. },
  490. // 补充客户并领取
  491. handleSubmit(e) {
  492. e.preventDefault();
  493. this.props.form.validateFields((err, values) => {
  494. let re = new RegExp("^[\u4e00-\u9fa5]");
  495. // if (!re.test(values.name)) {
  496. // message.warning('公司名称必须以汉字开头!')
  497. // return
  498. // }
  499. // if (!re.test(values.name.charAt(values.name.length - 1))) {
  500. // message.warning('公司名称必须以汉字结尾!')
  501. // return
  502. // }
  503. if (values.name.length > 64) {
  504. message.warning('公司名称字数不超过64个!')
  505. return false;
  506. };
  507. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  508. if (regu.test(values.name)) {
  509. message.warning('公司名称不能存在特殊符号或空格!')
  510. return false;
  511. }
  512. if (!/^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(values.orgCode)) {
  513. message.warning('请输入正确的统一社会信用代码!')
  514. return
  515. }
  516. if (/.*[\u4e00-\u9fa5]+.*$/.test(values.content)) {
  517. } else {
  518. message.error("请填写正确的联系人,且至少包含一个汉字");
  519. return false;
  520. };
  521. if (/.*[\u4e00-\u9fa5]+.*$/.test(values.position)) {
  522. } else {
  523. message.error("请填写正确的职位,且至少包含一个汉字");
  524. return false;
  525. };
  526. if (!values.ProvinceCity[1]) {
  527. message.warning('请选择地区');
  528. return false;
  529. };
  530. if (values.content.length > 32) {
  531. message.warning('联系人字数不超过32个')
  532. return false;
  533. };
  534. if (values.length > 13) {
  535. message.warning('电话号码字数不超过13个')
  536. return false;
  537. };
  538. if (this.state.businessScope.length === 0) {
  539. message.warning('请选择主营产品')
  540. return false;
  541. }
  542. if (this.state.selectCooperationProjects.length === 0) {
  543. message.warning('请选择意向合作项目')
  544. return false;
  545. }
  546. if (!this.state.level && this.state.level != 0) {
  547. message.warning('请选择客户类型')
  548. return false;
  549. }
  550. if (!this.state.nature && this.state.nature != 0) {
  551. message.warning('请选择客户性质')
  552. return false;
  553. }
  554. if (this.state.nature == 0 && !this.state.natureOther) {
  555. message.warning('其他说明不能为空')
  556. return false;
  557. }
  558. let arr = [];
  559. for (let i of this.state.selectCooperationProjects) {
  560. arr.push(i.label)
  561. }
  562. if (!err) {
  563. this.setState({
  564. loading: true
  565. });
  566. let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
  567. let listedNature = undefined; // 上市 0=否,1=是
  568. if (this.state.nature.length >= 2) {
  569. enterpriseNature = this.state.nature[1];
  570. }
  571. if (this.state.nature.length >= 3) {
  572. listedNature = this.state.nature[2];
  573. }
  574. $.ajax({
  575. method: "POST",
  576. dataType: "json",
  577. crossDomain: false,
  578. url: globalConfig.context + '/api/admin/customer/updateAndReceiveCustomer',
  579. data: {
  580. id: this.state.id,
  581. orgCode: values.orgCode,
  582. contacts: values.content,
  583. contactMobile: values.telnum,
  584. societyTag: '0', //社会属性默认为 社会企业
  585. //source:values.customerSource,
  586. province: (values.ProvinceCity)[0],//省
  587. city: (values.ProvinceCity)[1],//市
  588. area: (values.ProvinceCity)[2],//区
  589. type: '1',
  590. intendedProject: arr.join(','),
  591. businessScope: this.state.businessScope.join(','),
  592. position: values.position,
  593. level: this.state.level,
  594. nature: this.state.nature[0],
  595. natureOther: this.state.natureOther,
  596. enterpriseNature,
  597. listedNature,
  598. }
  599. }).done(function (data) {
  600. this.setState({
  601. loading: false
  602. });
  603. if (!data.error.length) {
  604. message.success('领取成功!');
  605. this.loadData(this.state.ispage);
  606. this.handleModalClose();
  607. } else {
  608. message.warning(data.error[0].message);
  609. }
  610. }.bind(this));
  611. }
  612. });
  613. },
  614. handleModalClose() {
  615. this.setState({
  616. verification: false,
  617. id: undefined,
  618. name: undefined,
  619. orgCode: undefined,
  620. ProvinceCity: [],
  621. content: undefined,
  622. position: undefined,
  623. telnum: undefined,
  624. businessScope: [],
  625. selectCooperationProjects: [],
  626. level: undefined,
  627. nature: undefined,
  628. natureOther: undefined,
  629. })
  630. this.props.form.resetFields();
  631. },
  632. render() {
  633. const intentionState = this.props.intentionState;
  634. const { getFieldDecorator } = this.props.form;
  635. const formItemLayout = {
  636. labelCol: { span: 6 },
  637. wrapperCol: { span: 14 },
  638. };
  639. const FormItem = Form.Item;
  640. const { TabPane } = Tabs
  641. const rowSelection = {
  642. selectedRowKeys: this.state.selectedRowKeys,
  643. onChange: (selectedRowKeys, selectedRows) => {
  644. this.setState({
  645. selectedRows: selectedRows,
  646. selectedRowKeys: selectedRowKeys
  647. });
  648. },
  649. onSelect: (recordt, selected, selectedData) => {
  650. this.setState({
  651. selectedData: selectedData,
  652. recordt: recordt.id
  653. })
  654. },
  655. };
  656. return (
  657. <div className="user-content">
  658. <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
  659. <div className="content-title" style={{ marginBottom: 10 }}>
  660. <span style={{ fontWeight: 900, fontSize: 16 }}>{!intentionState ? "单位公共客户" : "个人公共客户"}</span>
  661. </div>
  662. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  663. <TabPane tab="搜索" key="1">
  664. <div className="user-search">
  665. <Input
  666. placeholder="客户名称"
  667. value={this.state.nameSearch}
  668. style={{ width: 150 }}
  669. onChange={(e) => {
  670. this.setState({ nameSearch: e.target.value });
  671. }}
  672. />
  673. <Select
  674. placeholder="省"
  675. style={{ width: 80 }}
  676. value={this.state.provinceSearch}
  677. onChange={(e) => {
  678. this.setState({ provinceSearch: e });
  679. }}
  680. >
  681. {this.state.Provinces}
  682. </Select>
  683. <span style={{ marginRight: "10px" }}>
  684. <Cascader
  685. options={citySelect()}
  686. value={this.state.addressSearch}
  687. placeholder="选择城市"
  688. onChange={(e, pre) => {
  689. this.setState({ addressSearch: e });
  690. }}
  691. />
  692. </span>
  693. <span>排序:</span>
  694. <Select style={{ width: 120 }} value={this.state.sort} onChange={e => { this.setState({ sort: e }) }} placeholder="选择排序">
  695. <Option value={0}>默认</Option>
  696. <Option value={1}>降序</Option>
  697. <Option value={2}>升序</Option>
  698. </Select>
  699. <Button type="primary" onClick={this.search}>
  700. 搜索
  701. </Button>
  702. <Button onClick={this.reset}>重置</Button>
  703. </div>
  704. </TabPane>
  705. <TabPane tab="更改表格显示数据" key="2">
  706. <div style={{ marginLeft: 10 }}>
  707. <ChooseList
  708. columns={this.state.columns}
  709. changeFn={this.changeList}
  710. changeList={this.state.changeList}
  711. top={55}
  712. margin={11}
  713. />
  714. </div>
  715. </TabPane>
  716. </Tabs>
  717. <div className="patent-table">
  718. <Spin spinning={this.state.loading}>
  719. <Table
  720. size="middle"
  721. columns={
  722. this.state.changeList
  723. ? this.state.changeList
  724. : this.state.columns
  725. }
  726. dataSource={this.state.dataSource}
  727. // rowSelection={rowSelection}
  728. pagination={this.state.pagination}
  729. />
  730. </Spin>
  731. </div>
  732. <Modal maskClosable={false}
  733. visible={this.state.verification}
  734. onCancel={this.handleModalClose}
  735. width='600px'
  736. title='客户信息'
  737. footer={null}
  738. className="admin-desc-content">
  739. <Spin spinning={this.state.loading}>
  740. <div>
  741. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
  742. <Spin spinning={this.state.loading}>
  743. <div>
  744. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>注意:请录入真实有效的客户信息</Col>
  745. <div className="clearfix">
  746. <FormItem className="mid-item"
  747. {...formItemLayout}
  748. label="公司名称" >
  749. {getFieldDecorator('name', {
  750. rules: [{ required: true, message: '此项为必填项!' }],
  751. initialValue: this.state.name
  752. })(
  753. <Input placeholder="公司名称" disabled />
  754. // <span style={{ display: 'flex', alignItems: 'center', position: 'relative' }}>
  755. // <Input placeholder="公司名称" value={this.state.name} />
  756. // {this.state.verification && <Icon type="check-circle" style={{
  757. // fontSize: 16,
  758. // color: '#30e031',
  759. // position: 'absolute',
  760. // right: '80px',
  761. // }} />}
  762. // <Button onClick={this.checkUserName} type="primary" style={{ marginLeft: '10px' }}>验证</Button>
  763. // </span>
  764. )}
  765. </FormItem>
  766. </div>
  767. <div className="clearfix">
  768. <FormItem
  769. {...formItemLayout}
  770. label="统一社会信用代码"
  771. >
  772. {getFieldDecorator('orgCode', {
  773. rules: [{ required: true, message: '此项为必填项!' }],
  774. initialValue: this.state.orgCode
  775. })(
  776. <Input placeholder="统一社会信用代码" />
  777. )}
  778. </FormItem>
  779. </div>
  780. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>如,科德集团则填写91430105670766451M</Col>
  781. <div className="clearfix">
  782. <FormItem
  783. {...formItemLayout}
  784. label="省-市-区"
  785. >
  786. {getFieldDecorator('ProvinceCity', {
  787. rules: [{ required: true, message: '此项为必填项!' }],
  788. initialValue: this.state.ProvinceCity
  789. })(
  790. <Cascader options={areaSelect()} placeholder="选择城市" />
  791. )}
  792. </FormItem>
  793. </div>
  794. <div className="clearfix">
  795. <FormItem className="mid-item"
  796. {...formItemLayout}
  797. label="联系人" >
  798. {getFieldDecorator('content', {
  799. rules: [{ required: true, message: '此项为必填项!' }],
  800. initialValue: this.state.content
  801. })(
  802. <Input placeholder="联系人姓名" />
  803. )}
  804. </FormItem>
  805. </div>
  806. <div className="clearfix">
  807. <FormItem className="mid-item"
  808. {...formItemLayout}
  809. label="职位" >
  810. {getFieldDecorator('position', {
  811. rules: [{ required: true, message: '此项为必填项!' }],
  812. initialValue: this.state.position
  813. })(
  814. <Input placeholder="联系人职位" />
  815. )}
  816. </FormItem>
  817. </div>
  818. <div className="clearfix">
  819. <FormItem className="mid-item"
  820. {...formItemLayout}
  821. label="联系电话" >
  822. {getFieldDecorator('telnum', {
  823. rules: [{ required: true, message: '此项为必填项!' }],
  824. initialValue: this.state.telnum
  825. })(
  826. <Input placeholder="请填写手机号,仅填座机号时,请后续补充手机号" />
  827. )}
  828. </FormItem>
  829. </div>
  830. <div className="clearfix">
  831. <FormItem className="mid-item"
  832. {...formItemLayout}
  833. required
  834. label="主营产品" >
  835. <div>
  836. {this.state.businessScope.map((tag, index) => {
  837. const isLongTag = tag.length > 20;
  838. const tagElem = (
  839. <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
  840. {isLongTag ? `${tag.slice(0, 20)}...` : tag}
  841. </Tag>
  842. );
  843. return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
  844. })}
  845. {
  846. !this.state.inputVisible &&
  847. <Button
  848. size="small"
  849. type="primary"
  850. onClick={this.showInput}>
  851. + 新增主营产品
  852. </Button>
  853. }
  854. </div>
  855. {this.state.inputVisible && (<div>
  856. <TextArea
  857. style={{ width: '300px', height: '100px' }}
  858. value={this.state.inputValue}
  859. onChange={(e) => {
  860. this.setState({
  861. inputValue: e.target.value
  862. })
  863. }} />
  864. <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
  865. <div>
  866. <Button
  867. size="small"
  868. type="primary"
  869. onClick={this.handleInputConfirm}>
  870. 确定
  871. </Button>
  872. <Button
  873. size="small"
  874. style={{ marginLeft: '5px' }}
  875. onClick={() => {
  876. this.setState({
  877. inputVisible: false,
  878. inputValue: ''
  879. })
  880. }}>
  881. 取消
  882. </Button>
  883. </div>
  884. </div>)}
  885. </FormItem>
  886. </div>
  887. <div className="clearfix">
  888. <FormItem
  889. className="mid-item"
  890. {...formItemLayout}
  891. required
  892. label="意向合作项目" >
  893. <div>
  894. <div style={{ paddingBottom: this.state.selectCooperationProjects.length === 0 ? 0 : '10px' }}>
  895. {this.state.selectCooperationProjects.map((tag, index) => {
  896. const isLongTag = tag.label.length > 20;
  897. const tagElem = (
  898. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  899. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  900. </Tag>
  901. );
  902. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  903. })}
  904. </div>
  905. <div>
  906. <AutoComplete
  907. style={{ width: 200 }}
  908. onSearch={this.supervisor}
  909. onSelect={this.onSelect}
  910. placeholder="请输入关键字"
  911. >
  912. {
  913. this.state.cooperationProjects.map(function (item) {
  914. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  915. })
  916. }
  917. </AutoComplete>
  918. </div>
  919. </div>
  920. </FormItem>
  921. </div>
  922. <div className="clearfix">
  923. <FormItem
  924. className="mid-item"
  925. {...formItemLayout}
  926. required
  927. label="客户类型" >
  928. <Select
  929. placeholder="请选择客户类型"
  930. value={this.state.level}
  931. onChange={(e) => {
  932. this.setState({ level: e });
  933. }}
  934. >
  935. <Option value={0}>一般客户(一年以上预签)</Option>
  936. <Option value={1}>意向客户(半年内预签)</Option>
  937. <Option value={2}>重点客户(一个月内预签)</Option>
  938. </Select>
  939. </FormItem>
  940. </div>
  941. <div className="clearfix">
  942. <FormItem
  943. className="mid-item"
  944. {...formItemLayout}
  945. required
  946. label="客户性质" >
  947. {/* <Select
  948. placeholder="请选择客户性质"
  949. value={this.state.nature}
  950. onChange={(e) => {
  951. this.setState({ nature: e });
  952. }}
  953. >
  954. <Option value={1}>政府机构</Option>
  955. <Option value={2}>科研院所</Option>
  956. <Option value={3}>高等院校</Option>
  957. <Option value={4}>国有企业</Option>
  958. <Option value={5}>民营企业</Option>
  959. <Option value={6}>社会团体</Option>
  960. <Option value={0}>其他(请注明)</Option>
  961. </Select> */}
  962. <Cascader
  963. options={this.state.natureOptions}
  964. placeholder="请选择客户性质"
  965. value={this.state.nature}
  966. onChange={e => { this.setState({ nature: e }) }}
  967. />
  968. </FormItem>
  969. </div>
  970. {
  971. this.state.nature == 0 &&
  972. <div className="clearfix">
  973. <FormItem
  974. className="mid-item"
  975. {...formItemLayout}
  976. required
  977. label="其他说明" >
  978. <Input
  979. placeholder="其他说明"
  980. value={this.state.natureOther}
  981. onChange={e => {
  982. this.setState({
  983. natureOther: e.target.value
  984. })
  985. }}
  986. />
  987. </FormItem>
  988. </div>
  989. }
  990. </div>
  991. <FormItem wrapperCol={{ span: 12, offset: 6 }}>
  992. <Button type="primary" htmlType="submit" style={{}}>领取客户</Button>
  993. </FormItem>
  994. </Spin>
  995. </Form >
  996. </div>
  997. </Spin>
  998. </Modal>
  999. </div>
  1000. );
  1001. }
  1002. })
  1003. export default Form.create({})(QueryCustomer);