<template>
  <div class="eibs">
    <!-- =================顶部====================== -->
    <c-row>
      <c-col :span="24">
        <c-col :span="12" style="padding-right: 20px">
          <el-form-item
            label="信用证参考号"
            prop="ledgrp.rec.ownref"
            style="width: 100%"
          >
            <c-fullbox>
              <c-input
                v-model="model.ledgrp.rec.ownref"
                maxlength="16"
                placeholder="请输入信用证参考号"
                style="width: 95%"
                :disabled="true"
              >
              </c-input>
              <template slot="footer">
                <c-button
                  style="margin: 0 0 0 0; padding: 0 10px"
                  size="small"
                  type="primary"
                  @click="onSeainf"
                  icon="el-icon-info"
                >
                </c-button>
              </template>
            </c-fullbox>
          </el-form-item>
        </c-col>
        <c-col :span="12" style="padding-left: 20px">
          <el-form-item label="摘要" 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="24">
        <c-col :span="12" style="padding-right: 20px">
          <el-form-item
            label="转让信用证业务编号"
            prop="ltdgrp.rec.ownref"
            style="width: 100%"
          >
            <c-fullbox>
              <c-input
                v-model="model.ltdgrp.rec.ownref"
                maxlength="16"
                placeholder="请输入转让信用证业务编号"
                style="width: 95%"
                :disabled="true"
              >
              </c-input>
              <template slot="footer">
                <c-button
                  style="margin: 0 10px 0 0; padding: 0 12px"
                  size="small"
                  type="primary"
                  @click="onSeainf"
                  icon="el-icon-info"
                >
                </c-button>
                <c-button
                  style="margin: 0 0"
                  size="small"
                  type="primary"
                  @click="onlttpButgetref"
                >
                  获取
                </c-button>
              </template>
            </c-fullbox>
          </el-form-item>
        </c-col>
        <c-col :span="12" style="padding-left: 20px">
          <el-form-item label="摘要" prop="ltdgrp.rec.nam">
            <c-input
              text-align="middle"
              v-model="model.ltdgrp.rec.nam"
              maxlength="40"
              placeholder="请输入"
              disabled
            >
            </c-input>
          </el-form-item>
        </c-col>
      </c-col>
    </c-row>

    <!-- ====================左边======================= -->
    <c-col :span="12" style="padding-right: 20px">
      <!-- 信用证类型 -->
      <c-col :span="24">
        <el-form-item label="转让信用证类型" prop="ltdgrp.rec.lcrtyp">
          <c-select
            v-model="model.ltdgrp.rec.lcrtyp"
            style="width: 100%"
            placeholder="请选择转让信用证类型"
            :code="codes.lcrtyp1"
          >
          </c-select>
        </el-form-item>
      </c-col>

      <!-- Responsible user  所属客户经理-->
      <c-col :span="24">
        <el-form-item label="责任用户" prop="lttp.usr.extkey">
          <c-fullbox>
            <c-input
              v-model="model.lttp.usr.extkey"
              maxlength="8"
              placeholder="请输入"
              disabled
            ></c-input>
            <template slot="footer">
              <c-button
                style="margin-left: 10px; padding: 0 10px"
                size="small"
                type="primary"
                @click="onExtkey"
                icon="el-icon-info"
              ></c-button>
            </template>
          </c-fullbox>
        </el-form-item>
      </c-col>

      <!-- Nominal Amount  信用证金额-->
      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="名义金额" prop="ltdgrp.cbs.nom1.cur">
            <c-select
              v-model="model.ltdgrp.cbs.nom1.cur"
              style="width: 100%"
              placeholder="请选择币种"
              :code="codes.curtxt1"
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="7">
          <el-form-item label="" label-width="5px" prop="ltdgrp.cbs.nom1.amt">
            <c-input-currency
              v-model="model.ltdgrp.cbs.nom1.amt"
              style="text-align: left; width: 95%"
              placeholder="请输入名义金额"
              @keyup.enter.native="$event.target.blur()"
              disabled
            ></c-input-currency>
          </el-form-item>
        </c-col>
        <c-col :span="5">
          <c-checkbox
            v-model="model.lttp.aamp.aammod.addamtflg"
            style="margin-left: -1px"
            >附加金额</c-checkbox
          >
        </c-col>
      </c-col>

      <!-- 金额浮动 Amount Tolerance +/- -->
      <c-col :span="24">
        <c-col :span="15">
          <c-form-item label="金额容差 +/-" prop="ltdgrp.rec.nomtop">
            <c-input
              v-model.number="model.ltdgrp.rec.nomtop"
              maxlength="2"
              style="width: 100%"
              placeholder="请输入金额下限"
              class="m-input-currency"
              @keyup.enter.native="$event.target.blur()"
              disabled
            ></c-input>
          </c-form-item>
        </c-col>
        <c-col :span="9">
          <el-form-item label="" label-width="5px" prop="ltdgrp.rec.nomton">
            <c-input
              v-model.number="model.ltdgrp.rec.nomton"
              maxlength="2"
              style="width: 100%"
              placeholder="请输入金额上限"
              @keyup.enter.native="$event.target.blur()"
              class="m-input-currency"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="5"> </c-col>
      </c-col>

      <!-- Amount Specification 适用金额规范-->
      <c-col :span="24">
        <el-form-item label="适用金额规范" prop="ltdgrp.rec.nomspc">
          <c-select
            v-model="model.ltdgrp.rec.nomspc"
            style="width: 100%"
            placeholder="请选择适用金额规范"
            :code="codes.nomspc"
            disabled
          >
          </c-select>
        </el-form-item>
      </c-col>

      <!-- Maximum Amount 信用证最大金额-->
      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="最大金额" prop="ltdgrp.cbs.max.cur">
            <c-select
              v-model="model.ltdgrp.cbs.max.cur"
              style="width: 100%"
              placeholder="请选择币种"
              :code="codes.curtxt1"
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="12">
          <el-form-item label="" label-width="5px" prop="ltdgrp.cbs.max.amt">
            <c-input
              disabled
              v-model="model.ltdgrp.cbs.max.amt"
              placeholder="请输入最大金额"
              class="m-input-currency"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <!-- Issued on开证日期   Date Pre-advised 预通知日期-->
        <c-col :span="24">
          <el-form-item label="开证日期" prop="ltdgrp.rec.opndat">
            <c-date-picker
              type="date"
              v-model="model.ltdgrp.rec.opndat"
              style="width: 100%"
              value-format="yyyy-MM-dd"
              placeholder="请选择开证日期"
            >
            </c-date-picker>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <!-- Shipment Date 装运日期 -->
        <c-col :span="24">
          <el-form-item label="装运日期" prop="ltdgrp.rec.shpdat">
            <c-date-picker
              type="date"
              v-model="model.ltdgrp.rec.shpdat"
              style="width: 100%"
              placeholder="请选择装运日期"
              value-format="yyyy-MM-dd"
            >
            </c-date-picker>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <!--Expiring on 到期日 -->
        <c-col :span="24">
          <el-form-item label="到期日" prop="ltdgrp.rec.expdat">
            <c-date-picker
              type="date"
              v-model="model.ltdgrp.rec.expdat"
              style="width: 100%"
              disabled
              placeholder="请选择到期日"
              value-format="yyyy-MM-dd"
            ></c-date-picker>
          </el-form-item>
        </c-col>
        <c-col :span="12"></c-col>
      </c-col>

      <!-- in (Place)/counters of有效地点 -->
      <c-col :span="24">
        <el-form-item label="in" prop="ltdgrp.rec.expplc">
          <c-input
            v-model="model.ltdgrp.rec.expplc"
            maxlength="29"
            placeholder=""
            :code="codes.expplc"
          ></c-input>
        </el-form-item>
      </c-col>

      <!--Partial Shipment 分批装运 -->
      <c-col :span="24">
        <el-form-item label="分批装运" prop="ltdgrp.rec.shppars18">
          <c-select
            v-model="model.ltdgrp.rec.shppars18"
            style="width: 100%"
            placeholder="请选择分批装运"
            :code="codes.shptrss18"
          >
          </c-select>
        </el-form-item>
      </c-col>

      <!--转运 转运 -->
      <c-col :span="24">
        <el-form-item label="转运" prop="ltdgrp.rec.shptrss18">
          <c-select
            v-model="model.ltdgrp.rec.shptrss18"
            style="width: 100%"
            placeholder="请选择转运"
            :code="codes.shptrss18"
          >
          </c-select>
        </el-form-item>
      </c-col>

      <!--适用规则 适用规则 -->
      <c-col :span="24">
        <el-form-item label="适用规则" prop="ltdgrp.rec.apprul">
          <c-select
            v-model="model.ltdgrp.rec.apprul"
            style="width: 100%"
            placeholder="请选择适用规则"
            :code="codes.apprul1"
            @change="apprulChange"
          >
          </c-select>
        </el-form-item>
      </c-col>

      <!-- 其他规则 -->
      <c-col :span="24">
        <el-form-item label="其他适用规则" prop="ltdgrp.rec.apprultxt">
          <c-input
            v-model="model.ltdgrp.rec.apprultxt"
            maxlength="35"
            placeholder="请输入其他规则"
            :disabled="model.ltdgrp.rec.apprul === 'OTHR' ? false : true"
          ></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="确认接收指示" prop="ltdgrp.rec.cnfins">
          <c-select
            v-model="model.ltdgrp.rec.cnfins"
            style="width: 100%"
            placeholder="请选择确认接收指示"
            :code="codes.cnfins"
          >
          </c-select>
        </el-form-item>
      </c-col>
    </c-col>

    <!-- ========================右边======================= -->
    <c-col :span="12" style="padding-left: 20px">
      <c-col :span="24">
        <el-form-item label="第一受益人参考号" prop="ltdgrp.be1.pts.ref">
          <c-input
            v-model="model.ltdgrp.be1.pts.ref"
            maxlength="16"
            placeholder="请输入第一受益人参考号"
          ></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="第一受益人" prop="ltdgrp.be1.pts.extkey">
          <c-fullbox>
            <c-input
              v-model="model.ltdgrp.be1.pts.extkey"
              maxlength="16"
              placeholder=""
            ></c-input>

            <template slot="footer">
              <c-button
                style="margin: 0 10px 0 10px; padding: 0 12px"
                size="small"
                type="primary"
                icon="el-icon-search"
              >
              </c-button>
              <c-button
                style="margin: 0 0"
                size="small"
                type="primary"
                icon="el-icon-info"
              >
              </c-button>
            </template>
          </c-fullbox>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="名称" prop="ltdgrp.be1.pts.nam">
          <c-input
            disabled
            type="textarea"
            v-model="model.ltdgrp.be1.pts.nam"
            maxlength="35"
            show-word-limit
            placeholder="请输入"
          ></c-input>
        </el-form-item>
      </c-col>

      <!-- 开证行 Issuer Ref.-->
      <c-col :span="24">
        <c-ptap
          :model="model"
          :argadr="{
            title: '通知行',
            grp: 'ltdgrp',
            rol: 'adt',
          }"
          :disabled="true"
          @onSeainf="onSeainf"
          @onAplpDet="onIsspDet"
        >
        </c-ptap>
      </c-col>

      <!--Applicant Ref. 申请人 -->
      <c-col :span="24">
        <c-ptap
          :model="model"
          :argadr="{
            title: '第二受益人',
            grp: 'ltdgrp',
            rol: 'be2',
          }"
          :disabled="true"
          @onSeainf="onSeainf"
          @onAplpDet="onAplpDet"
        >
        </c-ptap>
      </c-col>

      <c-col :span="12">
        <el-form-item label="" prop="ltdgrp.rec.rmbflg" class="checkbox-left">
          <c-checkbox v-model="model.ltdgrp.rec.rmbflg">偿付信息</c-checkbox>
        </el-form-item>
      </c-col>
    </c-col>
  </div>
</template>
<script>
import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Lttame/Event";
import Ptap from "~/views/Public/Ptap";

export default {
  components: { "c-ptap": Ptap },
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [commonProcess],
  data() {
    return {};
  },
  methods: {
    ...Event,
    onExtkey() {},
    apprulChange(v) {
      if (v !== "OTHR") {
        this.model.ltdgrp.rec.apprultxt = "";
      }
    },
  },
  created: function () {},
};
</script>
<style>
</style>