|
@@ -1,6 +1,6 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
|
import pathToRegexp from 'path-to-regexp';
|
|
|
-import { Form, Input, Button, Radio, Switch } from 'antd';
|
|
|
+import { Card, Form, Input, Button, Radio, Switch } from 'antd';
|
|
|
import { connect } from 'dva';
|
|
|
import { routerRedux } from 'dva/router';
|
|
|
import {
|
|
@@ -148,147 +148,149 @@ export default class MerchantCreatePage extends PureComponent {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <Form onSubmit={this.handlePageSubmit}>
|
|
|
- <Form.Item label={fieldLabels.type} {...formItemLayout}>
|
|
|
- {getFieldDecorator('domain', {
|
|
|
- rules: [{ required: true, message: '请选择商户类型!' }],
|
|
|
- initialValue: currentItem.domain || DOMAIN_PJ,
|
|
|
- })(
|
|
|
- <Radio.Group className={styles.radio}>
|
|
|
- {
|
|
|
- domains.map(item =>
|
|
|
- (
|
|
|
- <Radio.Button
|
|
|
- key={item.value}
|
|
|
- value={item.value}
|
|
|
- >{item.title}
|
|
|
- </Radio.Button>
|
|
|
+ <Card>
|
|
|
+ <Form onSubmit={this.handlePageSubmit}>
|
|
|
+ <Form.Item label={fieldLabels.type} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('domain', {
|
|
|
+ rules: [{ required: true, message: '请选择商户类型!' }],
|
|
|
+ initialValue: currentItem.domain || DOMAIN_PJ,
|
|
|
+ })(
|
|
|
+ <Radio.Group className={styles.radio}>
|
|
|
+ {
|
|
|
+ domains.map(item =>
|
|
|
+ (
|
|
|
+ <Radio.Button
|
|
|
+ key={item.value}
|
|
|
+ value={item.value}
|
|
|
+ >{item.title}
|
|
|
+ </Radio.Button>
|
|
|
+ )
|
|
|
)
|
|
|
- )
|
|
|
- }
|
|
|
- </Radio.Group>
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
|
|
|
- {getFieldDecorator('code', {
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true, message: '请给商户编号!',
|
|
|
- }, {
|
|
|
- pattern: /^[0-9]{4,6}$/g, message: '请输入4-6位数字编号!',
|
|
|
- },
|
|
|
- ],
|
|
|
- initialValue: currentItem.code,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item hasFeedback label={fieldLabels.name} {...formItemLayout}>
|
|
|
- {getFieldDecorator('name', {
|
|
|
- rules: [{ required: true, message: '请给商户命名!' }],
|
|
|
- initialValue: currentItem.name,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item hasFeedback label={fieldLabels.contactName} {...formItemLayout}>
|
|
|
- {getFieldDecorator('contactName', {
|
|
|
- rules: [{ required: true, message: '请填写商户联系人!' }],
|
|
|
- initialValue: currentItem.contactName,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item hasFeedback label={fieldLabels.mobile} {...formItemLayout}>
|
|
|
- {getFieldDecorator('mobile', {
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true, message: '请填写联系电话!',
|
|
|
+ }
|
|
|
+ </Radio.Group>
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('code', {
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true, message: '请给商户编号!',
|
|
|
+ }, {
|
|
|
+ pattern: /^[0-9]{4,6}$/g, message: '请输入4-6位数字编号!',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ initialValue: currentItem.code,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item hasFeedback label={fieldLabels.name} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('name', {
|
|
|
+ rules: [{ required: true, message: '请给商户命名!' }],
|
|
|
+ initialValue: currentItem.name,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item hasFeedback label={fieldLabels.contactName} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('contactName', {
|
|
|
+ rules: [{ required: true, message: '请填写商户联系人!' }],
|
|
|
+ initialValue: currentItem.contactName,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item hasFeedback label={fieldLabels.mobile} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('mobile', {
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true, message: '请填写联系电话!',
|
|
|
+ }, {
|
|
|
+ pattern: /^[1][3,4,5,7,8][0-9]{9}$/g, message: '请输入11位有效手机号!',
|
|
|
+ }],
|
|
|
+ initialValue: currentItem.mobile,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item hasFeedback label={fieldLabels.depositBank} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('depositBank', {
|
|
|
+ rules: [{
|
|
|
+ required: true, message: '开户银行不能为空!',
|
|
|
+ }],
|
|
|
+ initialValue: currentItem.depositBank,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item hasFeedback label={fieldLabels.bankAccount} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('bankAccount', {
|
|
|
+ rules: [{
|
|
|
+ required: true, message: '银行账号不能为空!',
|
|
|
}, {
|
|
|
- pattern: /^[1][3,4,5,7,8][0-9]{9}$/g, message: '请输入11位有效手机号!',
|
|
|
+ pattern: /^[0-9]{1,22}$/g, message: '请输入有效的银行账户!',
|
|
|
}],
|
|
|
- initialValue: currentItem.mobile,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item hasFeedback label={fieldLabels.depositBank} {...formItemLayout}>
|
|
|
- {getFieldDecorator('depositBank', {
|
|
|
- rules: [{
|
|
|
- required: true, message: '开户银行不能为空!',
|
|
|
- }],
|
|
|
- initialValue: currentItem.depositBank,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item hasFeedback label={fieldLabels.bankAccount} {...formItemLayout}>
|
|
|
- {getFieldDecorator('bankAccount', {
|
|
|
- rules: [{
|
|
|
- required: true, message: '银行账号不能为空!',
|
|
|
- }, {
|
|
|
- pattern: /^[0-9]{1,22}$/g, message: '请输入有效的银行账户!',
|
|
|
- }],
|
|
|
- initialValue: currentItem.bankAccount,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label={fieldLabels.licenseId} {...formItemLayout}>
|
|
|
- {getFieldDecorator('licenseId', {
|
|
|
- initialValue: currentItem.licenseId,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label={fieldLabels.taxNumber} {...formItemLayout}>
|
|
|
- {getFieldDecorator('taxNumber', {
|
|
|
- initialValue: currentItem.taxNumber,
|
|
|
- })(
|
|
|
- <Input placeholder="请输入" />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label={fieldLabels.receiptType} {...formItemLayout}>
|
|
|
- {getFieldDecorator('receiptType', {
|
|
|
- initialValue: currentItem.receiptType || 'COMMON',
|
|
|
- })(
|
|
|
- <Radio.Group className={styles.radio}>
|
|
|
- {
|
|
|
- receipts.map(item =>
|
|
|
- (
|
|
|
- <Radio.Button
|
|
|
- key={item.value}
|
|
|
- value={item.value}
|
|
|
- >{item.title}
|
|
|
- </Radio.Button>
|
|
|
+ initialValue: currentItem.bankAccount,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label={fieldLabels.licenseId} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('licenseId', {
|
|
|
+ initialValue: currentItem.licenseId,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label={fieldLabels.taxNumber} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('taxNumber', {
|
|
|
+ initialValue: currentItem.taxNumber,
|
|
|
+ })(
|
|
|
+ <Input placeholder="请输入" />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label={fieldLabels.receiptType} {...formItemLayout}>
|
|
|
+ {getFieldDecorator('receiptType', {
|
|
|
+ initialValue: currentItem.receiptType || 'COMMON',
|
|
|
+ })(
|
|
|
+ <Radio.Group className={styles.radio}>
|
|
|
+ {
|
|
|
+ receipts.map(item =>
|
|
|
+ (
|
|
|
+ <Radio.Button
|
|
|
+ key={item.value}
|
|
|
+ value={item.value}
|
|
|
+ >{item.title}
|
|
|
+ </Radio.Button>
|
|
|
+ )
|
|
|
)
|
|
|
- )
|
|
|
- }
|
|
|
- </Radio.Group>
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="状态" {...formItemLayout}>
|
|
|
- {getFieldDecorator('status', {
|
|
|
- valuePropName: 'checked',
|
|
|
- initialValue: isChecked(currentItem.status),
|
|
|
- })(
|
|
|
- <Switch
|
|
|
- checkedChildren="启用"
|
|
|
- unCheckedChildren="不启用"
|
|
|
- />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
|
|
|
- <Button onClick={this.handlePageBack}>取消</Button>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- htmlType="submit"
|
|
|
- loading={submitting}
|
|
|
- style={{ marginLeft: 8 }}
|
|
|
- >提交
|
|
|
- </Button>
|
|
|
- </Form.Item>
|
|
|
- </Form>
|
|
|
+ }
|
|
|
+ </Radio.Group>
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="状态" {...formItemLayout}>
|
|
|
+ {getFieldDecorator('status', {
|
|
|
+ valuePropName: 'checked',
|
|
|
+ initialValue: isChecked(currentItem.status),
|
|
|
+ })(
|
|
|
+ <Switch
|
|
|
+ checkedChildren="启用"
|
|
|
+ unCheckedChildren="不启用"
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
|
|
|
+ <Button onClick={this.handlePageBack}>取消</Button>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ htmlType="submit"
|
|
|
+ loading={submitting}
|
|
|
+ style={{ marginLeft: 8 }}
|
|
|
+ >提交
|
|
|
+ </Button>
|
|
|
+ </Form.Item>
|
|
|
+ </Form>
|
|
|
+ </Card>
|
|
|
);
|
|
|
}
|
|
|
}
|