checkInfor.jsx 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. import React, { Component } from 'react';
  2. import { Button, Form, Input, message, Modal, Radio, Select, Spin } from "antd";
  3. import {
  4. getboutique,
  5. } from "@/tools";
  6. import $ from "jquery";
  7. const formItemLayout = {
  8. labelCol: { span: 8 },
  9. wrapperCol: { span: 14 }
  10. };
  11. const FormItem = Form.Item;
  12. class checkInfor extends Component {
  13. constructor(props) {
  14. super(props);
  15. this.state = {
  16. loading: false,
  17. patentType: props.infor ? props.infor.patentType : '',
  18. officialCost: props.infor ? props.infor.officialCost : '',
  19. costReduction: props.infor ? props.infor.costReduction : '',
  20. patentTypeList: [],
  21. }
  22. this.onChange = this.onChange.bind(this);
  23. this.getpatentTypeList = this.getpatentTypeList.bind(this);
  24. }
  25. componentDidMount() {
  26. this.getpatentTypeList();
  27. }
  28. onChange() {
  29. this.setState({
  30. loading: true,
  31. });
  32. if (this.state.patentType === null) {
  33. message.warning('请选择专利类型')
  34. return
  35. }
  36. if ((this.state.patentType === 0 || this.state.patentType === 2) && isNaN(parseInt(this.state.costReduction))) {
  37. message.warning('请选择是否有费减')
  38. return;
  39. }
  40. $.ajax({
  41. method: "POST",
  42. dataType: "json",
  43. crossDomain: false,
  44. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  45. data: {
  46. id: this.props.infor.id, //项目ID
  47. officialCost: this.state.officialCost, //是否有官费
  48. costReduction: (this.state.patentType === 0 || this.state.patentType === 2) ? this.state.costReduction : 0, //是否有费减
  49. patentType: this.state.patentType, //专利类型
  50. },
  51. }).done(
  52. function (data) {
  53. this.setState({
  54. loading: false,
  55. });
  56. if (!data.error.length) {
  57. message.success("保存成功!");
  58. this.props.onCancel();
  59. } else {
  60. message.warning(data.error[0].message);
  61. }
  62. }.bind(this)
  63. );
  64. }
  65. getpatentTypeList() {
  66. $.ajax({
  67. method: "get",
  68. dataType: "json",
  69. crossDomain: false,
  70. url: globalConfig.context + '/api/admin/orderProject/getPatentType',
  71. success: function (data) {
  72. if (data.error.length === 0) {
  73. this.setState({
  74. patentTypeList: data.data
  75. })
  76. } else {
  77. message.warning(data.error[0].message);
  78. };
  79. }.bind(this)
  80. });
  81. }
  82. render() {
  83. const {
  84. commodityName,
  85. commodityQuantity,
  86. officialCost,
  87. costReduction,
  88. commodityPrice,
  89. main,
  90. taskComment,
  91. ifCertificationFee,//是否包含认证费
  92. declarationBatch,//批次
  93. type,//项目类型 0 正常 1专利 2软著 3审计 4双软 5高新 6商标
  94. patentType,//项目类型
  95. patentTypeName,//项目类型名称
  96. } = this.props.infor;
  97. return (
  98. <Modal
  99. maskClosable={false}
  100. visible={this.props.visible}
  101. onOk={this.props.onCancel}
  102. onCancel={this.props.onCancel}
  103. width="800px"
  104. title="项目任务详情"
  105. footer=""
  106. className="admin-desc-content"
  107. >
  108. <Form layout="horizontal" id="demand-form">
  109. <div className="clearfix">
  110. <FormItem
  111. className="half-item"
  112. {...formItemLayout}
  113. label="项目名称"
  114. >
  115. <span>{commodityName}</span>
  116. </FormItem>
  117. <FormItem
  118. className="half-item"
  119. {...formItemLayout}
  120. label="项目数量"
  121. >
  122. <span>{commodityQuantity}</span>
  123. </FormItem>
  124. <FormItem
  125. className="half-item"
  126. {...formItemLayout}
  127. label="金额(万元)"
  128. >
  129. <span>{commodityPrice}</span>
  130. </FormItem>
  131. <FormItem
  132. className="half-item"
  133. {...formItemLayout}
  134. label="主要项目"
  135. >
  136. <span>{getboutique(String(main))}</span>
  137. </FormItem>
  138. {type === 5 && <FormItem
  139. className="half-item"
  140. {...formItemLayout}
  141. label="企业申报批次"
  142. >
  143. <span>
  144. {
  145. declarationBatch === 1 ? '第一批' :
  146. declarationBatch === 2 ? '第二批' :
  147. declarationBatch === 3 ? '第三批' :
  148. declarationBatch === 4 ? '第四批' : '未知'
  149. }
  150. </span>
  151. </FormItem>}
  152. <div className="clearfix">
  153. <FormItem
  154. labelCol={{ span: 4 }}
  155. wrapperCol={{ span: 16 }}
  156. label="服务说明"
  157. >
  158. <span>{taskComment}</span>
  159. </FormItem>
  160. </div>
  161. <div className="clearfix">
  162. <FormItem
  163. className="half-item"
  164. {...formItemLayout}
  165. label="专利类型"
  166. >
  167. <Select
  168. placeholder="请选择专利类型"
  169. style={{ width: "200px" }}
  170. value={this.state.patentType}
  171. onChange={(e) => {
  172. this.setState({ patentType: e });
  173. if (e !== 0 && e !== 2) {
  174. this.setState({
  175. costReduction: ''
  176. })
  177. }
  178. }}
  179. >
  180. {this.state.patentTypeList.map(function (v, k) {
  181. return (
  182. <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
  183. );
  184. })}
  185. </Select>
  186. </FormItem>
  187. </div>
  188. <div className="clearfix">
  189. <FormItem
  190. className="half-item"
  191. {...formItemLayout}
  192. label="官费"
  193. style={{ display: this.state.displayFees }}
  194. >
  195. <Radio.Group
  196. value={this.state.officialCost}
  197. onChange={(e) => {
  198. this.setState({ officialCost: e.target.value });
  199. if (e.target.value === 0) {
  200. this.setState({
  201. costReduction: ''
  202. })
  203. }
  204. }}
  205. >
  206. <Radio value={1}>含官费</Radio>
  207. <Radio value={0}>不含官费</Radio>
  208. </Radio.Group>
  209. </FormItem>
  210. </div>
  211. <div className="clearfix">
  212. <FormItem
  213. className="half-item"
  214. {...formItemLayout}
  215. label="费减"
  216. style={{ display: this.state.displayFees }}
  217. >
  218. <Radio.Group
  219. disabled={this.state.patentType !== 0 && this.state.patentType !== 2}
  220. value={this.state.costReduction}
  221. onChange={(e) => {
  222. this.setState({ costReduction: e.target.value });
  223. }}
  224. >
  225. <Radio value={1}>有费减</Radio>
  226. <Radio value={0}>无费减</Radio>
  227. </Radio.Group>
  228. </FormItem>
  229. </div>
  230. </div>
  231. <div style={{ color: '#f00', paddingLeft: '67px', paddingBottom: '10px' }}>
  232. 注意:技术员已发起二次确认,请核对本次费用情况,填写有误,将影响到成本支付情况
  233. </div>
  234. <div style={{ display: 'flex', justifyContent: "center" }}>
  235. <Button type='primary' onClick={() => {
  236. this.onChange();
  237. }}>确认核对</Button>
  238. </div>
  239. </Form>
  240. </Modal>
  241. );
  242. }
  243. }
  244. export default checkInfor;