<template>
    <div class="eContainer">
        <c-page title="国内保函通知闭卷">
            <el-form :model="model" :rules="rules" :validate-on-rule-change="false" label-position="right"
                     label-width="120px" ref="modelForm" size="small">
                <c-tabs @tab-click="tabClick" ref="elment" type="card" v-model="tabVal">
                    <!--PD000026 -->
                    <el-tab-pane label="业务信息" name="ovwp">
                        <c-content>
                            <m-ovwp :codes="codes" :model="model"/>
                        </c-content>
                    </el-tab-pane>

                    <!--PD000001 -->
                    <!--                    <el-tab-pane label="统一授信" name="limitbody">-->
                    <!--                        <c-content>-->
                    <!--                            <m-limitbody :model="model" :codes="codes"/>-->
                    <!--                        </c-content>-->
                    <!--                    </el-tab-pane>-->

                    <!--PD000027 -->
                    <el-tab-pane label="表外记账" name="engp">
                        <c-content>
                            <!-- 表外记账 -->
                            <m-engp :codes="codes" :model="model"/>
                        </c-content>
                    </el-tab-pane>

                    <!--PD000027 -->
                    <el-tab-pane label="费用/账务" name="setpan">
                        <c-content>
                            <m-setmod :codes="codes" :model="model"/>
                        </c-content>
                    </el-tab-pane>

                    <!--PD000529 -->
                    <el-tab-pane label="报文/面函" name="docpan">
                        <c-content>
                            <m-docpan :codes="codes" :model="model"/>
                        </c-content>
                    </el-tab-pane>

                </c-tabs>
            </el-form>
            <!-- 底部按钮 -->
            <c-function-btn :handleCheck="handleCheck" :handleStash="handleStash" :handleSubmit="handleSubmit"
                            @handleSureWarning="handleSureWarning" ref="commonBtn"></c-function-btn>
        </c-page>
    </div>
</template>
<script>
    import event from "../event";
    import operationFunc from "../../../../mixin/operationFunc";
    import commonDepend from "../../../../mixin/commonDepend";
    import Netcan from "../model";
    import Check from "../model/check";
    import Default from "../model/default";
    import buildFn from "../event/buildCommons.js";
    import Canp from "./Canp";
    import CodeTable from "../../../../config/CodeTable";
    import Ovwp from "./Ovwp";

    import Engp from "~/components/business/engp/views";
    import Setmod from "~/components/business/setmod/views";
    import Glentry from "~/components/business/glentry/views";
    import Docpan from "~/components/business/docpan/views";
    import Limitbody from "~/components/business/limitbody/views";

    export default {
        name: "Getcan",
        components: {
            "m-canp": Canp,
            "m-engp": Engp,
            "m-ovwp": Ovwp,
            "m-setmod": Setmod,
            "m-glentry": Glentry,
            "m-docpan": Docpan,
            "m-limitbody": Limitbody
        },
        provide() {
            return {
                root: this,
                activeNames: ["ovwp"]
            };
        },
        mixins: [operationFunc, event, commonDepend, Check, Default, buildFn], // 里面包含了Default、Check等的公共处理
        data() {
            return {
                tabVal: "ovwp",
                trnName: "netcan",
                model: new Netcan().data,
                codes: {
                    ...CodeTable
                },
                lang: "CN"
            };
        },
        methods: {},
        watch: {
            'model.nidgrp.rec.purcan': function () {
                this.$nextTick(() => {
                    this.$refs['modelForm'].validateField(['newref']);
                })
            }
        },
        created: async function () {
            console.log("进入netcan交易");
            let params = {
                transName: this.trnName,
                nidgrp: {
                    rec: {
                        inr: this.$route.query.inr
                    }
                }
            };
            this.init(params);
        }
    };
</script>
<style>
</style>