<template>
  <div class="eibs-tab">
                              

                                   
       <el-col :span="12">
        <el-form-item label="Branch">
            <c-select v-model="model.bchcon" style="width:100%" placeholder="请选择Branch">
              </c-select>
        </el-form-item>
       </el-col>
                                   
       <el-col :span="12">
        <el-form-item label="Reference">
            <c-input  v-model="model.trncorco.ownref" maxlength="16"  placeholder="请输入Reference"></c-input>
        </el-form-item>
       </el-col>             
                                   
       <el-col :span="12">
        <el-form-item label="Status">
            <c-select v-model="model.trncorco.relflg" style="width:100%" placeholder="请选择Status">
              <el-option label="All" value=" "></el-option>
                <el-option label="Waiting" value="W"></el-option>
                <el-option label="Release" value="R"></el-option>
              </c-select>
        </el-form-item>
       </el-col>
                                   
       <el-col :span="12">
        <el-form-item label="User">
            <c-select v-model="model.usrcon" style="width:100%" placeholder="请选择User">
              </c-select>
        </el-form-item>
       </el-col>
                  
       

      <!--            
       <el-col :span="12">
        <el-form-item label="Drag  Drop Sender">
            <c-input  v-model="model.atpget.sdamod.dadsnd"  placeholder="请输入Drag  Drop Sender"></c-input>
        </el-form-item>
       </el-col>
       -->            
                                   
                 
                                   
       <el-col :span="12">
        <el-form-item label="Between">
            <el-date-picker type="date"  v-model="model.trncorco.inidatfro" style="width:45%"  placeholder="请选择Date of entry of Transaction"></el-date-picker>
            -
            <el-date-picker type="date"  v-model="model.trncorco.inidattil" style="width:45%"  placeholder="请选择Date of entry of Transaction until"></el-date-picker>
        </el-form-item>
       </el-col>

        <!--                           
       <el-col :span="12">
        <el-form-item label="and">
            
        </el-form-item>
       </el-col> -->
                  
        <el-col :span="12">
        <el-form-item label="Transaction Type ">
            <c-input  v-model="model.atp.cod" maxlength="6" style="width:50%"  placeholder="请输入Transaction Type "></c-input>
            <!-- <c-input  v-model="model.atpget.sdamod.seainf"  style="width:10%" placeholder="i"></c-input> -->
            <c-button size="small" type="primary;width:10%"  @click="onSeainf">i</c-button>
        </el-form-item>
       </el-col>     
                                   
                         
       <el-col :span="12">
        <el-form-item label="信用证标志">
            <c-select v-model="model.trncorco.dflg" style="width:100%" placeholder="请选择信用证标志">
                <el-option label="All" value="1"></el-option>
                <el-option label="国内业务" value="2"></el-option>
                <el-option label="国际业务" value="3"></el-option>
              </c-select>
        </el-form-item>
       </el-col>

       <el-col :span="12">
        <el-form-item label="Transaction Text">
            <c-input  v-model="model.atptxt" maxlength="37"  placeholder="请输入Transaction Text"></c-input>
        </el-form-item>
       </el-col>  

       <!--                            
       <el-col :span="12">
        <el-form-item label="List of transaction sfor display">
            <c-input  v-model="model.trncorco.trnstm"  placeholder="请输入List of transaction sfor display"></c-input>
        </el-form-item>
       </el-col>             
                  
       <el-col :span="12">
        <el-form-item label="# of transactions">
            <c-input  v-model="model.numtrn"  placeholder="请输入# of transactions"></c-input>
        </el-form-item>
       </el-col>
       -->             

       <el-col :span="24" style="text-align:center">
            <c-button size="small" type="primary"  @click="onSeaown">
                Search Own
            </c-button>

            <c-button size="small" type="primary"  @click="onSearow">
                Search All
            </c-button>

            <c-button size="small" type="primary" disabled="disabled"  @click="onImgmodNewimg">
                Img
            </c-button>
            <c-button size="small" type="primary" disabled="disabled" @click="onImgmodNewhisimg">
                His.img
            </c-button>
            <c-button size="small" type="primary" disabled="disabled" @click="onDiaconButdia">
                Diaries
            </c-button>
            <c-button size="small" type="primary" disabled="disabled" @click="onImgmodHisimg">
                Old.img
            </c-button>
            <c-button size="small" type="primary" disabled="disabled" @click="onRelrow">
                Release
            </c-button>
            <c-button size="small" type="primary" disabled="disabled" @click="onReprow">
                Repair
            </c-button>
            <c-button size="small" type="primary" disabled="disabled" @click="onRejrow">
                Reject
            </c-button>
            <c-button size="small" type="primary" @click="onExi">
                Exit
            </c-button>
       </el-col>

       <!--   
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onSeajbh">
            Search All
        </c-button>
       </el-col>

       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onSeactr">
            Search
        </c-button>
       </el-col>

        <el-col :span="12">
        <c-button size="small" type="primary"  @click="onSearow">
            Search All
        </c-button>
       </el-col>

        <el-col :span="12">
        <c-button size="small" type="primary"  @click="onDsp">
            Display
        </c-button>
       </el-col>

       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onImgmodNewimg">
            Img
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onImgmodNewhisimg">
            His.img
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onDiaconButdia">
            Diaries
        </c-button>
       </el-col>
                                                    
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onImgmodHisimg">
            Old.img
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onRelrow">
            Release
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onPrinte">
            导出Excel
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onReprow">
            Repair
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onRejrow">
            Reject
        </c-button>
       </el-col>
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onRelcor">
            Rel Control
        </c-button>
       </el-col>
       -->

        <!--          
       <el-col :span="12">
        <el-form-item label=">>">
            <c-input  v-model="model.orddsp"  placeholder="请输入>>"></c-input>
        </el-form-item>
       </el-col>          
                  
       <el-col :span="12">
        <c-button size="small" type="primary"  @click="onExi">
            Exit
        </c-button>
       </el-col> -->   
       <!--<p>{{model.trncorco.trnstm}}</p>-->
       <c-table style="text-align:center"
            :data="stmData"
       >
                <el-table-column
                    label="TRN"
                    width=60
                    prop="10"
                > 
                </el-table-column>
                <el-table-column
                    label="Own Reference"
                    width=60
                    prop="11"
                >
                </el-table-column>
                <el-table-column
                    label="Addtional Text"
                    width=60
                    prop="17"
                > 
                </el-table-column>
                <el-table-column
                    label="Cur"
                    width=50
                    prop="12"
                > 
                </el-table-column>
                <el-table-column
                    label="Relevent Amount"
                    width=70
                    prop="13"
                > 
                </el-table-column>
                <el-table-column
                    label="Entry"
                    width=100
                    prop="14"
                > 
                </el-table-column>
                <el-table-column
                    label="Req"
                    width=50
                    prop="9"
                > 
                </el-table-column>
                <el-table-column
                    label="Sig"
                    width=50
                    prop="2"
                > 
                </el-table-column>
                <el-table-column
                    label="Rq0"
                    width=30
                    prop="6"
                > 
                </el-table-column>
                <el-table-column
                    label="Rel0"
                    width=100
                    prop="3"
                > 
                </el-table-column>
                <el-table-column
                    label="Rq1"
                    width=30
                    prop="7"
                > 
                </el-table-column>
                <el-table-column
                    label="Rel1"
                    width=100
                    prop="4"
                > 
                </el-table-column>
                <el-table-column
                    label="Rq2"
                    width=30
                    prop="8"
                > 
                </el-table-column>
                <el-table-column
                    label="Rel2"
                    width=100
                    prop="5"
                > 
                </el-table-column>
                <el-table-column
                    label="Branch"
                    width=50
                    prop="15"
                > 
                </el-table-column>
                <el-table-column
                    label=" User"
                    width=50
                    prop="16"
                > 
                </el-table-column>
                <el-table-column
                    label=""
                    width=50
                    prop="18"
                > 
                </el-table-column>
                <el-table-column
                    label="Status"
                    width=50
                    prop="0"
                > 
                </el-table-column>
            </c-table>

        <c-istream-table :list="testJson.data" :columns="testJson.columns"></c-istream-table>    
  </div>
  
</template>
<script>
import Api from "~/service/Api"
import CommonProcess from "~/mixin/CommonProcess"
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Trnrel/Event"

export default {
    props:["model","codes"],
    components: {

    },
    data(){
        return {
            testJson: {
                columns: [
                    "10 1 \"TRN\" 50 1 tdViewTypeEdit:0 3 ATPTXT",
                    "11 2:1 \"Own Reference\" 112",
                    "17 2:2 \"Addtional Text\" 112",
                    "12 3 \"Cur\" 37",
                    "13 4 \"Relevant Amount\" 101 2 8:1 2 5",
                    "14 5 \"Entry\" 104 20 DateTime 1",
                    "9 6:1 \"Req\" 39",
                    "2 6:2 \"Sig\" 35",
                    "6 8:1 \"Rq0\" 40",
                    "3 8:2 \"Rel0\" 40",
                    "7 9:1 \"Rq1\" 40",
                    "4 9:2 \"Rel1\" 40",
                    "8 10:1 \"Rq2\" 40",
                    "5 10:2 \"Rel2\" 40",
                    "15 13 \"Branch\" 142",
                    "16 11:1 \"User\" 62",
                    "18 11:2 \"\" 62",
                    "0 12 \"Status\" 54 1 tdViewTypeEdit:0 1 RELSTA",
                    "P COLORED TRUE",
                    "P VERTLINES TRUE",
                    "P HORZLINES TRUE"
                ],
                data: [
                    "DITOPN\t10.00 13213 2000007350 GUONEI\t00000101\t2021-04-23 11:26:54.444\tZL      \tKZ3500210003AA  \t10\tW\tNN \tOA \tNN \tNN \tCNY\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "BTTSND\t \t00000100\t2020-06-19 16:10:57.739\tZL      \tBP3500200002AAT \t20000\tW\tNN \tOA \tNN \tNN \tUSD\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "BTTDCK\t \t00000099\t2020-06-19 16:03:34.871\tZL      \tBP3500200002AAT \t20000\tW\tNN \tOA \tNN \tNN \tUSD\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "LTTDCK\t \t00000098\t2020-06-19 15:58:24.007\tZL      \tBP3500200002AAT \t16000\tW\tNN \tOA \tNN \tNN \tUSD\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "LTTOPN\t \t00000096\t2020-06-19 15:54:14.219\tZL      \tTC3500200001AA  \t66000\tW\tNN \tOA \tNN \tNN \tUSD\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "LETOPN\t100,000.00\t00000095\t2020-06-19 15:42:45.222\tZL      \tAD3500200002AA  \t110000\tW\tNN \tOB \tNN \tNN \tUSD\t北京分行                                                      \tO  \tNN \tZHL                                     \tNB \tNN ",
                    "BDTDCK\tGUONEI\t00000094\t2020-06-11 09:25:30.824\tZL      \tDD3500190001AA02\t6\tW\tNN \tOA \tNN \tNN \tCNY\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "BDTDCR\tGUONEI\t00000093\t2020-06-11 09:12:19.237\tZL      \tDD3500190001AA02\t8\tW\tNN \tOA \tNN \tNN \tCNY\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "BDTDCK\tGUONEI\t00000092\t2020-06-11 09:10:27.276\tZL      \tDD3500190001AA02\t8\tW\tNN \tOA \tNN \tNN \tCNY\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "DITDCK\t0.00 北京三优机电设备有限公司 2000007350 GUONEI\t00000091\t2020-06-10 18:04:40.818\tZL      \tDD3500190001AA02\t10\tW\tNN \tOA \tNN \tNN \tCNY\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN ",
                    "DITOPN\t100,000.00 北京宇宙中心第一家有限公司 2000007350 GUONEI\t00000087\t2020-06-10 15:42:44.7\tZL      \tKZ3500200002AA  \t100000\tW\tNN \tOA \tNN \tNN \tCNY\t北京分行                                                      \tO  \tNN \tZHL                                     \tNA \tNN "
                ]
            }
        }
    },
    methods:{...Event},
    created:function(){

    },
    computed:{
        stmData(){
            let data = this.model.trncorco.trnstm
            if(!data)
                return []
            data = this.model.trncorco.trnstm.map(item=>{
                let obj = {}
                item.split("\t").forEach((item,index)=>{
                    obj[(index)+""]=item;
                });
                return obj;
            })
            return data;
        }
    }
}
</script>
<style>

</style>
