<template>
  <c-row>
    <!-- 第一行 -->
    <c-col :span="24">
      <c-col :span="8">
        <el-form-item label="业务编号" 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="4">
        <c-button size="small" type="primary;width:10%" @click="onSeainf"
          >i</c-button
        >
        <c-button
          size="small"
          type="primary"
          :disabled="
            model.ledgrp.ben.pts.adrblk && !model.ledgrp.rec.ownref ? false : true
          "
          @click="onLetpButgetref"
        >
          获取
        </c-button>
      </c-col>

      <c-col :span="11">
        <c-col :span="12">
          <el-form-item label="信用证余额" prop="ledgrp.cbs.opn1.cur">
            <c-select
              v-model="model.ledgrp.cbs.opn1.cur"
              style="width: 100%"
              placeholder="请选择币种"
              :code="codes.acccur"
            >
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="" label-width="20px" prop="ledgrp.cbs.opn1.amt">
            <c-input
              v-model="model.ledgrp.cbs.opn1.amt"
              placeholder="请输入信用证余额"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>
    </c-col>
    <!-- 第二行 -->
    <c-col :span="24">
      <c-col :span="8">
        <el-form-item label="单据编号" prop="bedgrp.rec.ownref">
          <c-input
            v-model="model.bedgrp.rec.ownref"
            maxlength="16"
            placeholder="请输入Reference"
            :disabled="true"
          ></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="4">
        <c-button size="small" type="primary;width:10%" @click="onSeainf"
          >i</c-button
        >
        <c-button
          size="small"
          type="primary"
          :disabled="
            model.bedgrp.ben.pts.adrblk && !model.bedgrp.rec.ownref ? false : true
          "
          @click="onLetpButgetref"
        >
          获取
        </c-button>
      </c-col>

      <c-col :span="11">
        <el-form-item label="摘要" prop="bedgrp.rec.nam">
          <c-input
            v-model="model.bedgrp.rec.nam"
            maxlength="29"
            placeholder="摘要"
          ></c-input>
        </el-form-item>
      </c-col>
    </c-col>
    <!-- 第三行 -->
    <c-col :span="24">
      <!-- 第三行 左边-->
      <c-col :span="12">
        <c-col :span="24">
          <c-col :span="8">
            <el-form-item label="单据金额" prop="bedgrp.cbs.max.cur">
              <c-select
                v-model="model.bedgrp.cbs.max.cur"
                style="width: 100%"
                placeholder="请选择币种"
                :code="codes.acccur"
              >
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="8">
            <el-form-item label="" label-width="10px" prop="bedgrp.cbs.max.amt">
              <c-input-currency
                v-model="model.bedgrp.cbs.max.amt"
                style="text-align: left; width: 100%"
                placeholder="请输入单据金额"
              ></c-input-currency>
            </el-form-item>
          </c-col>
          <c-col :span="4" class="centerLable">
            <c-checkbox v-model="model.betp.aamp.aammod.addamtflg"
              >附加金额</c-checkbox
            >
          </c-col>
        </c-col>

        <c-col :span="24">
          <c-col :span="8">
            <el-form-item label="单据余额" prop="bedgrp.cbs.opn1.cur">
              <c-select
                v-model="model.bedgrp.cbs.opn1.cur"
                style="width: 100%"
                placeholder="请选择币种"
                :code="codes.acccur"
              >
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="14">
            <el-form-item label="" label-width="10px" prop="bedgrp.cbs.opn1.amt">
              <c-input-currency
                v-model="model.bedgrp.cbs.opn1.amt"
                style="text-align: left; width: 100%"
                placeholder="请输入单据余额"
              ></c-input-currency>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24">
          <c-col :span="22">
            <el-form-item label="单据类型" prop="bedgrp.rec.doctypcod">
              <c-select
                v-model="model.bedgrp.rec.doctypcod"
                style="width: 100%"
                placeholder="请选择单据类型"
                :code="codes.doc"
              >
              </c-select>
            </el-form-item>
          </c-col>
        </c-col>

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

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


      </c-col>
      <!-- 第三行 右边-->
      <c-col :span="11">
        <c-ptap
          :model="model"
          :argadr="{
            title: '交单人',
            grp: 'bedgrp',
            rol: 'prb',
          }"
          :disabled="true"
          @onSeainf="onSeainf"
          @onAplpDet="onBenpDet"
        >
        </c-ptap>
      </c-col>
    </c-col>
    
    <!-- 第四行 左边-->
    <c-col :span="12">
      <c-col :span="14">
        <el-form-item label="提示日期" prop="bedgrp.rec.disdat">
          <c-date-picker
            type="date"
            v-model="model.bedgrp.rec.disdat"
            style="width: 100%"
            placeholder="请选择提示日期"
          ></c-date-picker>
        </el-form-item>
      </c-col>
      <c-col :span="10"></c-col>

      <c-col :span="24">
        <c-col :span="22">
          <el-form-item label="单据状态" prop="bedgrp.rec.docsta">
            <c-select
              v-model="model.bedgrp.rec.docsta"
              style="width: 100%"
              placeholder="请选择单据状态"
              :code="codes.bedtyp"
            >
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="22">
          <el-form-item label="tenstm">
            <c-input
              v-model="model.trnmod.swiadd.strinf"
              maxlength="29"
              placeholder="tenstm">
            </c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="22">
          <el-form-item label="Payment instr">
            <c-input
              v-model="model.trnmod.swiadd.strinf"
              maxlength="29"
              placeholder="payinstxt">
            </c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="22">
          <el-form-item label="Less comm">
            <c-input
              v-model="model.trnmod.swiadd.strinf"
              maxlength="29"
              placeholder="less comm">
            </c-input>
          </el-form-item>
        </c-col>
      </c-col>

    </c-col>
    <!-- 第四行 右边-->
    <c-col :span="11">
      <c-ptap
        :model="model"
        :argadr="{
          title: '开证行',
          grp: 'bedgrp',
          rol: 'iss',
        }"
        :disabled="true"
        @onSeainf="onSeainf"
        @onAplpDet="onIsspDet"
      >
      </c-ptap>
    </c-col>
    <!-- 第五行 -->
    <c-col :span="24">
      <c-col :span="12">
        <c-col :span="22">
          <el-form-item label="Narrative : 77">
            <c-input
              v-model="model.trnmod.swiadd.strinf"
              maxlength="29"
              placeholder="Narrative : 77"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="11">
        <c-ptap
          :model="model"
          :argadr="{
            title: '申请人',
            grp: 'bedgrp',
            rol: 'apl',
          }"
          :disabled="true"
          @onSeainf="onSeainf"
          @onAplpDet="onAplpDet"
        >
        </c-ptap>
      </c-col>
    </c-col>

    <c-col :span="24" v-if="model.betp.aamp.aammod.addamtflg">
      <c-col :span="12">
        <c-col :span="8">
          <el-form-item label="单据金额" prop="bedgrp.cbs.max.cur">
            <c-select
              v-model="model.bedgrp.cbs.max.cur"
              style="width: 100%"
              placeholder="请选择币种"
              :code="codes.acccur"
            >
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="14">
          <el-form-item label="" label-width="10px" prop="aamset.utlamt">
            <c-input-currency
              v-model="model.aamset.utlamt"
              style="text-align: left; width: 100%"
              placeholder="请输入单据金额"
            ></c-input-currency>
          </el-form-item>
        </c-col>
      </c-col>
      <c-col :span="12">
      </c-col>
    </c-col>
    <c-col :span="24" v-if="model.betp.aamp.aammod.addamtflg">
      <c-col :span="12">
        <c-col :span="8">
          <el-form-item label="附加金额" prop="bedgrp.cbs.max.cur">
            <c-select
              v-model="model.bedgrp.cbs.max.cur"
              style="width: 100%"
              placeholder="请选择币种"
              :code="codes.acccur"
            >
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="14">
          <el-form-item label="" label-width="10px" prop="aamset.utlamt2">
            <c-input-currency
              v-model="model.aamset.utlamt2"
              style="text-align: left; width: 100%"
              placeholder="请输入附加金额"
            ></c-input-currency>
          </el-form-item>
        </c-col>
      </c-col>
      <c-col :span="12">
      </c-col>
    </c-col>
  </c-row>
</template>
<script>
import Api from "~/service/Api"
import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Betacc/Event";
import Ptap from "~/views/Public/Ptap";

export default {
    components: { "c-ptap": Ptap },
    inject: ['root'],
    props:["model","codes"],
    mixins: [CommonProcess],
    data(){
        return {

        }
    },
    methods:{...Event},
    created:function(){

    },
    watch:{
      "model.bedgrp.cbs.max.amt": function(){
          this.model.aamset.utlamt = this.model.bedgrp.cbs.max.amt;
      }
    }
}
</script>
<style>

</style>
