import React, { Component, Fragment } from 'react'
import {
	Page, Validator, Notification, FormItem,
	InputItem, Input, Bind, SelectItem, Button, Label, DatePickerItem, Section, Table, TextAreaItem,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 {PtyPicker} from '@/components/Business-Library'
import {Link,withRouter} from 'react-router-dom'
import Ptspta from '@/views/Public/Ptspta'
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 Mt103Screen extends Page {
	@observable
	formBlur = false
		
	constructor(props) {
		super(props)
		this.model = props.model
		this.bind = Bind.bind(this)
	}
	
	async componentWillMount() {	
	}
	
	componentWillUnmount() {
	}
	
	  // 退出按钮
	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
		bind("pts3_namcn")
		bind("pts7_namcn")
		bind("pts1_namcn")
		bind("pts4_namcn")
		bind("pts5_namcn")
		bind("pts6_namcn")
		return (
			<div style={{ position: 'relative' }}>
				 <Business  wrappedComponentRef={ref => (this.com = ref)}  extra={this.props.extra}  model={this.model} />
				{/* 表格 */}
				<Row>
					<Col span={12}>
						<Row className="row">
				           <Ptspta ref="rmtp" model={this.model} argArr={{desc:"收款行账户行（56A）",prefix:'pts6',url:'cptopn/rmtp_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\rmtp\\ptslst'}}  />
				    	</Row>
					</Col>
					<Col span={12}>
						<Row className="row">
					<Ptspta ref="pybp" model={this.model} argArr={{desc:"收款人开户行（57A）",prefix:'pts4',url:'cptopn/pybp_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\pybp\\ptslst'}} />
					    </Row>
					</Col>
				</Row>
				
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="账号" />
							</Col>
				<Col span={13}>
								<InputItem InputProps={bind("pts6_extact")}  />
							</Col>
						</Row>
					</Col>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="账号" />
							</Col>
							<Col span={13}>
								<InputItem InputProps={bind("pts4_extact")} />
							</Col>
						</Row>
					</Col>
				</Row>
				
				<Row>
				 <Col span={12}>
						<Row className="row">
				     <Ptspta ref="orip" model={this.model} argArr={{desc:"发报行代理行（53A）",prefix:'pts3',url:'cptopn/orip_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\orip\\ptslst'}} />
					 </Row>
					 </Col>
					 <Col span={12}>
						<Row className="row">
					 <Ptspta ref="sndp" model={this.model} argArr={{desc:"收报行",prefix:'pts7',url:'cptopn/sndp_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\sndp\\ptslst'}} />
					 </Row>
					 </Col>
				</Row>
				
				<Row>
				<Col span={12}>
						<Row className="row">
				    <Ptspta ref="acsp" model={this.model} argArr={{desc:"收报行代理行（54A）",prefix:'pts1',url:'cptopn/acsp_ptysel',flg:'B',datakey:'\\setmod\\msgmod\\acsp\\ptslst'}} />
					</Row>
					</Col>
					<Col span={12}>
						<Row className="row">
					<Ptspta ref="pyep" model={this.model} argArr={{desc:"收款人（59）",prefix:'pts5',url:'cptopn/pyep_ptysel',flg:'C',datakey:'\\setmod\\msgmod\\pyep\\ptslst'}} />
					</Row>
					</Col>
				</Row>
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="收报代理行账号" />
							</Col>
							<Col span={13}>
							<InputItem InputProps={bind("pts1_extact")}  />
							</Col>
						</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 i18nId={"CPTP_LT000080"} />
							</Col>
							<Col span={6}>
								<SelectItem InputProps={bind("msgmod_curf33b")} code={CodeTable.curtxt} />
							</Col>
							<Col span={6} offset={1}> 
								<InputItem InputProps={bind("msgmod_amtf33b")} />
							</Col>
						</Row>

					</Col>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label i18nId={"CPTP_LT000082"} />
							</Col>
							<Col span={13}>
								<InputItem InputProps={bind("f36")}  />
							</Col>
						</Row>
					</Col>
				</Row>
				
					<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="费用承担方" />
							</Col>
							<Col span={13} > 
								<SelectItem InputProps={bind("msgmod_chato")} code={CodeTable.chato}  desp="费用承担方" path="/setmod/msgmod/chato"/>
							</Col>
						</Row>

					</Col>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="起息日" />
							</Col>
							<Col span={13}>
								<DatePickerItem InputProps={bind("msgmod_valdat")}  desp="起息日" path="/setmod/msgmod/valdat" />
							</Col>
						</Row>
					</Col>
				</Row>
				
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="汇款信息(70)" />
							</Col>
							<Col span={13} > 
								<TextAreaItem  rows={4} style={{resize:"none"}} InputProps={bind("msgmod_contag70")}    desp="Content of TAG 70" path="/setmod/msgmod/contag70"/>
							</Col>
						</Row>

					</Col>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="报文附言(72)" />
							</Col>
							<Col span={13}>
								<TextAreaItem  rows={4} style={{resize:"none"}} InputProps={bind("msgmod_contag72")}    desp="Content of TAG 72" path="/setmod/msgmod/contag72"/>
							</Col>
						</Row>
					</Col>
				</Row>
				{/*
				<Row>
					<Col span={12}>
						<Row className="row">
							<Col span={5} offset={2}>
								<Label value="报文附言(202)" />
							</Col>
							<Col span={13} > 
									<TextAreaItem rows={4} style={{resize:"none"}} InputProps={bind("msgmod_tag20272")} desp="202报文附言" path="/setmod/msgmod/tag20272"/>
							</Col>
						</Row>

					</Col>
				</Row>
				*/}
				<br />
				<Row type="flex" justify="center">
					<Col>
			
					
					<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>
					
				
			
					</Col>
                </Row>
			</div >
		)
	}
}
