userDesc.jsx 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Input, Select, DatePicker, Button, Radio, Form, Cascader } from 'antd';
  3. import moment from 'moment';
  4. import './userList.less';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import { areaSelect, getProvince } from '../../NewDicProvinceList.js';
  8. import { getAuditState } from '../../tools.js';
  9. import { auditStatusList, certifyStepList } from '../../dataDic.js';
  10. const UserShow = Form.create()(React.createClass({
  11. getInitialState() {
  12. return {
  13. visible: false,
  14. loading: false
  15. };
  16. },
  17. loadData(uid) {
  18. this.props.spinState(true);
  19. $.ajax({
  20. method: "get",
  21. dataType: "json",
  22. crossDomain: false,
  23. url: globalConfig.context + "/api/admin/userCertify/userDetail",
  24. data: {
  25. uid: uid
  26. },
  27. success: function (data) {
  28. let thisData = data.data;
  29. if (!thisData) {
  30. if (data.error && data.error.length) {
  31. message.warning(data.error[0].message);
  32. };
  33. thisData = {};
  34. };
  35. this.setState({
  36. username: thisData.username,
  37. sex: thisData.sex,
  38. id: thisData.id,
  39. birth: thisData.dateOfBirthYear + '-' + thisData.dateOfBirthMonth,
  40. idNumber: thisData.idNumber,
  41. province: thisData.province,
  42. city: thisData.city,
  43. area: thisData.area,
  44. positiveIdUrl: thisData.positiveIdUrl,
  45. oppositeIdUrl: thisData.oppositeIdUrl,
  46. aftUsername: thisData.aftUsername,
  47. contactMobile: thisData.contactMobile,
  48. bankName: thisData.bankName,
  49. bankAccount: thisData.bankAccount,
  50. bankCardNumber: thisData.bankCardNumber,
  51. amountMoney: thisData.amountMoney,
  52. auditStatus: thisData.auditStatus,
  53. process: thisData.process ? String(thisData.process) : undefined,
  54. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  55. paymentDate: thisData.paymentDate,
  56. expert: thisData.expert,
  57. celebrity: thisData.celebrity,
  58. level: thisData.lvl,
  59. aid: thisData.aid, //业务员ID
  60. mid: thisData.mid //客户经理ID
  61. });
  62. this.props.form.resetFields();
  63. }.bind(this),
  64. }).always(function () {
  65. this.props.spinState(false);
  66. }.bind(this));
  67. },
  68. getAccountManagerList() {
  69. this.props.spinState(true);
  70. $.ajax({
  71. method: "get",
  72. dataType: "json",
  73. crossDomain: false,
  74. url: globalConfig.context + "/api/admin/userCertify/accountManager",
  75. success: function (data) {
  76. let theArr = [];
  77. if (!data.data) {
  78. if (data.error && data.error.length) {
  79. message.warning(data.error[0].message);
  80. };
  81. return;
  82. };
  83. for (var item in data.data) {
  84. theArr.push(
  85. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  86. )
  87. };
  88. this.setState({
  89. accountManagerOption: theArr,
  90. accountManagerList: data.data
  91. });
  92. }.bind(this),
  93. }).always(function () {
  94. this.props.spinState(false);
  95. }.bind(this));
  96. },
  97. getTechnicianList() {
  98. this.props.spinState(true);
  99. $.ajax({
  100. method: "get",
  101. dataType: "json",
  102. crossDomain: false,
  103. url: globalConfig.context + "/api/admin/userCertify/technician",
  104. success: function (data) {
  105. let theArr = [];
  106. if (!data.data) {
  107. if (data.error && data.error.length) {
  108. message.warning(data.error[0].message);
  109. };
  110. return;
  111. };
  112. for (var item in data.data) {
  113. theArr.push(
  114. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  115. )
  116. };
  117. this.setState({
  118. technicianOption: theArr,
  119. technicianList: data.data
  120. });
  121. }.bind(this),
  122. }).always(function () {
  123. this.props.spinState(false);
  124. }.bind(this));
  125. },
  126. handleSubmit(e) {
  127. e.preventDefault();
  128. this.props.form.validateFields((err, values) => {
  129. if (!err) {
  130. this.props.spinState(true);
  131. $.ajax({
  132. method: "POST",
  133. dataType: "json",
  134. crossDomain: false,
  135. url: globalConfig.context + "/api/admin/userCertify/updateUserDetail",
  136. data: {
  137. uid: this.props.uid,
  138. id: this.state.id,
  139. auditStatus: values.auditStatus,
  140. level: this.state.level,
  141. aid: values.aid, //指派业务员ID
  142. mid: values.mid, //指派客户经理ID
  143. }
  144. }).done(function (data) {
  145. if (!data.error.length) {
  146. message.success('保存成功!');
  147. } else {
  148. message.warning(data.error[0].message);
  149. }
  150. }.bind(this)).always(function () {
  151. this.props.spinState(false);
  152. this.props.handleOk();
  153. }.bind(this));
  154. }
  155. });
  156. },
  157. componentWillMount() {
  158. this.loadData(this.props.uid);
  159. this.getAccountManagerList();
  160. this.getTechnicianList();
  161. },
  162. componentWillReceiveProps(nextProps) {
  163. if (!this.props.visible && nextProps.visible) {
  164. this.loadData(nextProps.uid);
  165. };
  166. },
  167. render() {
  168. const { getFieldDecorator } = this.props.form;
  169. const FormItem = Form.Item
  170. const formItemLayout = {
  171. labelCol: { span: 6 },
  172. wrapperCol: { span: 12 },
  173. };
  174. return (
  175. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  176. <FormItem
  177. {...formItemLayout}
  178. label="用户名" >
  179. {getFieldDecorator('username')(
  180. <span>{this.state.username}</span>
  181. )}
  182. </FormItem>
  183. <FormItem
  184. {...formItemLayout}
  185. label="性别" >
  186. {getFieldDecorator('sex')(
  187. <span>{this.state.sex}</span>
  188. )}
  189. </FormItem>
  190. <FormItem
  191. {...formItemLayout}
  192. label="出生日期" >
  193. {getFieldDecorator('birth')(
  194. <span>{this.state.birth}</span>
  195. )}
  196. </FormItem>
  197. <FormItem
  198. {...formItemLayout}
  199. label="身份证号" >
  200. {getFieldDecorator('idNumber')(
  201. <span>{this.state.idNumber}</span>
  202. )}
  203. </FormItem>
  204. <FormItem
  205. labelCol={{ span: 6 }}
  206. wrapperCol={{ span: 18 }}
  207. label="身份证图片" >
  208. <div className="idcard-img clearfix">
  209. {this.state.positiveIdUrl ? <div>
  210. <div className="idcard-imgbox">
  211. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.positiveIdUrl} alt="点击查看大图"
  212. onClick={(e) => { window.open(e.target.src) }} />
  213. </div>
  214. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  215. {this.state.oppositeIdUrl ? <div>
  216. <div className="idcard-imgbox">
  217. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.oppositeIdUrl} alt="点击查看大图"
  218. onClick={(e) => { window.open(e.target.src) }} />
  219. </div>
  220. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  221. </div>
  222. </FormItem>
  223. <FormItem
  224. {...formItemLayout}
  225. label="认证姓名" >
  226. {getFieldDecorator('aftUsername')(
  227. <span>{this.state.aftUsername}</span>
  228. )}
  229. </FormItem>
  230. <FormItem
  231. {...formItemLayout}
  232. label="联系电话" >
  233. {getFieldDecorator('contactMobile')(
  234. <span>{this.state.contactMobile}</span>
  235. )}
  236. </FormItem>
  237. <FormItem
  238. {...formItemLayout}
  239. label="所在地" >
  240. {getFieldDecorator('address')(
  241. <span>{getProvince(this.state.province, this.state.city, this.state.area)}</span>
  242. )}
  243. </FormItem>
  244. <FormItem
  245. {...formItemLayout}
  246. label="开户银行" >
  247. {getFieldDecorator('bankAccount')(
  248. <span>{this.state.bankAccount}</span>
  249. )}
  250. </FormItem>
  251. <FormItem
  252. {...formItemLayout}
  253. label="银行卡号" >
  254. {getFieldDecorator('bankCardNumber')(
  255. <span>{this.state.bankCardNumber}</span>
  256. )}
  257. </FormItem>
  258. <FormItem
  259. {...formItemLayout}
  260. label="用户等级" >
  261. {getFieldDecorator('level')(
  262. <span>{"Lv." + (this.state.level || 0)}</span>
  263. )}
  264. </FormItem>
  265. <FormItem
  266. {...formItemLayout}
  267. label="是否专家" >
  268. {getFieldDecorator('expert')(
  269. <span>{this.state.expert == 1 ? "是" : "否"}</span>
  270. )}
  271. </FormItem>
  272. <FormItem
  273. {...formItemLayout}
  274. label="是否明星" >
  275. {getFieldDecorator('celebrity')(
  276. <span>{this.state.celebrity == 1 ? "是" : "否"}</span>
  277. )}
  278. </FormItem>
  279. <FormItem
  280. {...formItemLayout}
  281. label="认证状态" >
  282. {getFieldDecorator('auditStatus', {
  283. initialValue: this.state.auditStatus
  284. })(
  285. <Select placeholder="选择要修改的认证状态" style={{ width: 200 }}
  286. onChange={(e) => { this.state.auditStatus = e }}>
  287. {
  288. auditStatusList.map(function (item, i) {
  289. return <Select.Option key={i} value={item.value} >{item.key}</Select.Option>
  290. })
  291. }
  292. </Select>
  293. )}
  294. </FormItem>
  295. <FormItem
  296. {...formItemLayout}
  297. label="业务员" >
  298. {getFieldDecorator('aid', {
  299. initialValue: this.state.aid
  300. })(
  301. <Select placeholder="选择一个业务员" style={{ width: 200 }}>
  302. {this.state.technicianOption}
  303. </Select>
  304. )}
  305. </FormItem>
  306. <FormItem
  307. {...formItemLayout}
  308. label="客户经理" >
  309. {getFieldDecorator('mid', {
  310. initialValue: this.state.mid
  311. })(
  312. <Select placeholder="选择一个客户经理" style={{ width: 200 }}>
  313. {this.state.accountManagerOption}
  314. </Select>
  315. )}
  316. </FormItem>
  317. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  318. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  319. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  320. </FormItem>
  321. </Form >
  322. )
  323. }
  324. }));
  325. const UserForm = Form.create()(React.createClass({
  326. getInitialState() {
  327. return {
  328. visible: false,
  329. loading: false,
  330. saveSign: "save"
  331. };
  332. },
  333. loadData(uid) {
  334. this.props.spinState(true);
  335. $.ajax({
  336. method: "post",
  337. dataType: "json",
  338. crossDomain: false,
  339. url: globalConfig.context + "/api/admin/userDetail",
  340. data: {
  341. uid: uid
  342. },
  343. success: function (data) {
  344. let thisData = data.data;
  345. if (!thisData) {
  346. if (data.error && data.error.length) {
  347. message.warning(data.error[0].message);
  348. };
  349. thisData = {};
  350. };
  351. let d = new Date()
  352. if (thisData && thisData.dateOfBirthMonth && thisData.dateOfBirthYear) {
  353. d.setMonth(thisData.dateOfBirthMonth - 1);
  354. d.setYear(parseInt(thisData.dateOfBirthYear));
  355. };
  356. this.setState({
  357. username: thisData.username,
  358. sex: thisData.sex,
  359. id: thisData.id,
  360. birth: d,
  361. idNumber: thisData.idNumber,
  362. address: [thisData.province, thisData.city, thisData.area],
  363. positiveIdUrl: thisData.positiveIdUrl,
  364. oppositeIdUrl: thisData.oppositeIdUrl,
  365. aftUsername: thisData.aftUsername,
  366. contactMobile: thisData.contactMobile,
  367. bankName: thisData.bankName,
  368. bankAccount: thisData.bankAccount,
  369. bankCardNumber: thisData.bankCardNumber,
  370. amountMoney: thisData.amountMoney,
  371. auditStatus: thisData.auditStatus,
  372. process: thisData.process ? String(thisData.process) : undefined,
  373. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  374. paymentDate: thisData.paymentDate,
  375. level: thisData.level,
  376. expert: thisData.expert,
  377. celebrity: thisData.celebrity,
  378. aid: thisData.aid, //业务员ID
  379. mid: thisData.mid //客户经理ID
  380. });
  381. this.props.form.resetFields();
  382. }.bind(this),
  383. }).always(function () {
  384. this.props.spinState(false);
  385. }.bind(this));
  386. },
  387. handleSubmit(e) {
  388. if (e) {
  389. e.preventDefault();
  390. };
  391. this.props.form.validateFields((err, values) => {
  392. // //金额判断
  393. // if (values.amountMoney && values.amountMoney < 0 && values.amountMoney > 100 && /^\d+(\.\d{2})?$/.test(values.amountMoney)) {
  394. // message.warning('请输入0-100以内的金额');
  395. // return;
  396. // };
  397. if ((this.state.auditStatus == "5" && values.level == "0") || (this.state.auditStatus != "5" && values.level != "0")) {
  398. message.warning('认证状态和用户等级不匹配!');
  399. return;
  400. };
  401. if (!err) {
  402. this.props.spinState(true);
  403. $.ajax({
  404. method: "POST",
  405. dataType: "json",
  406. crossDomain: false,
  407. url: globalConfig.context + "/api/admin/updateUserDetail",
  408. data: {
  409. uid: this.props.uid,
  410. id: this.state.id,
  411. username: values.username,
  412. sex: values.sex,
  413. dateOfBirthYear: values.birth ? values.birth._d.getFullYear() : undefined,
  414. dateOfBirthMonth: values.birth ? values.birth._d.getMonth() + 1 : undefined,
  415. idNumber: values.idNumber,
  416. aftUsername: values.aftUsername,
  417. province: values.address[0],
  418. city: values.address[1],
  419. area: values.address[2],
  420. contactMobile: values.contactMobile,
  421. bankName: values.bankName,
  422. bankAccount: values.bankAccount,
  423. bankCardNumber: values.bankCardNumber,
  424. amountMoney: values.amountMoney,
  425. //auditStatus: values.auditStatus,
  426. paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
  427. level: values.level,
  428. expert: values.expert,
  429. celebrity: values.celebrity,
  430. //aid: values.aid, //指派业务员ID
  431. //mid: values.mid, //指派客户经理ID
  432. saveSign: this.state.saveSign
  433. }
  434. }).done(function (data) {
  435. if (!data.error.length) {
  436. message.success('保存成功!');
  437. } else {
  438. message.warning(data.error[0].message);
  439. }
  440. }.bind(this)).always(function () {
  441. this.setState({
  442. saveSign: "save"
  443. });
  444. this.props.spinState(false);
  445. this.props.handleOk();
  446. }.bind(this));
  447. }
  448. });
  449. },
  450. componentWillMount() {
  451. this.loadData(this.props.uid);
  452. },
  453. componentWillReceiveProps(nextProps) {
  454. if (!this.props.visible && nextProps.visible) {
  455. this.loadData(nextProps.uid);
  456. };
  457. },
  458. render() {
  459. const { getFieldDecorator } = this.props.form;
  460. const { MonthPicker } = DatePicker;
  461. const FormItem = Form.Item
  462. const formItemLayout = {
  463. labelCol: { span: 6 },
  464. wrapperCol: { span: 12 },
  465. };
  466. return (
  467. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  468. <FormItem
  469. {...formItemLayout}
  470. label="用户名" >
  471. {getFieldDecorator('username', {
  472. initialValue: this.state.username
  473. })(
  474. <Input />
  475. )}
  476. </FormItem>
  477. <FormItem
  478. {...formItemLayout}
  479. label="性别" >
  480. {getFieldDecorator('sex', {
  481. initialValue: this.state.sex
  482. })(
  483. <Radio.Group>
  484. <Radio value="男">男</Radio>
  485. <Radio value="女">女</Radio>
  486. </Radio.Group>
  487. )}
  488. </FormItem>
  489. <FormItem
  490. {...formItemLayout}
  491. label="出生日期" >
  492. {getFieldDecorator('birth', {
  493. initialValue: !this.state.birth ? null : moment(this.state.birth, 'YYYY/MM')
  494. })(
  495. <MonthPicker />
  496. )}
  497. </FormItem>
  498. <FormItem
  499. {...formItemLayout}
  500. label="身份证号" >
  501. {getFieldDecorator('idNumber', {
  502. initialValue: this.state.idNumber
  503. })(
  504. <Input />
  505. )}
  506. </FormItem>
  507. <FormItem
  508. labelCol={{ span: 6 }}
  509. wrapperCol={{ span: 18 }}
  510. label="身份证图片" >
  511. <div className="idcard-img clearfix">
  512. {this.state.positiveIdUrl ? <div>
  513. <div className="idcard-imgbox">
  514. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.positiveIdUrl} alt="点击查看大图"
  515. onClick={(e) => { window.open(e.target.src) }} />
  516. </div>
  517. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  518. {this.state.oppositeIdUrl ? <div>
  519. <div className="idcard-imgbox">
  520. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.oppositeIdUrl} alt="点击查看大图"
  521. onClick={(e) => { window.open(e.target.src) }} />
  522. </div>
  523. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  524. </div>
  525. </FormItem>
  526. <FormItem
  527. {...formItemLayout}
  528. label="认证姓名" >
  529. {getFieldDecorator('aftUsername', {
  530. initialValue: this.state.aftUsername
  531. })(
  532. <Input />
  533. )}
  534. </FormItem>
  535. <FormItem
  536. {...formItemLayout}
  537. label="联系电话" >
  538. {getFieldDecorator('contactMobile', {
  539. initialValue: this.state.contactMobile
  540. })(
  541. <Input />
  542. )}
  543. </FormItem>
  544. <FormItem
  545. {...formItemLayout}
  546. label="所在地" >
  547. {getFieldDecorator('address', {
  548. initialValue: this.state.address
  549. })(
  550. <Cascader options={areaSelect()} placeholder="请选择地址" />
  551. )}
  552. </FormItem>
  553. <FormItem
  554. {...formItemLayout}
  555. label="开户银行" >
  556. {getFieldDecorator('bankAccount', {
  557. initialValue: this.state.bankAccount
  558. })(
  559. <Input />
  560. )}
  561. </FormItem>
  562. <FormItem
  563. {...formItemLayout}
  564. label="银行卡号" >
  565. {getFieldDecorator('bankCardNumber', {
  566. initialValue: this.state.bankCardNumber
  567. })(
  568. <Input />
  569. )}
  570. </FormItem>
  571. <FormItem
  572. {...formItemLayout}
  573. label="用户等级" >
  574. {getFieldDecorator('level', {
  575. initialValue: this.state.level
  576. })(
  577. <Select placeholder="选择要修改的用户等级" style={{ width: 200 }} >
  578. <Select.Option value="0" >Lv.0</Select.Option>
  579. <Select.Option value="1" >Lv.1</Select.Option>
  580. <Select.Option value="2" >Lv.2</Select.Option>
  581. <Select.Option value="3" >Lv.3</Select.Option>
  582. <Select.Option value="4" >Lv.4</Select.Option>
  583. <Select.Option value="5" >Lv.5</Select.Option>
  584. </Select>
  585. )}
  586. </FormItem>
  587. <FormItem
  588. {...formItemLayout}
  589. label="专家" >
  590. {getFieldDecorator('expert', {
  591. initialValue: this.state.expert
  592. })(
  593. <Radio.Group>
  594. <Radio value={0}>否</Radio>
  595. <Radio value={1}>是</Radio>
  596. </Radio.Group>
  597. )}
  598. </FormItem>
  599. <FormItem
  600. {...formItemLayout}
  601. label="明星" >
  602. {getFieldDecorator('celebrity', {
  603. initialValue: this.state.celebrity
  604. })(
  605. <Radio.Group>
  606. <Radio value={0}>否</Radio>
  607. <Radio value={1}>是</Radio>
  608. </Radio.Group>
  609. )}
  610. </FormItem>
  611. <FormItem
  612. {...formItemLayout}
  613. label="认证状态" >
  614. {getFieldDecorator('auditStatus')(
  615. <span>{getAuditState(this.state.auditStatus)}</span>
  616. )}
  617. </FormItem>
  618. <FormItem
  619. {...formItemLayout}
  620. label="业务员" >
  621. {getFieldDecorator('aid', )(
  622. <span>{this.props.data.adminName}</span>
  623. )}
  624. </FormItem>
  625. <FormItem
  626. {...formItemLayout}
  627. label="客户经理" >
  628. {getFieldDecorator('mid')(
  629. <span>{this.props.data.managerName}</span>
  630. )}
  631. </FormItem>
  632. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  633. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  634. <Button className="set-submit" type="ghost"
  635. onClick={() => {
  636. this.state.saveSign = "submit";
  637. this.handleSubmit();
  638. }}>提交审核</Button>
  639. </FormItem>
  640. </Form >
  641. )
  642. }
  643. }));
  644. const PatentDesc = React.createClass({
  645. getInitialState() {
  646. return {
  647. visible: false,
  648. loading: false
  649. };
  650. },
  651. showModal() {
  652. this.setState({
  653. visible: true,
  654. });
  655. },
  656. handleCancel(e) {
  657. this.setState({
  658. visible: false,
  659. });
  660. this.props.closeDesc(false);
  661. },
  662. handleOk(e) {
  663. this.setState({
  664. visible: false,
  665. });
  666. this.props.closeDesc(false, true);
  667. },
  668. componentWillReceiveProps(nextProps) {
  669. this.state.visible = nextProps.showDesc;
  670. },
  671. spinChange(e) {
  672. this.setState({
  673. loading: e
  674. });
  675. },
  676. render() {
  677. if (this.props.data) {
  678. return (
  679. <div className="patent-desc">
  680. <Spin spinning={this.state.loading} className='spin-box'>
  681. <Modal maskClosable={false} title="用户详情" visible={this.state.visible}
  682. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  683. width='600px'
  684. footer=''
  685. className="admin-desc-content">
  686. {window.showAuditStatus ? <UserShow
  687. uid={this.props.data.id}
  688. data={this.props.data}
  689. closeDesc={this.handleCancel}
  690. visible={this.state.visible}
  691. spinState={this.spinChange}
  692. handleOk={this.handleOk} />
  693. : <UserForm
  694. uid={this.props.data.id}
  695. data={this.props.data}
  696. closeDesc={this.handleCancel}
  697. visible={this.state.visible}
  698. spinState={this.spinChange}
  699. handleOk={this.handleOk} />}
  700. </Modal>
  701. </Spin>
  702. </div>
  703. );
  704. } else {
  705. return <div></div>
  706. }
  707. },
  708. });
  709. export default PatentDesc;
  710. // <FormItem
  711. // {...formItemLayout}
  712. // label="打款金额"
  713. // >
  714. // {getFieldDecorator('amountMoney', {
  715. // initialValue: this.state.amountMoney
  716. // })(
  717. // <Input />
  718. // )}
  719. // </FormItem>
  720. // <FormItem
  721. // {...formItemLayout}
  722. // label="打款日期"
  723. // >
  724. // {getFieldDecorator('paymentDateFormattedDate', {
  725. // initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
  726. // })(
  727. // <DatePicker />
  728. // )}
  729. // </FormItem>