<template>
  <div class="eibs">

    <!-- 第一部分,信用证概要部分-->
    <c-col :span="24" style="padding-right: 20px;" >
      <!-- ============左边================= -->
      <c-col :span="12" style="padding-right: 20px;">
        <c-col :span="24">
          <el-form-item
                  label="Reference"
                  prop="ledgrp.rec.ownref"
                  style="width: 100%"
          >
            <c-fullbox>
              <c-input
                      v-model="model.ledgrp.rec.ownref"
                      maxlength="16"
                      placeholder="请输入编号"
                      style="width: 100%"
                      disabled
              ></c-input>
            </c-fullbox>
          </el-form-item>
        </c-col>


        <!-- L/C Amount -->
        <c-col :span="24" class="custom-box-wrap">
          <c-col :span="12">
              <el-form-item label="L/C Amount" prop="ledgrp.cbs.nom1.cur">
                <c-select-cur v-model="model.ledgrp.cbs.nom1.cur"
                          style="width: 100%"
                          disabled
                          placeholder="" dbCode="curtxt" sort="SRT">
                </c-select-cur>
              </el-form-item>
          </c-col>
          <c-col :span="12">
              <el-form-item label-width="5px" prop="ledgrp.cbs.nom1.amt">
                <c-input-currency v-model="model.ledgrp.cbs.nom1.amt"
                                  disabled
                                  :currency="model.ledgrp.cbs.nom1.cur"   @keyup.enter.native="$event.target.blur()" style="width:100%" placeholder="">
                </c-input-currency>
              </el-form-item>
          </c-col>

        </c-col>

        <!-- Open Amount -->
        <c-col :span="24" >
          <c-col :span="12">
              <el-form-item label="Open Amount" prop="ledgrp.cbs.opn1.cur">
                <c-select-cur v-model="model.ledgrp.cbs.opn1.cur"
                          disabled
                          style="width: 100%" placeholder="" dbCode="curtxt" sort="SRT">
                </c-select-cur>
              </el-form-item>
          </c-col>

          <c-col :span="12">
              <el-form-item label-width="5px" prop="ledgrp.cbs.nom1.amt">
                <c-input-currency v-model="model.ledgrp.cbs.opn1.amt"
                                  disabled
                                  :currency="model.ledgrp.cbs.opn1.cur"   @keyup.enter.native="$event.target.blur()" style="width:100%" placeholder="">
                </c-input-currency>
              </el-form-item>
          </c-col>
        </c-col>

        <!-- Additional Amount, 附加金额-->
        <div  v-if="model.letp.addamtflg == 'X'">
          <c-col :span="24">
            <c-col :span="13">
              <el-form-item label="Additional Amount" prop="ledgrp.cbs.max2.cur">
                <c-select v-model="max2cur" style="width:100%" disabled>
                </c-select>
              </el-form-item>
            </c-col>
            <c-col :span="11">
              <el-form-item label="" label-width="5px" prop="ledgrp.cbs.max2.amt">
                <c-input-currency v-model="model.ledgrp.cbs.max2.amt" :currency="max2cur" placeholder=""></c-input-currency>

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

          <c-col :span="24">
            <c-col :span="13">
              <el-form-item label="Open Add. Amount" prop="ledgrp.cbs.opn2.cur">
                <c-select v-model="opn2cur" style="width:100%" placeholder="" disabled>
                </c-select>
              </el-form-item>
            </c-col>
            <c-col :span="11">
              <el-form-item label="" label-width="5px" prop="ledgrp.cbs.opn2.amt">
                <c-input-currency v-model="opn2amt" :currency="opn2cur" placeholder="" disabled></c-input-currency>
              </el-form-item>
            </c-col>
          </c-col>

          <c-col :span="24">
            <el-form-item label="Additional Amounts Covered" prop="ledgrp.blk.addamtcov">
              <c-input type="textarea"
                       v-model="getBlkAddamtcov" maxlength="140" show-word-limit
                       placeholder="" rows="4" >

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

        <!-- Available with -->
        <c-col :span="24">
          <el-form-item label="Available with" prop="ledgrp.rec.avbnam">
            <c-input
                    v-model="model.ledgrp.rec.avbnam"
                    maxlength="40"
                    placeholder="请输入可用银行"
                    disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <!-- By -->
        <c-col :span="24">
          <el-form-item label="By" prop="ledgrp.rec.avbby">
            <c-fullbox>
              <c-select
                      v-model="model.ledgrp.rec.avbby"
                      maxlength="3"
                      style="width: 100%"
                      placeholder="请输入金额"
                      disabled
                      dbCode="AVBBY0"
              ></c-select>
<!--              <template slot="footer">
                <c-checkbox
                        v-model="model.ledgrp.rec.revflg"
                        style="margin-left: 10px"
                        disabled
                >Red/Green Clause
                </c-checkbox
                >
              </template>-->
            </c-fullbox>
          </el-form-item>
        </c-col>


        <c-col :span="24">
          <c-col :span="12">
            <el-form-item class="checkbox-left" >
              <c-checkbox v-model="model.letp.addamtflg" true-label="X" false-label=""    disabled >
                Add. Amount
              </c-checkbox>
            </el-form-item>
          </c-col>

          <c-col :span="12">
            <el-form-item class="checkbox-left" >
              <c-checkbox v-model="model.ledgrp.rec.revflg" true-label="X" false-label=""    disabled>
                Revolving L/C
              </c-checkbox>
            </el-form-item>
          </c-col>

        </c-col>


      </c-col>

      <!-- ============右边================= -->
      <c-col :span="12" style="padding-left: 20px;">
<!--
        <c-col :span="24">
          <el-form-item label="Name" prop="ledgrp.rec.nam">
            <c-input
                    v-model="model.ledgrp.rec.nam"
                    maxlength="40"
                    placeholder="请输入简略信息"
                    disabled
            ></c-input>
          </el-form-item>
        </c-col>
-->

        <!-- Form of L/C -->
        <c-col :span="24">
          <el-form-item
                  label="Form of L/C"
                  prop="ledgrp.rec.lcrtyp"
                  style="width: 100%"
          >
            <c-select
                    v-model="model.ledgrp.rec.lcrtyp"
                    style="width: 100%"
                    placeholder="请选择种类"
                    disabled
                    :filterKey="['I','IT']" dbCode="LCRTYP"
            >
              <!--              <el-option
                                    v-for="item in codes.lcrtyp1"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                            >
                            </el-option>-->
            </c-select>
          </el-form-item>
        </c-col>

        <!-- Date Issued -->
          <c-col :span="24">
            <el-form-item label="Date Issued" prop="ledgrp.rec.opndat">
              <c-date-picker
                      type="date"
                      v-model="model.ledgrp.rec.opndat"
                      style="width: 100%"
                      placeholder="请选择日期"
                      disabled
              ></c-date-picker>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="Shipment Date" prop="ledgrp.rec.shpdat">
              <c-date-picker
                      type="date"
                      v-model="model.ledgrp.rec.shpdat"
                      style="width: 100%"
                      placeholder="请选择日期"
                      disabled
              ></c-date-picker>
            </el-form-item>
          </c-col>

          <!-- expiring on -->
          <c-col :span="24">
            <el-form-item label="Expiring on" prop="ledgrp.rec.expdat">
              <c-date-picker
                      type="date"
                      v-model="model.ledgrp.rec.expdat"
                      style="width: 100%;min-width: 130px"
                      value-format="yyyy-MM-dd"
                      placeholder=""
                      disabled
              >
              </c-date-picker>
            </el-form-item>
          </c-col>

          <!-- in (place)/counters of -->
          <c-col :span="24">
            <el-form-item label="in (Place)/ counters of" prop="ledgrp.rec.expplc">
              <c-input
                      v-model="model.ledgrp.rec.expplc"
                      maxlength="29"
                      placeholder=""
                      disabled
              ></c-input>
            </el-form-item>
          </c-col>

        <!-- confirmation -->
        <c-col :span="24">
          <el-form-item label="Confirmation text" prop="letp.cnftxt">
            <c-input
                    v-model="cnftxt"
                    maxlength="40"
                    placeholder="请输入"
                    disabled
            ></c-input>
          </el-form-item>
        </c-col>

        </c-col>


    </c-col>
    <!-- 第一部分,概要部分结束-->

  </div>
</template>
<script>
// import Ptsmsg from "~/views/Public/Ptsmsg";
import event from '../event';
// import Ptap from "~/views/Public/Ptap";
// import Ptap1 from "~/views/Public/Ptap1";

export default {
  // components: {"c-ptap": Ptap,"c-ptsmsg": Ptsmsg,},
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event],
  data() {
    return {
      flag1: false,
      flag2: false,
    };
  },
  watch: {
  },
  methods: {},
  created: function () {
  },
  computed: {
    flag() {
      return this.model.mtabut.coninf.usr.extkey == "";
    },
    maxcur(){
      this.model.bedgrp.cbs.max.cur = this.model.ledgrp.cbs.nom1.cur
      return this.model.bedgrp.cbs.max.cur
    },
    maxamt:{
      get:function (){
        // this.model.bedgrp.cbs.max.amt = this.model.ledgrp.cbs.opn1.amt
        return this.model.bedgrp.cbs.max.amt
      },
      // set:function (newVal){
      //   this.model.bedgrp.cbs.max.amt = newVal
      // }
      set:function (){}

    },
    opn2cur(){
      this.model.bedgrp.cbs.opn2.cur = this.model.ledgrp.cbs.nom1.cur
      return this.model.bedgrp.cbs.opn2.cur
    },
  },
};
</script>
<style>
</style>