import React, { Component, Fragment } from 'react'
import {
	Page, Validator, Notification, FormItem,
	InputItem, Input, Bind, SelectItem, Button, Label, DatePickerItem, Section, Table, TextArea,ConfirmButton,Steps
} from '@/components/Common-Library'
import Api from '@/service/api'
import CodeTableFactory from '@/components/CodeTable'
import "./index.less"
import { inject, observer } from 'mobx-react'
import { action, observable } from 'mobx'
import { Row, Col, Popconfirm, Modal } from 'antd';
import {Link,withRouter} from 'react-router-dom'
import {PtyPicker} from '@/components/Business-Library'
import Ptspta1 from '@/views/Public/Ptspta1'
import Business from '@/views/Public/Business'

const {Pre,Next,StepWrapper} = Steps
const CodeTable = CodeTableFactory.getInstance()
const confirm = Modal.confirm

@withRouter
@inject('UserContext')
@inject('i18n')
@observer
export default class Cmt100Screen extends Page {
	@observable
	formBlur = false
		
	constructor(props) {
		super(props)
		this.model = props.model
		this.bind = Bind.bind(this)
	}
	
	async componentWillMount() {	
	}
	
	componentWillUnmount() {
	//	this.model.closeValidate()//关闭校验
	}
	
	  // 退出按钮
	onRtn = async () => {
		this.com.wrappedInstance.wrappedInstance.onRtn();
	}
	// 暂存按钮
	onPed = async () => {
		 this.com.wrappedInstance.wrappedInstance.onPed();
	}
	// 校验 按钮
	onChk = () => {
		this.com.wrappedInstance.wrappedInstance.onChk();
	}
	
	//交易内实现
	renderPage() {
		const bind = this.bind
		const { i18n } = this.props
		
		return (
			<div style={{ position: 'relative' }}>
			 <Business  wrappedComponentRef={ref => (this.com = ref)}  steps={this.props.steps}  extra={this.props.extra}  model={this.model} />
				<Row>
				  <Col span={12}>
					<Row className="row">
			            <Ptspta1 ref="rmtp" model={this.model} argArr={{desc:"接收行",prefix:'pts6',url:'cptopn/rmtp_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\rmtp\\ptslst'}}  />
                    </Row>
				  </Col>
				  <Col span={12}>
					<Row className="row">			   
			              <Ptspta1 ref="pybp" model={this.model} argArr={{desc:"收款人",prefix:'pts5',url:'cptopn/pyep_ptysel',flg:'C',datakey:'\\setmod\\msgmod\\pyep\\ptslst'}} />
			        </Row>
				  </Col>
				</Row>
				
				<Row>
				  <Col span={12}>
					<Row className="row">
			               <Ptspta1 ref="pybp" model={this.model} argArr={{desc:"收款人开户行",prefix:'pts4',url:'cptopn/pybp_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\pybp\\ptslst'}} />
                    </Row>
				  </Col>
				  <Col span={12}>
				  <Row className="row">
							<Col span={5} offset={2}>
								<Label value="收款人账号" />
							</Col>
								<Col span={13}>
								<InputItem InputProps={bind("pts5_extact")}  />
							</Col>
						</Row>
				  </Col>
				</Row>
			    <Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								{/* 汇款类型 */}
								<Label value="业务种类" />
							</Col>
							<Col span={14}>
							<SelectItem InputProps={bind("msgmod_busflg")} code={CodeTable.busflg}  desp="业务种类" path="/setmod/msgmod/busflg"/>
							</Col>
						</Row>
					</Col>
				</Row>
				
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								{/* 汇款类型 */}
									<Label value="费用承担方" />
							</Col>
							<Col span={14}>
									<SelectItem InputProps={bind("msgmod_chato")} code={CodeTable.chato}  desp="费用承担方" path="/setmod/msgmod/chato"/>
							</Col>
						</Row>
					</Col>
				</Row>
				
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								{/* 汇款类型 */}
									<Label value="汇款人账户性质" />
							</Col>
							<Col span={14}>
								<SelectItem InputProps={bind("msgmod_acctyp")} code={CodeTable.payacttyp}  desp="汇款人账户性质" path="/setmod/msgmod/acctyp"/>
							</Col>
						</Row>
					</Col>
				</Row>
				
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								{/* 汇款类型 */}
								<Label value="附言" />
							</Col>
							<Col span={14}>
									<TextArea InputProps={bind("msgmod_commet")} desp="附言" path="/setmod/msgmod/commet"/>
							</Col>
						</Row>
					</Col>
				</Row>
				<br />
				<Row type="flex" justify="center">
					<Col>
				<div className='button0'>
					
					<div className='button2'>
						{/* 退出按钮 */}
						<ConfirmButton
						
							onOK={this.onRtn}
							title=""
							message="确定退出？"
						>
							<Label i18nId="MTABUT_BT000464" />
						</ConfirmButton>
					</div>
					<div className='button2'>
						{/* 暂存按钮 */}
						<ConfirmButton
							
							onOK={this.onPed}
							title=""
							message="确定暂存？"
						>
							<Label i18nId="MTABUT_BT000398" />
						</ConfirmButton>
					</div>
					<div className='button2'>
						{/* 检核按钮 */}
						<Button  type="primary" onClick={this.onChk}>
							<Label i18nId="MTABUT_BT000180" />
						</Button>
					</div>
					
				
				</div>
								 </Col>
                </Row>
			</div >
		)
	}
}
