Commit 58b5bdd4 authored by superman's avatar superman

修改BUG

parent 282b4461
This diff is collapsed.
This diff is collapsed.
...@@ -146,10 +146,11 @@ export default class ContactForm extends Component { ...@@ -146,10 +146,11 @@ export default class ContactForm extends Component {
: :
this.state.staffs.length ? this.state.staffs.length ?
<table> <Form.Item>
<table className="data-grid">
<thead> <thead>
<tr> <tr>
<th>姓名</th> <th width="100">姓名</th>
<th>电话</th> <th>电话</th>
</tr> </tr>
</thead> </thead>
...@@ -164,6 +165,7 @@ export default class ContactForm extends Component { ...@@ -164,6 +165,7 @@ export default class ContactForm extends Component {
} }
</tbody> </tbody>
</table> </table>
</Form.Item>
: :
<Form.Item {...footerFormSubmitLayout}> <Form.Item {...footerFormSubmitLayout}>
还没有设置过任何一位服务经理及其联系电话 还没有设置过任何一位服务经理及其联系电话
......
...@@ -56,7 +56,7 @@ export default class DateTimeSatausForm extends Component { ...@@ -56,7 +56,7 @@ export default class DateTimeSatausForm extends Component {
data.fundRaisedStartTime = formatDateTime(formData.fundRaisedStartTime[0]); data.fundRaisedStartTime = formatDateTime(formData.fundRaisedStartTime[0]);
} }
if (formData.fundRaisedStartTime[1]) { if (formData.fundRaisedStartTime[1]) {
data.fundRaisedEndTime = formatDateTime(formData.fundRaisedStartTime[0]) data.fundRaisedEndTime = formatDateTime(formData.fundRaisedStartTime[1])
} }
if (formData.remittanceEndTime) { if (formData.remittanceEndTime) {
data.remittanceEndTime = formatDateTime(formData.remittanceEndTime); data.remittanceEndTime = formatDateTime(formData.remittanceEndTime);
...@@ -83,6 +83,7 @@ export default class DateTimeSatausForm extends Component { ...@@ -83,6 +83,7 @@ export default class DateTimeSatausForm extends Component {
const {product, loading, form:{getFieldProps}, isCreate, isEdit} = this.props; const {product, loading, form:{getFieldProps}, isCreate, isEdit} = this.props;
const { const {
fundReservationStartTime, fundReservationStartTime,
fundRaisedStartTime,
fundRaisedEndTime, fundRaisedEndTime,
remittanceEndTime, remittanceEndTime,
fundEstablishedTime, fundEstablishedTime,
...@@ -133,13 +134,13 @@ export default class DateTimeSatausForm extends Component { ...@@ -133,13 +134,13 @@ export default class DateTimeSatausForm extends Component {
<DatePicker.RangePicker showTime format="yyyy-MM-dd HH:mm:ss" <DatePicker.RangePicker showTime format="yyyy-MM-dd HH:mm:ss"
{...getFieldProps('fundRaisedStartTime', { {...getFieldProps('fundRaisedStartTime', {
initialValue: [ initialValue: [
fundReservationStartTime ? formatDateTime(fundReservationStartTime) : '', fundRaisedStartTime ? formatDateTime(fundRaisedStartTime) : '',
fundRaisedEndTime ? formatDateTime(fundRaisedEndTime) : '' fundRaisedEndTime ? formatDateTime(fundRaisedEndTime) : ''
] ]
})} })}
/> />
: :
((fundReservationStartTime ? formatDateTime(fundReservationStartTime) : NULL) ((fundRaisedStartTime ? formatDateTime(fundRaisedStartTime) : NULL)
+ ' 、' + + ' 、' +
(fundRaisedEndTime ? formatDateTime(fundRaisedEndTime) : NULL)) (fundRaisedEndTime ? formatDateTime(fundRaisedEndTime) : NULL))
......
...@@ -19,7 +19,15 @@ import { ...@@ -19,7 +19,15 @@ import {
Table, Table,
Spin Spin
} from 'antd'; } from 'antd';
import {arrayRemoveIndex, NULL, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils'; import {
arrayRemoveIndex,
NULL,
UUID,
formItemLayout,
smallFormItemLayout,
footerFormSubmitLayout,
innerHTML
} from '../../utils';
export function CreateBaseElement() { export function CreateBaseElement() {
...@@ -107,8 +115,10 @@ export default class ElementForm extends Component { ...@@ -107,8 +115,10 @@ export default class ElementForm extends Component {
} }
render() { render() {
const {form:{getFieldProps}, loading, isEdit} = this.props; const {form:{getFieldProps}, loading, isEdit} = this.props;
console.log(this.state.elements);
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Form horizontal onSubmit={this.handleSubmit.bind(this)}> <Form horizontal onSubmit={this.handleSubmit.bind(this)}>
...@@ -152,20 +162,31 @@ export default class ElementForm extends Component { ...@@ -152,20 +162,31 @@ export default class ElementForm extends Component {
</div> </div>
: :
this.state.elements.length ? this.state.elements.length ?
<table> <Form.Item>
<table className="data-grid">
<colgroup>
<col width="150px"/>
<col />
</colgroup>
<thead>
<tr>
<th>元素标题</th>
<th>元素内容</th>
</tr>
</thead>
<tbody> <tbody>
{ {
this.state.elements.map(item=> { this.state.elements.map(item=>
item.title && item.content && item.title && item.content &&
<tr> <tr key={item.key}>
<th>{item.title}</th> <th>{item.title}</th>
<td>{item.content}</td> <td {...innerHTML(item.content, true)}></td>
</tr> </tr>
}
) )
} }
</tbody> </tbody>
</table> </table>
</Form.Item>
: :
<Form.Item {...footerFormSubmitLayout}> <Form.Item {...footerFormSubmitLayout}>
还没有设置过任何基本要素 还没有设置过任何基本要素
......
...@@ -192,7 +192,7 @@ componentWillReceiveProps(nextProps) { ...@@ -192,7 +192,7 @@ componentWillReceiveProps(nextProps) {
: :
( (
this.state.yongjing.length ? this.state.yongjing.length ?
<table> <table className="data-grid tac">
<thead> <thead>
<tr> <tr>
<th className="tac">最小投资额</th> <th className="tac">最小投资额</th>
......
...@@ -47,7 +47,7 @@ export default class AddItem extends Component { ...@@ -47,7 +47,7 @@ export default class AddItem extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const {item} = nextProps; const {item} = nextProps;
if (item && item.id) { if (item && item.id) {
this.props.history.push('/announcement/' + item.id); this.props.history.replace('/announcement/' + item.id);
this.props.dispatch({ this.props.dispatch({
type: 'INIT_ANNOUNCEMENT' type: 'INIT_ANNOUNCEMENT'
}); });
......
...@@ -75,6 +75,16 @@ ...@@ -75,6 +75,16 @@
} }
} }
.ant-menu-inline .ant-menu-item,
.ant-menu-vertical .ant-menu-item{
border-right: 0;
margin-left: 0;
left: 0;
}
.ant-menu-inline .ant-menu-item-selected,
.ant-menu-inline .ant-menu-selected{
border-right: 0;
}
} }
} }
......
import React, {Component, PropTypes} from 'react'; import React, {Component, PropTypes} from 'react';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {Link} from 'react-router'; import {Link} from 'react-router';
import {Form, Input, Button, Checkbox, message, Row, Col, Spin, Icon} from 'antd'; import {Form, Input, Button, Popconfirm, Checkbox, message, Row, Col, Spin, Icon} from 'antd';
import { import {
formatDateTime, formatDateTime,
tradeStatusToString, tradeStatusToString,
...@@ -25,6 +25,12 @@ export default class Item extends Component { ...@@ -25,6 +25,12 @@ export default class Item extends Component {
}); });
}; };
handleEstablish(id) {
this.props.dispatch({
type: 'ESTABLISH_TRADE_ITEM',
id
});
}
render() { render() {
...@@ -106,8 +112,8 @@ export default class Item extends Component { ...@@ -106,8 +112,8 @@ export default class Item extends Component {
<span>{'收益 ' + item.realReturn.sy}</span> <span>{'收益 ' + item.realReturn.sy}</span>
} }
{ {
item.realReturn && item.commission && item.commission &&
<span>{'佣金 ' + item.commission}</span> <span>{'佣金 ' + item.commission + '元'}</span>
} }
</Col> </Col>
</Row> </Row>
...@@ -126,11 +132,28 @@ export default class Item extends Component { ...@@ -126,11 +132,28 @@ export default class Item extends Component {
</div> </div>
<p> <p>
{ {
(item.status == 11 || item.status == 21) && (! item.commissionId) && item.status == 11 &&
<Link to={'/trades/commission/'+ item.id}><Button>发放佣金</Button></Link> <Popconfirm title="确定这个订单要成立了吗?" onConfirm={this.handleEstablish.bind(this, item.id)}>
<Button type="primary"
style={{marginRignt:'1em'}}>
<Icon type="like"/>订单成立
</Button>
</Popconfirm>
}
{
(item.status == 11 || item.status == 21) && (!item.commissionId) &&
<Link to={'/trades/commission/'+ item.id}>
<Button type="ghost">
<Icon type="pay-circle-o"/>发放佣金
</Button>
</Link>
} }
<Link to={'/trades/contract/'+ item.id}><Button>邮寄合同</Button></Link> <Link to={'/trades/contract/'+ item.id}>
<Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}} <Button type="ghost">
<Icon type="exception"/>邮寄合同
</Button>
</Link>
<Button type="ghost" onClick={e=>{e.preventDefault(); this.props.history.goBack();}}
style={{marginLeft:'1em'}}> style={{marginLeft:'1em'}}>
<Icon type="rollback"/>返回 <Icon type="rollback"/>返回
</Button> </Button>
......
...@@ -71,7 +71,6 @@ const columns = [ ...@@ -71,7 +71,6 @@ const columns = [
<Link to={'/trades/commission/'+ record.id} onClick={e=>e.stopPropagation()}>佣金</Link> <Link to={'/trades/commission/'+ record.id} onClick={e=>e.stopPropagation()}>佣金</Link>
</span> </span>
} }
</span> </span>
) )
} }
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
} }
body { body {
.ant-modal-mask{ .ant-modal-mask {
animation-duration: 300ms !important; animation-duration: 300ms !important;
} }
.img-priview-dialog { .img-priview-dialog {
...@@ -189,4 +189,26 @@ ...@@ -189,4 +189,26 @@
} }
} }
.data-grid {
border-spacing: 0;
width:100%;
thead{
th{
background-color: #f8f8f8;
}
}
td, th {
border-bottom: 1px solid #e9e9e9;
padding: 5px 5px;
text-align: left;
vertical-align: top;
}
&.tac{
td, th{
text-align: center;
}
}
}
} }
...@@ -41,11 +41,22 @@ const trade = handleActions({ ...@@ -41,11 +41,22 @@ const trade = handleActions({
return {...state, loading: true}; return {...state, loading: true};
}, },
['SETTLEMENT_TRADE_ITEM_SUCCESS'](state, action){ ['SETTLEMENT_TRADE_ITEM_SUCCESS'](state, action){
return {...state, loading: false, item:{...state.item, ...action.item}}; return {...state, loading: false, item: {...state.item, ...action.item}};
}, },
['SETTLEMENT_TRADE_ITEM_FAILED'](state, action){ ['SETTLEMENT_TRADE_ITEM_FAILED'](state, action){
return {...state, err: action.err, loading: false}; return {...state, err: action.err, loading: false};
},
['ESTABLISH_TRADE_ITEM'](state){
return {...state, loading: true};
},
['ESTABLISH_TRADE_ITEM_SUCCESS'](state, action){
return {...state, loading: false, item: {...state.item, ...action.item}};
},
['ESTABLISH_TRADE_ITEM_FAILED'](state, action){
return {...state, err: action.err, loading: false};
} }
}, initState); }, initState);
export default trade; export default trade;
import {takeLatest} from 'redux-saga'; import {takeLatest} from 'redux-saga';
import {take, call, put, fork, cancel, select} from 'redux-saga/effects'; import {take, call, put, fork, cancel, select} from 'redux-saga/effects';
import {fetchList, fetchItem, createItem, settlementItem} from '../services/trade'; import {fetchList, fetchItem, createItem, settlementItem, establish} from '../services/trade';
import {message} from 'antd'; import {message} from 'antd';
function* getList(query) { function* getList(query) {
...@@ -102,10 +102,38 @@ function* watchSettlement() { ...@@ -102,10 +102,38 @@ function* watchSettlement() {
} }
} }
function* establishItem(id) {
try {
yield call(establish, id);
message.success('^.^ 喜大普奔,订单成立了!');
yield put({
type: 'ESTABLISH_TRADE_ITEM_SUCCESS',
item: {
status: 21
}
});
} catch (err) {
console.log(err);
message.error(err);
yield put({
type: 'ESTABLISH_TRADE_ITEM_FAILED',
err
});
}
}
function* watchEstablishItem() {
while (true) {
const {id} = yield take('ESTABLISH_TRADE_ITEM');
yield fork(establishItem, id);
}
}
export default function*() { export default function*() {
yield fork(watchTradeList); yield fork(watchTradeList);
yield fork(watchTradeItem); yield fork(watchTradeItem);
yield fork(watchAdd); yield fork(watchAdd);
yield fork(watchSettlement); yield fork(watchSettlement);
yield fork(watchEstablishItem);
} }
...@@ -2,19 +2,23 @@ import xFetch from './xFetch'; ...@@ -2,19 +2,23 @@ import xFetch from './xFetch';
import {serialize} from '../utils'; import {serialize} from '../utils';
export async function fetchList(query) { export async function fetchList(query) {
return xFetch('/api/trades' +'?' + serialize(query)); return xFetch('/api/trades' + '?' + serialize(query));
} }
export async function fetchItem(id) { export async function fetchItem(id) {
return xFetch('/api/trades/'+ id); return xFetch('/api/trades/' + id);
} }
export async function createItem(data){ export async function createItem(data) {
return xFetch('/api/trades', { return xFetch('/api/trades', {
method:'POST', method: 'POST',
body: serialize(data) body: serialize(data)
}); });
} }
export async function settlementItem(id){ export async function settlementItem(id) {
return xFetch('/api/trade/commission/settlement/'+id); return xFetch('/api/trade/commission/settlement/' + id);
}
export async function establish(id) {
return xFetch('/api/trade/success/' + id);
} }
...@@ -225,3 +225,32 @@ export function remittanceAuditStatusToString(status) { ...@@ -225,3 +225,32 @@ export function remittanceAuditStatusToString(status) {
export function mobileSecrecy(mobile){ export function mobileSecrecy(mobile){
return (mobile+'').replace(/^(\d{3})(\d{4})(\d{4})$/g, (b,c,d,e)=>(c+'****'+e)); return (mobile+'').replace(/^(\d{3})(\d{4})(\d{4})$/g, (b,c,d,e)=>(c+'****'+e));
} }
export function innerHTML(html, safe){
return {
dangerouslySetInnerHTML: {
__html: safe ? cr2br(htmlEncode(html)) :html
}
}
}
export function htmlEncode(text){
return (text+'').replace(/[\<\>\&]/gi, (m)=>{
switch(m){
case '<':
return '&lt;';
case '>':
return '&gt;';
case '&':
return '&amp;';
default:
return m;
}
});
}
export function cr2br(text){
return (text+'').replace(/\n/g, '<br/>');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment