//第二个


import React, { Component, Fragment } from 'react'
import {
	Page, Validator, Notification, FormItem, BottomBtn,
	InputItem, Input, Bind, SelectItem, Button, Label, DatePickerItem, Section, ConfirmButton, Steps, TextAreaItem
} from '@/components/Common-Library'
import Api from '@/service/api'
import "./index.less"
import { inject, observer } from 'mobx-react'
import { action, observable } from 'mobx'
import { Row, Col, Popconfirm, Modal ,Spin ,Table, Select} 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'
import Ptspta1 from '@/views/Public/Ptspta1'
import CodeTableFactory from '@/components/CodeTable'


const { Pre, Next, StepWrapper } = Steps
const CodeTable = CodeTableFactory.getInstance()
const confirm = Modal.confirm
   
@withRouter
@inject('UserContext')
@inject('i18n')
@observer
export default class DetpScreen extends Page {
	@observable
	formBlur = false

	constructor(props) {
		super(props)
		this.model = props.model
		this.bind = Bind.bind(this)
	}

	//交易内实现
	renderPage() {
    const bind = this.bind
    
    //将模型变量绑定到页签的bindSet对象中，才能在检核的时候被检查到变量所在页签，继而跳转到对应页签
    bind("pts11_namcn")

		const { i18n } = this.props
		const { bchlevelLst } = this.props.extra
		//const {next,pre} = this.props.steps
		if(this.props.flag==true){
			return <Spin style={{width:"100%", justifyContent:"center"}} spinning={this.props.flag} />
		}
		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}>
						<Col span={24}>
							<Row className="row">
								<Col span={5} offset={2}>
									<Label itext="索偿金额" trn="bmtrgf" />
								</Col>
								<Col span={6}>
									<SelectItem InputProps={bind("totcur")} code={CodeTable.curtxt} disabled={true} />
								</Col>
								<Col span={7} offset={1}>
									<InputItem   InputProps={ {...bind("totamt"), type:"amount", cur:this.model.totcur} } />
								</Col>
							</Row>
						</Col>
						<Col span={24}>
							<Row className="row">
								<Col span={5} offset={2}>
									<Label itext="交单行费用" trn="bmtrgf" />
								</Col>
                <Col span={6}>
									<SelectItem InputProps={bind("totcur")} code={CodeTable.curtxt} disabled={true} />
								</Col>
								<Col span={7} offset={1}>
									<InputItem   InputProps={ {...bind("prbfee"), type:"amount", cur:this.model.totcur} } />
								</Col>
								{/* <Col span={14}>
									<InputItem InputProps={bind("prbfee")}   desp="交单行费用" path="/bmdgrp/rec/prbfee" />
								</Col> */}
							</Row>
						</Col>
						<Col span={24}>
							<Row className="row">
								<Col span={5} offset={2}>
									<Label itext="快递单号" trn="bmtrgf" />
								</Col>
								<Col span={14}>
									<InputItem InputProps={bind("expmno")}  maxLength={60}  desp="快递单号" path="/bmdgrp/rec/expmno" />	
								</Col>
							</Row>
						</Col>
						<Col span={24}>
							<Row className="row">
								<Col span={5} offset={2}>
									<Label itext="议付标志" trn="bmtrgf" />
								</Col>
								<Col span={14}>
									<SelectItem InputProps={bind("negflg")} code={CodeTable.yesno}  desp="议付标志" path="/bmdgrp/rec/negflg" />
								</Col>
							</Row>
						</Col>
						<Col span={24}>
							<Row className="row">
								<Col span={24}>
									<Ptspta1 model={this.model} argArr={{ desc: "收单行", prefix: 'pts11', url: 'bmtrgf/othp_ptysel', flg: 'B', datakey: '\\bmtp\\othp\\ptslst' }} formBlur={this.formBlur}  />
								</Col>
							</Row>
						</Col>
            <Col span={24}>
              <Row className="row">
                <Col span={5} offset={2}>
                  <Label itext="远期付款指示" trn="bmtrgf" />
                </Col>
                <Col span={14}>
                  <InputItem InputProps={bind("payinf")}  maxLength={60} />
                </Col>
              </Row>
            </Col>
            <Col span={24}>
              <Row className="row">
                <Col span={5} offset={2}>
                  <Label itext="远期付款期限" trn="bmtrgf" />
                </Col>
                <Col span={14}>
                  <InputItem InputProps={bind("tenmaxday")} />
                </Col>
              </Row>
            </Col>
					</Col>
					<Col span={12}>
            <Col span={24}>
              <Row className="row">
                <Col span={5} offset={2}>
                  <Label itext="单据明细" trn="bmtrgf" />
                </Col>
              </Row>
            </Col>
            <Col span={24}>
              <Row className="row"> 
                <Col span={19}  offset={2}>
                  <TextAreaItem InputProps={bind("prsdoc")} rows={6} style={{ resize: "none" }} formBlur={this.formBlur} />
                </Col>
              </Row>
            </Col>
            <Col span={24}>
							<Row className="row"> 
								<Col span={5} offset={2}>
									<Label itext="发票信息" trn="bmtrgf" />
								</Col>
							</Row>
						</Col>
            <Col span={24}>
							<Row className="row">
								<Col span={19} offset={2}>
									<TextAreaItem InputProps={bind("invdtl")} rows={6} style={{ resize: "none" }} formBlur={this.formBlur} />
								</Col>
							</Row>
						</Col>	
					</Col>
				</Row>

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