<template>
<div class="eibs-tab">
    <!-- =================顶部====================== -->
    <c-row>
        <!--line1-->
        <c-col :span="24">
            <c-col :span="11">
                <el-form-item label="Parent Contract" prop="bpdgrp.rec.pntref" style="width: 100%">
                    <c-fullbox>
                        <c-input v-model="model.bpdgrp.rec.pntref" maxlength="16" placeholder="请输入Reference" disabled></c-input>
                        <template slot="footer">
                            <c-button style="margin: 0 10px 0 10px; padding: 0 12px" size="small" type="primary" @click="onSeainf">
                                <span style="font-family: '宋体'; font-weight: bold">i</span>
                            </c-button>
                        </template>
                    </c-fullbox>
                </el-form-item>
            </c-col>

            <c-col :span="1">
                <el-form-item label="" prop="" style="width: 100%">

                </el-form-item>
            </c-col>

            <c-col :span="12">
                <el-form-item label="Name" prop="bpdgrp.rec.pntnam" style="width: 100%">
                    <c-fullbox>
                        <c-input v-model="model.bpdgrp.rec.pntnam" maxlength="16" placeholder="" disabled></c-input>
                        <template slot="footer"> </template>
                    </c-fullbox>
                </el-form-item>
            </c-col>
        </c-col>

        <!--line2-->
        <c-col :span="24">
            <c-col :span="11">
                <el-form-item label="Finance Reference" prop="bpdgrp.rec.ownref" style="width: 100%">
                    <c-fullbox>
                        <c-input v-model="model.bpdgrp.rec.ownref" maxlength="16" placeholder="请输入Reference" disabled></c-input>
                        <template slot="footer">
                            <c-button style="margin: 0 10px 0 10px; padding: 0 12px" size="small" type="primary" @click="onSeainf">
                                <span style="font-family: '宋体'; font-weight: bold">i</span>
                            </c-button>
                        </template>
                    </c-fullbox>
                </el-form-item>

            </c-col>

            <c-col :span="1">
                <c-button size="small" type="primary" @click="onBptmodButgetref">
                    Get
                </c-button>
            </c-col>

            <c-col :span="12">
                <el-form-item label="Name" prop="bpdgrp.rec.nam" style="width: 100%">
                    <c-fullbox>
                        <c-input v-model="model.bpdgrp.rec.nam" maxlength="16" placeholder="" disabled></c-input>
                        <template slot="footer"> </template>
                    </c-fullbox>
                </el-form-item>
            </c-col>
        </c-col>

        <!--line3-->
        <c-col :span="24">
            <c-col :span="11">
                <el-form-item label="Purchase Agreement" prop="bptp.fpdgrp.rec.ownref" style="width: 100%">
                    <c-fullbox>
                        <c-input v-model="model.bptp.fpdgrp.rec.ownref" maxlength="16" placeholder="请输入Reference" disabled></c-input>
                        <template slot="footer">
                            <c-button style="margin: 0 10px 0 10px; padding: 0 12px" size="small" type="primary" @click="onSeainf">
                                <span style="font-family: '宋体'; font-weight: bold">i</span>
                            </c-button>
                        </template>
                    </c-fullbox>
                </el-form-item>
            </c-col>

            <c-col :span="1">
                <el-form-item label="" prop="" style="width: 100%">

                </el-form-item>
            </c-col>

            <c-col :span="12">
                <el-form-item label="Name" prop="bptp.fpdgrp.rec.nam" style="width: 100%">
                    <c-fullbox>
                        <c-input v-model="model.bptp.fpdgrp.rec.nam" maxlength="16" placeholder="" disabled></c-input>
                        <template slot="footer"> </template>
                    </c-fullbox>
                </el-form-item>
            </c-col>
        </c-col>
    </c-row>

    <!-- =================中部====================== -->
    <c-row>
        <!------------左部------------->
        <c-col :span="12">
            <!---line1--->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="Responsible User" prop="bptp.usr.extkey" style="width: 100%">
                        <c-fullbox>
                            <c-input v-model="model.bptp.usr.extkey" maxlength="8" placeholder="" disabled></c-input>
                            <template slot="footer">
                                <c-button style="margin: 0 10px 0 10px; padding: 0 12px" size="small" type="primary" @click="onSeainf">
                                    <span style="font-family: '宋体'; font-weight: bold">i</span>
                                </c-button>
                            </template>
                        </c-fullbox>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="Mortgage Flag" prop="bpdgrp.rec.guaflg" style="width: 100%">
                        <c-fullbox>
                            <c-select v-model="model.bpdgrp.rec.guaflg" style="width: 100%" maxlength="16" placeholder="">
                                <el-option v-for="item in codes.guaflg" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </c-select>

                            <template slot="footer"> </template>
                        </c-fullbox>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line2--->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="Finance Type" prop="bpdgrp.rec.fintyp" style="width: 100%">
                        <c-fullbox>
                            <c-select v-model="model.bpdgrp.rec.fintyp" style="width: 100%" maxlength="16" placeholder="">
                                <el-option v-for="item in codes.fintyp_bpd" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </c-select>

                            <template slot="footer"> </template>
                        </c-fullbox>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="Discount Type" prop="bptp.distyp" style="width: 100%" v-if="
                model.bpdgrp.rec.fintyp == 'D' || model.bpdgrp.rec.fintyp == 'T'
              ">
                        <c-fullbox>
                            <c-select v-model="model.bptp.distyp" style="width: 100%" maxlength="16" placeholder="">
                                <el-option v-for="item in codes.distyp" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </c-select>

                            <template slot="footer"> </template>
                        </c-fullbox>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="Purchase Type" prop="bptp.purtyp" v-if="
                model.bpdgrp.rec.fintyp == 'P' || model.bpdgrp.rec.fintyp == 'M'
              ">
                        <c-select v-model="model.bptp.purtyp" style="width: 100%" placeholder=" ">
                            <el-option v-for="item in codes.purtyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line3--->
            <c-row>
                <c-col :span="24">
                    <el-form-item label="Tenor Stream" prop="liaall.tenstm">
                        <c-input v-model="model.liaall.tenstm" placeholder="请输入Tenor Stream"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line4--->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="Financial Doc. Amt." prop="tensetcur">
                        <c-select v-model="model.tensetcur" style="width: 100%" placeholder="请选择Financial Doc. Amt.">
                            <el-option v-for="item in codes.cur" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="Amount" prop="tensetamt">
                        <c-input v-model="model.tensetamt" placeholder="Amount" maxlength="16"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line5--->
            <c-row>
                <c-col :span="24">
                    <el-form-item label="贸易合同号" prop="bpdgrp.rec.mycontno">
                        <c-input v-model="model.bpdgrp.rec.mycontno" maxlength="35" placeholder="请输入贸易合同号"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>
        </c-col>

        <!------------右部------------->
        <c-col :span="12">
            <c-col :span="24">
                <c-ptap :model="model" :argadr="{
              title: '融资客户',
              grp: 'bpdgrp',
              rol: 'fia',
            }" :disabled="true" :isAdrblk="true" @onSeainf="onSeainf" @onFiapDet="onFiapDet">
                </c-ptap>
            </c-col>
        </c-col>
    </c-row>

    <!-- =================下部====================== -->
    <c-row>
        <!-----------左侧------------->
        <c-col :span="12">
            <!---line1---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="融资金额" prop="bpdgrp.cbs.max.cur">
                        <c-select v-model="model.bpdgrp.cbs.max.cur" style="width: 100%" placeholder="请选择融资金额">
                            <el-option v-for="item in codes.cur" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="" prop="bpdgrp.cbs.max.amt">
                        <c-input v-model="model.bpdgrp.cbs.max.amt" placeholder="请输入Balance"></c-input>
                    </el-form-item>
                </c-col>

            </c-row>

            <!---line2---->
            <c-row>

                <c-col :span="12">
                    <el-form-item label="Percentage" prop="bpdgrp.rec.pctfin">
                        <c-input v-model="model.bpdgrp.rec.pctfin" placeholder="请输入Percentage"></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="计息周期" prop="bptmod.finmod.intprd">
                        <c-select v-model="model.bptmod.finmod.intprd" style="width: 100%" placeholder="请选择计息周期">
                            <el-option v-for="item in codes.intprd" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

            </c-row>

            <!---line3---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="利率调整方式" prop="bptmod.finmod.ratchgtyp">
                        <c-select v-model="model.bptmod.finmod.ratchgtyp" style="width: 100%" placeholder="请选择利率调整方式">
                            <el-option v-for="item in codes.ratchgtyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line4---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="开立日期" prop="bpdgrp.rec.opndat">
                        <c-date-picker type="date" v-model="model.bpdgrp.rec.opndat" style="width: 100%" placeholder="请选择起息日期"></c-date-picker>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="到期日" prop="bpdgrp.rec.matdat">
                        <c-date-picker type="date" v-model="model.bpdgrp.rec.matdat" style="width: 100%" placeholder="请选择到期日"></c-date-picker>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line5---->
            <c-row>
                <c-col :span="10">
                    <el-form-item label="基准利率" prop="bpdgrp.rec.intrat">
                        <c-input v-model="model.bpdgrp.rec.intrat" placeholder="请输入Base Rate"></c-input>
                    </el-form-item>
                </c-col>
                <c-col :span="2">
                    <c-button size="small" type="primary" @click="onFinmodButget">
                        Get
                    </c-button>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="是否定向收付" prop="bpdgrp.rec.flowflag">
                        <c-select v-model="model.bpdgrp.rec.flowflag" style="width: 100%" placeholder="请选择是否定向收付">
                            <el-option v-for="item in codes.flowflag" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line6---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="基准利率规则" prop="bptmod.finmod.dinmod.jzllgz">
                        <c-select v-model="model.bptmod.finmod.dinmod.jzllgz" style="width: 100%" placeholder="请选择基准利率规则">
                            <el-option v-for="item in codes.jzllgz" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line7---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="执行利率" prop="bpdgrp.rec.tolrat">
                        <c-input v-model="model.bpdgrp.rec.tolrat" placeholder="请输入Total Rate"></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="卖出执行利率" prop="bpdgrp.rec.bmhrat">
                        <c-input v-model="model.bpdgrp.rec.bmhrat" placeholder="请输入参考指标"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line8---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="第一还款账号" prop="bptmod.finmod.act1">
                        <c-select v-model="model.bptmod.finmod.act1" style="width: 100%" placeholder="请选择第一还款帐号">
                            <el-option v-for="(item, idx) in codes.codeSet['bptmod.finmod.act1']" :key="idx" :label="item.split('\t')[1]" :value="item.split('\t')[0]"></el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="税率" prop="bptmod.finmod.shuilv">
                        <c-input v-model="model.bptmod.finmod.shuilv" placeholder="请输入税率"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line9---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="预收息金额" prop="bptmod.finmod.intamt">
                        <c-input v-model="model.bptmod.finmod.intamt" placeholder="请输入预收息金额"></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="1">
                    <c-button size="small" type="primary" @click="onFinmodButcal">
                        计算
                    </c-button>
                </c-col>
            </c-row>

            <!---line10---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="预扣息方式" prop="bptmod.finmod.inttyp">
                        <c-select v-model="model.bptmod.finmod.inttyp" style="width: 100%" placeholder="请选择预扣息方式">
                            <el-option v-for="item in codes.inttyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="市场LPR期限品种" prop="bpdgrp.rec.lprtyp">
                        <c-select v-model="model.bpdgrp.rec.lprtyp" style="width: 100%" placeholder="请选择市场LPR期限品种">
                            <el-option v-for="item in codes.lprtyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line11---->
            <c-row>
                <c-col :span="10">
                    <el-form-item label="定价审批代码" prop="bptmod.finmod.dinjdm">
                        <c-input v-model="model.bptmod.finmod.dinjdm" maxlength="20" placeholder="请输入定价审批代码"></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="2">
                    <c-button size="small" type="primary" @click="onDinmodDget">
                        Get
                    </c-button>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="审批流程发起标识" prop="bptmod.finmod.dinmod.rmbsbs">
                        <c-select v-model="model.bptmod.finmod.dinmod.rmbsbs" style="width: 100%" placeholder="请选择审批流程发起标识">
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>
        </c-col>

        <!------------右侧------------->
        <c-col :span="12">
            <!---line1---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="借据编号" prop="bpdgrp.rec.fincod">
                        <c-input v-model="model.bpdgrp.rec.fincod" maxlength="17" placeholder=""></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="计息日期" prop="bptmod.finmod.intdat">
                        <c-input v-model="model.bptmod.finmod.intdat" maxlength="2" placeholder="请输入计息日期"></c-input>
                    </el-form-item>
                </c-col>

            </c-row>

            <!---line2---->
            <c-row>

                <c-col :span="12">
                    <el-form-item label="发票类型" prop="bpdgrp.rec.invtyp">
                        <c-select v-model="model.bpdgrp.rec.invtyp" style="width: 100%" placeholder="请选择发票类型">
                            <el-option v-for="item in codes.invtyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="2">
                    <el-form-item label="" prop="">
                    </el-form-item>
                </c-col>
                <c-col :span="10">
                    <c-checkbox v-model="model.bptmod.finmod.wjdkfl">是否到期主动扣收款</c-checkbox>
                </c-col>

            </c-row>

            <!---line3---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="利率调整周期" prop="bptmod.finmod.ratchgprd">
                        <c-select v-model="model.bptmod.finmod.ratchgprd" style="width: 100%" placeholder="">
                            <el-option v-for="item in codes.ratchgprd" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="月日数" prop="bptmod.finmod.ratchgdat">
                        <c-input v-model="model.bptmod.finmod.ratchgdat" maxlength="4" placeholder=""></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line4---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="融资天数" prop="bpdgrp.rec.intday">
                        <c-input v-model="model.bpdgrp.rec.intday" placeholder=""></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="宽限期" prop="bptmod.finmod.graday">
                        <c-input v-model="model.bptmod.finmod.graday" placeholder=""></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line5---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="浮动方式" prop="bptmod.finmod.flttyp">
                        <c-select v-model="model.bptmod.finmod.flttyp" style="width: 100%" placeholder="请选择浮动方式">
                            <el-option v-for="item in codes.flttyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="浮动值" prop="bptmod.finmod.fltval">
                        <c-input v-model="model.bptmod.finmod.fltval" placeholder="请输入浮动值"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line6---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="逾期计息方式" prop="bptmod.finmod.ovdinttyp">
                        <c-select v-model="model.bptmod.finmod.ovdinttyp" style="width: 100%" placeholder="请选择我行卖出执行利率">
                            <el-option v-for="item in codes.ovdinttyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="罚息比率" prop="bptmod.finmod.ovdintrat">
                        <c-input v-model="model.bptmod.finmod.ovdintrat" placeholder="请输入罚息比率"></c-input>
                    </el-form-item>
                </c-col>

            </c-row>

            <!---line7---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="第三方还款方式" prop="bptmod.finmod.acttyp">
                        <c-select v-model="model.bptmod.finmod.acttyp" style="width: 100%" placeholder="请选择第三方还款方式">
                            <el-option v-for="item in codes.acttyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="12">
                    <el-form-item label="入账机构" prop="bptmod.finmod.accbch">
                        <c-select v-model="model.bptmod.finmod.accbch" style="width: 100%" placeholder="请选择入入账机构">
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line8---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="第三方还款账号" prop="bptmod.finmod.act3">
                        <c-select v-model="model.bptmod.finmod.act3" style="width: 100%" placeholder="请选择第三方还款账号">
                        </c-select>
                    </el-form-item>
                </c-col>

            </c-row>

            <!---line9---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="预扣息账号" prop="bptmod.finmod.intact">
                        <c-select v-model="model.bptmod.finmod.intact" style="width: 100%" placeholder="请选择利息付款帐号">
                        <el-option v-for="(item, idx) in codes.codeSet['bptmod.finmod.intact']" :key="idx" :label="item.split('\t')[1]" :value="item.split('\t')[0]"></el-option>
                        
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="8">
                    <el-form-item label="交易类型" prop="bpdgrp.rec.trntyp">
                        <c-input v-model="model.bpdgrp.rec.trntyp" maxlength="6" placeholder="请输入交易类型"></c-input>
                    </el-form-item>
                </c-col>
                <c-col :span="1">
                    <c-button size="small" type="primary" icon="el-icon-search" @click="onCodselSelbut">

                    </c-button>
                </c-col>

            </c-row>

            <!---line10---->
            <c-row>
                <c-col :span="12">
                    <el-form-item label="对方账号" prop="bpdgrp.rec.oppacc">
                        <c-input v-model="model.bpdgrp.rec.oppacc" maxlength="35" placeholder="请输入对方帐号"></c-input>
                    </el-form-item>
                </c-col>
            </c-row>

            <!---line11---->
            <c-row>
                <c-col :span="12">
                    <span v-text="model.fftlxx" data-path=".fftlxx"> </span>
                </c-col>
                <c-col :span="12">
                    <el-form-item label="福费廷廷转卖类型" prop="bpdgrp.rec.ffttyp">
                        <c-select v-model="model.bpdgrp.rec.ffttyp" style="width: 100%" placeholder="请选择福费廷转卖类型">
                            <el-option v-for="item in codes.ffttyp" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </c-select>
                    </el-form-item>
                </c-col>
            </c-row>
        </c-col>
    </c-row>

</div>
</template>

<script>
import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Bptopn/Event";
import Ptap from "~/views/Public/Ptap";
import Utils from "~/utils";

export default {
    components: {
        "c-ptap": Ptap
    },
    inject: ["root"],
    props: ["model", "codes"],
    mixins: [commonProcess],
    data() {
        return {};
    },
    methods: {
        ...Event
    },
    created: function () {},
};
</script>

<style>
</style>
