<template>
  <c-row class="eibs-tab">

      <!-- <div class="infTopBtn">
            <el-button-group>
                <c-button size="small" type="primary" icon="el-icon-arrow-left"></c-button>
                <c-button size="small" type="primary" icon="el-icon-arrow-right"></c-button>
            </el-button-group>
            <c-button size="small" type="primary">Print</c-button>
            <c-button size="small" type="primary">Use</c-button>
            <c-button size="small" type="primary">Loginfo</c-button>
        </div>

        <c-row class="infrow" style="margin-top:50px;">
            <c-col :span="23" :offset="1">
                Fee Pool
            </c-col>
        </c-row>

        <br /> -->
        <c-col :span="11">
             <!-- <c-col :span="23">
                Fee Pool
            </c-col> -->
            <c-col :span="23" >
                <el-form-item
                    label="Fee Code"
                    prop="infcon.fepfeecod"
                    style="width:100%"
                >
                    <c-select v-model="model.infcon.fepfeecod" 
                              style="width:100%" 
                              placeholder="请选择Fee Code"
                              @change="getInfconFepfeecod"
                              >
                        <el-option
                          v-for="item in codes.fepfeecod"
                          :key="item.value"
                          :label="item.value"
                          :value="item.value"
                        >
                        <span style="float: left">{{ item.value +'\t' + item.label}}</span>
                        </el-option>
                    </c-select>
                    
                </el-form-item>
            </c-col>

            <c-col :span="23" >
                <el-form-item
                    label="Disposition"
                    prop="infcon.fepdsp"
                    style="width:100%"
                >
                    <c-select v-model="model.infcon.fepdsp" 
                              style="width:100%" 
                              placeholder="请选择Disposition"
                              @change="getInfconFepfeecod"
                              >
                         <el-option
                          v-for="item in codes.fepdsp"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        >
                        </el-option>
                    </c-select>
                </el-form-item>
            </c-col>
        </c-col>
    <!-- ======================== 左边结束 ========================= -->    
        <c-col :span="11" :offset="1">
            <c-col :span="23">
                <el-form-item label="Fee Text" prop="infcon.fepfeecod">
                    <c-select v-model="model.infcon.fepfeecod" 
                              style="width:100%" 
                              placeholder="请选择Fee Code"
                              disabled
                              >
                        <el-option
                          v-for="item in codes.fepfeecod"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        >
                        </el-option>
                    </c-select>
                </el-form-item>
            </c-col>
        </c-col>

    <!-- ============================== 右侧结束 ===================== -->
    <!-- ======================分割线====================== -->
        <c-col :span="23" style="height:25px">
           <el-divider></el-divider>
       </c-col>
        <c-col :span="23" style="margin-top:5px;">
            <c-istream-table :list="stmData.fepstmData" :columns="stmData.fepstmColumns">
                <!-- <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-col>

        <br/>
        <!-- ======================分割线====================== -->
        <c-col :span="23" style="height:25px">
           <el-divider></el-divider>
       </c-col>

        <c-col :span="11" style="margin-top:5px;">

            <c-col :span="23" >
                <el-form-item
                    label="Disposition"
                    prop="infcon.fcpdsp"
                    style="width:100%"
                >
                    <c-select v-model="model.infcon.fcpdsp" 
                              style="width:100%" 
                              placeholder="请选择Disposition"
                               :code="getValues('infcon.fcpdsp')"
                               @change="getInfconFcpfeecod"
                              >
                              <el-option
                                v-for="item in codes.fcpdsp"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                                >
                                </el-option>
                    </c-select>
                </el-form-item>
            </c-col>
        </c-col>
        <!-- <c-row class="infrow">
            <c-col :span="11" :offset="1">
                <c-row>
                    <c-col :span="20">
                        <el-form-item label="Disposition" prop="infcon.fcpdsp">
                            <c-select v-model="model.infcon.fcpdsp" style="width:100%" placeholder="请选择Disposition">
                            </c-select>
                        </el-form-item>
                    </c-col>
                </c-row>
            </c-col>
            <c-col :span="11" :offset="1">

            </c-col>
        </c-row> -->

            <c-col :span="23">
                <c-istream-table :list="stmData.fcpstmData" :columns="stmData.fcpstmColumns">
                    <!-- <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-col>
            <c-col :span="23">
                
            </c-col>

  </c-row>
</template>
<script>
import Utils from "~/utils/index";
import Api from "~/service/Api"
import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Infbed/Event"

export default {
    inject: ['root'],
    props:["model","codes"],
    mixins: [CommonProcess],
    data(){
        return {
            stmData: {
                    fepstmColumns: [
                        "3 1 \"Fee Code\" 0 ",
                        "4 2 \"Fee Text\" 0 ",
                        "11 3 \"Disposition\" 0 ",
                        "12 4 \"Role\" 0 ",
                        "5 5 \"Cur\" 0 ",
                        "6 6 \"Amount\" 0 ",
                        "9 7 \"Transaction/INR\" 0 ",
                        "7 8 \"Entry Date\" 0 ",
                        "10 9 \"Status\" 0 ",
                    ],
                    fepstmData: [

                    ],
                    fcpstmColumns: [
                        "1 1 \"Payer\" 0 ",
                        "5 1 \"Text for Payer\" 0 ",
                        "1 2 \"Payee\" 0 ",
                        "2 2 \"Text for Payee\" 0 ",
                        "1 3 \"Disposition\" 0 ",
                        "6 4 \"Cur\" 0 ",
                        "7 5 \"Amount\" 0 ",
                        "10 6 \"Transaction/INR\" 0 ",
                        "8 7 \"Entry Date\" 0 ",
                        "11 8 \"Status\" 0 ",
                    ],
                    fcpstmData: [

                    ],
                }
        }
    },
    methods:{...Event,
        dispDefault(index){
            console.log(index);
            // this.executeDefault(`setmod.setfeg.setfel(${index}).mac`).then(res=>{
            //     Utils.copyValueFromVO(this.model, res.data)
            // })
            
        },
        async  getInfconFepfeecod() {
            let rtnmsg = await this.executeDefault("fepfeecod")
            if(rtnmsg.respCode == SUCCESS)
            {
                this.stmData.fepstmData = rtnmsg.data.infcon_fepstm.rows;
                Utils.copyValueFromVO(this.model, rtnmsg.data);
                console.log(this.stmData.fepstmData);
            }
            else
            {
                this.$notify.error({title: '错误',message: '服务请求失败！'});
            }
        },
        async  getInfconFcpfeecod() {
            let rtnmsg = await this.executeDefault("fcpdsp")
            if(rtnmsg.respCode == SUCCESS)
            {
                this.stmData.fcpstmData = rtnmsg.data.infcon_fcpstm.rows;
                Utils.copyValueFromVO(this.model, rtnmsg.data);
                console.log(this.stmData.fcpstmData);
            }
            else
            {
                this.$notify.error({title: '错误',message: '服务请求失败！'});
            }
        }
    },
    created:function(){
        this.getInfconFcpfeecod();
        this.getInfconFepfeecod();
    }
}
</script>
<style>

</style>
