comPatentChange.jsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Steps, Input, Select, Upload, DatePicker, Button, Row, Col } from 'antd';
  3. import './comprehensive.less';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import $ from 'jquery/src/ajax';
  6. import { patentTypeList, patentFieldList, patentStateList } from '../../../dataDic.js';
  7. import { getBase64, beforeUpload, getPatentState, getTime } from '../../../tools.js';
  8. const PatentDesc = React.createClass({
  9. getInitialState() {
  10. return {
  11. visible: false,
  12. loading: false,
  13. patentTypeOption: [],
  14. patentFieldOption: [],
  15. patentStateOption: [],
  16. adminOption: [],
  17. patentProcessList: [],
  18. companyOption: []
  19. };
  20. },
  21. loadData() {
  22. this.setState({
  23. loading: true
  24. });
  25. $.when($.ajax({
  26. method: "post",
  27. dataType: "json",
  28. crossDomain: false,
  29. url: globalConfig.context + "/techservice/patent/patentProcess",
  30. data: {
  31. pid: this.state.xid
  32. }
  33. }), $.ajax({
  34. method: "get",
  35. dataType: "json",
  36. crossDomain: false,
  37. url: globalConfig.context + "/techservice/patent/getAdmin"
  38. }), $.ajax({
  39. method: "get",
  40. dataType: "json",
  41. crossDomain: false,
  42. url: globalConfig.context + "/techservice/patent/getUnitNames",
  43. })).done((data1, data2, data3) => {
  44. if (data1[0].error.length) {
  45. message.warning(data1[0].error[0].message);
  46. return;
  47. };
  48. let _me = this;
  49. data1[0].data.map(function (item) {
  50. _me.state.patentProcessList.push(
  51. <p className="patent-process-list" key={item.id}>
  52. <span>专利状态: {getPatentState(item.state)}</span>
  53. <span>处理时间: {getTime(item.recordTime)}</span>
  54. <span>负责人:{item.principal}</span>
  55. <span>操作人:{item.operator}</span>
  56. </p>
  57. )
  58. });
  59. if (data2[0].error.length) {
  60. message.warning(data2[0].error[0].message);
  61. return;
  62. };
  63. for (var item in data2[0].data) {
  64. _me.state.adminOption.push(
  65. <Select.Option value={item} key={item}>{data2[0].data[item]}</Select.Option>
  66. )
  67. };
  68. if (data3[0].error.length || !data3[0].data) {
  69. return;
  70. };
  71. for (var item in data3[0].data) {
  72. _me.state.companyOption.push(
  73. <Select.Option value={item} key={item}>{data3[0].data[item]}</Select.Option>
  74. )
  75. };
  76. }).always(function () {
  77. this.setState({
  78. loading: false
  79. });
  80. }.bind(this));
  81. },
  82. getOption() {
  83. let _me = this;
  84. _me.state.patentTypeOption = [];
  85. _me.state.patentFieldOption = [];
  86. _me.state.patentStateOption = [];
  87. patentTypeList.map(function (item) {
  88. _me.state.patentTypeOption.push(
  89. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  90. )
  91. });
  92. patentFieldList.map(function (item) {
  93. _me.state.patentFieldOption.push(
  94. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  95. )
  96. });
  97. patentStateList.map(function (item) {
  98. _me.state.patentStateOption.push(
  99. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  100. )
  101. });
  102. },
  103. downloadFile(url, type) {
  104. window.open(globalConfig.context + "/techservice/patent/downloadFile?path=" + url + "&sign=" + type)
  105. },
  106. showModal() {
  107. this.setState({
  108. visible: true,
  109. });
  110. },
  111. handleOk() {
  112. this.setState({
  113. visible: true,
  114. });
  115. $.ajax({
  116. method: "POST",
  117. dataType: "json",
  118. crossDomain: false,
  119. url: globalConfig.context + "/techservice/patent/managePatentInfo",
  120. data: {
  121. "xid": this.state.xid,
  122. "patentNumber": this.state.patentNumber,
  123. "patentName": this.state.patentName,
  124. "patentCatagory": this.state.patentType,
  125. "patentField": this.state.patentField,
  126. "patentDes": this.state.patentDes,
  127. "patentWritingUrl": this.state.patentWritingUrl,
  128. "authorizationNoticeUrl": this.state.authorizationNoticeUrl,
  129. "patentCertificateUrl": this.state.patentCertificateUrl,
  130. "state": this.state.patentStateAdd,
  131. "recordTimeFormattedDate": this.state.recordTime,
  132. "principal": this.state.adminName
  133. }
  134. }).done(function (data) {
  135. if (!data.error.length) {
  136. message.success('保存成功!');
  137. } else {
  138. message.warning(data.error[0].message);
  139. }
  140. }.bind(this)).always(function () {
  141. this.setState({
  142. visible: false,
  143. });
  144. this.props.closeDesc(false);
  145. }.bind(this));
  146. },
  147. checkPatentProcess() {
  148. if (this.state.patentStateAdd || this.state.adminName || this.state.recordTime) {
  149. if (this.state.patentStateAdd && this.state.adminName && this.state.recordTime)
  150. { this.handleOk() } else {
  151. message.warning("请填写完整的状态流转信息!");
  152. return;
  153. }
  154. } else {
  155. this.handleOk()
  156. };
  157. },
  158. componentWillReceiveProps(nextProps) {
  159. let _me = this;
  160. this.state.patentStateAdd = '';
  161. this.state.adminName = '';
  162. this.state.recordTime = '';
  163. this.state.adminOption = [];
  164. this.state.patentProcessList = [];
  165. this.state.visible = nextProps.showDesc;
  166. if (nextProps.data) {
  167. this.state.xid = nextProps.data.pid;
  168. this.state.patentDes = nextProps.data.patentDes;
  169. this.state.patentName = nextProps.data.patentName;
  170. this.state.patentNumber = nextProps.data.patentNumber;
  171. this.state.patentType = String(nextProps.data.patentType);
  172. this.state.patentState = String(nextProps.data.patentState);
  173. this.state.patentField = String(nextProps.data.patentField);
  174. this.loadData();
  175. this.getOption();
  176. }
  177. },
  178. handleCancel(e) {
  179. this.setState({
  180. visible: false,
  181. });
  182. this.props.closeDesc(false);
  183. },
  184. getPatentWritingUrl(e) {
  185. this.state.patentWritingUrl = e;
  186. },
  187. getAuthorizationNoticeUrl(e) {
  188. this.state.authorizationNoticeUrl = e;
  189. },
  190. getPatentCertificateUrl(e) {
  191. this.state.patentCertificateUrl = e;
  192. },
  193. render() {
  194. const Step = Steps.Step;
  195. const theData = this.props.data;
  196. if (this.props.data) {
  197. return (
  198. <div className="patent-desc">
  199. <Spin spinning={this.state.loading} className='spin-box'>
  200. <Modal title="专利详情" visible={this.state.visible}
  201. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  202. width='800px'
  203. footer={[
  204. <Button key="submit" type="primary" size="large" onClick={this.checkPatentProcess}>保存</Button>,
  205. <Button key="back" type="ghost" size="large" onClick={this.handleCancel}>取消</Button>,
  206. ]}
  207. className="patent-desc-content">
  208. <Row className="express-desc-row">
  209. <Col span={4}>公司名称</Col>
  210. <Col span={4}>xxxxxx</Col>
  211. <Col span={4}>公司组织机构代码</Col>
  212. <Col span={4}>xxxxxxxx</Col>
  213. </Row>
  214. <Row className="express-desc-row">
  215. <Col span={4}>公司地址</Col>
  216. <Col span={4}>xxxxxx</Col>
  217. <Col span={4}>联系人</Col>
  218. <Col span={4}>xxxxxxxx</Col>
  219. </Row>
  220. <Row className="express-desc-row">
  221. <Col span={4}>编号</Col>
  222. <Col span={4}>xxxxxx</Col>
  223. <Col span={4}>外包公司</Col>
  224. <Col span={4}>
  225. <Select placeholder="外包公司名"
  226. filterOption={(input, option) => {
  227. this.setState({companyId : option.key});
  228. option.props.value.indexOf(input) >= 0;
  229. }}
  230. onChange={(e)=>{ this.state.companyName = e;}}
  231. showSearch={true} style={{ width: 200 }} >{this.state.companyOption}</Select>
  232. </Col>
  233. </Row>
  234. <Row className="express-desc-row">
  235. <Col span={3}>派单详情</Col>
  236. <Col span={16}>
  237. <Input type="textarea"
  238. placeholder="多行输入"
  239. rows={6} />
  240. </Col>
  241. </Row>
  242. <Row className="express-desc-row">
  243. <Col span={3}>备注</Col>
  244. <Col span={16}>
  245. <Input type="textarea"
  246. placeholder="多行输入"
  247. rows={6} />
  248. </Col>
  249. </Row>
  250. <Row className="express-desc-row">
  251. <Col span={3}>软著名称</Col>
  252. <Col span={6}>
  253. <Input type="input" value="名称" />
  254. </Col>
  255. </Row>
  256. <Row className="express-desc-row">
  257. <Col span={3}>下证时间(预计)</Col>
  258. <Col span={6}>
  259. <DatePicker />
  260. </Col>
  261. </Row>
  262. <p>状态流转记录</p>
  263. <Row className="express-desc-row">
  264. <Col span={3}>专利状态</Col>
  265. <Col span={3}>派单</Col>
  266. <Col span={3}>处理时间</Col>
  267. <Col span={3}>2017/01/01</Col>
  268. <Col span={3}>负责人</Col>
  269. <Col span={3}>随便</Col>
  270. </Row>
  271. <Row className="express-desc-row">
  272. <Col span={3}>专利状态</Col>
  273. <Col span={3}>受理中</Col>
  274. <Col span={3}>处理时间</Col>
  275. <Col span={3}>2017/01/01</Col>
  276. <Col span={3}>负责人</Col>
  277. <Col span={3}>随便</Col>
  278. <Col span={3}>操作人</Col>
  279. <Col span={3}>随便</Col>
  280. </Row>
  281. <Row className="express-desc-row">
  282. <Col span={3}>状态流转</Col>
  283. <Col span={4}>
  284. <Select placeholder="请选择" value={this.state.searchKey} style={{ width: 120 }} onChange={(e) => { this.setState({ searchKey: e, searchValue: '' }); }}>
  285. <Select.Option value="1">1</Select.Option>
  286. <Select.Option value="2">2</Select.Option>
  287. </Select>
  288. </Col>
  289. <Col span={3}>处理时间</Col>
  290. <Col span={4}>
  291. <DatePicker />
  292. </Col>
  293. <Col span={3}>负责人</Col>
  294. <Col span={4}>
  295. <Select placeholder="请选择" value={this.state.searchKey} style={{ width: 120 }} onChange={(e) => { this.setState({ searchKey: e, searchValue: '' }); }}>
  296. <Select.Option value="1">1</Select.Option>
  297. <Select.Option value="2">2</Select.Option>
  298. </Select>
  299. </Col>
  300. </Row>
  301. </Modal>
  302. </Spin>
  303. </div>
  304. );
  305. } else {
  306. return <div></div>
  307. }
  308. },
  309. });
  310. export default PatentDesc;