|
@@ -6,37 +6,6 @@ import {transactionProject,transactionChannel} from '@/dataDic.js';
|
|
|
import moment from 'moment';
|
|
|
|
|
|
const Receivable=React.createClass({
|
|
|
- loadData(record) {
|
|
|
- this.state.data = [];
|
|
|
- this.setState({
|
|
|
- loading: true
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/financial/selectOneOrderAllRefundFlow',
|
|
|
- data: {
|
|
|
- orderNo:record?record.orderNo:this.props.data.orderNo
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let thisdata = data.data;
|
|
|
- if (!thisdata.length) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- } else {
|
|
|
- this.setState({
|
|
|
- data:thisdata,
|
|
|
- });
|
|
|
- }
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
loading: false,
|
|
@@ -63,15 +32,16 @@ const Receivable=React.createClass({
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
|
+ let data = this.props.data || {};
|
|
|
$.ajax({
|
|
|
method: "post",
|
|
|
dataType: "json",
|
|
|
async:true,
|
|
|
url: globalConfig.context + this.props.api,
|
|
|
data: {
|
|
|
- orderNo: this.state.data.orderNo,
|
|
|
- payeeId:this.state.data.payeeId,
|
|
|
- payerId:this.state.data.payerId,
|
|
|
+ orderNo: data.orderNo,
|
|
|
+ payeeId:data.companyId,
|
|
|
+ payerId:data.buyerId,
|
|
|
transactionAmount: this.state.settlementAmount,
|
|
|
transactionSubject: this.state.transactionProject,
|
|
|
transactionChannel: this.state.transactionChannel,
|
|
@@ -115,9 +85,6 @@ const Receivable=React.createClass({
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
this.state.visible=nextProps.showDesc;
|
|
|
- if(nextProps.data.orderNo){
|
|
|
- this.loadData(nextProps.data);
|
|
|
- }
|
|
|
this.setState({
|
|
|
transactionProject:undefined,
|
|
|
settlementAmount:undefined,
|
|
@@ -128,7 +95,7 @@ const Receivable=React.createClass({
|
|
|
})
|
|
|
},
|
|
|
render() {
|
|
|
- const theData = this.state.data || {};
|
|
|
+ const theData = this.props.data || {};
|
|
|
const FormItem = Form.Item;
|
|
|
const formItemLayout = {
|
|
|
labelCol: { span: 8 },
|
|
@@ -146,10 +113,10 @@ const Receivable=React.createClass({
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<div className="clearfix">
|
|
|
<FormItem className="half-item" {...formItemLayout} label="付款方">
|
|
|
- <span>{theData.payerName}</span>
|
|
|
+ <span>{theData.buyerName}</span>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item" {...formItemLayout} label="收款方">
|
|
|
- <span>{theData.payeeName}</span>
|
|
|
+ <span>{theData.companyName}</span>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item" {...formItemLayout} label={<span><strong style={{color:'#f00'}}>*</strong>金额</span>}>
|
|
|
<InputNumber min={0} max={9999} placeholder="金额"
|
|
@@ -210,8 +177,8 @@ const Receivable=React.createClass({
|
|
|
}}
|
|
|
/>
|
|
|
</FormItem>
|
|
|
- <FormItem wrapperCol={{ span: 12, offset:5 }}>
|
|
|
- <Button type="primary" htmlType="submit" style={{marginRight:20}}>确认</Button>
|
|
|
+ <FormItem wrapperCol={{ span: 12, offset:4 }}>
|
|
|
+ <Button type="primary" htmlType="submit" style={{marginRight:30}}>确认</Button>
|
|
|
<Button type="default" onClick={()=>{this.onCancel()}}>取消</Button>
|
|
|
</FormItem>
|
|
|
</div>
|