<template>
  <c-row>
    <!-- =================顶部====================== -->
    <c-col :span="24">
      <c-col :span="11">
        <c-col :span="20">
          <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="4">
          <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="摘要" prop="bodgrp.rec.nam">
          <c-input text-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="12">
        <el-form-item label="Document Amount" prop="bodgrp.cbs.max.cur">
          <c-select disabled v-model="model.bodgrp.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="20px" prop="bodgrp.cbs.max.amt">
          <c-input-currency v-model="model.bodgrp.cbs.max.amt" style="text-align: left; width: 100%"
            placeholder="请输入Document Amount" disabled
            @keyup.enter.native="defaultFunction('bodgrp.cbs.max.amt', model.bodgrp.cbs.max.amt)"></c-input-currency>
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="Warehouse/Insurance" prop="bodgrp.cbs.opn1.cur">
          <c-select disabled v-model="model.bodgrp.cbs.opn1.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="20px" prop="bodgrp.cbs.opn1.amt">
          <c-input-currency v-model="model.bodgrp.cbs.opn1.amt" style="text-align: left; width: 100%"
            placeholder="请输入Warehouse/Insurance" disabled
            @keyup.enter.native="defaultFunction('bodgrp.cbs.opn1.amt', model.bodgrp.cbs.opn1.amt)"></c-input-currency>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="Collection Condition" prop="bodgrp.rec.doctypcod">
          <c-select v-model="model.bodgrp.rec.doctypcod" style="width:100%" placeholder="请选择Collection Condition" :code="codes.doctypcod" disabled
            >
          </c-select>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="Document Set Status" prop="bodgrp.rec.docsta">
          <c-select v-model="model.bodgrp.rec.docsta" maxlength="40" placeholder="请输入Document Set Status" :code="codes.docstabot" disabled>
          </c-select>
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="Maturity Date" prop="bodgrp.rec.matdat">
          <c-date-picker type="date" v-model="model.bodgrp.rec.matdat" style="width:100%" placeholder="请选择Maturity Date"
            disabled></c-date-picker>
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="Tenor Specification" prop="bodgrp.rec.matpercnt">
          <c-input v-model="model.bodgrp.rec.matpercnt" placeholder="请输入Tenor Specification" disabled></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="  " prop="bodgrp.rec.matperbeg">
          <c-select v-model="model.bodgrp.rec.matperbeg" style="width:100%"
            placeholder="请选择Start of Maturity Period MATBEG" disabled>
          </c-select>
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="Order Date" prop="bodgrp.rec.rcvdat">
          <c-date-picker type="date" v-model="model.bodgrp.rec.rcvdat" style="width:100%" placeholder="请选择Order Date"
            disabled></c-date-picker>
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="Presentation Date" prop="bodgrp.rec.predat">
          <c-date-picker type="date" v-model="model.bodgrp.rec.predat" style="width:100%"
            placeholder="请选择Presentation Date" disabled></c-date-picker>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="Instructions for Second Mail" prop="bodgrp.blk.colinssnm" >
            <c-input type="textarea" v-model="model.bodgrp.blk.colinssnm" maxlength="60" show-word-limit placeholder="请输入Instructions for Second Mail" ></c-input>
        </el-form-item>
        </c-col>

        <c-col :span="12">
	    <c-checkbox v-model="model.oridre" padding="15">Original Documents Passed to Drawee</c-checkbox>
       </c-col>


      
    </c-col>
    <!-- ====================右边======================= -->
    <c-col :span="11" :offset="1">

      <c-col :span="24">
        <el-form-item label="Drawer" prop="bodgrp.drr.pts.ref">
          <c-input v-model="model.bodgrp.drr.pts.ref" maxlength="16" placeholder="请输入Drawer" ></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="Name of Party" prop="bodgrp.drr.pts.nam">
          <c-input v-model="model.bodgrp.drr.pts.nam" maxlength="40" placeholder="请输入Name of Party" disabled></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="Collecting Bank" prop="bodgrp.col.pts.ref">
          <c-input v-model="model.bodgrp.col.pts.ref" maxlength="16" placeholder="请输入Collecting Bank" disabled></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="Name of Party" prop="bodgrp.col.pts.nam">
          <c-input v-model="model.bodgrp.col.pts.nam" maxlength="40" placeholder="请输入Name of Party" disabled></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="Drawee" prop="bodgrp.dre.pts.ref">
          <c-input v-model="model.bodgrp.dre.pts.ref" maxlength="16" placeholder="请输入Drawee" disabled></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <el-form-item label="Name of Party" prop="bodgrp.dre.pts.nam">
          <c-input v-model="model.bodgrp.dre.pts.nam" maxlength="40" placeholder="请输入Name of Party" disabled></c-input>
        </el-form-item>
      </c-col>

      <!-- <c-col :span="24" style="height: 24px; margin-top: -10px">
        <el-form-item :label="model.botp.docgrdm.docdsclab" class="messageLabel">
          <c-button style="float: right" @click="addTableValue" type="primary">新增单据</c-button>
        </el-form-item>
      </c-col>
      <c-col :span="24" style="margin-bottom: 30px;">
        <c-table height="200px" style="text-align: center" :list="this.model.botp.docgrdm.docgrd || []"
          :paginationShow="false" :border="true">
          <el-table-column label="1st" width="auto">
            <template slot-scope="scope">
              <c-input v-model="scope.row.cmail1"></c-input>
            </template>

          </el-table-column>
          <el-table-column label="2st" width="auto">
            <template slot-scope="scope">
              <c-input v-model="scope.row.cmail2"></c-input>
            </template>
          </el-table-column>
          <el-table-column label="Document" prop="docnam" width="auto">
            <template slot-scope="scope">
              <c-select style="width: 100%" placeholder="请选择" v-model="scope.row.docnam">
                <el-option v-for="item in codeTable" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </c-select>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="170px" fixed="right">
            <template slot-scope="scope">
              <c-button @click="deleteTable(scope.$index)" type="primary">删除</c-button>
            </template>
          </el-table-column>
        </c-table>
      </c-col> -->

      <c-docpre 
      :model="model" 
      :argadr="{
        path:'bodgrp.blk.docpre',
        grp: 'botp',
        code:'docpre'
      }"></c-docpre>

    </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/Botdcr/Event"
import Utils from "~/utils";
import Ptap from "~/views/Public/Ptap";
import Docpre from "~/views/Public/Docpre";

export default {
  components: { "c-ptap": Ptap ,
    "c-docpre": Docpre,},
  inject: ['root'],
  props: ["model", "codes"],
  mixins: [commonProcess],
  data() {
    return {
      columns: ['0 0 "lst1" 100 ', '1 1 "lst2" 100', '2 2 "document" 200'],
      codeTable: [
        { label: "Airway Bills", value: "Airway Bills" },
        { label: "Beneficiary's Declaration", value: "Beneficiary's Declaration" },
        { label: "Bill of Lading Copies", value: "Bill of Lading Copies" },
        { label: "Bill of Lading Originals", value: "Bill of Lading Originals" },
        { label: "Certificate", value: "Certificate" },
        { label: "Certificate of Analysis", value: "Certificate of Analysis" },
        { label: "Certificate of Origin", value: "Certificate of Origin" },
        { label: "Certificate of Quality", value: "Certificate of Quality" },
        { label: "Certificate of Quantity", value: "Certificate of Quantity" },
        { label: "Commercial Invoice", value: "Commercial Invoice" },
        { label: "Courier Receipt", value: "Courier Receipt" },
        { label: "Draft", value: "Draft" },
        { label: "Export Licence", value: "Export Licence" },
        { label: "Fax Report", value: "Fax Report" },
        { label: "Inspection Cert", value: "Inspection Cert" },
        { label: "Insurance Policy", value: "Insurance Policy" },
        { label: "Packing List", value: "Packing List" },
        { label: "Shipment Advice", value: "Shipment Advice" },
        { label: "Weight List", value: "Weight List" },
      ],
      TableValue: [
        {
          id: 0,
          cmail1: "",
          cmail2: "",
          docnam: "",
          description: "",
          serialNum: "",
          tableName: "",
          tcddoc: "",
        },
      ],
      newValue: {
        id: 0,
        cmail1: "",
        cmail2: "",
        docnam: "",
        description: "",
        serialNum: "",
        tableName: "",
        tcddoc: "",
      },

    }
  },
  methods: {
    ...Event,
    addTableValue(index) {
      var newTableValue = Object.assign({}, this.newValue);
      const serial = Utils.generateUUID();
      newTableValue.serialNum = serial;
      this.model.botp.docgrdm.docgrd.splice(index - 1, 0, newTableValue);
    },
    deleteTable(index) {
      this.model.botp.docgrdm.docgrd.splice(index, 1);
    },
  },

  created: function () {
    console.log(this.root);
  }
}
</script>
<style>
.messageLabel>>>.el-form-item__label {
  text-align: left;
  font-weight: bold;
  font-size: 12px;
}
</style>


<!-- <template>
  <div class="eibs-tab">
                              
       <c-col :span="12">
        <el-form-item label="Drag  Drop Sender" prop="botp.recget.sdamod.dadsnd">
            <c-input  v-model="model.botp.recget.sdamod.dadsnd"  placeholder="请输入Drag  Drop Sender"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Reference" prop="bodgrp.rec.ownref">
            <c-input  v-model="model.bodgrp.rec.ownref" maxlength="16"  placeholder="请输入Reference"></c-input>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="" prop="botp.recget.sdamod.seainf">
            <c-input  v-model="model.botp.recget.sdamod.seainf"  placeholder="请输入"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Name" prop="bodgrp.rec.nam">
            <c-input  v-model="model.bodgrp.rec.nam" maxlength="40"  placeholder="请输入Name"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Document Amount" prop="bodgrp.cbs.max.cur">
            <c-select v-model="model.bodgrp.cbs.max.cur" style="width:100%" placeholder="请选择Document Amount">
              </c-select>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Document Amount" prop="bodgrp.cbs.max.amt">
            <c-input  v-model="model.bodgrp.cbs.max.amt"  placeholder="请输入Document Amount"></c-input>
        </el-form-item>
       </c-col>
                                                    
       <c-col :span="12">
        <el-form-item label="Drawer" prop="bodgrp.drr.pts.ref">
            <c-input  v-model="model.bodgrp.drr.pts.ref" maxlength="16"  placeholder="请输入Drawer"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Open Amount" prop="bodgrp.cbs.opn1.cur">
            <c-select v-model="model.bodgrp.cbs.opn1.cur" style="width:100%" placeholder="请选择Open Amount">
              </c-select>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Open Amount" prop="bodgrp.cbs.opn1.amt">
            <c-input  v-model="model.bodgrp.cbs.opn1.amt"  placeholder="请输入Open Amount"></c-input>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Name of Party" prop="bodgrp.drr.pts.nam">
            <c-input  v-model="model.bodgrp.drr.pts.nam" maxlength="40"  placeholder="请输入Name of Party"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Collection Condition" prop="bodgrp.rec.doctypcod">
            <c-select v-model="model.bodgrp.rec.doctypcod" style="width:100%" placeholder="请选择Collection Condition">
              </c-select>
        </el-form-item>
       </c-col>
                                                    
       <c-col :span="12">
        <el-form-item label="Collecting Bank" prop="bodgrp.col.pts.ref">
            <c-input  v-model="model.bodgrp.col.pts.ref" maxlength="16"  placeholder="请输入Collecting Bank"></c-input>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Name of Party" prop="bodgrp.col.pts.nam">
            <c-input  v-model="model.bodgrp.col.pts.nam" maxlength="40"  placeholder="请输入Name of Party"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Document Set Status" prop="bodgrp.rec.docsta">
            <c-input  v-model="model.bodgrp.rec.docsta" maxlength="40"  placeholder="请输入Document Set Status"></c-input>
        </el-form-item>
       </c-col>
                                   
	<c-col :span="12">
	    <span  v-text="model.botp.matp.mattxtlab"   data-path=".botp.matp.mattxtlab" > </span>
	</c-col>
                  
       <c-col :span="12">
        <el-form-item label="Maturity Date" prop="bodgrp.rec.matdat">
            <c-date-picker type="date"  v-model="model.bodgrp.rec.matdat" style="width:100%"  placeholder="请选择Maturity Date"></c-date-picker>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Tenor Specification" prop="bodgrp.rec.matpercnt">
            <c-input  v-model="model.bodgrp.rec.matpercnt"  placeholder="请输入Tenor Specification"></c-input>
        </el-form-item>
       </c-col>
                  
	<c-col :span="12">
	    <span  v-text="model.bodgrp.rec.matpertyp"   data-path=".bodgrp.rec.matpertyp" > </span>
	</c-col>
                                                    
       <c-col :span="12">
        <el-form-item label="Drawee" prop="bodgrp.dre.pts.ref">
            <c-input  v-model="model.bodgrp.dre.pts.ref" maxlength="16"  placeholder="请输入Drawee"></c-input>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Start of Maturity Period MATBEG" prop="bodgrp.rec.matperbeg">
            <c-select v-model="model.bodgrp.rec.matperbeg" style="width:100%" placeholder="请选择Start of Maturity Period MATBEG">
              </c-select>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Name of Party" prop="bodgrp.dre.pts.nam">
            <c-input  v-model="model.bodgrp.dre.pts.nam" maxlength="40"  placeholder="请输入Name of Party"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Order Date" prop="bodgrp.rec.rcvdat">
            <c-date-picker type="date"  v-model="model.bodgrp.rec.rcvdat" style="width:100%"  placeholder="请选择Order Date"></c-date-picker>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Presentation Date" prop="bodgrp.rec.predat">
            <c-date-picker type="date"  v-model="model.bodgrp.rec.predat" style="width:100%"  placeholder="请选择Presentation Date"></c-date-picker>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Instructions for Second Mail" prop="bodgrp.blk.colinssnm">
            <c-input type="textarea" v-model="model.bodgrp.blk.colinssnm" maxlength="60" show-word-limit placeholder="请输入Instructions for Second Mail" ></c-input>
        </el-form-item>
        </c-col>
                  
       <c-col :span="12">
	    <c-checkbox v-model="model.oridre">Original Documents Passed to Drawee</c-checkbox>
       </c-col>
                  
	<c-col :span="12">
	    <span  v-text="model.botp.docgrdm.docdsclab"   data-path=".botp.docgrdm.docdsclab" > </span>
	</c-col>
  </div>
</template>
<script>
import Api from "~/service/Api"
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Botrad/Event"

export default {
    inject: ['root'],
    props:["model","codes"],
    mixins: [commonProcess],
    data(){
        return {

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

    }
}
</script>
<style>

</style> -->
