Commit 3055db68 authored by superman's avatar superman

update

parent bad46fae
This diff is collapsed.
This diff is collapsed.
...@@ -20,7 +20,8 @@ import { ...@@ -20,7 +20,8 @@ import {
Spin Spin
} from 'antd'; } from 'antd';
import {arrayRemoveIndex, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils';
import {arrayRemoveIndex, NULL, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils';
@Form.create() @Form.create()
export default class HuikuanInfoForm extends Component { export default class HuikuanInfoForm extends Component {
...@@ -48,38 +49,63 @@ export default class HuikuanInfoForm extends Component { ...@@ -48,38 +49,63 @@ export default class HuikuanInfoForm extends Component {
render() { render() {
const {form:{getFieldProps}, product:{fundRaisedAccount}, loading} = this.props; const {form:{getFieldProps}, product:{fundRaisedAccount}, loading, isEdit} = this.props;
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Form horizontal onSubmit={this.handleSubmit.bind(this)}> <Form horizontal onSubmit={this.handleSubmit.bind(this)}>
<Form.Item label="名称" help="接收打款帐户名称" {...smallFormItemLayout} >
<Form.Item label="名称" help={isEdit && "接收打款帐户名称"} {...smallFormItemLayout} >
{
isEdit ?
<Input placeholder="名称" <Input placeholder="名称"
{...getFieldProps('fundRaisedAccount.name', { {...getFieldProps('fundRaisedAccount.name', {
initialValue: fundRaisedAccount.name initialValue: fundRaisedAccount.name
})} })}
/> />
:
fundRaisedAccount.name || NULL
}
</Form.Item> </Form.Item>
<Form.Item label="银行帐号" help="接收打款银行帐号" {...smallFormItemLayout}> <Form.Item label="银行帐号" help={isEdit && "接收打款银行帐号"} {...smallFormItemLayout}>
{
isEdit ?
<Input placeholder="银行帐号" <Input placeholder="银行帐号"
{...getFieldProps('fundRaisedAccount.number', { {...getFieldProps('fundRaisedAccount.number', {
initialValue: fundRaisedAccount.number initialValue: fundRaisedAccount.number
})} })}
/> />
:
fundRaisedAccount.number || NULL
}
</Form.Item> </Form.Item>
<Form.Item label="开户行" help="接收打款银行开户行" {...formItemLayout}> <Form.Item label="开户行" help={isEdit &&"接收打款银行开户行"} {...formItemLayout}>
{
isEdit ?
<Input placeholder="开户行" <Input placeholder="开户行"
{...getFieldProps('fundRaisedAccount.bank', { {...getFieldProps('fundRaisedAccount.bank', {
initialValue: fundRaisedAccount.bank initialValue: fundRaisedAccount.bank
})} })}
/> />
:
fundRaisedAccount.bank || NULL
}
</Form.Item> </Form.Item>
<Form.Item label="打款须知" help="接收打款的一些必要告知信息" {...formItemLayout}> <Form.Item label="打款须知" help={ isEdit && "接收打款的一些必要告知信息"} {...formItemLayout}>
{
isEdit ?
<Input type="textarea" autosize={{minRows:5, maxRows:20}} placeholder="" <Input type="textarea" autosize={{minRows:5, maxRows:20}} placeholder=""
{...getFieldProps('fundRaisedAccount.memo', { {...getFieldProps('fundRaisedAccount.memo', {
initialValue: fundRaisedAccount.memo initialValue: fundRaisedAccount.memo
})} })}
/> />
:
fundRaisedAccount.memo || NULL
}
</Form.Item> </Form.Item>
<Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}> <Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}>
<Button type="primary" htmlType="submit" loading={loading}><Icon type="save"/>保存</Button> <Button type="primary" htmlType="submit" loading={loading}><Icon type="save"/>保存</Button>
...@@ -87,7 +113,7 @@ export default class HuikuanInfoForm extends Component { ...@@ -87,7 +113,7 @@ export default class HuikuanInfoForm extends Component {
!this.props.isCreate && !this.props.isCreate &&
<Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}} <Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}}
style={{marginLeft:'1em'}}> style={{marginLeft:'1em'}}>
<Icon type="rollback" />返回 <Icon type="rollback"/>返回
</Button> </Button>
} }
</Form.Item> </Form.Item>
......
...@@ -21,7 +21,7 @@ import { ...@@ -21,7 +21,7 @@ import {
} from 'antd'; } from 'antd';
import {arrayRemoveIndex, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils'; import {arrayRemoveIndex, NULL, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils';
export function YongjingTransform(arr) { export function YongjingTransform(arr) {
...@@ -88,11 +88,11 @@ export default class ShouyiYongjingForm extends Component { ...@@ -88,11 +88,11 @@ export default class ShouyiYongjingForm extends Component {
if (/^[\d]+$/g.test(key)) { if (/^[\d]+$/g.test(key)) {
const d = formData[key]; const d = formData[key];
commissionAlg.push({ commissionAlg.push({
min:d.min, min: d.min,
max:d.max, max: d.max,
result:{ result: {
yj:d.yj, yj: d.yj,
sy:d.sy sy: d.sy
} }
}); });
} else { } else {
...@@ -112,26 +112,41 @@ export default class ShouyiYongjingForm extends Component { ...@@ -112,26 +112,41 @@ export default class ShouyiYongjingForm extends Component {
render() { render() {
const {form:{getFieldProps}, product, loading} = this.props; const {form:{getFieldProps}, product, loading, isEdit} = this.props;
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Form horizontal onSubmit={this.handleSubmit.bind(this)}> <Form horizontal onSubmit={this.handleSubmit.bind(this)}>
<Form.Item label="佣金结算方式" help="例如: 打款结佣、成立结佣" {...smallFormItemLayout}> <Form.Item label="佣金结算方式" help={isEdit && "例如: 打款结佣、成立结佣"} {...smallFormItemLayout}>
{
isEdit ?
<Input placeholder="佣金结算方式" <Input placeholder="佣金结算方式"
{...getFieldProps('settlement', { {...getFieldProps('settlement', {
initialValue: product.settlement initialValue: product.settlement
})} })}
/> />
:
product.settlement || NULL
}
</Form.Item> </Form.Item>
<Form.Item label="产品的预期收益" help="浮动或百分比" {...smallFormItemLayout}> <Form.Item label="产品的预期收益" help={isEdit && "浮动或百分比"} {...smallFormItemLayout}>
{
isEdit ?
<Input placeholder="产品的预期收益" <Input placeholder="产品的预期收益"
{...getFieldProps('productProspectiveReturn', { {...getFieldProps('productProspectiveReturn', {
initialValue: product.productProspectiveReturn initialValue: product.productProspectiveReturn
})} })}
/> />
:
product.productProspectiveReturn || NULL
}
</Form.Item> </Form.Item>
<Form.Item label="佣金算法" {...formItemLayout}> <Form.Item label="佣金算法" {...formItemLayout}>
{
isEdit ?
<div>
<Input.Group> <Input.Group>
<Col span="5" className="tac">最小投资额</Col> <Col span="5" className="tac">最小投资额</Col>
<Col span="5" className="tac">最大投资额</Col> <Col span="5" className="tac">最大投资额</Col>
...@@ -155,17 +170,44 @@ export default class ShouyiYongjingForm extends Component { ...@@ -155,17 +170,44 @@ export default class ShouyiYongjingForm extends Component {
<Input {...getFieldProps(index + '.yj', {initialValue: item.result && item.result.yj})}/> <Input {...getFieldProps(index + '.yj', {initialValue: item.result && item.result.yj})}/>
</Col> </Col>
<Col span="4"> <Col span="4">
<Icon type="cross" onClick={this.handleRemoveYongjin.bind(this, index)}/> <Icon type="cross"
onClick={this.handleRemoveYongjin.bind(this, index)}/>
</Col> </Col>
</Input.Group> </Input.Group>
</div> </div>
) )
} }
<Row style={{marginTop:15}}> </div>
<Col span="20" className="tac"> :
(
this.state.yongjing.length ?
<table>
<thead>
<tr>
<th className="tac">最小投资额</th>
<th className="tac">最大投资额</th>
<th className="tac">收益</th>
<th className="tac">佣金</th>
</tr>
</thead>
<tbody>
{
</Col> this.state.yongjing.map((item, index)=>
</Row> <tr key={item.key}>
<td>{item.min}</td>
<td>{item.max}</td>
<td>{item.result && item.result.sy}</td>
<td>{item.result && item.result.yj}</td>
</tr>
)
}
</tbody>
</table>
:
NULL
)
}
</Form.Item> </Form.Item>
<Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}> <Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}>
<Button style={{marginRight:'1em'}} <Button style={{marginRight:'1em'}}
...@@ -176,7 +218,7 @@ export default class ShouyiYongjingForm extends Component { ...@@ -176,7 +218,7 @@ export default class ShouyiYongjingForm extends Component {
!this.props.isCreate && !this.props.isCreate &&
<Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}} <Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}}
style={{marginLeft:'1em'}}> style={{marginLeft:'1em'}}>
<Icon type="rollback" />返回 <Icon type="rollback"/>返回
</Button> </Button>
} }
</Form.Item> </Form.Item>
......
...@@ -148,7 +148,7 @@ export default class AddItem extends Component { ...@@ -148,7 +148,7 @@ export default class AddItem extends Component {
<Tabs className={styles.tabs} tabPosition="left"> <Tabs className={styles.tabs} tabPosition="left">
{ tabs.map(tp=> { tabs.map(tp=>
<Tabs.TabPane tab={tp.tab} key={tp.key}> <Tabs.TabPane tab={tp.tab} key={tp.key}>
{product && <tp.children {...this.props} /> } {product && <tp.children {...this.props} isEdit={true} /> }
</Tabs.TabPane> </Tabs.TabPane>
)} )}
</Tabs> </Tabs>
......
...@@ -118,7 +118,7 @@ export default class EditItem extends Component { ...@@ -118,7 +118,7 @@ export default class EditItem extends Component {
</div> </div>
); );
const title = (product && product.itemShortTitle ? product.itemShortTitle + ' - ' : '') + '产品详情'; const title = (product && product.itemShortTitle ? product.itemShortTitle + ' - ' : '') + '产品详情' + (isEdit?' - 编辑中': '');
const header = (<MainHeader breadcrumb={['产品管理', '产品详情']} title={title} operation={operation}/>); const header = (<MainHeader breadcrumb={['产品管理', '产品详情']} title={title} operation={operation}/>);
......
...@@ -28,7 +28,8 @@ import { ...@@ -28,7 +28,8 @@ import {
formItemLayout, formItemLayout,
smallFormItemLayout, smallFormItemLayout,
footerFormSubmitLayout, footerFormSubmitLayout,
remittanceAuditStatusToString remittanceAuditStatusToString,
leftRightFormItemLayout
} from '../../utils'; } from '../../utils';
@connect(state=>({ @connect(state=>({
...@@ -119,7 +120,7 @@ export default class PassItem extends Component { ...@@ -119,7 +120,7 @@ export default class PassItem extends Component {
const header = (<MainHeader breadcrumb={['审核管理', '报单审核','审核详情']} title={title} operation={operation}/>); const header = (<MainHeader breadcrumb={['审核管理', '报单审核','审核详情']} title={title} operation={operation}/>);
const filayout = {...formItemLayout, labelCol: {span: 6}};
const imgProps = (src)=>({ const imgProps = (src)=>({
src: src + '!t', src: src + '!t',
...@@ -142,60 +143,60 @@ export default class PassItem extends Component { ...@@ -142,60 +143,60 @@ export default class PassItem extends Component {
<Form className="main-form" horizontal> <Form className="main-form" horizontal>
<Row style={{padding:'0 20px'}}> <Row style={{padding:'0 20px'}}>
<Col span="12"> <Col span="12">
<Form.Item label="报单时间" {...filayout}> <Form.Item label="报单时间" {...leftRightFormItemLayout}>
{audit.dateCreated && formatDateTime(audit.dateCreated) || '错误的时间'} {audit.dateCreated && formatDateTime(audit.dateCreated) || '错误的时间'}
</Form.Item> </Form.Item>
<Form.Item label="产品募集情况" {...filayout}> <Form.Item label="产品募集情况" {...leftRightFormItemLayout}>
{'已募集:' + audit.fundRaisedOver + '、募集目标:' + audit.fundRaisedTarget} {'已募集:' + audit.fundRaisedOver + '、募集目标:' + audit.fundRaisedTarget}
</Form.Item> </Form.Item>
<Form.Item label="预约姓名" {...filayout}> <Form.Item label="预约姓名" {...leftRightFormItemLayout}>
{audit.buyerName} {audit.buyerName}
</Form.Item> </Form.Item>
<Form.Item label="预约金额" {...filayout}> <Form.Item label="预约金额" {...leftRightFormItemLayout}>
{audit.reservationAmount} {audit.reservationAmount}
</Form.Item> </Form.Item>
{ {
isEdit ? isEdit ?
<Form.Item label="实际入账金额" help="实际入账金额,请核对打款凭条" {...filayout}> <Form.Item label="实际入账金额" help="实际入账金额,请核对打款凭条" {...leftRightFormItemLayout}>
<Input placeholder="实际入账金额" <Input placeholder="实际入账金额"
{...getFieldProps('remittanceAmount', { {...getFieldProps('remittanceAmount', {
initialValue: audit.remittanceAmount initialValue: audit.remittanceAmount
})} /> })} />
</Form.Item> </Form.Item>
: :
<Form.Item label="实际入账金额" {...filayout}> <Form.Item label="实际入账金额" {...leftRightFormItemLayout}>
{audit.remittanceAmount} {audit.remittanceAmount}
</Form.Item> </Form.Item>
} }
{ {
isEdit ? isEdit ?
<Form.Item label="投资人姓名" help="真实的投资人姓名,请核对身份证照片上的姓名" {...filayout}> <Form.Item label="投资人姓名" help="真实的投资人姓名,请核对身份证照片上的姓名" {...leftRightFormItemLayout}>
<Input placeholder="投资人姓名" <Input placeholder="投资人姓名"
{...getFieldProps('realName', { {...getFieldProps('realName', {
initialValue: audit.realName initialValue: audit.realName
})} /> })} />
</Form.Item> </Form.Item>
: :
<Form.Item label="投资人姓名" {...filayout}> <Form.Item label="投资人姓名" {...leftRightFormItemLayout}>
{audit.realName} {audit.realName}
</Form.Item> </Form.Item>
} }
{ {
isEdit ? isEdit ?
<Form.Item label="投资人身份证号码" help="真实的投资人身份证号码,请核对身份证照片上的号码" {...filayout}> <Form.Item label="投资人身份证号码" help="真实的投资人身份证号码,请核对身份证照片上的号码" {...leftRightFormItemLayout}>
<Input placeholder="投资人身份证号码" <Input placeholder="投资人身份证号码"
{...getFieldProps('identityCardNumber', { {...getFieldProps('identityCardNumber', {
initialValue: audit.identityCardNumber initialValue: audit.identityCardNumber
})} /> })} />
</Form.Item> </Form.Item>
: :
<Form.Item label="投资人身份证号码" {...filayout}> <Form.Item label="投资人身份证号码" {...leftRightFormItemLayout}>
{audit.identityCardNumber} {audit.identityCardNumber}
</Form.Item> </Form.Item>
} }
{ {
isEdit && isEdit &&
<Form.Item label="拒绝理由" {...filayout}> <Form.Item label="拒绝理由" {...leftRightFormItemLayout}>
<Input placeholder="拒绝理由" <Input placeholder="拒绝理由"
{...getFieldProps('memo', { {...getFieldProps('memo', {
initialValue: audit.memo initialValue: audit.memo
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// return key + '=' + query[key]; // return key + '=' + query[key];
// }).join('&'); // }).join('&');
export const NULL = '_____?_____';
export function serialize(obj, prefix) { export function serialize(obj, prefix) {
var str = []; var str = [];
...@@ -139,6 +140,10 @@ export const formItemLayout = { ...@@ -139,6 +140,10 @@ export const formItemLayout = {
labelCol: {span: 4}, labelCol: {span: 4},
wrapperCol: {span: 16}, wrapperCol: {span: 16},
}; };
export const leftRightFormItemLayout = {
labelCol: {span: 6},
wrapperCol: {span: 16}
};
export const smallFormItemLayout = { export const smallFormItemLayout = {
labelCol: {span: 4}, labelCol: {span: 4},
......
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