<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="开立日期" >
                    <c-date-picker type="date" v-model="model.infcon.opndatfrom"  placeholder="请选择Opening between" style="width:43%"></c-date-picker>
                    -
                    <c-date-picker type="date" v-model="model.infcon.opndatto"  placeholder="请选择Open Date to" style="width:43%"></c-date-picker>
                </el-form-item>
            </c-col>
         </el-row>  
                                              
       <!--<c-col :span="12">
        <el-form-item label="Own Reference" prop="infcon.seaownref">
            <c-input  v-model="model.infcon.seaownref" maxlength="16"  placeholder="请输入Own Reference"></c-input>
        </el-form-item>
       </c-col>-->
       <el-row v-show="searchSlot.searchToggle">                                
            <c-col :span="12">
                <el-form-item label="Name" prop="infcon.nam">
                    <c-input  v-model="model.infcon.nam" maxlength="40"  placeholder="请输入Name"></c-input>
                </el-form-item>
            </c-col>
                        
           <!-- <c-col :span="12">
                <c-button size="small" type="primary"  @click="onInfbutSearow">
                    Search
                </c-button>
            </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="Release Status" prop="infcon.relflg">
                    <c-select v-model="model.infcon.relflg" style="width:100%" placeholder="请选择Release Status">
                    </c-select>
                </el-form-item>
            </c-col>
                        
            <!--<c-col :span="12">
                <c-button size="small" type="primary"  @click="onInfbutDsp">
                    Display
                </c-button>
            </c-col>-->
                        
            <c-col :span="12">
                <el-form-item label="Handling Type" prop="infcon.hndtyp">
                    <c-select v-model="model.infcon.hndtyp" style="width:100%" placeholder="请选择Handling Type">
                    </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="External Visible Name" prop="infcon.pty.nam">
                    <c-input  v-model="model.infcon.pty.nam" maxlength="40"  placeholder="请输入External Visible Name"></c-input>
                </el-form-item>
            </c-col>
                        
            <!--<c-col :span="12">
                <c-button size="small" type="primary"  @click="onInfbutUserow">
                    Use
                </c-button>
            </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">
                    </c-select>
                </el-form-item>
            </c-col>
                        
            <!--<c-col :span="12">
                <c-button size="small" type="primary"  @click="onInfbutClr">
                    Clear
                </c-button>
            </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" 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" style="width:100%"  placeholder="请选择Open Date to"></c-date-picker>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="User ID" 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="Status" prop="infcon.seasta">
                    <c-select v-model="model.infcon.seasta" style="width:100%" placeholder="请选择Status">
                    </c-select>
                </el-form-item>
            </c-col>
                                        
            <!--<c-col :span="12">
                <c-button size="small" type="primary"  @click="onInfbutButprt">
                    导Excel
                </c-button>
            </c-col>-->
                                        
            <c-col :span="12">
                <el-form-item label="Currency" prop="infcon.seacur">
                    <c-select v-model="model.infcon.seacur" style="width:100%" placeholder="请选择Currency">
                    </c-select>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="Amount between" prop="infcon.seaamtfr">
                    <c-input  v-model="model.infcon.seaamtfr"  placeholder="请输入Amount between"></c-input>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="Amount to" prop="infcon.seaamtto">
                    <c-input  v-model="model.infcon.seaamtto"  placeholder="请输入Amount to"></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="请选择是否显示查询码">
                    </c-select>
                </el-form-item>
            </c-col>
                                                            
            <c-col :span="12">
                <el-form-item label="Financing Type" prop="seafintyp">
                    <c-select v-model="model.seafintyp" style="width:100%" placeholder="请选择Financing Type">
                    </c-select>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="Goods Code" prop="seagodcod">
                    <c-select v-model="model.seagodcod" style="width:100%" placeholder="请选择Goods Code">
                    </c-select>
                </el-form-item>
            </c-col>
                                        
            <c-col :span="12">
                <el-form-item label="Overdue Flag" prop="trdgrp.rec.ovdflg">
                    <c-select v-model="model.trdgrp.rec.ovdflg" style="width:100%" placeholder="请选择Overdue Flag">
                    </c-select>
                </el-form-item>
            </c-col>
                        
            <c-col :span="12">
                <c-checkbox v-model="model.trdgrp.rec.oseflg">海外代付</c-checkbox>
            </c-col>
                        
            <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>                  
            <!--<c-col :span="12">
                <c-button size="small" type="primary"  @click="onInfbutExi">
                    Exit
                </c-button>
            </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="TRTOPN"  @click="onChoose('trtopn')">
            融资开立
        </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/Inftrd/Event"
import BusNavbar from "~/views/Business/Inftrd/BusNavbar"

export default {
    inject: ['root'],
    props:["model","codes"],
    mixins: [CommonProcess],
    components:{'m-busbtn':BusNavbar},
    data(){
        return {
              curownref:"",
            initdialog:false,
            columns:[
                "1 1 \"业务编号\" 100",
                "2 2 \"经办柜员\" 100",
                "20 3 \"币种\" 100",
                "21 4 \"融资金额\" 100",
                "5 5 \"融资状态\" 100",
                "9 6 \"融资账号\" 100",
                "7 7 \"开立日期\" 100",
                "8 8 \"到期日\" 100",
                "16 9 \"融资客户编号\" 100",
                "18 10 \"融资客户名称\" 100",
                "13 11 \"融资类型\" 100",
                
                ]
        }
    },
    methods:{...Event,
      async getButtons(ownref){
        this.initdialog = true
        this.curownref = ownref
         console.log("inftrd.ownref:" + 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>
