<template>
  <div class="eibs-tab">
    <c-row>
    <!-- =================信用证信息====================== -->
    <!-- =================顶部====================== -->
      <c-col :span="24">
        <c-col :span="8">
          <el-form-item label="信用证参考号" prop="didgrp.rec.ownref">
            <c-input v-model="model.didgrp.rec.ownref" maxlength="16" placeholder="请输入信用证参考号" disabled></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="4">
          <el-form-item style="text-align: left" label="" label-width="-10px">
            <c-button size="small" type="primary;width:10%" @click="onSeainf">i</c-button>
          </el-form-item>
        </c-col>
        <!-- <c-col :span="4">
      <el-form-item label="Drag  Drop Sender" prop="bdtp.recget.sdamod.dadsnd">
        <c-input
          v-model="model.bdtp.recget.sdamod.dadsnd"
          placeholder="请输入Drag  Drop Sender"
        ></c-input>
      </el-form-item>
     </c-col> -->
        <c-col :span="11">
          <el-form-item label="摘要" prop="didgrp.rec.nam">
            <c-input align="middle" v-model="model.didgrp.rec.nam" maxlength="40" placeholder="请输入摘要" disabled>
            </c-input>
          </el-form-item>
        </c-col>
      </c-col>
 
    <!-- =================左边====================== -->
    <c-col :span="11">
      <c-col :span="12">
        <el-form-item label="信用证金额" prop="didgrp.cbs.nom1.cur">
          <c-select disabled v-model="model.didgrp.cbs.nom1.cur" style="width: 100%" placeholder="请选择币种"
            @keyup.enter.native="didCurEvent">
            <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="12">
        <el-form-item style="text-align: left" label-width="20px" prop="didgrp.cbs.nom1.amt">
          <c-input disabled v-model="model.didgrp.cbs.nom1.amt" placeholder="请输入信用证金额"></c-input>
        </el-form-item>
      </c-col>
      <!-- </c-col> -->


      <c-col :span="12">
        <el-form-item label="单据金额" prop="didgrp.cbs.opn1.cur">
          <c-select disabled v-model="model.didgrp.cbs.opn1.cur" style="width: 100%" placeholder="请选择币种"
            @keyup.enter.native="didCurEvent">
            <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="12">
        <el-form-item style="text-align: left" label-width="20px" label="" prop="didgrp.cbs.opn1.amt">
          <c-input disabled v-model="model.didgrp.cbs.opn1.amt" placeholder="请输入单据金额"></c-input>
        </el-form-item>
      </c-col>


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

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

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

      <c-col :span="24">
        <el-form-item label="到期日" prop="didgrp.rec.expdat">
          <c-date-picker type="date" v-model="model.didgrp.rec.expdat" style="width: 100%" placeholder="到期日">
          </c-date-picker>
        </el-form-item>
      </c-col>

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

      <c-col :span="24">
        <c-col :span="12">
          <span v-text="model.bdtp.zchday" data-path=".bdtp.zchday"> </span>
        </c-col>
        <c-col :span="12">
          <el-form-item label="" prop="didgrp.rec.shpdat">
            <c-date-picker type="date" v-model="model.didgrp.rec.shpdat" style="width: 100%"
              placeholder="请选择最迟货物装运/服务提供日期"></c-date-picker>
          </el-form-item>
        </c-col>
      </c-col>
    </c-col>

    <!-- =================右边====================== -->
    <c-col :span="11" :offset="1">
      <c-col :span="24">
        <el-form-item label="申请人编号" prop="bddgrp.apl.pts.ref">
          <c-input v-model="model.bddgrp.apl.pts.ref" maxlength="16" placeholder="请输入申请人编号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="申请人名称" prop="bddgrp.apl.pts.nam">
          <c-input v-model="model.bddgrp.apl.pts.nam" maxlength="40" placeholder="申请人名称"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="受益人编号" prop="bddgrp.ben.pts.ref">
          <c-input v-model="model.bddgrp.ben.pts.ref" maxlength="16" placeholder="请输入受益人编号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="受益人名称" prop="bddgrp.ben.pts.nam">
          <c-input v-model="model.bddgrp.ben.pts.nam" maxlength="40" placeholder="受益人名称"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="交单行编号" prop="bddgrp.prb.pts.ref">
          <c-input v-model="model.bddgrp.prb.pts.ref" maxlength="16" placeholder="请输入交单行编号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="交单行名称" prop="bddgrp.prb.pts.nam">
          <c-input v-model="model.bddgrp.prb.pts.nam" maxlength="40" placeholder="交单行名称"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="到期地点">
          <c-input type="textarea" v-model="model.didgrp.rec.expplc" maxlength="35" show-word-limit
            placeholder="请输入到期地点"></c-input>
        </el-form-item>
      </c-col>

    </c-col>

    <!-- =================单据信息====================== -->
    <!-- =================顶部====================== -->
      <c-col :span="24">
        <c-col :span="8">
          <el-form-item label="单据参考号" prop="bddgrp.rec.ownref">
            <c-input v-model="model.bddgrp.rec.ownref" maxlength="16" placeholder="请输入单据参考号"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="4">
          <el-form-item style="text-align: left" label="" label-width="-25px">
            <c-button size="small" type="primary" @click="onBdtmodButgetref">
              获取
            </c-button>
          </el-form-item>
        </c-col>

        <c-col :span="11">
          <el-form-item label="摘要" prop="bddgrp.rec.nam">
            <c-input align="middle" v-model="model.bddgrp.rec.nam" maxlength="40" placeholder="请输入摘要"></c-input>
          </el-form-item>
        </c-col>

      </c-col>

    <!-- =================左边====================== -->
    <c-col :span="11">
      <c-col :span="24">
        <el-form-item label="单据类型" prop="bddgrp.rec.docflg">
          <c-select v-model="model.bddgrp.rec.docflg" style="width: 100%" placeholder="请选择单据类型">
          </c-select>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="单据金额" prop="bddgrp.cbs.max.cur">
            <c-select disabled v-model="model.bddgrp.cbs.max.cur" style="width: 100%" placeholder="请选择币种"
              @keyup.enter.native="bddCurEvent">
              <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="12">
          <el-form-item style="text-align: left" label-width="20px" label="" prop="bddgrp.cbs.max.amt">
            <c-input v-model="model.bddgrp.cbs.max.amt" placeholder="请输入单据金额"></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <el-form-item label="原发起直接参与机构" prop="trnmod.swiadd.oriinstgagt">
          <c-input v-model="model.trnmod.swiadd.oriinstgagt" maxlength="20" placeholder="请输入原发起直接参与机构"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="此信用证下的到单次数" prop="didgrp.rec.utlnbr">
          <c-input v-model="model.didgrp.rec.utlnbr" placeholder="请输入此信用证下的到单次数"></c-input>
        </el-form-item>
      </c-col>

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

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

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

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

      <c-col :span="24">
        <el-form-item label="货物装运/服务提供日期" prop="bddgrp.rec.shpdat">
          <c-date-picker type="date" v-model="model.bddgrp.rec.shpdat" style="width: 100%" placeholder="请选择货物装运/服务提供日期">
          </c-date-picker>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="远期起算日" prop="bddgrp.rec.stadat">
          <c-date-picker type="date" v-model="model.bddgrp.rec.stadat" style="width: 100%" placeholder="请选择起算日">
          </c-date-picker>
        </el-form-item>
      </c-col>

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

      <c-col :span="24">
        <el-form-item label="期限" prop="bddgrp.rec.tenmaxday">
          <c-input v-model="model.bddgrp.rec.tenmaxday" placeholder="请输入期限"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="发票类型" prop="bddgrp.rec.invtyp">
          <c-select v-model="model.bddgrp.rec.invtyp" style="width: 100%" placeholder="请选择发票类型">
          </c-select>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <c-checkbox v-model="model.bddgrp.rec.dscinsflg">录入单据、不符点、结算指示和货运详细信息</c-checkbox>
      </c-col>

      <c-col :span="24">
        <c-checkbox v-model="model.bdtp.setnowflg">Register to Send and Settle Document</c-checkbox>
      </c-col>
    </c-col>
    <!-- =================右边====================== -->
    <c-col :span="11" :offset="1">
      <c-col :span="24">
        <el-form-item label="交单行编号" prop="bddgrp.prb.pts.ref">
          <c-input v-model="model.bddgrp.prb.pts.ref" maxlength="16" placeholder="请输入交单行编号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="交单行BIC" prop="bddgrp.prb.pts.extkey">
          <c-input v-model="model.bddgrp.prb.pts.extkey" maxlength="16" placeholder="请输入交单行BIC"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="交单行联行行号" prop="bddgrp.prb.pts.bankno">
          <c-input v-model="model.bddgrp.prb.pts.bankno" maxlength="20" placeholder="请输入交单行联行行号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="交单行联行名称(电证用)">
          <c-input type="textarea" v-model="model.bddgrp.prb.pts.jigomc" maxlength="35" show-word-limit
            placeholder="请输入联行名称"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="交单行地址(电证用)">
          <c-input type="textarea" v-model="model.bddgrp.prb.pts.dizhii" maxlength="35" show-word-limit
            placeholder="请输入交单行地址"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="原报文标识号" prop="trnmod.swiadd.orimsgid">
          <c-input v-model="model.trnmod.swiadd.orimsgid" maxlength="35" placeholder="请输入原报文标识号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="单据状态" prop="bddgrp.rec.docsta">
          <c-input v-model="model.bddgrp.rec.docsta" maxlength="1" placeholder="请输入单据状态"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="原报文类型" prop="trnmod.swiadd.orimsgtyp">
          <c-select v-model="model.trnmod.swiadd.orimsgtyp" style="width: 100%" placeholder="请选择原报文类型">
          </c-select>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="收款行行号" prop="bddgrp.skh.pts.bankno">
          <c-input v-model="model.bddgrp.skh.pts.bankno" maxlength="20" placeholder="请输入收款行行号"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="收款行名称">
          <c-input type="textarea" v-model="model.bddgrp.skh.pts.jigomc" maxlength="35" show-word-limit
            placeholder="请输入收款行名称"></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="申请人编号" prop="didgrp.apl.pts.ref">
          <c-input v-model="model.didgrp.apl.pts.ref" maxlength="16" placeholder="请输入申请人编号"></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/Ditdck/Event";
  import Utils from "~/utils";

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