checkInfor.jsx 9.5 KB

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