<template>
  <div class="eibs-tab">
    <c-row>
      <!-- =========================== 左边 ==========================-->
      <c-col :span="11">
        <!-- Reference -->
        <c-col :span="24">
          <el-form-item label="Reference" prop="ledgrp.rec.ownref">
            <c-input
              v-model="model.ledgrp.rec.ownref"
              maxlength="16"
              placeholder="请输入Reference"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <!-- L/C Amount -->
        <c-col :span="12">
          <el-form-item label="L/C Amount" prop="ledgrp.cbs.nom1.cur">
            <c-select
              v-model="model.ledgrp.cbs.nom1.cur"
              maxlength="3"
              placeholder="请输入Nominal Amount"
              :code="codes.curtxt1"
              disabled
            ></c-select>
          </el-form-item>
        </c-col>

        <c-col :span="7">
          <el-form-item label="" label-width="5px" prop="ledgrp.cbs.nom1.amt">
            <c-input
              v-model="model.ledgrp.cbs.nom1.amt"
              class="m-input-currency"
              placeholder="请输入Nominal Amount"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="3" :offset="1">
          <c-checkbox v-model="model.letp.letp0.aammod.addamtflg" disabled
            >Add. Amount</c-checkbox
          >
        </c-col>

        <!-- Open Amount -->
        <c-col :span="12">
          <el-form-item label="Open Amount" prop="ledgrp.cbs.opn1.cur">
            <c-select
              v-model="model.ledgrp.cbs.opn1.cur"
              maxlength="3"
              placeholder="请输入Open Amount"
              :code="codes.curtxt1"
              disabled
            ></c-select>
          </el-form-item>
        </c-col>

        <c-col :span="7">
          <el-form-item label="" label-width="5px" prop="ledgrp.cbs.opn1.amt">
            <c-input
              v-model="model.ledgrp.cbs.opn1.amt"
              class="m-input-currency"
              placeholder="请输入Balance"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="3" :offset="1">
          <c-checkbox v-model="model.ledgrp.rec.revflg" disabled
            >Revolving L/C</c-checkbox
          >
        </c-col>
        <!-- Available with -->
        <c-col :span="24">
          <el-form-item label="Available with" prop="ledgrp.avbnam">
            <c-input
              v-model="model.ledgrp.avbnam"
              maxlength="40"
              placeholder="请输入Available with"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <!-- by -->
        <c-col :span="24">
          <c-col :span="12">
            <el-form-item label="by" prop="ledgrp.rec.avbby">
              <c-select
                v-model="model.ledgrp.rec.avbby"
                style="width: 100%"
                placeholder="请选择Available by [AVBBY0]"
                disabled
              >
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="11" :offset="1">
            <c-checkbox v-model="model.ledgrp.rec.redclsflg" disabled
              >Red/Green Clause</c-checkbox
            >
          </c-col>
        </c-col>

        <!-- Date Issued -->
        <c-col :span="12">
          <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="请选择Issued on"
              value-format="yyyy-MM-dd"
              disabled
            >
            </c-date-picker>
          </el-form-item>
        </c-col>
        <!-- Shipment Date -->
        <c-col :span="12">
          <el-form-item label="Shipment Date" prop="ledgrp.rec.shpdat">
            <c-date-picker
              type="date"
              v-model="model.ledgrp.rec.shpdat"
              style="width: 100%"
              value-format="yyyy-MM-dd"
              placeholder="请选择Shipment Date"
              disabled
            >
            </c-date-picker>
          </el-form-item>
        </c-col>
        <!-- Date/Place of Expiry -->
        <c-col :span="13">
          <el-form-item label="Date/Place of Expiry" prop="ledgrp.rec.expdat">
            <c-date-picker
              type="date"
              v-model="model.ledgrp.rec.expdat"
              style="width: 100%"
              placeholder="请选择Expiring on"
              value-format="yyyy-MM-dd"
              disabled
            >
            </c-date-picker>
          </el-form-item>
        </c-col>

        <c-col :span="11">
          <el-form-item label="" label-width="10px" prop="ledgrp.rec.expplc">
            <c-input
              v-model="model.ledgrp.rec.expplc"
              maxlength="29"
              placeholder="请输入in (Place)/ counters of"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Form of L/C" prop="ledgrp.rec.lcrtyp">
            <c-select
              v-model="model.ledgrp.rec.lcrtyp"
              style="width: 100%"
              placeholder="请选择Form of L/C"
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>

        <!-- Condition -->
        <c-col :span="24">
          <el-form-item label="Condition" prop="ledgrp.rec.cnfdet">
            <c-select
              v-model="model.ledgrp.rec.cnfdet"
              style="width: 100%"
              placeholder="请选择Confirmation Instruct."
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Confirmation Status " prop="ledgrp.rec.cnfsta">
            <c-select
              v-model="model.ledgrp.rec.cnfsta"
              style="width: 100%"
              placeholder="请选择Confirmation Status "
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <c-col :span="12">
            <el-form-item label="Confirmation" prop="ledgrp.cbs.cnf.cur">
              <c-select
                v-model="model.ledgrp.cbs.cnf.cur"
                maxlength="3"
                placeholder="请输入Confirmation"
                :code="codes.curtxt1"
                @keyup.enter.native="cnfCurEvent" style="width:100%"
                disabled
              ></c-select>
            </el-form-item>
          </c-col>
          <c-col :span="8">
            <el-form-item label="" label-width="10px" prop="ledgrp.cbs.cnf.amt">
              <c-input
                v-model="model.ledgrp.cbs.cnf.amt"
                class="m-input-currency"
                placeholder="请输入Balance"
                @keyup.enter.native="defaultFunction('ledgrp.cbs.cnf.amt', model.ledgrp.cbs.cnf.amt)"
              ></c-input>
            </el-form-item>
          </c-col>
          <c-col :span="4">
            <el-form-item label="" label-width="10px" prop="ledgrp.rec.partcon">
              <c-fullbox>
                <c-input
                  v-model="model.ledgrp.rec.partcon"
                  placeholder="请输入Partial Confirmation"
                  @keyup.enter.native="defaultFunction('ledgrp.rec.partcon', model.ledgrp.rec.partcon)"
                ></c-input>
                <!-- <span>%</span> -->
                <template slot="footer">%</template>
              </c-fullbox>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Confir. Requested on" prop="reqdat">
            <c-date-picker
              type="date"
              v-model="model.reqdat"
              style="width: 100%"
              placeholder="请选择Confir. Requested on"
              value-format="yyyy-MM-dd"
            >
            </c-date-picker>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Confirmed on" prop="ledgrp.rec.cnfdat">
            <c-date-picker
              type="date"
              v-model="model.ledgrp.rec.cnfdat"
              style="width: 100%"
              placeholder="请选择Confirmed on"
              value-format="yyyy-MM-dd"
            >
            </c-date-picker>
          </el-form-item>
        </c-col>
      </c-col>

      <!-- =========================== 右边 ==========================-->
      <c-col :span="11" :offset="1">
        <c-col :span="12">
          <el-form-item label="name" prop="letp.letp0.recget.sdamod.dadsnd">
            <c-input
              v-model="model.letp.letp0.recget.sdamod.dadsnd"
              placeholder="请输入Reference"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="" label-width="5px" prop="ledgrp.rec.nam">
            <c-input
              v-model="model.ledgrp.rec.nam"
              maxlength="40"
              placeholder="请输入Name"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <!-- Applicant         Ref. -->
        <c-col :span="24">
          <el-form-item label="Applicant Ref." prop="ledgrp.apl.pts.ref">
            <c-input
              v-model="model.ledgrp.apl.pts.ref"
              maxlength="16"
              placeholder="请输入Applicant Ref."
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="" prop="ledgrp.apl.pts.nam">
            <c-input
              v-model="model.ledgrp.apl.pts.nam"
              maxlength="40"
              placeholder="请输入Name of Party"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Issuer Ref." prop="ledgrp.iss.pts.ref">
            <c-input
              v-model="model.ledgrp.iss.pts.ref"
              maxlength="16"
              placeholder="请输入Issuer Ref."
              disabled
            >
            </c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="" prop="ledgrp.iss.pts.nam">
            <c-input
              v-model="model.ledgrp.iss.pts.nam"
              maxlength="40"
              placeholder="请输入Name of Party"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="Beneficiary Ref." prop="ledgrp.ben.pts.ref">
            <c-input
              v-model="model.ledgrp.ben.pts.ref"
              maxlength="16"
              placeholder="请输入Beneficiary Ref."
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="Date/Place of Expiry" prop="ledgrp.ben.pts.nam">
            <c-input
              v-model="model.ledgrp.ben.pts.nam"
              maxlength="40"
              placeholder="请输入Date/Place of Expiry"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="" prop="letp.letp0.cnftxt">
            <c-input
              v-model="model.letp.letp0.cnftxt"
              maxlength="40"
              placeholder="请输入Form of L/C"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </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/Letamc/Event'
import Utils from "~/utils";

export default {
  inject: ['root'],
  props: ['model', 'codes'],
  mixins: [commonProcess],
  data() {
    return {}
  },
  methods: { 
    ...Event,
    cnfCurEvent() {
      this.executeDefault("didgrp.cbs.cnf.cur").then((res) => {
        if ((res.respCode == SUCCESS)) {
          Utils.copyValueFromVO(this.model, res.data);
        }
      });
    },
  },
  created: function () {},
}
</script>
<style></style>
