import React, { Component } from 'react'; import { Button, Form, Input, message, Modal, Radio, Select, Spin } from "antd"; import { getboutique, } from "@/tools"; import $ from "jquery"; const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 } }; const FormItem = Form.Item; class checkInfor extends Component { constructor(props) { super(props); this.state = { loading: false, patentType: props.infor ? props.infor.patentType : '', officialCost: props.infor ? props.infor.officialCost : '', costReduction: props.infor ? props.infor.costReduction : '', patentTypeList: [], } this.onChange = this.onChange.bind(this); this.getpatentTypeList = this.getpatentTypeList.bind(this); } componentDidMount() { this.getpatentTypeList(); } onChange() { this.setState({ loading: true, }); if (this.state.patentType === null) { message.warning('请选择专利类型') return } if ((this.state.patentType === 0 || this.state.patentType === 2) && isNaN(parseInt(this.state.costReduction))) { message.warning('请选择是否有费减') return; } $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/newOrder/updateOrderTask", data: { id: this.props.infor.id, //项目ID officialCost: this.state.officialCost, //是否有官费 costReduction: (this.state.patentType === 0 || this.state.patentType === 2) ? this.state.costReduction : 0, //是否有费减 patentType: this.state.patentType, //专利类型 }, }).done( function (data) { this.setState({ loading: false, }); if (!data.error.length) { message.success("保存成功!"); this.props.onCancel(); } else { message.warning(data.error[0].message); } }.bind(this) ); } getpatentTypeList() { $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/orderProject/getPatentType', success: function (data) { if (data.error.length === 0) { this.setState({ patentTypeList: data.data }) } else { message.warning(data.error[0].message); }; }.bind(this) }); } render() { const { commodityName, commodityQuantity, officialCost, costReduction, commodityPrice, main, taskComment, ifCertificationFee,//是否包含认证费 declarationBatch,//批次 type,//项目类型 0 正常 1专利 2软著 3审计 4双软 5高新 6商标 patentType,//项目类型 patentTypeName,//项目类型名称 } = this.props.infor; return (
{commodityName} {commodityQuantity} {commodityPrice} {getboutique(String(main))} {type === 5 && { declarationBatch === 1 ? '第一批' : declarationBatch === 2 ? '第二批' : declarationBatch === 3 ? '第三批' : declarationBatch === 4 ? '第四批' : '未知' } }
{taskComment}
{ this.setState({ officialCost: e.target.value }); if (e.target.value === 0) { this.setState({ costReduction: '' }) } }} > 含官费 不含官费
{ this.setState({ costReduction: e.target.value }); }} > 有费减 无费减
注意:技术员已发起二次确认,请核对本次费用情况,填写有误,将影响到成本支付情况
); } } export default checkInfor;