import React,{Component,Fragment} from 'react'
import PropTypes from 'prop-types'
import {Page,Validator,Notification,FormItem,DatePickerItem,TextAreaItem,CheckboxItem,Checkbox,
    InputItem,Input,Bind,SelectItem,Button,Label,Image,Table,Steps} from '@/components/Common-Library'
import Api from '@/service/api'
import mDetsel from '../model'
import CodeTableFactory from '@/components/CodeTable'
import "./index.less"
import { inject, observer } from 'mobx-react'
import { action, observable,runInAction } from 'mobx'
import Ovwp from './Ovwp'
import Detp from './Detp'
import { Card } from 'antd'

const CodeTable = CodeTableFactory.getInstance()
const StepItem = Steps.Item
 
@inject('UserContext')
@inject('i18n')
@observer
export default class DetselScreen extends Page
{
    @observable
    formBlur=false

		@observable
		extra = { inifrm: 'detsel', sptinr: '', bchlevelLst: [] }

    constructor(props)
    {
        super(props)
        this.model = new mDetsel()    
				this.bind = Bind.bind(this)
    }
	
		//初始化代码
		async componentWillMount() {
			//快照模式下，不必开启校验，否则，静默校验，和记录变动
			!this.loadDisplay() && this.model.openMonitor() //开启校验	
		}

    componentWillUnmount()
    {
        this.model.stopMonitor&&this.model.stopMonitor()//关闭校验
    }


    //交易内实现
    renderPage(){
			return (
				<Card title="国内证卖方" size="small" className="transTitle">
					<Steps>
						<StepItem title="信用证寄单">
							<Ovwp model={this.model} extra={this.extra} flg="0"   />
						</StepItem>
						<StepItem title="信用证闭卷">
							<Ovwp model={this.model} extra={this.extra} flg="4"   />
						</StepItem>
						<StepItem title="单据拒付">
							<Detp model={this.model} extra={this.extra} flg="1"   />
						</StepItem>
						<StepItem title="承兑通知">
							<Detp model={this.model} extra={this.extra} flg="2"   />
						</StepItem>
						<StepItem title="单据收款">
							<Detp model={this.model} extra={this.extra} flg="3"   />
						</StepItem>

            <StepItem title="信用证其他">
              <Ovwp model={this.model} extra={this.extra} flg="5"   />
            </StepItem>
						<StepItem title="单据其他">
							<Detp model={this.model} extra={this.extra} flg="6"   />
						</StepItem>
					</Steps>

          <Button style={{ position:'absolute',right:'3em',top:'4em' }}  type="primary" size="small" onClick={()=>{this.props.history.push('detopn')}}>
            <Label itext="信用证通知" />
          </Button>
          <Button style={{ position:'absolute',right:'10em',top:'4em' }}  type="primary" size="small" onClick={()=>{this.props.history.push('infded')}}>
            <Label itext="信用证查询" />
          </Button>
				</Card>
			)
	  }
}
