|
@@ -1,5 +1,5 @@
|
|
|
import React,{Component} from 'react';
|
|
|
-import {Button, Form, Input, message, Modal, Radio, Spin} from "antd";
|
|
|
+import {Button, Form, Input, message, Modal, Radio, Spin, InputNumber} from "antd";
|
|
|
import propType from 'prop-types';
|
|
|
import $ from "jquery";
|
|
|
|
|
@@ -34,13 +34,13 @@ class ApplyPaymentModal extends Component{
|
|
|
this.state={
|
|
|
loading: false,
|
|
|
paymentStatus: 0,
|
|
|
+ totalPrice: -1,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//申请付款
|
|
|
handleSubmit(e){
|
|
|
e.preventDefault();
|
|
|
- console.log(this.props.previewPayInfor)
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
if (err) {
|
|
|
return;
|
|
@@ -174,20 +174,26 @@ class ApplyPaymentModal extends Component{
|
|
|
</Radio.Group>
|
|
|
)}
|
|
|
</Form.Item> : <div/>}
|
|
|
- {/*<Form.Item*/}
|
|
|
- {/* {...formItemLayout}*/}
|
|
|
- {/* style={{*/}
|
|
|
- {/* display:'flex'*/}
|
|
|
- {/* }}*/}
|
|
|
- {/* label="单价(万元):"*/}
|
|
|
- {/*>*/}
|
|
|
- {/* {getFieldDecorator('unitPrice', {*/}
|
|
|
- {/* rules: [{ required: true, message: '请输入单价!' }],*/}
|
|
|
- {/* })(*/}
|
|
|
- {/* <Input style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>*/}
|
|
|
- {/* )}*/}
|
|
|
- {/*</Form.Item>*/}
|
|
|
- {/*//TODO 官费暂未确定*/}
|
|
|
+ {this.props.type !== 2 ? <Form.Item
|
|
|
+ {...formItemLayout}
|
|
|
+ style={{
|
|
|
+ display:'flex'
|
|
|
+ }}
|
|
|
+ label="单价(万元):"
|
|
|
+ >
|
|
|
+ {/*可以查看单价 正常 审计 专利买卖
|
|
|
+ 软著 专利申请 打星号 */}
|
|
|
+ {
|
|
|
+ this.props.projectType === 2 || (this.props.projectType === 1 && this.props.patentType === 0)?
|
|
|
+ '***' :
|
|
|
+ getFieldDecorator('unitPrice', {
|
|
|
+ initialValue:previewPayInfor.unitPrice,
|
|
|
+ rules: [{ required: true, message: '请输入单价!' }],
|
|
|
+ })(
|
|
|
+ <Input disabled={true} style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ </Form.Item> : <div/>}
|
|
|
{
|
|
|
this.props.type === 2 ?
|
|
|
<Form.Item
|
|
@@ -200,8 +206,9 @@ class ApplyPaymentModal extends Component{
|
|
|
<div>***</div>
|
|
|
</Form.Item> : <div/>
|
|
|
}
|
|
|
+ {/* 0正常 1专利 2软著 3审计 */}
|
|
|
{
|
|
|
- this.props.projectType !== 0?
|
|
|
+ this.props.projectType === 1 || this.props.projectType === 2?
|
|
|
<Form.Item
|
|
|
{...formItemLayout}
|
|
|
style={{
|
|
@@ -222,7 +229,15 @@ class ApplyPaymentModal extends Component{
|
|
|
initialValue: parseInt(previewPayInfor.quantity),
|
|
|
rules: [{ required: false, message: '请输入數量!' }],
|
|
|
})(
|
|
|
- <Input disabled={previewPayInfor.quantity <= 1} style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
|
|
|
+ <InputNumber min={0} onChange={(e)=>{
|
|
|
+ //软著 专利申请不需要计算,因为单价未知
|
|
|
+ if(!(this.props.projectType === 2 || (this.props.projectType === 1 && this.props.patentType === 0))){
|
|
|
+ let num = previewPayInfor.unitPrice * e;
|
|
|
+ this.setState({
|
|
|
+ totalPrice: num
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }} disabled={previewPayInfor.quantity <= 1 || this.props.projectType === 3} style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
|
|
|
)}
|
|
|
</Form.Item>
|
|
|
}
|
|
@@ -233,15 +248,29 @@ class ApplyPaymentModal extends Component{
|
|
|
}}
|
|
|
label="总价(万元):"
|
|
|
>
|
|
|
- <div>{previewPayInfor.totalAmount}</div>
|
|
|
+ <div>{this.state.totalPrice > -1 ? this.state.totalPrice : previewPayInfor.totalAmount}</div>
|
|
|
{/*{getFieldDecorator('totalPrice', {*/}
|
|
|
{/* rules: [{ required: false, message: '请输入总价!' }],*/}
|
|
|
{/*})(*/}
|
|
|
{/* <Input disabled={true} style={{ width: '200px' }} placeholder="请输入总价" type={'number'}/>*/}
|
|
|
{/*)}*/}
|
|
|
</Form.Item>
|
|
|
+ {/*<Form.Item*/}
|
|
|
+ {/* {...formItemLayout}*/}
|
|
|
+ {/* style={{*/}
|
|
|
+ {/* display:'flex'*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/* label="已付(万元):"*/}
|
|
|
+ {/*>*/}
|
|
|
+ {/* {getFieldDecorator('totalPrice', {*/}
|
|
|
+ {/* initialValue: previewPayInfor.partyAmount ? parseFloat(previewPayInfor.partyAmount) : 0,*/}
|
|
|
+ {/* rules: [{ required: false, message: '请输入已付金额!' }],*/}
|
|
|
+ {/* })(*/}
|
|
|
+ {/* <Input disabled={true} style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>*/}
|
|
|
+ {/* )}*/}
|
|
|
+ {/*</Form.Item>*/}
|
|
|
{
|
|
|
- this.props.projectType === 1 && this.props.type === 2?
|
|
|
+ this.props.projectType === 1 || this.props.projectType === 2 || this.props.type === 2?
|
|
|
<Form.Item
|
|
|
{...formItemLayout}
|
|
|
style={{
|
|
@@ -256,20 +285,6 @@ class ApplyPaymentModal extends Component{
|
|
|
<Input disabled={previewPayInfor.quantity <= 1 || this.state.paymentStatus !== 0} style={{ width: '200px' }} placeholder="请输入本次申请支付数量" type={'number'}/>
|
|
|
)}
|
|
|
</Form.Item> : <div/>}
|
|
|
- {/*<Form.Item*/}
|
|
|
- {/* {...formItemLayout}*/}
|
|
|
- {/* style={{*/}
|
|
|
- {/* display:'flex'*/}
|
|
|
- {/* }}*/}
|
|
|
- {/* label="已付(万元):"*/}
|
|
|
- {/*>*/}
|
|
|
- {/* {getFieldDecorator('totalPrice', {*/}
|
|
|
- {/* initialValue: previewPayInfor.partyAmount ? parseFloat(previewPayInfor.partyAmount) : 0,*/}
|
|
|
- {/* rules: [{ required: false, message: '请输入已付金额!' }],*/}
|
|
|
- {/* })(*/}
|
|
|
- {/* <Input disabled={true} style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>*/}
|
|
|
- {/* )}*/}
|
|
|
- {/*</Form.Item>*/}
|
|
|
<Form.Item
|
|
|
{...formItemLayout}
|
|
|
style={{
|