<template>
 <c-row>
<!-- =================顶部====================== -->
  <c-col :span="24">
    <c-col :span="11">
        <c-col :span="22">
          <el-form-item
            label="Reference"
            prop="bodgrp.rec.ownref"
            style="width: 100%"
          >
            <c-input
              v-model="model.bodgrp.rec.ownref"
              maxlength="16"
              placeholder="请输入Reference"
              style="width: 95%"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
          <c-col :span="2">
              <c-button
               style="margin:0 10px 0 0;padding: 0 10px;"
                size="small"
                type="primary"
                icon="el-icon-search"
              ></c-button>
          </c-col>
          
    </c-col>
    <c-col :span="11" :offset="1">
        <el-form-item label="Name" prop="bodgrp.rec.nam">
          <c-input
            align="middle"
            v-model="model.bodgrp.rec.nam"
            maxlength="40"
            disabled
            placeholder="请输入Externally Displayed Name to Identify the Contract"
          ></c-input>
        </el-form-item>
    </c-col>
  </c-col>
<!-- ====================左边======================= -->
  <c-col :span="11">            
    <c-col :span="24">
        <el-form-item label="Amendment Date" prop="botamep.amedat">
            <c-date-picker type="date"  v-model="model.botamep.amedat" style="width:100%"  placeholder="请选择Amendment Date"></c-date-picker>
        </el-form-item>
    </c-col>
    
    <c-col :span="24">
    <c-col :span="12" >
        <el-form-item label="" >
        </el-form-item>
    </c-col>  
    <c-col :span="12" :offset="4">
        <el-form-item label="Amount" >
        </el-form-item>
    </c-col>
    </c-col>
    
    <c-col :span="12">
        <el-form-item label="Original Amount" prop="oldbodgrp.cbs.max.cur">
          <c-select
            disabled
            v-model="model.oldbodgrp.cbs.max.cur"
            style="width: 100%"
            placeholder="请选择Currency"
            
          >
            <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="5px"
          prop="oldbodgrp.cbs.max.amt"
        >
          <c-input-currency
          disabled
            v-model="model.oldbodgrp.cbs.max.amt"
            style="text-align: left; width: 100%"
            placeholder="请输入Original Amount"
            @keyup.enter.native="defaultFunction('oldbodgrp.cbs.max.amt', model.oldbodgrp.cbs.max.amt)"
          ></c-input-currency>
        </el-form-item>
      </c-col>
    
    <c-col :span="12">
        <el-form-item label="Amended" prop="trnmod.swiadd.amecur">
          <c-select
            disabled
            v-model="model.trnmod.swiadd.amecur"
            style="width: 100%"
            placeholder="请选择Currency"
            
          >
            <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="5px"
          prop="trnmod.swiadd.ameamt"
        >
          <c-input-currency
            v-model="model.trnmod.swiadd.ameamt"
            style="text-align: left; width: 100%"
            placeholder="请输入Amended"
            @keyup.enter.native="defaultFunction('trnmod.swiadd.ameamt', model.trnmod.swiadd.ameamt)"
          ></c-input-currency>
        </el-form-item>
      </c-col>
    
    <c-col :span="12">
        <el-form-item label="New Amount" prop="trnmod.swiadd.newcur">
          <c-select
            disabled
            v-model="model.trnmod.swiadd.newcur"
            style="width: 100%"
            placeholder="请选择Currency"
            
          >
            <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="5px"
          prop="trnmod.swiadd.newamt"
        >
          <c-input-currency
            v-model="model.trnmod.swiadd.newamt"
            style="text-align: left; width: 100%"
            placeholder="请输入New Amount"
            @keyup.enter.native="defaultFunction('trnmod.swiadd.newamt', model.trnmod.swiadd.newamt)"
          ></c-input-currency>
        </el-form-item>
      </c-col>
  </c-col>


<!-- ====================底部======================= -->
<c-col>
  <el-row>
   <c-col :span="11">       
     <c-col :span="24">                           
       <c-col :span="9">
        <el-form-item label="Tenor Data" prop="oldbodgrp.rec.matpercnt">
            <c-input disabled v-model="model.oldbodgrp.rec.matpercnt"  placeholder="请输入New Tenor Data"></c-input>
        </el-form-item>
       </c-col>
                  
       <c-col :span="4">
        <el-form-item label="" prop="oldbodgrp.rec.matpertyp" label-width="5px">
            <c-select disabled v-model="model.oldbodgrp.rec.matpertyp" style="width: 100%"  placeholder="请选择Days/Month or Year for Maturity Period">
            <el-option
              v-for="item in matpertyp"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
            </c-select>
            
        </el-form-item>
       </c-col>
                  
       <c-col :span="11">
        <el-form-item label="" prop="oldbodgrp.rec.matperbeg" label-width="5px">
            <c-select disabled v-model="model.oldbodgrp.rec.matperbeg" style="width:100%" placeholder="请选择Start of Maturity Period">
            <el-option
              v-for="item in codes.matperbeg"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
              </c-select>
        </el-form-item>
       </c-col>
     </c-col>
   </c-col>
   </el-row>

    <el-row>
    <c-col :span="11">       
      <c-col :span="24">                           
       <c-col :span="9">
        <el-form-item label="New Tenor Data" prop="trnmod.swiadd.newmatpercnt">
            <c-input  :disabled="model.bodgrp.rec.doctypcod === 'P'" v-model="model.trnmod.swiadd.newmatpercnt"   placeholder="请输入Tenor Data"></c-input>
        </el-form-item>
       </c-col>
   
       <c-col :span="4">
        <el-form-item label="" prop="trnmod.swiadd.newmatpertyp" label-width="5px">
            <c-select  :disabled="model.bodgrp.rec.doctypcod === 'P'" v-model="model.trnmod.swiadd.newmatpertyp"  style="width: 100%"  placeholder="请输入Days/Months or Years for Maturity Period">
            <el-option
              v-for="item in matpertyp"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
            </c-select>
        </el-form-item>
       </c-col>
                  
       <c-col :span="11">
        <el-form-item label="" prop="trnmod.swiadd.newmatperbeg" label-width="5px">
            <c-select :disabled="model.bodgrp.rec.doctypcod === 'P'" v-model="model.trnmod.swiadd.newmatperbeg" style="width:100%" placeholder="请选择Start of Maturity Period MATBEG">
            <el-option
              v-for="item in codes.matperbeg"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
              </c-select>
        </el-form-item>
       </c-col>
       </c-col>
    </c-col>
    </el-row>

</c-col>

<!-- ====================左边======================= -->
  <c-col :span="11">                       
       <c-col :span="24">
        <el-form-item label="Maturity Date" prop="oldbodgrp.rec.matdat">
            <c-date-picker type="date" disabled v-model="model.oldbodgrp.rec.matdat" style="width:100%"  placeholder="请选择Maturity Date"></c-date-picker>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="24">
        <el-form-item label="New Maturity Date" prop="trnmod.swiadd.newmatdat">
            <c-date-picker type="date"  :disabled="model.bodgrp.rec.doctypcod === 'P'" v-model="model.trnmod.swiadd.newmatdat" style="width:100%"  placeholder="请选择New Maturity Date"></c-date-picker>
        </el-form-item>
       </c-col>
                                                    
       <c-col :span="24">
        <el-form-item label="Further Amendments" prop="trnmod.swiadd.ametxt">
            <c-input-format type="textarea" v-model="model.trnmod.swiadd.ametxt" :maxRows="6" :maxCols="35" placeholder="请输入Further Amendments" ></c-input-format>
        </el-form-item>
        </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/Botame/Event"

export default {
    inject: ['root'],
    props:["model","codes"],
    mixins: [commonProcess],
    data(){
        return {
          matpertyp: [
        { label: "Days", value: "D" },
        { label: "Months", value: "M" },
    ],

        }
    },
    watch:{
        "model.bodgrp.rec.doctypcod":function(){
            if(this.model.bodgrp.rec.doctypcod=='P'){
                this.model.trnmod.swiadd.newmatdat="";
                this.model.bodgrp.rec.matdat="";
            }
        },
      },
    methods:{...Event,
    // change() {
    // if(this.model.trnmod.swiadd.newmatdat!="" ){
    //         this.model.bodgrp.rec.matdat=this.model.trnmod.swiadd.newmatdat;
    //         }
    //       else{
    //           this.model.bodgrp.rec.matdat=this.model.oldbodgrp.rec.matdat;
    //         }
    // },
    },
    created:function(){

    }
}
</script>
<style>

</style>