queryCutomer.jsx 37 KB

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