import React, { Component, Fragment } from 'react'
import {
	Page, Validator, Notification, FormItem, BottomBtn,
	InputItem, Input, Bind, SelectItem, Button, Label, DatePickerItem, Section, Table, TextArea,Checkbox,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 {ButtonModal,ModalTest} from '@/components/Business-Library'
import {Link,withRouter} from 'react-router-dom'
import Business from '@/views/Public/Business'

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

@withRouter
@inject('UserContext')
@inject('i18n')
@observer
export default class BsptScreen extends Page {
	@observable
	formBlur = false
	
	constructor(props) {
		super(props)
        this.model = props.model
		this.bind = Bind.bind(this)
		if (!this.model.max_cur){
			this.model.bopmod_szflg='3'
		}else {
			if (this.model.max_cur=='CNY')
		    {
			   this.model.bopmod_szflg='2'
			   this.model.bopmod_acttyp='JN'
		    }else{
			  this.model.bopmod_szflg='1'
			  this.model.bopmod_acttyp='JW'
            }	 
        }			
	}
	
	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)}  extra={this.props.extra}  model={this.model} />
			<Row>
				<Col span={12}>
					<Row className="row">
						<Col span={5} offset={2}>
							{/* 3操作类型*/}
							<Label value="申报单类型" />
						</Col>
						<Col span={14}>
							<SelectItem InputProps={bind("bopmod_szflg")} code={CodeTable.szflg} />
						</Col>
					</Row>
				</Col>
			</Row>
			
			<Row>
				<Col span={12}>
					<Row className="row">
						<Col span={5} offset={2}>
							{/* 3操作类型*/}
							<Label value="款项性质" />
						</Col>
						<Col span={14}>
							<SelectItem InputProps={bind("bopmod_acttyp")} code={CodeTable.acttyp} />
						</Col>
					</Row>
				</Col>
			</Row>
			
				{/* 底部按钮 */}
        <BottomBtn _this={this} />
			</div >
		)
	}
}
