import React, { Component, Fragment } from 'react'
import {
    Page, Validator, Notification, FormItem,
    InputItem, Input, Bind, SelectItem, Button, Label, DatePickerItem, Section, ConfirmButton, Steps, CheckboxItem, TextAreaItem, Table, BottomBtn
} 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, Spin } from 'antd';
import { PtyPicker } from '@/components/Business-Library'
import { Link, withRouter } from 'react-router-dom'
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 BasicScreen extends Page {
    @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' }}>
                <Business  wrappedComponentRef={ref => (this.com = ref)} page={this} steps={this.props.steps} extra={this.props.extra}  model={this.model} />
                {/* 第一行 */}
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                {/* 业务编号 */}
                                <Label itext="业务编号" />
                            </Col>
                            <Col span={6}>
                                <InputItem InputProps={bind("ownref1")} maxLength={16}  disabled={true} desp="业务编号" path="/didgrp/rec/ownref" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                {/* 概要描述 */}
                                <Label itext="概要描述" />
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("nam1")} maxLength={40} disabled={true}  desp="概要描述" path="/didgrp/rec/nam" />
                            </Col>
                        </Row>
                    </Col>

                </Row>
                <Row>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                {/* 单据编号 */}
                                <Label itext="单据编号" />
                            </Col>
                            <Col span={6}>
                                <InputItem InputProps={bind("ownref")} maxLength={16}  disabled={true} desp="Own Reference BR Number" path="/bddgrp/rec/ownref" />
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Row className="row">
                            <Col span={5} offset={2}>
                                {/* 概要描述 */}
                                <Label itext="概要描述" />
                            </Col>
                            <Col span={14}>
                                <InputItem InputProps={bind("nam")} maxLength={40} disabled={true}  desp="Name of Bill Contract" path="/bddgrp/rec/nam" />
                            </Col>
                        </Row>
                    </Col>

                </Row>
                {/* 第二行 */}
                <Row>
                    <Col span={12}>
                        <Row className="row" type='flex'>
                            <Col span={5} offset={2}>
                                {/* 到单金额 */}
                                <Label itext="到单金额" />
                            </Col>
                            <Col span={6}>
                                <SelectItem InputProps={{
                                    ...bind("max_cur"), onChange: val => {
                                        this.model.max_cur = val
                                        this.model.liqtyp = ""
                                        this.model.swftyp = ""
                                    }
                                }}
                                disabled={true} code={CodeTable.curtxt} />
                            </Col>
                            <Col span={7} offset={1}>
                                {/* <InputItem InputProps={bind("max_amt")}  disabled={true}  /> */}
                                <InputItem  disabled={true} InputProps={ {...bind("max_amt"), type:"amount", cur:this.model.max_cur} } />
                            </Col>


                        </Row>

                    </Col>
                    <Col span={12}>
                        <Col span={5} offset={2}>
                            {/* 申请人名称 */}
                            <Label itext="申请人名称" />
                        </Col>
                        <Col span={14}>
                            <InputItem InputProps={bind("pts5_namcn")} maxLength={100} disabled={true}  desp="客户中文名称" path="/didgrp/apl/pts/namcn" />
                        </Col>


                    </Col>

                </Row>
                {/* 第三行 */}
                <Row>
                    <Col span={12}>
                        <Row className="row" type='flex'>
                            <Col span={5} offset={2}>
                                {/* 未付款金额 */}
                                <Label itext="未付款金额" />
                            </Col>
                            <Col span={6}>
                                <SelectItem InputProps={{
                                    ...bind("opn1_cur"), onChange: val => {
                                        this.model.opn1_cur = val
                                        this.model.liqtyp = ""
                                        this.model.swftyp = ""
                                    }
                                }}
                                disabled={true}   code={CodeTable.curtxt} />
                            </Col>
                            <Col span={7} offset={1}>
                                {/* <InputItem InputProps={bind("opn1_amt")} desp="Balance"  disabled={true} path="/didgrp/cbs/opn1/amt" /> */}
                                <InputItem  disabled={true} InputProps={ {...bind("opn1_amt"), type:"amount", cur:this.model.opn1_cur} } />
                            </Col>
                        </Row>

                    </Col>
                    <Col span={12}>
                        <Col span={5} offset={2}>
                            {/* 受益人名称 */}
                            <Label itext="受益人名称" />
                        </Col>
                        <Col span={14}>
                            <InputItem InputProps={bind("pts6_namcn")} maxLength={100}  disabled={true} desp="客户中文名称" path="/didgrp/ben/pts/namcn" />
                        </Col>
                    </Col>

                </Row >
                {/* 第四行 */}
                <Row>
                    <Col span={12}>
                        <Row className="row" type='flex'>
                            <Col span={5} offset={2}>
                                {/* 到单日期 */}
                                <Label itext="到单日期" />
                            </Col>
                            <Col span={10}>
                                <DatePickerItem InputProps={bind("opndat")}  disabled={true} desp="Date of Opening" path="/bddgrp/rec/opndat" />
                            </Col>

                        </Row>

                    </Col>
                    <Col span={12}>



                        <Col span={5} offset={2}>
                            {/* 通知行名称 */}
                            <Label itext="通知行名称" />
                        </Col>
                        <Col span={14}>
                            <InputItem InputProps={bind("pts4_namcn")}  disabled={true} maxLength={100} desp="客户中文名称" path="/didgrp/adv/pts/namcn" />
                        </Col>
                    </Col>

                </Row >

                <Row>
                    <Col span={12}>
                        <Row className="row" type='flex'>
                            <Col span={5} offset={2}>
                                {/* 单据期限 */}
                                <Label itext="单据期限" />
                            </Col>
                            <Col span={10}>
                                <DatePickerItem InputProps={bind("matdat")}  disabled={true} desp="Maturity Date" path="/bddgrp/rec/matdat" />
                            </Col>
                            <Col span={7}>

                            </Col>
                        </Row>

                    </Col>
                    <Col span={12}>



                        <Col span={5} offset={2}>
                            {/* 单据类型 */}
                            <Label itext="单据类型" />
                        </Col>
                        <Col span={14}>
                            <SelectItem InputProps={bind("docflg")}  disabled={true} code={CodeTable.doc} desp="单据类型" path="/bddgrp/rec/docflg" />
                        </Col>
                    </Col>

                </Row >

                <Row>
                    <Col span={12}>
                        <Row className="row" type='flex'>
                            <Col span={5} offset={2}>
                                {/* 索引 */}
                                <Label itext="索引" trn="bdtacc" />
                            </Col>
                            <Col span={10}>
                                <InputItem InputProps={bind("inr")}  disabled={true} maxLength={8} desp="索引" path="/bddgrp/rec/inr" />
                            </Col>
                            <Col span={7}>

                            </Col>
                        </Row>

                    </Col>
                    <Col span={12}>
                        <Col span={5} offset={2}>
                            {/* 承兑到期日 */}
                            <Label itext="承兑到期日" />
                        </Col>
                        <Col span={14}>
                            <DatePickerItem InputProps={bind("accdat")}  disabled={true} desp="Acceptance Date" path="/bddgrp/rec/accdat" />
                        </Col>
                    </Col>

                </Row >

              {/* 底部按钮 */}
              <BottomBtn _this={this} />
            </div >
        )
    }
}
