publicCustomer.jsx 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017
  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. verificationMyUser: e.myUser,
  358. id: obj.id,
  359. name: obj.name,
  360. orgCode: obj.orgCode,
  361. ProvinceCity: [obj.province, obj.city, obj.area],
  362. // content: e.myUser == 1 ? obj.contacts : '',
  363. position: obj.position,
  364. // telnum: e.myUser == 1 ? obj.contactMobile : '',
  365. businessScope: !!obj.businessScope ? obj.businessScope.split(',') : [],
  366. selectCooperationProjects: selectCooperationProjects,
  367. level: obj.level,
  368. nature: obj.nature,
  369. natureOther: obj.natureOther,
  370. });
  371. } else {
  372. message.warning(data.error[0].message);
  373. };
  374. }.bind(this));
  375. },
  376. /*单个领取(旧)*/
  377. receives(e) {
  378. this.setState({
  379. loading: true,
  380. selectedRowKeys: [],
  381. });
  382. $.ajax({
  383. method: "get",
  384. dataType: "json",
  385. crossDomain: false,
  386. url: globalConfig.context + "/api/admin/customer/receiveCustomer",
  387. data: {
  388. uid: e.id,
  389. }
  390. }).done(function (data) {
  391. if (!data.error.length) {
  392. message.success(e.signBills == 1 ? '领取成功!客户为签单客户,请在【签单单位客户】列表中查询' : '领取成功!客户为私有客户,请在【私有单位客户】列表中查询');
  393. this.setState({
  394. loading: false,
  395. });
  396. } else {
  397. message.warning(data.error[0].message);
  398. };
  399. this.loadData(this.state.ispage);
  400. }.bind(this));
  401. },
  402. rTips(e) {
  403. let _this = this;
  404. Modal.confirm({
  405. title: "温馨提示",
  406. content: (
  407. <span style={{ color: "red" }}>
  408. <p>名称中含“协会”“商会”等名称为渠道信息!</p>
  409. <p>您是否确定将客户信息,领取为“私有渠道”信息,领取后,该信息即成为渠道信息不可再修改!!!</p>
  410. <p>领取成功后,您可以通过:渠道管理-渠道列表-私有渠道,查询到此条信息</p>
  411. </span>
  412. ),
  413. onOk() {
  414. _this.receiveNew(e)
  415. },
  416. onCancel() { },
  417. });
  418. },
  419. /*领取为私有渠道信息*/
  420. receiveNew(e) {
  421. this.setState({
  422. loading: true,
  423. selectedRowKeys: [],
  424. });
  425. $.ajax({
  426. method: "post",
  427. dataType: "json",
  428. crossDomain: false,
  429. url: globalConfig.context + "/api/admin/customer/receiveAsChannel",
  430. data: {
  431. uid: e.id,
  432. }
  433. }).done(function (data) {
  434. if (!data.error.length) {
  435. message.success('领取成功!');
  436. this.setState({
  437. loading: false,
  438. })
  439. } else {
  440. message.warning(data.error[0].message);
  441. };
  442. this.loadData(this.state.ispage);
  443. }.bind(this));
  444. },
  445. closeDesc(e) {
  446. this.state.visitModul = e;
  447. },
  448. search() {
  449. this.loadData();
  450. },
  451. reset() {
  452. this.state.nameSearch = '';
  453. this.state.provinceSearch = undefined;
  454. this.state.addressSearch = [];
  455. this.state.sort = 0
  456. this.loadData()
  457. },
  458. componentWillReceiveProps(nextProps) {
  459. if (nextProps.ApiUrl != this.props.ApiUrl) {
  460. this.state.nameSearch = '';
  461. this.state.provinceSearch = undefined;
  462. this.state.addressSearch = [];
  463. this.loadData(null, nextProps.ApiUrl);
  464. };
  465. },
  466. componentWillMount() {
  467. //城市
  468. let Province = [];
  469. provinceList.map(function (item) {
  470. var id = String(item.id)
  471. Province.push(
  472. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  473. )
  474. });
  475. this.state.Provinces = Province;
  476. this.loadData();
  477. },
  478. changeList(arr) {
  479. const newArr = [];
  480. this.state.columns.forEach(item => {
  481. arr.forEach(val => {
  482. if (val === item.title) {
  483. newArr.push(item);
  484. }
  485. });
  486. });
  487. this.setState({
  488. changeList: newArr
  489. });
  490. },
  491. // 补充客户并领取
  492. handleSubmit(e) {
  493. e.preventDefault();
  494. this.props.form.validateFields((err, values) => {
  495. let re = new RegExp("^[\u4e00-\u9fa5]");
  496. // if (!re.test(values.name)) {
  497. // message.warning('公司名称必须以汉字开头!')
  498. // return
  499. // }
  500. // if (!re.test(values.name.charAt(values.name.length - 1))) {
  501. // message.warning('公司名称必须以汉字结尾!')
  502. // return
  503. // }
  504. if (values.name.length > 64) {
  505. message.warning('公司名称字数不超过64个!')
  506. return false;
  507. };
  508. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  509. if (regu.test(values.name)) {
  510. message.warning('公司名称不能存在特殊符号或空格!')
  511. return false;
  512. }
  513. if (!/^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(values.orgCode)) {
  514. message.warning('请输入正确的统一社会信用代码!')
  515. return
  516. }
  517. if (!!values.content && !/.*[\u4e00-\u9fa5]+.*$/.test(values.content)) {
  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 && values.content.length > 32) {
  531. message.warning('联系人字数不超过32个')
  532. return false;
  533. };
  534. if (!!values.telnum && values.telnum.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: this.state.verificationMyUser != 1, 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: this.state.verificationMyUser != 1, 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);