addIntention.jsx 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. import React from 'react';
  2. import { Modal, message, Spin, Input, Select, Button, Form, Col, Cascader, Tag, Tooltip, AutoComplete, Icon } from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import { areaSelect } from '@/NewDicProvinceList';
  5. import { socialAttribute, customerSource } from '@/dataDic.js';
  6. import TextArea from "antd/es/input/TextArea";
  7. const confirm = Modal.confirm;
  8. const AchievementDetailForm = Form.create()(React.createClass({
  9. getInitialState() {
  10. return {
  11. loading: false,
  12. data: {},
  13. detailApi: '',
  14. businessScope: [],
  15. inputVisible: false,
  16. cooperationProjects: [],
  17. selectCooperationProjects: []
  18. };
  19. },
  20. handleSubmit(e) {
  21. // if (/.*[\u4e00-\u9fa5]+.*$/.test(this.state.content)) {
  22. // } else {
  23. // message.error("请填写正确的姓名,且至少包含一个汉字");
  24. // return;
  25. // }
  26. e.preventDefault();
  27. this.props.form.validateFields((err, values) => {
  28. let re = new RegExp("^[\u4e00-\u9fa5]");
  29. if (!re.test(values.name)) {
  30. message.warning('公司名称必须以汉字开头!')
  31. return
  32. }
  33. if (!re.test(values.name.charAt(values.name.length - 1))) {
  34. message.warning('公司名称必须以汉字结尾!')
  35. return
  36. }
  37. if (values.name.length > 64) {
  38. message.warning('公司名称字数不超过64个!')
  39. return false;
  40. };
  41. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  42. if (regu.test(values.name)) {
  43. message.warning('公司名称不能存在特殊符号或空格!')
  44. return false;
  45. }
  46. if (/.*[\u4e00-\u9fa5]+.*$/.test(values.content)) {
  47. } else {
  48. message.error("请填写正确的联系人,且至少包含一个汉字");
  49. return false;
  50. };
  51. if (/.*[\u4e00-\u9fa5]+.*$/.test(values.position)) {
  52. } else {
  53. message.error("请填写正确的职位,且至少包含一个汉字");
  54. return false;
  55. };
  56. if (!values.ProvinceCity[1]) {
  57. message.warning('请选择地区');
  58. return false;
  59. };
  60. if (values.content.length > 32) {
  61. message.warning('联系人字数不超过32个')
  62. return false;
  63. };
  64. if (values.length > 13) {
  65. message.warning('电话号码字数不超过13个')
  66. return false;
  67. };
  68. if (this.state.businessScope.length === 0) {
  69. message.warning('请选择主营产品')
  70. return false;
  71. }
  72. if (this.state.selectCooperationProjects.length === 0) {
  73. message.warning('请选择意向合作项目')
  74. return false;
  75. }
  76. let arr = [];
  77. for (let i of this.state.selectCooperationProjects) {
  78. arr.push(i.label)
  79. }
  80. if (!err) {
  81. this.setState({
  82. loading: true
  83. });
  84. $.ajax({
  85. method: "POST",
  86. dataType: "json",
  87. crossDomain: false,
  88. url: globalConfig.context + '/api/admin/customer/addCustomer',
  89. data: {
  90. name: values.name,
  91. contacts: values.content,
  92. contactMobile: values.telnum,
  93. societyTag: '0', //社会属性默认为 社会企业
  94. //source:values.customerSource,
  95. province: (values.ProvinceCity)[0],//省
  96. city: (values.ProvinceCity)[1],//市
  97. area: (values.ProvinceCity)[2],//区
  98. type: '1',
  99. intendedProject: arr.join(','),
  100. businessScope: this.state.businessScope.join(','),
  101. position: values.position,
  102. }
  103. }).done(function (data) {
  104. this.setState({
  105. loading: false
  106. });
  107. if (!data.error.length) {
  108. message.success('保存成功!');
  109. this.setState({
  110. verification: false
  111. })
  112. this.props.handleOk();
  113. } else {
  114. message.warning(data.error[0].message);
  115. }
  116. }.bind(this));
  117. }
  118. });
  119. },
  120. componentWillMount() {
  121. this.state.name = '';
  122. this.state.content = '';
  123. this.state.position = '';
  124. this.state.telnum = '';
  125. // this.state.societyTagt='0';
  126. this.state.customerSource = '0';
  127. this.state.inputValue = '';
  128. this.state.businessScope = [];
  129. this.state.inputVisible = false;
  130. this.state.cooperationProjects = [];
  131. this.state.selectCooperationProjects = [];
  132. },
  133. componentWillReceiveProps(nextProps) {
  134. if (!this.props.visible && nextProps.visible) {
  135. this.state.name = '';
  136. this.state.content = '';
  137. this.state.position = '';
  138. this.state.telnum = '';
  139. this.state.inputValue = '';
  140. this.state.businessScope = [];
  141. this.state.inputVisible = false;
  142. this.state.cooperationProjects = [];
  143. this.state.selectCooperationProjects = [];
  144. // this.state.societyTagt='0';
  145. this.props.form.resetFields();
  146. };
  147. },
  148. handleClose(removedTag) {
  149. let businessScope = this.state.businessScope.filter(tag => { return tag !== removedTag });
  150. this.setState({ businessScope });
  151. },
  152. handleCloseCooperation(removedTag) {
  153. let selectCooperationProjects = this.state.selectCooperationProjects.filter(tag => { return tag.value !== removedTag.value });
  154. this.setState({ selectCooperationProjects });
  155. },
  156. showInput() {
  157. let str = this.state.businessScope.join('/')
  158. this.setState({
  159. inputVisible: true,
  160. inputValue: str
  161. });
  162. },
  163. handleInputConfirm() {
  164. let inputValue = this.state.inputValue;
  165. let arr = inputValue.split('/');
  166. let lv = true;
  167. for (let i of arr) {
  168. if (!i.replace(/\s+/g, '')) {
  169. message.warning("请填写关键词且不为空");
  170. return;
  171. }
  172. if (i.length > 16) {
  173. message.warning('单个标签字数不能超过16个字符')
  174. lv = false;
  175. return;
  176. }
  177. }
  178. if (lv) {
  179. arr = Array.from(new Set(arr));
  180. arr = arr.filter(v => v);
  181. this.setState({
  182. businessScope: arr,
  183. inputVisible: false,
  184. inputValue: '',
  185. });
  186. }
  187. },
  188. //加载(自动补全)
  189. supervisor(value) {
  190. $.ajax({
  191. method: "get",
  192. dataType: "json",
  193. crossDomain: false,
  194. url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
  195. data: {
  196. businessName: value
  197. },
  198. success: function (data) {
  199. let thedata = data.data;
  200. if (data.error.length === 0) {
  201. this.setState({
  202. cooperationProjects: thedata,
  203. });
  204. } else {
  205. message.warning(data.error[0].message);
  206. }
  207. }.bind(this),
  208. }).always(
  209. function () {
  210. }.bind(this)
  211. );
  212. },
  213. onSelect(value) {
  214. let arr = this.state.cooperationProjects.filter(v => v.id === value);
  215. let arr1 = this.state.selectCooperationProjects.filter(v => v.value === value);
  216. if (arr.length > 0) {
  217. if (arr1.length > 0) {
  218. message.warning('选项已存在');
  219. } else {
  220. this.state.selectCooperationProjects.push({
  221. label: arr[0].bname,
  222. value: arr[0].id,
  223. })
  224. this.setState({
  225. selectCooperationProjects: this.state.selectCooperationProjects
  226. })
  227. }
  228. }
  229. },
  230. checkUserName() {
  231. this.setState({
  232. verification: false
  233. })
  234. let yzName = this.props.form.getFieldValue('name')
  235. if (!yzName) {
  236. message.warning('请输入公司名称');
  237. return;
  238. }
  239. let re = new RegExp("^[\u4e00-\u9fa5]");
  240. if (!re.test(yzName)) {
  241. message.warning('公司名称必须以汉字开头!')
  242. return
  243. }
  244. if (!re.test(yzName.charAt(yzName.length - 1))) {
  245. message.warning('公司名称必须以汉字结尾!')
  246. return
  247. }
  248. if (yzName.length > 64) {
  249. message.warning('公司名称字数不超过64个!')
  250. return;
  251. };
  252. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  253. if (regu.test(yzName)) {
  254. message.warning('公司名称不能存在特殊符号或空格!')
  255. return false;
  256. }
  257. $.ajax({
  258. method: "get",
  259. dataType: "json",
  260. crossDomain: false,
  261. url: globalConfig.context + '/api/admin/customer/checkUserName',
  262. data: {
  263. userName: this.props.form.getFieldValue('name')
  264. },
  265. success: function (data) {
  266. if (data.error.length === 0) {
  267. if (!data.data) {
  268. this.setState({
  269. verification: true
  270. })
  271. } else {
  272. Modal.info({
  273. title: '提醒',
  274. content: (
  275. <div>
  276. <p>企业客户已存在!请在“客户管理-企业客户-企业客户查询”输入企业全称查询所属人信息</p>
  277. </div>
  278. ),
  279. });
  280. this.setState({
  281. verification: false
  282. })
  283. }
  284. } else {
  285. message.warning(data.error[0].message);
  286. }
  287. }.bind(this),
  288. }).always(
  289. function () {
  290. }.bind(this)
  291. );
  292. },
  293. render() {
  294. const theData = this.state.data || {};
  295. const { getFieldDecorator } = this.props.form;
  296. const FormItem = Form.Item
  297. const formItemLayout = {
  298. labelCol: { span: 6 },
  299. wrapperCol: { span: 14 },
  300. };
  301. return (
  302. <div>
  303. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
  304. <Spin spinning={this.state.loading}>
  305. <div>
  306. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>注意:请录入真实有效的客户信息</Col>
  307. <div className="clearfix">
  308. <FormItem className="mid-item"
  309. {...formItemLayout}
  310. label="公司名称" >
  311. {getFieldDecorator('name', {
  312. rules: [{ required: true, message: '此项为必填项!' }],
  313. initialValue: this.state.name
  314. })(
  315. <span style={{ display: 'flex', alignItems: 'center', position: 'relative' }}>
  316. <Input placeholder="公司名称" />
  317. {this.state.verification && <Icon type="check-circle" style={{
  318. fontSize: 16,
  319. color: '#30e031',
  320. position: 'absolute',
  321. right: '80px',
  322. }} />}
  323. <Button onClick={this.checkUserName} type="primary" style={{ marginLeft: '10px' }}>验证</Button>
  324. </span>
  325. )}
  326. </FormItem>
  327. </div>
  328. <div className="clearfix">
  329. <FormItem
  330. {...formItemLayout}
  331. label="省-市-区"
  332. >
  333. {getFieldDecorator('ProvinceCity', {
  334. rules: [{ required: true, message: '此项为必填项!' }],
  335. initialValue: this.state.ProvinceCity
  336. })(
  337. <Cascader options={areaSelect()} placeholder="选择城市" />
  338. )}
  339. </FormItem>
  340. </div>
  341. <div className="clearfix">
  342. <FormItem className="mid-item"
  343. {...formItemLayout}
  344. label="联系人" >
  345. {getFieldDecorator('content', {
  346. rules: [{ required: true, message: '此项为必填项!' }],
  347. initialValue: this.state.content
  348. })(
  349. <Input placeholder="联系人姓名" />
  350. )}
  351. </FormItem>
  352. </div>
  353. <div className="clearfix">
  354. <FormItem className="mid-item"
  355. {...formItemLayout}
  356. label="职位" >
  357. {getFieldDecorator('position', {
  358. rules: [{ required: true, message: '此项为必填项!' }],
  359. initialValue: this.state.position
  360. })(
  361. <Input placeholder="联系人职位" />
  362. )}
  363. </FormItem>
  364. </div>
  365. <div className="clearfix">
  366. <FormItem className="mid-item"
  367. {...formItemLayout}
  368. label="联系电话" >
  369. {getFieldDecorator('telnum', {
  370. rules: [{ required: true, message: '此项为必填项!' }],
  371. initialValue: this.state.telnum
  372. })(
  373. <Input placeholder="请填写手机号,仅填座机号时,请后续补充手机号" />
  374. )}
  375. </FormItem>
  376. </div>
  377. <div className="clearfix">
  378. <FormItem className="mid-item"
  379. {...formItemLayout}
  380. required
  381. label="主营产品" >
  382. <div>
  383. {this.state.businessScope.map((tag, index) => {
  384. const isLongTag = tag.length > 20;
  385. const tagElem = (
  386. <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
  387. {isLongTag ? `${tag.slice(0, 20)}...` : tag}
  388. </Tag>
  389. );
  390. return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
  391. })}
  392. {
  393. !this.state.inputVisible &&
  394. <Button
  395. size="small"
  396. type="primary"
  397. onClick={this.showInput}>
  398. + 新增主营产品
  399. </Button>
  400. }
  401. </div>
  402. {this.state.inputVisible && (<div>
  403. <TextArea
  404. style={{ width: '300px', height: '100px' }}
  405. value={this.state.inputValue}
  406. onChange={(e) => {
  407. this.setState({
  408. inputValue: e.target.value
  409. })
  410. }} />
  411. <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
  412. <div>
  413. <Button
  414. size="small"
  415. type="primary"
  416. onClick={this.handleInputConfirm}>
  417. 确定
  418. </Button>
  419. <Button
  420. size="small"
  421. style={{ marginLeft: '5px' }}
  422. onClick={() => {
  423. this.setState({
  424. inputVisible: false,
  425. inputValue: ''
  426. })
  427. }}>
  428. 取消
  429. </Button>
  430. </div>
  431. </div>)}
  432. </FormItem>
  433. </div>
  434. <div className="clearfix">
  435. <FormItem
  436. className="mid-item"
  437. {...formItemLayout}
  438. required
  439. label="意向合作项目" >
  440. <div>
  441. <div style={{ paddingBottom: this.state.selectCooperationProjects.length === 0 ? 0 : '10px' }}>
  442. {this.state.selectCooperationProjects.map((tag, index) => {
  443. const isLongTag = tag.label.length > 20;
  444. const tagElem = (
  445. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  446. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  447. </Tag>
  448. );
  449. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  450. })}
  451. </div>
  452. <div>
  453. <AutoComplete
  454. style={{ width: 200 }}
  455. onSearch={this.supervisor}
  456. onSelect={this.onSelect}
  457. placeholder="请输入关键字"
  458. >
  459. {
  460. this.state.cooperationProjects.map(function (item) {
  461. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  462. })
  463. }
  464. </AutoComplete>
  465. </div>
  466. </div>
  467. </FormItem>
  468. </div>
  469. {/*<div className="clearfix">*/}
  470. {/* <FormItem className="mid-item"*/}
  471. {/* {...formItemLayout}*/}
  472. {/* label="社会属性"*/}
  473. {/* >*/}
  474. {/* {getFieldDecorator('societyTagt', {*/}
  475. {/* rules: [{ required: true, message: '此项为必填项!' }],*/}
  476. {/* initialValue: this.state.societyTagt*/}
  477. {/* })(*/}
  478. {/* <Select placeholder="客户社会属性">*/}
  479. {/* {*/}
  480. {/* socialAttribute.map(function (item) {*/}
  481. {/* return <Select.Option key={item.value} >{item.key}</Select.Option>*/}
  482. {/* })*/}
  483. {/* }*/}
  484. {/* </Select>*/}
  485. {/* )}*/}
  486. {/* </FormItem>*/}
  487. {/*</div>*/}
  488. </div>
  489. <FormItem wrapperCol={{ span: 12, offset: 6 }}>
  490. <Button type="primary" htmlType="submit" style={{ marginRight: '50px' }}>保存</Button>
  491. <Button type="ghost" onClick={this.props.closeDesc}>取消</Button>
  492. </FormItem>
  493. </Spin>
  494. </Form >
  495. </div>
  496. )
  497. }
  498. }));
  499. const AddPerson = Form.create()(React.createClass({
  500. getInitialState() {
  501. return {
  502. loading: false,
  503. data: {},
  504. detailApi: ''
  505. };
  506. },
  507. handleSubmit(e) {
  508. e.preventDefault();
  509. this.props.form.validateFields((err, values) => {
  510. if (values.companyNamet.length > 64) {
  511. message.warning('联系人字数不超过64个')
  512. return false;
  513. };
  514. if (!values.ProvinceCity[1]) {
  515. message.warning('请选择地区');
  516. return false;
  517. };
  518. if (values.telnums.length > 13) {
  519. message.warning('电话号码字数不超过13个')
  520. return false;
  521. };
  522. if (!err) {
  523. this.setState({
  524. loading: true
  525. });
  526. $.ajax({
  527. method: "POST",
  528. dataType: "json",
  529. crossDomain: false,
  530. url: globalConfig.context + '/api/admin/customer/addCustomer',
  531. data: {
  532. contacts: values.companyNamet,
  533. societyTag: values.societyTagt,
  534. name: values.companyNamet,
  535. contactMobile: values.telnums,
  536. source: values.customerSource,
  537. province: (values.ProvinceCity)[0],//省
  538. city: (values.ProvinceCity)[1],//市
  539. area: (values.ProvinceCity)[2],//区
  540. type: '0'
  541. }
  542. }).done(function (data) {
  543. this.setState({
  544. loading: false
  545. });
  546. if (!data.error.length) {
  547. message.success('保存成功!');
  548. this.props.handleOk();
  549. } else {
  550. message.warning(data.error[0].message);
  551. }
  552. }.bind(this));
  553. }
  554. });
  555. },
  556. componentWillMount() {
  557. this.state.companyNamet = '';
  558. this.state.telnum = '';
  559. this.state.societyTagt = '0';
  560. this.state.customerSource = '0';
  561. },
  562. componentWillReceiveProps(nextProps) {
  563. if (!this.props.visible && nextProps.visible) {
  564. this.state.companyNamet = '';
  565. this.state.telnum = '';
  566. this.state.societyTagt = '0';
  567. this.state.customerSource = '0';
  568. this.props.form.resetFields();
  569. };
  570. },
  571. render() {
  572. const theData = this.state.data || {};
  573. const { getFieldDecorator } = this.props.form;
  574. const FormItem = Form.Item
  575. const formItemLayout = {
  576. labelCol: { span: 6 },
  577. wrapperCol: { span: 14 },
  578. };
  579. return (
  580. <div>
  581. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
  582. <Spin spinning={this.state.loading}>
  583. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>注意:请录入真实有效的客户信息</Col>
  584. <div className="clearfix">
  585. <FormItem className="mid-item"
  586. {...formItemLayout}
  587. label="客户姓名" >
  588. {getFieldDecorator('companyNamet', {
  589. rules: [{ required: true, message: '此项为必填项!' }],
  590. initialValue: this.state.companyNamet
  591. })(
  592. <Input placeholder="客户姓名" />
  593. )}
  594. </FormItem>
  595. </div>
  596. <div className="clearfix">
  597. <FormItem
  598. {...formItemLayout}
  599. label="省-市-区"
  600. >
  601. {getFieldDecorator('ProvinceCity', {
  602. rules: [{ required: true, message: '此项为必填项!' }],
  603. initialValue: this.state.ProvinceCity
  604. })(
  605. <Cascader options={areaSelect()} placeholder="选择城市" />
  606. )}
  607. </FormItem>
  608. </div>
  609. <div className="clearfix">
  610. <FormItem className="mid-item"
  611. {...formItemLayout}
  612. label="联系电话" >
  613. {getFieldDecorator('telnums', {
  614. rules: [{ required: true, message: '此项为必填项!' }],
  615. initialValue: this.state.telnums
  616. })(
  617. <Input placeholder="联系电话" />
  618. )}
  619. </FormItem>
  620. </div>
  621. <div className="clearfix">
  622. <FormItem className="mid-item"
  623. {...formItemLayout}
  624. label="社会属性"
  625. >
  626. {getFieldDecorator('societyTagt', {
  627. rules: [{ required: true, message: '此项为必填项!' }],
  628. initialValue: this.state.societyTagt
  629. })(
  630. <Select placeholder="客户社会属性">
  631. {
  632. socialAttribute.map(function (item) {
  633. return <Select.Option key={item.value} >{item.key}</Select.Option>
  634. })
  635. }
  636. </Select>
  637. )}
  638. </FormItem>
  639. </div>
  640. <div className="clearfix">
  641. <FormItem className="mid-item"
  642. {...formItemLayout}
  643. label="客户来源"
  644. >
  645. {getFieldDecorator('customerSource', {
  646. rules: [{ required: true, message: '此项为必填项!' }],
  647. initialValue: this.state.customerSource
  648. })(
  649. <Select placeholder="客户来源">
  650. {
  651. customerSource.map(function (item) {
  652. return <Select.Option key={item.value} >{item.key}</Select.Option>
  653. })
  654. }
  655. </Select>
  656. )}
  657. </FormItem>
  658. </div>
  659. <FormItem wrapperCol={{ span: 12, offset: 6 }}>
  660. <Button style={{ marginRight: '50px' }} type="primary" htmlType="submit">保存</Button>
  661. <Button type="ghost" onClick={this.props.closeDesc}>取消</Button>
  662. </FormItem>
  663. </Spin>
  664. </Form >
  665. </div>
  666. )
  667. }
  668. }));
  669. const AddIntention = React.createClass({
  670. getInitialState() {
  671. return {
  672. visible: false,
  673. tabsKey: 1,
  674. loading: false,
  675. dataSource: [],
  676. };
  677. },
  678. handleCancel(e) {
  679. this.setState({
  680. visible: false,
  681. });
  682. this.props.closeDesc(false);
  683. },
  684. handleOk(e) {
  685. this.setState({
  686. visible: false,
  687. });
  688. this.props.closeDesc(false, true);
  689. },
  690. componentWillReceiveProps(nextProps) {
  691. if (!this.state.visible && nextProps.showDesc) {
  692. this.state.tabsKey = "1";
  693. };
  694. this.state.visible = nextProps.showDesc;
  695. },
  696. render() {
  697. return (
  698. <div className="patent-desc">
  699. {
  700. this.state.visible &&
  701. <Modal maskClosable={false} visible={this.state.visible}
  702. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  703. width='600px'
  704. title='新建客户'
  705. footer=''
  706. className="admin-desc-content">
  707. <Spin spinning={this.state.loading}>
  708. {this.props.api.indexOf('Personal') < 0 ? <AchievementDetailForm
  709. data={this.props.data}
  710. newmodal={this.props.newmodal}
  711. closeDesc={this.handleCancel}
  712. visible={this.state.visible}
  713. handleOk={this.handleOk} /> : <AddPerson
  714. data={this.props.data}
  715. newmodal={this.props.newmodal}
  716. closeDesc={this.handleCancel}
  717. visible={this.state.visible}
  718. handleOk={this.handleOk}
  719. />}
  720. </Spin>
  721. </Modal>
  722. }
  723. </div>
  724. );
  725. },
  726. });
  727. export default Form.create({})(AddIntention);