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


const CodeTable = CodeTableFactory.getInstance()


@inject('UserContext')
@inject('i18n')
@observer
export default class GitameScreen extends Page
{
    static childContextTypes = {
        trn: PropTypes.string,
    }
    getChildContext () {
        return {trn:'gitame'}
    }
    
    
    @observable
    formBlur=false

    constructor(props)
    {
        super(props)
        this.model = props.model    
        this.bind = Bind.bind(this)
    }
	
	
    //交易内实现
    renderPage(){
    	const bind = this.bind
        const {i18n} = this.props
             
        return (
        	<div style={{ position: 'relative' }}>
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Contract Reference" trn="gitame" />   
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("orcref")}  maxLength={35}  desp="Reference of Original Contract" path="/gidgrp/rec/orcref" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="企业海关十位编码" trn="gitame" /> 
                            </Col>
                            <Col span={6}>
                                <InputItem InputProps={bind("bngcod")}  maxLength={10}  desp="企业海关十位编码" path="/gidgrp/rec/bngcod" />
                            </Col>
                            <Col span={7} offset={1}>
                                <InputItem InputProps={bind("juscod")}  maxLength={10}  desp="组织机构" path="/gidgrp/rec/juscod" />
                            </Col>
                        </Row>
                    </Col>
                </Row>
                            	
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label value={this.model.gitp_laborcdat}   desp="Label for Contract Date" path="/gitp/laborcdat" />
                            </Col>
                            <Col span={14}>
                                <DatePickerItem InputProps={bind("orcdat")}  desp="Date from Original Contract" path="/gidgrp/rec/orcdat" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="组织机构" trn="gitame" /> 
                            </Col>
                            <Col span={14}>
                                <SelectItem InputProps={bind("cunqii")} code={CodeTable.cunqii}  desp="流动资金�'�款利率档次" path="/gidgrp/rec/cunqii"/>
                            </Col>
                        </Row>
                    </Col>
                </Row>
                            	
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Closing Date" trn="gitame" /> 
                            </Col>
                            <Col span={14}>
                                <DatePickerItem InputProps={bind("tenclsdat")}  desp="Tender Closing Date" path="/gidgrp/rec/tenclsdat" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="流动资金贷款利率档次" trn="gitame" />   
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("bilvvv")}   desp="利率" path="/gidgrp/rec/bilvvv" />
                            </Col>
                        </Row>
                    </Col>
                </Row>
                            	
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Object of Contract" trn="gitame" />   
                            </Col>
                            <Col span={14}>
                                <TextAreaItem InputProps={bind("blk_covgodsrv")} desp="Object of Contract" path="/gidgrp/blk/covgodsrv"/>
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Original Perc./ Rate" trn="gitame" /> 
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("orcrat")}   desp="Percentage/Rate of Original Contract" path="/gidgrp/rec/orcrat" />
                            </Col>
                        </Row>
                    </Col>
                </Row>           	
	
                        {/*    	<Label itext="利率" trn="gitame" />	
                            	<Label itext="InDirect Issuance Additional Clause" trn="gitame" />	*/}

                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Contract Amount " trn="gitame" /> 
                            </Col>
                            <Col span={6}>
                                <SelectItem InputProps={bind("orccur")}   desp="Currency of Original Contract" path="/gidgrp/rec/orccur"/>
                            </Col>
                            <Col span={7} offset={1}>
                                <InputItem InputProps={bind("orcamt")}   desp="Amount of Original Contract" path="/gidgrp/rec/orcamt" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Original Contract Place" trn="gitame" />  
                            </Col>
                            <Col span={14}>
                                <TextAreaItem InputProps={bind("blk_orcplc")} desp="Original Contract Place" path="/gidgrp/blk/orcplc"/>
                            </Col>
                        </Row>
                    </Col>
                </Row>  

                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="A/c for Adv. Paym. Guar." trn="gitame" /> 
                            </Col>
                            <Col span={6}>
                                <InputItem InputProps={bind("acc")}  maxLength={35}  desp="Account for Advance Payment" path="/gidgrp/rec/acc" />
                            </Col>
                            <Col span={7} offset={1}>
                                <Label value={this.model.gitp_labaddinf}   desp="Label for Additional Info" path="/gitp/labaddinf" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Law of Jurisdiction" trn="gitame" />  
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("jurlaw")}  maxLength={35}  desp="Law of Jurisdiction" path="/gidgrp/rec/jurlaw" />
                            </Col>
                        </Row>
                    </Col>
                </Row>              	

                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={19} offset={2}>
                                <TextAreaItem InputProps={bind("blk_addinf")} desp="Additional Info" path="/gidgrp/blk/addinf"/>
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Place of Jurisdiction" trn="gitame" />    
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("jurplc")}  maxLength={35}  desp="Place of Jurisdiction" path="/gidgrp/rec/jurplc" />
                            </Col>
                        </Row>
                    </Col>
                </Row>                  
      	
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Tender Reference" trn="gitame" /> 
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("tenref")}  maxLength={35}  desp="Tender Reference" path="/gidgrp/rec/tenref" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Tender Date" trn="gitame" />  
                            </Col>
                            <Col span={14}>
                                <DatePickerItem InputProps={bind("tendat")}  desp="Tender Date" path="/gidgrp/rec/tendat" />
                            </Col>
                        </Row>
                    </Col>
                </Row>

                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="Latest Transmiss. Date" trn="gitame" />   
                            </Col>
                            <Col span={14}>
                                <DatePickerItem InputProps={bind("trmdat")}  desp="Transmit Original Guarantee Latest on" path="/gidgrp/rec/trmdat" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={19} offset={2}>
                                <TextAreaItem InputProps={bind("ghd_remark")} desp="备注" path="/gidgrp/ghd/remark"/>
                            </Col>
                        </Row>
                    </Col>
                </Row>            	

                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="手册号码" trn="gitame" /> 
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("mannum")}  maxLength={12}  desp="手册号码" path="/gidgrp/rec/mannum" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="业务类型" trn="gitame" /> 
                            </Col>
                            <Col span={14}>
                                <SelectItem InputProps={bind("ghd_bustyp")}   desp="业务类型" path="/gidgrp/ghd/bustyp"/>
                            </Col>
                        </Row>
                    </Col>
                </Row>              
           	
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                <Label itext="仓库号" trn="gitame" />  
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("ghd_wahnum")}  maxLength={20}  desp="仓库号" path="/gidgrp/ghd/wahnum" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            
                        </Row>
                    </Col>
                </Row>  
                {/*            	<Label itext="Guarantee Text " trn="gitame" />	

                            	
                            	<Label itext="before this" trn="gitame" />	

                            	
                            	<Label itext="Amendment" trn="gitame" />	

                    
                            	<Label itext="备注 R=接受, J=拒绝, I=增额修改, D=减额修改" trn="gitame" />
                            	<Button  type="primary" icon="save"
                            		  onClick={this.onSav} desp="Save" path="/mtabut/sav">
                            		<Label   itext="提交"/>
                            	</Button>
                            	<Button  type="primary"  onClick={this.onChk} desp="Check" path="/mtabut/chk">
                            		<Label   itext="检核"/>
                            	</Button>
                            	<Button  type="primary"  onClick={this.onPed} desp="暂存" path="/mtabut/ped">
                            		<Label   itext="暂存"/>
                            	</Button>
                            	<Button  type="primary"  onClick={this.onExi} desp="Exit" path="/mtabut/exi">
                            		<Label   itext="退出"/>
                            	</Button>  */}
                {/* 底部按钮 */}
                <BottomBtn _this={this} />
		</div>
		)
	}
}
