<template>
    <div class="eContainer">
        <c-page title="跨境同业融资业务信息(2103)-新增">
            <el-form :model="model" :rules="rules" label-position="left" label-width="120px" ref="modelForm"
                     size="small">

                <c-tabs ref="elment" type="card" v-model="tabVal">
                    <el-tab-pane label="接口数据" name="selection">
                        <m-selection :codes="codes" :model="model"/>
                    </el-tab-pane>

                    <el-tab-pane label="跨境同业融资业务信息(2103)" name="ads2103">
                        <c-content>
                            <m-ads2103 :codes="codes" :model="model" ref="ads2103"/>
                        </c-content>
                    </el-tab-pane>
                </c-tabs>
            </el-form>
            <!-- 底部按钮 -->
            <div style="text-align: center">
                <c-button @click="saveTfb" style="margin-right: 10px" type="primary">提 交</c-button>
                <c-button @click="checkTfb" style="margin-right: 10px" type="primary">检核</c-button>
                <c-button @click="exit" style="margin-right: 10px" type="primary">退出</c-button>
            </div>
        </c-page>
    </div>
</template>
<script>
    import Tfbadd from "../model"
    import CodeTable from "~/config/CodeTable";
    import Event from "../event"
    import Check from "../model/check"
    import Ads2103 from "./ads2103"
    import init from "../../../rmbsel/event"
    import Selection from "../../tfb/views/selection"
    import {getDectyp} from "../../../../../../service/business/rmb";


    export default {
        name:"Tfbadd",
        components: {
            "m-ads2103": Ads2103,
            "m-selection": Selection,

        },
        mixins: [Event, init],
        provide() {
            return {
                root: this,
            }
        },
        computed:{
            rules(){
                    return Check.apply(this)
                }
        },
        data() {
            return {
                tabVal: "selection",
                trnName: "tfbadd",
                trnType: "",
                model: new Tfbadd().data,
                codes: {
                    ...CodeTable
                },
            }
        },
        created: async function () {
            console.log("进入tfbadd交易");
            this.model.pblmod.dectyp = getDectyp(this.trnName);
            const businessType = this.$route.query.businessType;
            if (businessType && businessType === "SPT") {
                const businessInr = this.$route.query.businessInr;
                this.initSpt(businessInr);
            }
        },

    }
</script>
<style scoped>
    /deep/ .el-form-item__label {
        padding-left: 10px;
        padding-right: 10px;
        line-height: 20px !important;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }
</style>