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

      <c-col :span="11" :offset="1">
        <el-form-item label="Name" prop="ledgrp.rec.nam">
          <c-input
            text-align="middle"
            v-model="model.ledgrp.rec.nam"
            maxlength="40"
            placeholder="请输入"
            disabled
          >
          </c-input>
        </el-form-item>
      </c-col>
    </c-col>

    <!-- ========================上半部分的左边=========================== -->
    <c-col :span="12">
      <!-- L/C Amount -->
      <c-col :span="24">
        <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"
              style="width: 100%"
              placeholder="请选择币种"
              @keyup.enter.native="nom1CurEvent"
              :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-currency
              v-model="model.ledgrp.cbs.nom1.amt"
              style="text-align: left; width: 100%"
              class="m-input-currency"
              placeholder="请输入信用证金额"
              @keyup.enter.native="
                defaultFunction(
                  'ledgrp.cbs.nom1.amt',
                  model.ledgrp.cbs.nom1.amt
                )
              "
              disabled
            ></c-input-currency>
          </el-form-item>
        </c-col>

        <c-col :span="5">
          <c-checkbox
            v-model="model.letp.aamp.aammod.addamtflg"
            style="margin-left: 10px"
            disabled
            >Add. Amount</c-checkbox
          >
        </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-input
            v-model="model.ledgrp.cbs.opn1.cur"
            maxlength="3"
            placeholder="请输入Open Amount"
            disabled
          ></c-input>
        </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"
            style="text-align: left; width: 100%"
            class="m-input-currency"
            placeholder="请输入Balance"
            disabled
          ></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="5">
        <c-checkbox v-model="model.ledgrp.rec.revflg"
        style="margin-left: 10px"
        disabled
          >Revolving L/C</c-checkbox
        >
      </c-col>
      </c-col>

      <c-row>
        <c-col :span="19">
          <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>
      </c-row>

      <c-col :span="24">
        <c-col :span="19">
        <el-form-item label="Available by [AVBBY0]" 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="5">
      <c-checkbox v-model="model.ledgrp.rec.redclsflg"
        style="margin-left: 10px"
        disabled
        >Red/Green Clause</c-checkbox
      >
    </c-col>
      </c-col>
      
      <c-col :span="24">
        <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="请选择Date Issued"
          value-format="yyyy-MM-dd"
          disabled
        ></c-date-picker>
      </el-form-item>
    </c-col>
    <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%"
          placeholder="请选择Shipment Date"
          value-format="yyyy-MM-dd"
          disabled
        ></c-date-picker>
      </el-form-item>
    </c-col>
      </c-col>

    <c-col :span="24">
      <c-col :span="12">
      <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="请选择Date/Place of Expiry"
          value-format="yyyy-MM-dd"
          disabled
        ></c-date-picker>
      </el-form-item>
    </c-col>
        <c-col :span="12">
      <el-form-item label="" label-width="5px" prop="ledgrp.rec.expplc">
        <c-input
          v-model="model.ledgrp.rec.expplc"
          maxlength="29"
          placeholder="请输入Date/Place of Expiry"
          value-format="yyyy-MM-dd"
          disabled
        ></c-input>
      </el-form-item>
    </c-col>
    </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>
      
    </c-col>

        <!-- ========================上半部分的右边======================= -->
    <c-col :span="11" :offset="1">
          <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"
          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="Iss. Bank Original LC No" prop="ledgrp.iss.pts.ref">
        <c-input
          v-model="model.ledgrp.iss.pts.ref"
          maxlength="16"
          placeholder="请输入Iss. Bank"
          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="24">
      <el-form-item label="Beneficiary Ref." prop="ledgrp.ben.pts.ref">
        <c-input
          v-model="model.ledgrp.ben.pts.ref"
          maxlength="16"
          placeholder="请输入Beneficiary"
          disabled
        ></c-input>
      </el-form-item>
    </c-col>
        <c-col :span="24">
      <el-form-item label="" prop="ledgrp.ben.pts.nam">
        <c-input
          v-model="model.ledgrp.ben.pts.nam"
          maxlength="40"
          placeholder="请输入Name of Party"
          disabled
        ></c-input>
      </el-form-item>
    </c-col>
        <c-col :span="24">
      <el-form-item label="Confirmation text" prop="letp.letp0.cnftxt">
        <c-input
          v-model="model.letp.letp0.cnftxt"
          maxlength="40"
          placeholder="请输入Confirmation text"
          disabled
        ></c-input>
      </el-form-item>
    </c-col>
    </c-col>

        <!-- ========================中部======================= -->
    <c-row>
      <c-col :span="24">
        <c-col :span="12">
            <el-form-item label="Document Reference" prop="bedgrp.rec.ownref">
              <c-fullbox>
                <c-input
                v-model="model.bedgrp.rec.ownref"
                maxlength="16"
                placeholder="请输入Document Reference"
                disabled
                ></c-input>
                <template slot="footer">
                  <c-button size="small" type="primary" @click="onBetmodButgetref"
                  disabled>
                    Get Ref
                  </c-button>
                </template>
              </c-fullbox>
            </el-form-item>
          </c-col>
        <c-col :span="11" :offset="1">
        <!-- Externally Displayed Name to Identify the Contract -->
            <el-form-item
              label="Name"
              text-align="middle"
              prop="bedgrp.rec.nam"
            >
              <c-input
                v-model="model.bedgrp.rec.nam"
                maxlength="40"
                placeholder="请输入Externally Displayed Name to Identify the Contract"
              ></c-input>
            </el-form-item>
          </c-col>
      </c-col>
    </c-row>

    <c-col :span="24">
          <!-- ========================下半部分的左边======================= -->
      <c-col :span="12">
        <c-col :span="24">
          <el-form-item label="Document Type" prop="bedgrp.rec.doctypcod">
            <c-select
              v-model="model.bedgrp.rec.doctypcod"
              style="width: 100%"
              placeholder="请选择Document Type"
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <c-col :span="12">
            <el-form-item label="Maturity Date" prop="bedgrp.rec.matdat">
              <c-date-picker
                type="date"
                v-model="model.bedgrp.rec.matdat"
                style="width: 100%"
                placeholder="请选择Maturity Date"
                value-format="yyyy-MM-dd"
              ></c-date-picker>
            </el-form-item>
          </c-col>
                <!-- Date of Shipment -->
          <c-col :span="12">
            <el-form-item label="Shipped on" prop="bedgrp.rec.shpdat">
              <c-date-picker
                type="date"
                v-model="model.bedgrp.rec.shpdat"
                style="width: 100%"
                placeholder="请选择Date of Shipment"
                value-format="yyyy-MM-dd"
              ></c-date-picker>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24">
          <c-col :span="12">
            <el-form-item label="Received on" prop="bedgrp.rec.rcvdat">
              <c-date-picker
                type="date"
                v-model="model.bedgrp.rec.rcvdat"
                style="width: 100%"
                value-format="yyyy-MM-dd"
                placeholder="请选择Received on"
              ></c-date-picker>
            </el-form-item>
          </c-col>
          <c-col :span="12">
            <el-form-item label="Order Date" prop="bedgrp.rec.orddat">
              <c-date-picker
                type="date"
                v-model="model.bedgrp.rec.orddat"
                style="width: 100%"
                value-format="yyyy-MM-dd"
                placeholder="请选择Order Date"
              ></c-date-picker>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24">
          <c-checkbox v-model="model.bedgrp.rec.dscinsflg"
            style="width: 100%; margin-left: 150px"
            >Enter Docs, Discrep. and Instructions</c-checkbox
          >
        </c-col>

        <c-col :span="24">
          <!-- <el-form-item
            label="No. of Existing and not Completely Processed  Document Sets"
            prop="ledgrp.rec.utlnbr"
          > -->
          <el-form-item
            label="Previous Drawings under this L/C"
            prop="ledgrp.rec.utlnbr"
          >
            <c-input
              v-model="model.ledgrp.rec.utlnbr"
              placeholder="请输入No. of Existing and not Completely Processed  Document Sets"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      
      </c-col>
          <!-- ========================下半部分的右边======================= -->
      <c-col :span="11" :offset="1">
        <c-col :span="24">
          <c-col :span="13">
            <el-form-item label="Document Amount" prop="bedgrp.cbs.max.cur">
              <c-input
                v-model="model.bedgrp.cbs.max.cur"
                maxlength="3"
                placeholder="请输入Currency"
              ></c-input>
            </el-form-item>
          </c-col>
          <c-col :span="11">
            <el-form-item label="" label-width="5px" prop="bedgrp.cbs.max.amt">
              <c-input
                v-model="model.bedgrp.cbs.max.amt"
                class="m-input-currency"
                placeholder="请输入Balance"
              ></c-input>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24">
          <c-col :span="13">
            <el-form-item label="Drawn Additional Amount" prop="bedgrp.cbs.opn2.cur">
              <c-select
                v-model="model.bedgrp.cbs.opn2.cur"
                style="width: 100%"
                placeholder="请选择Currency"
                disabled
              >
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="11">
            <el-form-item label="" label-width="5px" prop="bedgrp.cbs.max2.amt">
              <c-input
                v-model="model.bedgrp.cbs.max2.amt"
                class="m-input-currency"
                placeholder="请输入Balance"
                disabled
              ></c-input>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Presented by" prop="bedgrp.rec.docprbrol">
            <c-select
              v-model="model.bedgrp.rec.docprbrol"
              style="width: 100%"
              placeholder="请选择Presented by"
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <c-ptap
            :model="model"
            :argadr="{
              title: '',
              grp: 'bedgrp',
              rol: 'prb',
            }"
            :disabled="true"
            @onSeainf="onSeainf"
            @onAplpDet="onPrbpDet"
          >
          </c-ptap>
        </c-col>
      </c-col>
    </c-col>

    <!-- <c-col :span="12">
      <el-form-item
        label="Drag  Drop Sender"
        prop="letp.letp0.recget.sdamod.dadsnd"
      >
        <c-input
          v-model="model.letp.letp0.recget.sdamod.dadsnd"
          placeholder="请输入Drag  Drop Sender"
        ></c-input>
      </el-form-item>
    </c-col> -->

    <!-- <c-col :span="12">
      <el-form-item label="Reference" prop="ledgrp.rec.ownref">
        <c-input
          v-model="model.ledgrp.rec.ownref"
          maxlength="16"
          placeholder="请输入Reference"
        ></c-input>
      </el-form-item>
    </c-col>

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

    <c-col :span="12">
      <el-form-item
        label="Drag  Drop Sender"
        prop="betp.prbp.ptsget.sdamod.dadsnd"
      >
        <c-input
          v-model="model.betp.prbp.ptsget.sdamod.dadsnd"
          placeholder="请输入Drag  Drop Sender"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <el-form-item
        label="External Key of Address"
        prop="bedgrp.prb.pts.extkey"
      >
        <c-input
          v-model="model.bedgrp.prb.pts.extkey"
          maxlength="16"
          placeholder="请输入External Key of Address"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <el-form-item label="" prop="betp.prbp.ptsget.sdamod.seainf">
        <c-input
          v-model="model.betp.prbp.ptsget.sdamod.seainf"
          placeholder="请输入"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onPrbpDet">
        Details
      </c-button>
    </c-col>

    <c-col :span="12">
      <el-form-item label="名称" prop="bedgrp.prb.namelc">
        <c-input
          type="textarea"
          v-model="model.bedgrp.prb.namelc"
          maxlength="35"
          show-word-limit
          placeholder="请输入名称"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <el-form-item label="Address Block" prop="bedgrp.prb.pts.adrblk">
        <c-input
          type="textarea"
          v-model="model.bedgrp.prb.pts.adrblk"
          maxlength="35"
          show-word-limit
          placeholder="请输入Address Block"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <el-form-item label="Chinese address" prop="bedgrp.prb.dbfadrblkcn">
        <c-input
          type="textarea"
          v-model="model.bedgrp.prb.dbfadrblkcn"
          maxlength="35"
          show-word-limit
          placeholder="请输入Chinese address"
        ></c-input>
      </el-form-item>
    </c-col>



    <c-col :span="12">
      <el-form-item label="地址" prop="bedgrp.prb.adrelc">
        <c-input
          type="textarea"
          v-model="model.bedgrp.prb.adrelc"
          maxlength="35"
          show-word-limit
          placeholder="请输入地址"
        ></c-input>
      </el-form-item>
    </c-col>
-->

  </div>
</template>
<script>
import Api from '~/service/Api'
import commonProcess from '~/mixin/commonProcess'
import CodeTable from '~/config/CodeTable'
import Event from '~/model/Letdrw/Event'
import Utils from '~/utils'
import Ptap from '~/views/Public/Ptap'

export default {
  components: { 'c-ptap': Ptap },
  inject: ['root'],
  props: ['model', 'codes'],
  mixins: [commonProcess],
  data() {
    return {}
  },
  methods: {
    ...Event,
    nom1CurEvent() {
      this.executeDefault('ledgrp.cbs.nom1.cur').then((res) => {
        if (res.respCode == SUCCESS) {
          Utils.copyValueFromVO(this.model, res.data)
        }
      })
    },
    apprulChange(v) {
      if (v !== 'OTHR') {
        this.model.ledgrp.rec.apprultxt = ''
      }
    },
  },
  created: function () {},
}
</script>
<style></style>
