<template>
    <div class="eibs-tab">
        <c-row>
            <c-col :span="24">
                <!-- -------------------Left------------------- -->
                <c-col :span="12">
                    <c-col :span="24">
                        <el-form-item label="参考号" prop="dedgrp.rec.ownref">
                            <c-input
                                v-model="model.dedgrp.rec.ownref"
                                maxlength="16"
                                placeholder="请输入参考号"
                                disabled
                            ></c-input>
                        </el-form-item>
                    </c-col>

                    <c-col :span="24">
                        <c-col :span="13">
                            <el-form-item
                                label="信用证金额"
                                prop="dedgrp.cbs.nom1.cur"
                            >
                                <c-select
                                    disabled
                                    v-model="model.dedgrp.cbs.nom1.cur"
                                    style="width: 100%"
                                    placeholder="请选择Currency"
                                    @keyup.enter.native="nom1CurEvent"
                                >
                                    <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="11">
                            <el-form-item
                                style="text-align: left"
                                label-width="5px"
                                prop="dedgrp.cbs.nom1.amt"
                            >
                                <c-input-currency
                                    v-model="model.dedgrp.cbs.nom1.amt"
                                    style="text-align: left; width: 100%"
                                    placeholder="请输入信用证金额"
                                    disabled
                                ></c-input-currency>
                            </el-form-item>
                        </c-col>
                    </c-col>

                    <c-col :span="24">
                        <c-col :span="13">
                            <el-form-item
                                label="信用证余额"
                                prop="dedgrp.cbs.opn1.cur"
                            >
                                <c-select
                                    v-model="model.dedgrp.cbs.opn1.cur"
                                    placeholder="请选择币种"
                                    :code="codes.cur"
                                    style="width: 100%"
                                    disabled
                                >
                                </c-select>
                            </el-form-item>
                        </c-col>

                        <c-col :span="11">
                            <el-form-item
                                label=""
                                label-width="5px"
                                prop="dedgrp.cbs.opn1.amt"
                            >
                                <c-input-currency
                                    v-model="model.dedgrp.cbs.opn1.amt"
                                    placeholder="请输入金额"
                                    disabled
                                ></c-input-currency>
                            </el-form-item>
                        </c-col>
                    </c-col>

                    <c-col :span="24">
                        <el-form-item label="开证日期" prop="dedgrp.rec.opndat">
                            <c-date-picker
                                type="date"
                                v-model="model.dedgrp.rec.opndat"
                                placeholder="请选择开证日期"
                                style="width: 100%"
                                disabled
                            ></c-date-picker>
                        </el-form-item>

                        <!-- <c-col :span="12">
                            <el-form-item label="" prop="dedgrp.rec.shpdat">
                                <c-date-picker
                                    type="date"
                                    v-model="model.dedgrp.rec.shpdat"
                                    placeholder="请选择Shipment Date"
                                ></c-date-picker>
                            </el-form-item>
                        </c-col> -->
                    </c-col>

                    <c-col :span="24">
                        <el-form-item label="指定银行" prop="dedgrp.avbnam">
                            <c-input
                                v-model="model.dedgrp.avbnam"
                                maxlength="40"
                                placeholder="请输入指定银行"
                                disabled
                            ></c-input>
                        </el-form-item>
                    </c-col>

                    <c-col :span="24">
                        <el-form-item label="兑付方式" prop="dedgrp.rec.avbby">
                            <c-select
                                v-model="model.dedgrp.rec.avbby"
                                style="width: 100%"
                                placeholder="请选择兑付方式"
                                disabled
                            >
                            </c-select>
                        </el-form-item>
                    </c-col>

                    <c-col :span="24">
                        <el-form-item
                            label="最迟交单日期/交单地"
                            prop="dedgrp.rec.expdat"
                        >
                            <c-date-picker
                                type="date"
                                v-model="model.dedgrp.rec.expdat"
                                style="width: 100%"
                                placeholder="请选择最迟交单日期/交单地"
                                disabled
                            ></c-date-picker>
                        </el-form-item>
                    </c-col>
                    <c-col :span="24">
                        <el-form-item label="" prop="dedgrp.rec.expplc">
                            <c-input
                                type="textarea"
                                v-model="model.dedgrp.rec.expplc"
                                maxlength="35"
                                show-word-limit
                                placeholder="请输入最迟交单日期/交单地"
                                disabled
                            ></c-input>
                        </el-form-item>
                    </c-col>
                </c-col>
                <!-- -------------------Right------------------- -->

                <c-col :span="12">
                    <c-col :span="24">
                        <el-form-item label="概要" prop="dedgrp.rec.nam">
                            <c-input
                                v-model="model.dedgrp.rec.nam"
                                maxlength="40"
                                placeholder="请输入概要"
                                disabled
                            ></c-input>
                        </el-form-item>
                    </c-col>

                    <c-col :span="24">
                        <c-ptsmsg
                            :model="model"
                            :argadr="{
                                title: '申请人',
                                grp: 'bfdgrp',
                                rol: 'apl',
                            }"
                            :disabled="true"
                        ></c-ptsmsg>
                    </c-col>

                    <!-- <c-col :span="24">
                        <el-form-item label="开证行" prop="bfdgrp.iss.pts.ref">
                            <c-input
                                v-model="model.bfdgrp.iss.pts.ref"
                                maxlength="16"
                                placeholder="请输入开证行"
                            ></c-input>
                        </el-form-item>
                    </c-col>
                    <c-col :span="24">
                        <el-form-item label="" prop="bfdgrp.iss.pts.nam">
                            <c-input
                                v-model="model.bfdgrp.iss.pts.nam"
                                maxlength="40"
                                placeholder="请输入开证行"
                            ></c-input>
                        </el-form-item>
                    </c-col> -->
                    <c-ptsmsg
                        :model="model"
                        :argadr="{
                            title: '申请人',
                            grp: 'bfdgrp',
                            rol: 'iss',
                        }"
                        :disabled="true"
                    ></c-ptsmsg>

                    <c-col :span="24">
                        <c-ptsmsg
                            :model="model"
                            :argadr="{
                                title: '交单人',
                                grp: 'bfdgrp',
                                rol: 'prb',
                            }"
                            :disabled="true"
                        ></c-ptsmsg>
                    </c-col>

                    <c-col :span="24">
                        <el-form-item
                            label="信用证类型"
                            prop="dedgrp.rec.lcrtyp"
                        >
                            <c-select
                                v-model="model.dedgrp.rec.lcrtyp"
                                style="width: 100%"
                                placeholder="请选择信用证类型"
                                disabled
                            >
                            </c-select>
                        </el-form-item>
                    </c-col>
                </c-col>
            </c-col>

            <!-- -------------------Left------------------- -->
            <c-col :span="12">
                <c-col :span="24">
                    <el-form-item label="单据编号" prop="bfdgrp.rec.ownref">
                        <c-fullbox>
                            <c-input
                                v-model="model.bfdgrp.rec.ownref"
                                maxlength="16"
                                placeholder="请输入单据编号"
                                disabled
                            ></c-input>
                            <template slot="footer">
                                <c-button
                                    size="small"
                                    type="primary"
                                    @click="onBftmodButgetref"
                                >
                                    获取
                                </c-button>
                            </template>
                        </c-fullbox>
                    </el-form-item>
                </c-col>

                <c-col :span="24">
                    <el-form-item label="单据类型" prop="bfdgrp.rec.doctypcod">
                        <c-select
                            v-model="model.bfdgrp.rec.doctypcod"
                            style="width: 100%"
                            placeholder="请选择单据类型"
                            disabled
                        >
                        </c-select>
                    </el-form-item>
                </c-col>

                <c-col :span="24">
                    <c-col :span="13">
                        <el-form-item
                            label="单据金额"
                            prop="bfdgrp.cbs.max.cur"
                        >
                            <c-select
                                v-model="model.bfdgrp.cbs.max.cur"
                                style="width: 100%"
                                placeholder="请选择币种"
                                :code="codes.cur"
                                disabled
                            >
                            </c-select>
                        </el-form-item>
                    </c-col>

                    <c-col :span="11">
                        <el-form-item
                            label=""
                            label-width="5px"
                            prop="bfdgrp.cbs.max.amt"
                        >
                            <c-input-currency
                                v-model="model.bfdgrp.cbs.max.amt"
                                placeholder="请输入金额"
                            ></c-input-currency>
                        </el-form-item>
                    </c-col>
                </c-col>

                <c-col :span="24">
                    <c-col :span="13">
                        <el-form-item label="收单日期" prop="bfdgrp.rec.rcvdat">
                            <c-date-picker
                                type="date"
                                v-model="model.bfdgrp.rec.rcvdat"
                                style="width: 100%"
                                placeholder="请选择收单日期"
                            ></c-date-picker>
                        </el-form-item>
                    </c-col>

                    <c-col :span="11">
                        <el-form-item
                            label="寄单日期"
                            prop="bfdgrp.rec.orddat"
                            label-width="100px"
                        >
                            <c-date-picker
                                type="date"
                                v-model="model.bfdgrp.rec.orddat"
                                style="width: 100%"
                                placeholder="请选择寄单日期"
                            ></c-date-picker>
                        </el-form-item>
                    </c-col>
                </c-col>

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

                    <c-col :span="11">
                        <el-form-item
                            label="装船日期"
                            prop="bfdgrp.rec.shpdat"
                            label-width="100px"
                        >
                            <c-date-picker
                                type="date"
                                v-model="model.bfdgrp.rec.shpdat"
                                style="width: 100%"
                                placeholder="请选择装船日期"
                                disabled
                            ></c-date-picker>
                        </el-form-item>
                    </c-col>
                </c-col>

                <c-col :span="24">
                    <el-form-item
                        label="远期单据到期时间"
                        prop="bfdgrp.blk.matper"
                    >
                        <c-input
                            type="textarea"
                            v-model="model.bfdgrp.blk.matper"
                            maxlength="65"
                            show-word-limit
                            placeholder="请输入Maturity Period"
                            disabled
                        ></c-input>
                    </el-form-item>
                </c-col>

                <c-col :span="24">
                    <c-fullbox>
                        <el-form-item label="发票类型" prop="bfdgrp.rec.invtyp">
                            <c-select
                                v-model="model.bfdgrp.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>
                        <template slot="footer">
                            <c-checkbox
                                v-model="dscinsflg_flag"
                                style="margin-left: 10px"
                                >输入单据不符点指示</c-checkbox
                            >
                        </template>
                    </c-fullbox>
                </c-col>

                <c-col :span="24">
                    <el-form-item label="已交单次数" prop="dedgrp.rec.utlnbr">
                        <c-input
                            v-model="model.dedgrp.rec.utlnbr"
                            placeholder="请输入已交单次数"
                            disabled
                        ></c-input>
                    </el-form-item>
                </c-col>
            </c-col>

            <!-- -------------------Right------------------- -->
            <c-col :span="12">
                <c-col :span="24">
                    <el-form-item label="摘要" prop="bfdgrp.rec.nam">
                        <c-input
                            v-model="model.bfdgrp.rec.nam"
                            maxlength="40"
                            placeholder="请输入摘要"
                            disabled
                        ></c-input>
                    </el-form-item>
                </c-col>
                <c-col :span="24">
                    <el-form-item label="交单人" prop="bfdgrp.rec.docprbrol">
                        <c-select
                            v-model="model.bfdgrp.rec.docprbrol"
                            style="width: 100%"
                            placeholder="请选择交单人"
                        >
                        </c-select>
                    </el-form-item>
                </c-col>
                <c-col :span="24">
                    <el-form-item label="单据编号" prop="bfdgrp.prb.pts.ref">
                        <c-input
                            v-model="model.bfdgrp.prb.pts.ref"
                            maxlength="16"
                            placeholder="请输入单据编号"
                        ></c-input>
                    </el-form-item>
                </c-col>
                <c-col :span="24">
                    <c-ptap
                        :model="model"
                        :argadr="{
                            title: '联行行号',
                            grp: 'bfdgrp',
                            rol: 'prb',
                        }"
                        :disabled="true"
                    >
                    </c-ptap>
                </c-col>
            </c-col>

            <!-- <c-col :span="24">
                        <el-form-item label="申请人" prop="bfdgrp.apl.pts.ref">
                            <c-input
                                v-model="model.bfdgrp.apl.pts.ref"
                                maxlength="16"
                                placeholder="请输入申请人"
                            ></c-input>
                        </el-form-item>
                    </c-col>
                    <c-col :span="24">
                        <el-form-item label="" prop="bfdgrp.apl.pts.nam">
                            <c-input
                                v-model="model.bfdgrp.apl.pts.nam"
                                maxlength="40"
                                placeholder="请输入申请人"
                            ></c-input>
                        </el-form-item>
                    </c-col> -->

            <!-- <c-col :span="24">
                        <el-form-item label="交单人" prop="bfdgrp.prb.pts.ref">
                            <c-input
                                v-model="model.bfdgrp.prb.pts.ref"
                                maxlength="16"
                                placeholder="请输入交单人"
                            ></c-input>
                        </el-form-item>
                    </c-col>
                    <c-col :span="24">
                        <el-form-item label="" prop="bfdgrp.prb.pts.nam">
                            <c-input
                                v-model="model.bfdgrp.prb.pts.nam"
                                maxlength="40"
                                placeholder="请输入交单人"
                            ></c-input>
                        </el-form-item>
                    </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/Detdrv/Event";
import Ptap from "~/views/Public/Ptap";
import Ptsmsg from "~/views/Public/Ptsmsg";

export default {
    inject: ["root"],
    props: ["model", "codes"],
    mixins: [commonProcess],
    components: { "c-ptap": Ptap, "c-ptsmsg": Ptsmsg },
    data() {
        return {};
    },
    methods: { ...Event, dscinsflgChange() {} },
    computed: {
        dscinsflg_flag: {
            get: function () {
                return this.model.bfdgrp.rec.dscinsflg === "X";
            },
            set(val) {
                this.model.bfdgrp.rec.dscinsflg = val ? "X" : "";
            },
        },
    },
    created: function () {},
};
</script>
<style>
</style>
