|
@@ -9,6 +9,8 @@ import moment from 'moment';
|
|
|
import '../../userMangagement.less';
|
|
|
import {paymentState ,orderChannel,orderState} from '../../../../dataDic.js';
|
|
|
import {getProjectState,getOrderChannel,getOrderType,getOrderState,getPaymentState,getApprovedState} from '../../../../tools.js';
|
|
|
+import {setUserContactsList} from '../../../publicMenu.js'
|
|
|
+
|
|
|
|
|
|
const MySettlement=Form.create()(React.createClass({
|
|
|
loadData(pageNo,depart) {
|
|
@@ -205,10 +207,10 @@ const MySettlement=Form.create()(React.createClass({
|
|
|
key: 'zhifu',
|
|
|
render:(text,record)=>{
|
|
|
return <div>
|
|
|
- <Button onClick={(e) =>{ e.stopPropagation(),this.paymentMoney(record)}} type="dashed">支付</Button>
|
|
|
- <Button style={{marginLeft:'5px',}} onClick={(e) =>{ e.stopPropagation(),this.confirmDelet(record)}} type="primary">转交</Button>
|
|
|
+ {record.liquidationStatus<2&&<Button onClick={(e) =>{ e.stopPropagation(),this.paymentMoney(record)}} type="dashed">支付</Button>}
|
|
|
+ <Button style={{margin:'0 5px'}} onClick={(e) =>{ e.stopPropagation(),this.confirmDelet(record)}} type="primary">转交</Button>
|
|
|
+ {record.liquidationStatus==4&&<Button onClick={(e) =>{ e.stopPropagation(),this.refundMoney(record)}} type="danger">退款</Button>}
|
|
|
</div>
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
],
|
|
@@ -250,12 +252,22 @@ const MySettlement=Form.create()(React.createClass({
|
|
|
};
|
|
|
},
|
|
|
//测试用支付
|
|
|
- //支付
|
|
|
+ //支付
|
|
|
paymentMoney(record){
|
|
|
this.setState({
|
|
|
kid:record.orderNo,
|
|
|
payment:'',
|
|
|
- paymentVisible:true
|
|
|
+ paymentVisible:true,
|
|
|
+ paymentMoneyState:true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //退款
|
|
|
+ refundMoney(record){
|
|
|
+ this.setState({
|
|
|
+ kid:record.orderNo,
|
|
|
+ payment:'',
|
|
|
+ paymentVisible:true,
|
|
|
+ paymentMoneyState:false
|
|
|
})
|
|
|
},
|
|
|
paymentCancel(){
|
|
@@ -266,7 +278,7 @@ const MySettlement=Form.create()(React.createClass({
|
|
|
//支付保存
|
|
|
payment(){
|
|
|
if(!this.state.payment){
|
|
|
- message.warning('请输入支付金额!');
|
|
|
+ message.warning('请输入金额!');
|
|
|
return;
|
|
|
};
|
|
|
this.setState({
|
|
@@ -274,18 +286,22 @@ const MySettlement=Form.create()(React.createClass({
|
|
|
loading: true,
|
|
|
showDesc:false
|
|
|
});
|
|
|
+ let api = this.state.paymentMoneyState?'/api/admin/order/testPay':'/api/admin/order/testRefund';
|
|
|
$.ajax({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/order/testPay',
|
|
|
- data: {
|
|
|
+ url: globalConfig.context + api,
|
|
|
+ data: this.state.paymentMoneyState?{
|
|
|
orderNo:this.state.kid,
|
|
|
payAmount:this.state.payment
|
|
|
+ }:{
|
|
|
+ orderNo:this.state.kid,
|
|
|
+ refundAmount:this.state.payment
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
|
- message.success('支付成功!');
|
|
|
+ message.success(this.state.paymentMoneyState?'支付成功!':'退款成功!');
|
|
|
this.paymentCancel();
|
|
|
this.loadData(this.state.pageNo);
|
|
|
this.setState({
|
|
@@ -545,7 +561,7 @@ const MySettlement=Form.create()(React.createClass({
|
|
|
<Modal maskClosable={false} visible={this.state.paymentVisible}
|
|
|
onOk={this.paymentCancel} onCancel={this.paymentCancel}
|
|
|
width='600px'
|
|
|
- title='支付详情'
|
|
|
+ title= {this.state.paymentMoneyState?'支付详情':'退款详情'}
|
|
|
footer=''
|
|
|
className="admin-desc-content">
|
|
|
<Form layout="horizontal" id="demand-form">
|
|
@@ -554,11 +570,11 @@ const MySettlement=Form.create()(React.createClass({
|
|
|
<Form.Item className="half-middle"
|
|
|
labelCol={{ span: 8 }}
|
|
|
wrapperCol={{ span: 14 }}
|
|
|
- label="支付金额(万元)" >
|
|
|
+ label={this.state.paymentMoneyState?"支付金额(万元)":'退款金额'} >
|
|
|
<Input value={this.state.payment} onChange={(e)=>{this.setState({payment:e.target.value})}} style={{width:'150px'}} />
|
|
|
<span className="mandatory">*</span>
|
|
|
</Form.Item>
|
|
|
- <Button type="primary" onClick={this.payment} style={{marginRight:'20px',marginLeft:'210px'}}>支付</Button>
|
|
|
+ <Button type="primary" onClick={this.payment} style={{marginRight:'20px',marginLeft:'210px'}}>{this.state.paymentMoneyState?'支付':'退款'}</Button>
|
|
|
<Button onClick={this.paymentCancel}>取消</Button>
|
|
|
</div>
|
|
|
</Spin>
|