checkInfor.jsx 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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)) && this.state.officialCost === 1){
  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.officialCost === 1 ?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. <FormItem
  162. className="half-item"
  163. {...formItemLayout}
  164. label="专利类型"
  165. >
  166. <Select
  167. placeholder="请选择专利类型"
  168. style={{ width: "200px" }}
  169. value={this.state.patentType}
  170. onChange={(e) => {
  171. this.setState({ patentType: e });
  172. if(e !== 0 && e !== 2){
  173. this.setState({
  174. costReduction: ''
  175. })
  176. }
  177. }}
  178. >
  179. {this.state.patentTypeList.map(function (v,k) {
  180. return (
  181. <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
  182. );
  183. })}
  184. </Select>
  185. </FormItem>
  186. <FormItem
  187. className="half-item"
  188. {...formItemLayout}
  189. label="官费"
  190. style={{ display: this.state.displayFees }}
  191. >
  192. <Radio.Group
  193. value={this.state.officialCost}
  194. onChange={(e) => {
  195. this.setState({ officialCost: e.target.value });
  196. if(e.target.value === 0){
  197. this.setState({
  198. costReduction: ''
  199. })
  200. }
  201. }}
  202. >
  203. <Radio value={1}>含官费</Radio>
  204. <Radio value={0}>不含官费</Radio>
  205. </Radio.Group>
  206. </FormItem>
  207. <FormItem
  208. className="half-item"
  209. {...formItemLayout}
  210. label="费减"
  211. style={{ display: this.state.displayFees }}
  212. >
  213. <Radio.Group
  214. disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
  215. value={this.state.costReduction}
  216. onChange={(e) => {
  217. this.setState({ costReduction: e.target.value });
  218. }}
  219. >
  220. <Radio value={1}>有费减</Radio>
  221. <Radio value={0}>无费减</Radio>
  222. </Radio.Group>
  223. </FormItem>
  224. </div>
  225. <div style={{color:'#f00',paddingLeft: '67px',paddingBottom: '10px'}}>
  226. 注意:技术员已发起二次确认,请核对本次费用情况,填写有误,将影响到成本支付情况
  227. </div>
  228. <div style={{display:'flex',justifyContent:"center"}}>
  229. <Button type='primary' onClick={()=>{
  230. this.onChange();
  231. }}>确认核对</Button>
  232. </div>
  233. </Form>
  234. </Modal>
  235. );
  236. }
  237. }
  238. export default checkInfor;