expressDesc.jsx 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import React from 'react';
  2. import { Row, Col, DatePicker, Input, Select, Modal, message, Spin, Button } from 'antd';
  3. import moment from 'moment';
  4. import { expressArr } from '../../../dataDic.js';
  5. import './comprehensive.less';
  6. import ajax from 'jquery/src/ajax/xhr.js';
  7. import $ from 'jquery/src/ajax';
  8. const ExpressDesc = React.createClass({
  9. getInitialState() {
  10. return {
  11. visible: false,
  12. loading: false
  13. };
  14. },
  15. showModal() {
  16. this.setState({
  17. visible: true,
  18. });
  19. },
  20. handleOk() {
  21. this.setState({
  22. loading: true
  23. });
  24. $.ajax({
  25. method: "post",
  26. dataType: "json",
  27. crossDomain: false,
  28. url: globalConfig.context + "/api/admin/patent/saveRecieveSend",
  29. data: {
  30. "rid": this.props.data.rid,
  31. "pid": this.props.data.pid,
  32. "acceptanceReceiveTime": this.state.acceptanceReceiveTime,
  33. "acceptanceIssueTime": this.state.acceptanceIssueTime,
  34. "acceptanceTrackingNumber": this.state.acceptanceTrackingNumber,
  35. "acceptanceExpressCompany": "顺丰",
  36. "authorizationReceiveTime": this.state.authorizationReceiveTime,
  37. "authorizationIssueTime": this.state.authorizationIssueTime,
  38. "authorizationTrackingNumber": this.state.authorizationTrackingNumber,
  39. "authorizationExpressCompany": "顺丰",
  40. "certificateRecieveTime": this.state.certificateRecieveTime,
  41. "certificateIssueTime": this.state.certificateIssueTime,
  42. "certificateTrackingNumber": this.state.certificateTrackingNumber,
  43. "certificateExpressCompany": "顺丰"
  44. },
  45. success: function (data) {
  46. if (data.error && data.error.length) {
  47. message.warning(data.error[0].message);
  48. } else {
  49. message.success('保存成功!');
  50. this.props.closeDesc(false, true);
  51. };
  52. }.bind(this),
  53. }).always(function () {
  54. this.setState({
  55. loading: false,
  56. visible: false,
  57. });
  58. }.bind(this));
  59. },
  60. handleCancel(e) {
  61. this.setState({
  62. visible: false,
  63. });
  64. this.props.closeDesc(false);
  65. },
  66. componentWillReceiveProps(nextProps) {
  67. this.state.visible = nextProps.showDesc;
  68. if (nextProps.data) {
  69. this.state.acceptanceReceiveTime = nextProps.data.acceptanceReceiveTime;
  70. this.state.acceptanceIssueTime = nextProps.data.acceptanceIssueTime;
  71. this.state.acceptanceTrackingNumber = nextProps.data.acceptanceTrackingNumber;
  72. this.state.authorizationReceiveTime = nextProps.data.authorizationReceiveTime;
  73. this.state.authorizationIssueTime = nextProps.data.authorizationIssueTime;
  74. this.state.authorizationTrackingNumber = nextProps.data.authorizationTrackingNumber;
  75. this.state.certificateRecieveTime = nextProps.data.certificateRecieveTime;
  76. this.state.certificateIssueTime = nextProps.data.certificateIssueTime;
  77. this.state.certificateTrackingNumber = nextProps.data.certificateTrackingNumber;
  78. };
  79. },
  80. render() {
  81. let theData = this.props.data;
  82. if (this.props.data) {
  83. return (
  84. <div className="express-desc">
  85. <Spin spinning={this.state.loading} className='spin-box'>
  86. <Modal maskClosable={false} title="收发登记详情" visible={this.state.visible}
  87. onOk={this.handleOk} onCancel={this.handleCancel}
  88. width='800px'
  89. footer={[
  90. <Button key="submit" type="primary" size="large" onClick={this.handleOk}>确认</Button>,
  91. <Button key="back" type="ghost" size="large" onClick={this.handleCancel}>取消</Button>,
  92. ]}
  93. className="patent-desc-content">
  94. <div>
  95. <p className="widthHalf"><span>专利号:</span>{theData.patentNumber}</p>
  96. <p className="widthHalf"><span>专利名:</span>{theData.patentName}</p>
  97. </div>
  98. <Row className="express-desc-row">
  99. <Col span={3}>收发内容</Col>
  100. <Col span={4}>收到时间</Col>
  101. <Col span={4}>发出时间</Col>
  102. <Col span={5}>发出快递单号</Col>
  103. <Col span={5}>发出快递公司</Col>
  104. </Row>
  105. <Row className="express-desc-row">
  106. <Col span={3}>受理通知书</Col>
  107. <Col span={4}>
  108. <DatePicker
  109. value={this.state.acceptanceReceiveTime ? moment(this.state.acceptanceReceiveTime) : null}
  110. onChange={(data, dataString) => { this.setState({ acceptanceReceiveTime: dataString }); }} />
  111. </Col>
  112. <Col span={4}>
  113. <DatePicker
  114. value={this.state.acceptanceIssueTime ? moment(this.state.acceptanceIssueTime) : null}
  115. onChange={(data, dataString) => { this.setState({ acceptanceIssueTime: dataString }); }} />
  116. </Col>
  117. <Col span={5}>
  118. <Input value={this.state.acceptanceTrackingNumber}
  119. onChange={(e) => { this.setState({ acceptanceTrackingNumber: e.target.value }); }} />
  120. </Col>
  121. <Col span={5}>
  122. <Select defaultValue="顺丰">
  123. <Select.Option value="顺丰">顺丰</Select.Option>
  124. </Select>
  125. </Col>
  126. </Row>
  127. <Row className="express-desc-row">
  128. <Col span={3}>授权通知书</Col>
  129. <Col span={4}>
  130. <DatePicker
  131. value={this.state.authorizationReceiveTime ? moment(this.state.authorizationReceiveTime) : null}
  132. onChange={(data, dataString) => { this.setState({ authorizationReceiveTime: dataString }); }} />
  133. </Col>
  134. <Col span={4}>
  135. <DatePicker
  136. value={this.state.authorizationIssueTime ? moment(this.state.authorizationIssueTime) : null}
  137. onChange={(data, dataString) => { this.setState({ authorizationIssueTime: dataString }); }} />
  138. </Col>
  139. <Col span={5}>
  140. <Input value={this.state.authorizationTrackingNumber}
  141. onChange={(e) => { this.setState({ authorizationTrackingNumber: e.target.value }); }} />
  142. </Col>
  143. <Col span={5}>
  144. <Select defaultValue="顺丰">
  145. <Select.Option value="顺丰">顺丰</Select.Option>
  146. </Select>
  147. </Col>
  148. </Row>
  149. <Row className="express-desc-row">
  150. <Col span={3}>专利证书</Col>
  151. <Col span={4}>
  152. <DatePicker
  153. value={this.state.certificateRecieveTime ? moment(this.state.certificateRecieveTime) : null}
  154. onChange={(data, dataString) => { this.setState({ certificateRecieveTime: dataString }); }} />
  155. </Col>
  156. <Col span={4}>
  157. <DatePicker value={this.state.certificateIssueTime ? moment(this.state.certificateIssueTime) : null}
  158. onChange={(data, dataString) => { this.setState({ certificateIssueTime: dataString }); }} />
  159. </Col>
  160. <Col span={5}>
  161. <Input value={this.state.certificateTrackingNumber}
  162. onChange={(e) => { this.setState({ certificateTrackingNumber: e.target.value }); }} />
  163. </Col>
  164. <Col span={5}>
  165. <Select defaultValue="顺丰">
  166. <Select.Option value="顺丰">顺丰</Select.Option>
  167. </Select>
  168. </Col>
  169. </Row>
  170. </Modal>
  171. </Spin>
  172. </div>
  173. );
  174. } else {
  175. return <div></div>
  176. }
  177. },
  178. });
  179. export default ExpressDesc;