<template>
    <div class="eibs-tab">       
        <!--顶部-->
        <c-col :span="24">
            <c-col :span="12">
                <el-form-item label="参考号" prop="didgrp.rec.ownref">
            <c-fullbox>
              <c-input
              disabled
                  v-model="model.didgrp.rec.ownref"
                  maxlength="16"
                  placeholder="请输入Reference"
              ></c-input>
              <template slot="footer">
                <c-button
                style="margin:0 10px 0 10px;padding: 0 12px;"
                  size="small"
                  type="primary"
                >
                <span style="font-family:'宋体';font-weight:bold">i</span>
                </c-button>
              </template>
           </c-fullbox>
                </el-form-item>
            </c-col>
                             
            <c-col :span="12">
                    <el-form-item label="摘要" prop="didgrp.rec.nam">
                        <c-input  
                        disabled
                            v-model="model.didgrp.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="12">
            <c-col :span="24">
                <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="请选择金额类型"
                        >
                        <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 label="" prop="didgrp.cbs.nom1.amt" label-width="5px">
                        <c-input  
                        disabled
                            v-model="model.didgrp.cbs.nom1.amt"  
                            placeholder="请输入信用证金额"
                        ></c-input>
                    </el-form-item>
                </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" 
                            maxlength="3"  
                            placeholder="请选择金额类型"
                        >
                        <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 label="" prop="didgrp.cbs.opn1.amt" label-width="5px">
                        <c-input 
                        disabled 
                            v-model="model.didgrp.cbs.opn1.amt"  
                            placeholder="请输入单据余额"
                        ></c-input>
                    </el-form-item>
                </c-col>   
            </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.avbby0"
                    :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 label="开证日期" prop="didgrp.rec.opndat">
          <c-date-picker
          disabled
            type="date"
            v-model="model.didgrp.rec.opndat"
            style="width: 100%"
            placeholder="请选择Date L/C Opened/Issued"
          ></c-date-picker>
        </el-form-item>
      </c-col>

      <c-col :span="12">
        <el-form-item label="最迟装运日期" prop="didgrp.rec.shpdat">
          <c-date-picker
          disabled
            type="date"
            v-model="model.didgrp.rec.shpdat"
            style="width: 100%"
            placeholder="请选择Shipment Date"
          ></c-date-picker>
        </el-form-item>
      </c-col>

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

        <c-col :span="12">
        <el-form-item label="" prop="didgrp.rec.expplc" label-width="5px">
          <c-input
          disabled
            v-model="model.didgrp.rec.expplc"
            maxlength="35"
            placeholder="请输入Place of Expiry"
          ></c-input>
        </el-form-item>
        </c-col>

            <c-col :span="24">
                <el-form-item label="信用证类型" prop="didgrp.rec.lcrtyp">
                    <c-select 
                    disabled
                        v-model="model.didgrp.rec.lcrtyp" 
                        style="width:100%" 
                        placeholder="请选择Form of Documentary Credit"
                    >
                    <el-option
                    v-for="item in codes.lcrtyp"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
            >
            </el-option>
                    </c-select>
                </el-form-item>
            </c-col>
            </c-col>

            
            <!--右边-->
            <c-col :span="12">
            <c-col :span="24">
                    <el-form-item label="申请人" prop="bddgrp.apl.pts.ref">
                        <c-input  
                        disabled
                            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  
                    disabled
                        v-model="model.bddgrp.apl.pts.nam" 
                        maxlength="40"  
                        placeholder="请输入Name of Party"
                    ></c-input>
                </el-form-item>
            </c-col>

            <c-col :span="24">
                <el-form-item label="受益人" prop="bddgrp.ben.pts.ref">
                    <c-input  
                    disabled
                        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  
                    disabled
                        v-model="model.bddgrp.ben.pts.nam" 
                        maxlength="40"  
                        placeholder="请选择Available by"
                    ></c-input>
                </el-form-item>
            </c-col>

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

            <c-col :span="24">
                <el-form-item label="" prop="bddgrp.prb.pts.nam">
                    <c-input  
                    disabled
                        v-model="model.bddgrp.prb.pts.nam" 
                        maxlength="40"  
                        placeholder="请输入Reference"
                    ></c-input>
                </el-form-item>
            </c-col>
        </c-col>
        </c-row>

                <div class="line" />
                <hr />

                
    <el-row>
        <!--左边-->
        <c-col :span="12">
    <el-row>
    <c-col :span="22">
                <el-form-item label="Document Reference" prop="bddgrp.rec.ownref">
                    <c-input  
                    disabled
                        v-model="model.bddgrp.rec.ownref" 
                        maxlength="16"  
                        placeholder="请输入Document Reference"
                    ></c-input>
                </el-form-item>
            </c-col>

            <c-col :span="2" style="text-align: right">
        <el-form-item label-width="0">
          <c-button
            size="small"
            type="primary"
            icon="el-icon-search"
            style="margin-left: 0"
          ></c-button>
        </el-form-item>
      </c-col>
            </el-row>


            <c-col :span="24">
                <el-form-item label="Type of Advice" prop="bddgrp.rec.advtyp">
                    <c-select 
                    v-model="model.bddgrp.rec.advtyp" 
                    style="width:100%" 
                    placeholder="请选择Type of Advice"
                    :code="advtyp"
                ></c-select>
                </el-form-item>
            </c-col>
                                        
                                        
            <c-col :span="12">
                <el-form-item label="Payment" prop="bddgrp.rec.advdat">
                    <c-date-picker 
                    :disabled="model.bddgrp.rec.advtyp=='750' || model.bddgrp.rec.advtyp=='oth'"
                        type="date"  
                        v-model="model.bddgrp.rec.advdat" 
                        style="width:100%"  
                        placeholder="请选择Payment advised on"
                    ></c-date-picker>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="Discrep" prop="bddgrp.rec.disdat">
                    <c-date-picker
                    :disabled="model.bddgrp.rec.advtyp=='754' || model.bddgrp.rec.advtyp=='oth'" 
                        type="date"  
                        v-model="model.bddgrp.rec.disdat" 
                        style="width:100%"  
                        placeholder="请选择Discrep. advised on"
                    ></c-date-picker>
                </el-form-item>
            </c-col>
                        
            <!-- <c-col :span="24">
                <el-form-item label="">
                    <c-checkbox v-model="model.bdtp.setnowflg">Register to Send and Settle Document</c-checkbox>
                    </el-form-item>   
            </c-col>

            <c-col :span="24">
                <el-form-item label="">
                    <c-checkbox v-model="model.bdtp.dcrflg" >Register to Handle Discrepancies</c-checkbox>
                    </el-form-item>   
            </c-col>  -->
            </c-col>    


        <!--右部-->
        <c-col :span="12">
            <c-col :span="24" >
                <el-form-item label="name" prop="bddgrp.rec.nam">
                    <c-input  
                    disabled
                        v-model="model.bddgrp.rec.nam" 
                        maxlength="40"  
                        placeholder="请输入Name"
                    ></c-input>
                </el-form-item>
            </c-col>
                                                               
                                
            <c-col :span="24" >
                <el-form-item label="Presented" prop="bddgrp.rec.docprbrol">
                    <c-select 
                    v-model="model.bddgrp.rec.docprbrol" 
                    style="width:100%" 
                    placeholder="请选择Presented by"
                    @change="selectOrCheckboxRule('bddgrp.rec.docprbrol')"
                >
                <el-option
              v-for="item in docprbrol"
              :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="Reference" prop="bddgrp.prb.pts.ref">
                    <c-input  
                        v-model="model.bddgrp.prb.pts.ref"
                        maxlength="16"  
                        placeholder="请输入Reference"
                    ></c-input>
                </el-form-item>
            </c-col> -->


            <c-col :span="24">
        <c-ptap
          :model="model"
          :argadr="{
            title: 'ExtKey',
            grp: 'bddgrp',
            rol: 'prb',
          }"
          :disabledExtkey="this.flag"
          :onlySearch="true"
        >
        </c-ptap>
      </c-col>
            <!-- <c-col :span="24" >
            <c-col :span="19">
                <el-form-item label="ExtKey" prop="bddgrp.prb.pts.extkey">
                    <c-input  v-model="model.bddgrp.prb.pts.extkey" maxlength="16"  placeholder="请输入External Key of Address"></c-input>
                </el-form-item>
            </c-col>

            <c-col :span="5">
            <c-button
                style="margin:0 10px 0 10px;padding: 0 12px;"
                  size="small"
                  type="primary"
                  @click="onSeainf"
                >
                <span style="font-family:'宋体';font-weight:bold">i</span>
                </c-button>
            <c-button size="small" type="primary"  @click="onPrbpDet">
                    Details
                </c-button>
                </c-col>
                </c-col> -->

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

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



    </div>
</template>
<script>
import Api from "~/service/Api"
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Ditdav/Event"
import Ptap from "~/views/Public/Ptap";

export default {
    components: { "c-ptap": Ptap },
    inject: ['root'],
    props:["model","codes"],
    mixins: [commonProcess],
    data(){
        return {
            docprbrol: [
        { label: "Advising Bank", value: "ADV" },
        { label: "Beneficiary", value: "BEN" },
        { label: "Presenter(PRP)", value: "PRB" },
    ],
            advtyp: [
        { label: "Advice of Discrepancy (MT750)", value: "750" },
        { label: "Advice of Payment (MT754)", value: "754" },
        { label: "Other", value: "oth" },
    ],

        };
    },
    watch:{
        "model.bddgrp.rec.advtyp":function(){
            if(this.model.bddgrp.rec.advtyp=='750'){
                this.model.bddgrp.rec.advdat="";
            }
            else if(this.model.bddgrp.rec.advtyp=='754'){
                this.model.bddgrp.rec.disdat="";
            }
            else if (this.model.bddgrp.rec.advtyp=='oth'){
                this.model.bddgrp.rec.disdat="";
                this.model.bddgrp.rec.advdat="";
            }
        },
        "model.bddgrp.rec.docprbrol":function(){
            if(this.model.bddgrp.rec.docprbrol=='ADV'){
                this.flag=true;
            }
            else if(this.model.bddgrp.rec.docprbrol=='BEN'){
                this.flag=true;
            }
            else if(this.model.bddgrp.rec.docprbrol=='PRB'){
                this.flag=false;
            }

        },

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

    }
}
</script>
<style>
/* .change1{
    position: relative;
    margin-top: 52px;
}
.change{
    position: relative;
    background-color: #ccc;
 } */
</style>
