checkInfor.jsx 9.8 KB

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