<template>
  <div class="eibs-tab">
        <c-list-search  @form-reset="handleReset" @form-search="onInfbutSearow">
            <template v-slot="searchSlot">
                <el-form
                    class="m-table-search-form"
                    ref="paramsForm"
                    :inline="true"
                    label-position="left"
                    label-width="110px"
                    size="small"
                >
        <el-row>                                        
            <c-col :span="12">
                <el-form-item label="业务编号" prop="infcon.seaownref" >
                    <c-input  v-model="model.infcon.seaownref" maxlength="16"  placeholder="请输入Own Reference" ></c-input>
                </el-form-item>
            </c-col>

             <c-col :span="12" >
                <el-form-item label="开立日期" >
                    <el-date-picker type="date"   v-model="model.infcon.opndatfrom"  placeholder="请选择Opening between" style="width:43%"></el-date-picker>
                    -
                    <el-date-picker type="date"  v-model="model.infcon.opndatto"  placeholder="请选择Open Date to" style="width:43%"></el-date-picker>
                </el-form-item>
            </c-col>
         </el-row>
            <!--<c-col :span="12">
                <el-form-item label="Opening between" prop="infcon.opndatfrom">
                    <c-date-picker type="date"  v-model="model.infcon.opndatfrom" value-format="yyyy-MM-dd" style="width:100%"  placeholder="请选择Opening between"></c-date-picker>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="Open Date to" prop="infcon.opndatto">
                    <c-date-picker type="date"  v-model="model.infcon.opndatto"  value-format="yyyy-MM-dd" style="width:100%"  placeholder="请选择Open Date to"></c-date-picker>
                </el-form-item>
            </c-col>-->
      
        <el-row v-show="searchSlot.searchToggle">                           
            <c-col :span="12">
                <el-form-item label="业务主题" prop="infcon.nam"  style="">
                    <c-input  v-model="model.infcon.nam" maxlength="40"  placeholder="请输入Name" ></c-input>
                </el-form-item>
            </c-col>
             
       <!--<c-col :span="12">
        <el-form-item label="Party Reference"  prop="infcon.searef" >
            <c-input  v-model="model.infcon.searef" maxlength="16"  placeholder="请输入Party Reference" ></c-input>
        </el-form-item>
       </c-col>-->
                                   
       <c-col :span="12">
        <el-form-item label="复核状态" prop="infcon.relflg"  style="">
            <c-select v-model="model.infcon.relflg" style="width:100%" placeholder="请选择Release Status">
                <el-option
                    v-for="item in codes.relflg"
                    :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="Handling Type" v-show ="false" prop="infcon.hndtyp" >
            <c-select v-model="model.infcon.hndtyp" style="width:100%" placeholder="请选择Handling Type">
                <el-option
                    v-for="item in codes.hndtyp"
                    :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="Select Single Party" prop="infcon.pty.extkey"  >
            <c-input  v-model="model.infcon.pty.extkey" maxlength="24"  placeholder="请输入Select Single Party" ></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Party Name" prop="infcon.pty.nam" >
            <c-input  v-model="model.infcon.pty.nam" maxlength="40"  placeholder="请输入Party Name" ></c-input>
        </el-form-item>
       </c-col>

       <c-col :span="12">
        <el-form-item label="Party Name/BIC" prop="infcon.seapty"  >
            <c-input  v-model="model.infcon.seapty" maxlength="24"  placeholder="请输入Party Name/BIC"></c-input>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Role" prop="infcon.searol" >
            <c-select v-model="model.infcon.searol" style="width:100%" placeholder="请选择Role">
                <el-option
                    v-for="item in codes.searol"
                    :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="Opening between" prop="infcon.opndatfrom" >
            <c-date-picker type="date"  v-model="model.infcon.opndatfrom" value-format="yyyy-MM-dd" style="width:100%"  placeholder="请选择Opening between"></c-date-picker>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Open Date to" prop="infcon.opndatto" >
            <c-date-picker type="date"  v-model="model.infcon.opndatto"  value-format="yyyy-MM-dd" style="width:100%"  placeholder="请选择Open Date to"></c-date-picker>
        </el-form-item>
       </c-col>-->
                                   
       <!--<c-col :span="12">
        <el-form-item label="Resp.User" disabled prop="infcon.usr.extkey" >
            <c-input  v-model="model.infcon.usr.extkey" maxlength="8"  placeholder="请输入User ID"></c-input>
        </el-form-item>
       </c-col>-->
                                   
       <c-col :span="12">
        <el-form-item label="业务状态" prop="infcon.seasta" >
            <c-select v-model="model.infcon.seasta" style="width:100%" placeholder="请选择Status">
                <el-option
                    v-for="item in codes.seasta"
                    :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="infcon.seacur" >
            <c-select v-model="model.infcon.seacur" style="width:100%" placeholder="请选择Currency">
                <el-option
                    v-for="item in codes.seacur"
                    :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="金额" >
            <c-input  v-model="model.infcon.seaamtfr"  placeholder="请输入Amount between"style="width:45%"></c-input>
                -
            <c-input  v-model="model.infcon.seaamtto"  placeholder="请输入Amount to"style="width:45%"></c-input>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="是否显示查询码" prop="infcon.cxmflg" >
            <c-select v-model="model.infcon.cxmflg" style="width:100%" placeholder="请选择是否显示查询码">
                <el-option
                    v-for="item in codes.cxmflg"
                    :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="seacnfdet" >
            <c-select v-model="model.seacnfdet" style="width:100%" placeholder="请选择Confirmation Status">
                <el-option
                    v-for="item in codes.cnfins"
                    :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="sealcrtyp" >
            <c-select v-model="model.sealcrtyp" :code="codes.lcrtyp" style="width:100%" placeholder="请选择form of L/C">
              </c-select>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="货物种类" prop="seagodcod">
            <c-select v-model="model.seagodcod" style="width:100%" placeholder="请选择Goods Code">
                <el-option
                    v-for="item in codes.godcod"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                >
                </el-option>
            </c-select>
        </el-form-item>
       </c-col>
      
    </el-row>   
  </el-form>
</template>
</c-list-search>       
       <!--<c-col :span="12">
        <el-form-item label="display stream" prop="infbut.dspstm">
            <c-input  v-model="model.infbut.dspstm"  placeholder="请输入display stream"></c-input>
        </el-form-item>
       </c-col>-->

    <el-col :span="24" style="padding: 20px 16px;">
    <!--    <c-button size="small" type="primary"  @click="onInfbutSearow">
            Search
        </c-button>  
        -->
        <c-button size="small" type="primary" title="LITOPN"  @click="onChoose('litopn')">
            进口信用证开立
        </c-button>
        <c-button size="small" type="primary"  @click="onInfbutDsp">
            Display
        </c-button>
        <!-- <c-button size="small" type="primary"  @click="onInfbutUserow">
            Use
        </c-button>-->
        <c-button size="small" type="primary"  @click="onInfbutClr">
            Clear
        </c-button>
        <c-button size="small" type="primary"  @click="onInfbutButprt">
            导Excel
        </c-button>
        <c-button size="small" type="primary"  @click="onInfbutExi">
            Exit
        </c-button>
       </el-col>
       <c-istream-table :list="this.model.infbut.dspstm" :columns="columns" style="padding: 0 16px;">
          <el-table-column
                prop="display"
                label="操作"
                width="100">
            <template slot-scope="scope">
                 <c-button size="small" type="primary"  @click="getButtons(scope.row['业务编号'])">处理</c-button>
                <!--<a href="javascript:void(0)"   @click="getButtons(scope.row['业务编号'])">处理</a>-->
            </template>
          </el-table-column>
        </c-istream-table>
         <el-dialog :visible.sync="initdialog" :title="'交易列表'" append-to-body>
            <div class="m-list-btns">
                <m-busbtn ref="childs"  :ownref="curownref"  @onChoose="onChoose" >11</m-busbtn>
            </div>
         </el-dialog> 
  </div>
</template>
<script>
import Api from "~/service/Api"
import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Inflid/Event"
import  BusNavbar from "~/views/Business/Inflid/BusNavbar"

export default {
    inject: ['root'],
    props:["model","codes"],
    mixins: [CommonProcess],
    components:{'m-busbtn':BusNavbar},
    data(){
        return {
            // curinr:"",
            curownref:"",
            initdialog:false,
             columns:[
          "1 1 \"业务编号\" 130 200",
          "2 2 \"经办柜员\" 90 80",
          "5 5 \"开立日期\" 120 250",
          "6 6 \"到期日\" 300 250",
          "8 7 \"分行名称\" 200 300",
          "9 8 \"申请人编号\" 150 200",
          "11 9 \"申请人名称\" 150 300",
          "15 10 \"受益人名称\" 60 300",
          "16 3 \"开立币种\" 90 80",
          "17 4 \"开立金额\" 90 80",
          ]
        }
    },
    
    methods:{...Event,
        async getButtons(ownref){
        this.initdialog = true
        this.curownref = ownref
        console.log("curownref:" +ownref);
        setTimeout(()=>{
        this.$refs.childs.$emit("childmethods")
        },10)
      },
        async  onChoose(code){
            //跳转交易
        this.$router.history.push("/business/" + code)                     
        },
        
       handleReset: function () {
        this.model = {
          instNo: '', 
          instName: ''
        }
      },
    },
    created:function(){

    }
}
</script>
<style>

</style>
