<template>
    <c-content class="eibs-tab" :height="200">
        <c-infsearch-group @handleSearch="handleSearch" @handleReset="handleReset">
            <!-- 持续展示区 -->
            <template slot="keepShow">
                <c-row class="infrow">
                    <c-col :span="11" :offset="1">
                        <c-row>
                            <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-row>
                    </c-col>
                    <c-col :span="10" :offset="1">
                        <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-row>
            </template>

            <!-- 可控展示区 -->
            <template slot="changeShow">
                <c-row class="infrow">
                    <c-col :span="11" :offset="1">
                        <c-row >
                            <c-col :span="24" >
                                <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="24">
                                <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="24">
                                <el-form-item label="Party Name/BIC" prop="infcon.seapty">
                                    <c-input  
                                        v-model="model.infcon.seapty" 
                                        style="width:100%"
                                        maxlength="24"  
                                        placeholder="请输入Party Name/BIC"
                                    ></c-input>
                                </el-form-item>
                            </c-col>

                            <c-col :span="12">
                                <el-form-item label="Opening between" >
                                    <el-date-picker 
                                        type="date"  
                                        v-model="model.infcon.opndatfrom" 
                                        style="width:100%"  
                                        placeholder="请选择Opening between"
                                    ></el-date-picker>
                                 </el-form-item>
                            </c-col>
                            <c-col :span="11" :offset="1">
                                <el-form-item label="and" label-width="40px" >
                                    <el-date-picker 
                                        type="date"  
                                        v-model="model.infcon.opndatto" 
                                        style="width:100%"  
                                        placeholder="请选择Open Date to"
                                    ></el-date-picker>
                                </el-form-item>
                            </c-col>
                            <c-col :span="15">
                                <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-row>
                    </c-col>
                    <c-col :span="10" :offset="1">
                        <c-row>
                            <c-col :span="24">
                            </c-col>
                            <c-col :span="24">
                                <el-form-item label="Party 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="15">
                                <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="13">
                                <el-form-item label="Resp.User" prop="infcon.usr.extkey">
                                    <c-input  
                                        v-model="model.infcon.usr.extkey"
                                        style="width:100%"
                                        maxlength="8"  
                                        placeholder="请输入User ID"
                                    ></c-input>
                                </el-form-item>
                            </c-col>
                            <c-col :span="10" :offset="1">
                                <el-form-item label="Status" label-width="50px" 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="13">
                                <el-form-item label="金额" prop="infcon.seaamtfr">
                                    <c-input  
                                        v-model="model.infcon.seaamtfr"  
                                        style="width:100%" 
                                        placeholder="请输入Amount between"
                                    ></c-input>
                                </el-form-item>
                            </c-col>
                             <c-col :span="10" :offset="1">
                                <el-form-item label="and" label-width="50px" prop="infcon.seaamtfr">
                                    <c-input  
                                        v-model="model.infcon.seaamtfr"  
                                        style="width:100%" 
                                        placeholder="请输入Amount to"
                                    ></c-input>
                                </el-form-item>
                            </c-col>
                        </c-row>
                    </c-col>
                </c-row>
                <c-col :span="11" :offset="1">
                    <el-form-item label="Form of L/C" prop="sealcrtyp">
                        <c-select 
                            v-model="model.sealcrtyp" 
                            style="width:100%" 
                            :code="codes.lcrtyp"  
                            placeholder="请选择Form of L/C"
                        ></c-select>
                    </el-form-item>
                </c-col>
            </template>
        </c-infsearch-group>
        <c-row style="margin-top:20px; padding: 0 10px 0 10px;">
            <c-col>
               <c-button size="small" type="primary" @click="onInfbutSearow">
                 Search
                </c-button>
                <c-button size="small" type="primary" @click="onInfbutDsp" disabled>
                    Display
                </c-button>
                <c-button size="small" type="primary" @click="onInfbutUserow" disabled>
                    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>
            </c-col>
        </c-row>
        

        <c-row style="margin-top:20px; padding: 0 10px 0 10px;">
            <c-istream-table :list="this.model.infbut.dspstm" :columns="columns">
                <el-table-column prop="op" label="OP" width="100">
                    <template slot-scope="scope">
                        <a href="javascript:void(0)" @click="continueEdit(scope.row)">操作</a>
                    </template>
                </el-table-column>
            </c-istream-table>
        </c-row>
    </c-content>
</template>
<script>
import Api from "~/service/Api"
import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Infled/Event"
import BusNavbar from "~/views/Business/Infled/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",
                "1 1 \"Reference\" 150",
                "2 1 \"Resp. User\" 150",
                "3 1 \"Tendor day\" 150",
                "1 2 \"Party Number\" 150",
                "2 2 \"Applicant\" 150",
                "3 2 \"PTA NO.\" 150",
                "1 3 \"Party Number\" 150",
                "2 3 \"Beneficiary\" 150",
                "3 3 \"Beneficiary CN\" 150",
                "1 4 \"Party Number\" 150",
                "2 4 \"Issuing Bank\" 150",
                "3 4 \"分行名称\" 150",
                "1 5 \"Opened\" 150",
                "2 5 \"Expired\" 150",
                "3 5 \"Closed\" 150",
                "1 6 \"Cur\" 150",
                "2 6 \"Cur\" 150",
                "1 7 \"L/C Amount\" 150",
                "2 7 \"Open Amount\" 150"
            ]
        }
    },
    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>