<template>
    <el-dialog :visible.sync="visiable" center fullscreen destroy-on-close><el-col>
        <el-form v-model="model.setmod.setfeg.setfel[idx]" inline>
            <el-col>
                <el-col :span="8">
                    <el-form-item label="费用代码">
                        <el-input
                                v-model="model.setmod.setfeg.setfel[idx].feecod"
                                disabled/>
                        </el-form-item>
                    </el-col>
                    <el-col :span="16">
                        <el-form-item label="中文描述">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].feetxt"
                                style="width: 350px"/>
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].modflg"
                                disabled
                                style="width: 350px; margin-left: 100px"/>
                        </el-form-item>
                    </el-col>
                </el-col>
                <el-col>
                    <el-col :span="6">
                        <el-form-item label="详细信息">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].feetxtinf"
                            />
                        </el-form-item
                        >
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="起算时间">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].dat1"
                                type="date"
                            />
                        </el-form-item
                        >
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="结束时间">
                            <el-input
                                v-model="
                                    model.setmod.setfeg.setfel[idx].dat2
                                "
                                type="date"
                            />
                        </el-form-item
                        >
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="收取份数">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].unt"
                            />
                        </el-form-item
                        >
                    </el-col>
                </el-col>
                <el-col>
                    <el-form-item label="费用换算">
                        <el-select
                            v-model="model.setmod.setfeg.setfel[idx].usrcur">
                                <el-option 
                                    v-for="item in codes.usrcur"
                                    :label="item.label"
                                    :value="item.value"
                                    :key="item.value"
                                />
                        </el-select>
                        <el-input
                            v-model="model.setmod.setfeg.setfel[idx].usramt"
                            style="width: 200px; margin-left: 50px"
                        />
                    </el-form-item>
                </el-col>
                <el-col>
                    <el-col :span="8">
                        <el-form-item label="应收费用"
                        >
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].cur"
                                disabled
                                style="width: 100px; margin-right: 10px"
                            />
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].ogiamt"
                                disabled
                                style="width: 200px"
                            />
                        </el-form-item
                        >
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="优惠百分比"
                        >
                            <el-input v-model="model.setmod.setfeg.setfel[idx].dctrat" >
                                <template #append>%</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="Period calculation starting at">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].datrefbeg"
                                disabled/>
                        </el-form-item
                        >
                    </el-col>
                </el-col>
                <el-col>
                    <el-col :span="8">
                        <el-form-item label="付款方">
                            <el-select
                                v-model="model.setmod.setfeg.setfel[idx].rol">
                                <el-option 
                                    v-for="item in codes.rol"
                                    :label="item.label"
                                    :value="item.value"
                                    :key="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="优惠金额">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].dctamt"/>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="优惠后实收费用金额">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].amt"/>
                        </el-form-item>
                    </el-col>
                </el-col>
                <el-col>
                    <el-form-item
                        :label="idx==0?'Per mile fee depending on duration':
                        'A fixed amount per unit is caculated. This type will, for example, be used for correspondence charges.'"
                    />
                </el-col>
                    <el-col :span="12">
                        <el-col v-if="idx==0">
                        <el-col>
                            <el-form-item label="千分率">
                                <el-input
                                    v-model="model.setmod.setfeg.setfel[idx].fecp1.ratcal"
                                    style="width: 200px"
                                />
                            </el-form-item>
                        </el-col>
                        <el-col>
                            <el-form-item label="最小值">
                                <el-select
                                    v-model="model.setmod.setfeg.setfel[idx].fecp1.mincur"
                                    style="width: 200px" >
                                    <el-option 
                                        v-for="item in codes.mincur"
                                        :label="item.label"
                                        :value="item.value"
                                        :key="item.value"
                                    />
                                </el-select>
                                <!-- v-model="model.setmod.setfeg.setfel[idx].fecp1.fec.minamt" -->
                                <el-input
                                    style="width: 200px"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.minamt"
                                />
                                <el-input
                                    style="width: 200px"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.minfcc"
                                />
                            </el-form-item>
                        </el-col>
                        <el-col>
                            <el-form-item label="最大值">
                                <el-select
                                    v-model="model.setmod.setfeg.setfel[idx].fecp1.maxcur"
                                    style="width: 200px" >
                                    <el-option 
                                        v-for="item in codes.maxcur"
                                        :label="item.label"
                                        :value="item.value"
                                        :key="item.value"
                                    />
                                </el-select>

                                <el-input
                                    style="width: 200px;"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.maxamt"/>
                                <el-input
                                    style="width: 200px"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.maxfcc"
                                />
                            </el-form-item>
                        </el-col>
                        <el-col>
                            <el-form-item>
                                <el-checkbox 
                                label="CG000652"
                                v-model="model.setmod.setfeg.setfel[idx].fecp1.jnwshx"
                                />
                            </el-form-item>
                        </el-col>
                    </el-col>
                    <el-col v-else>
                        <el-form-item label="Amount">
                            <el-select v-model="model.setmod.setfeg.setfel[idx].wrkfec.ratcur">
                                <el-option 
                                v-for="item in codes.cur"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                                >

                                </el-option>
                            </el-select>
                            <el-input  
                            style="width:200px;"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.untamt  "
                            >

                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col>
                        <el-form-item label="销项税">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].fecp1.taxrat"
                                disabled
                                style="width: 200px"
                            />
                        </el-form-item>
                    </el-col>
                    <el-col>
                        <el-form-item label="客户属性">
                            <el-input
                                v-model="model.setmod.setfeg.setfel[idx].fecp1.custyp"
                                disabled
                                style="width: 200px"
                            />
                        </el-form-item>
                    </el-col>
                </el-col>
                <el-col v-if="idx==0" :span="12">
                    <el-form-item label="Caiculation Base">
                        <el-input
                            v-model="model.setmod.setfeg.setfel[idx].fecp1.calcbs"
                            disabled
                            style="width: 200px"
                        />
                    </el-form-item>
                    <el-form-item label="Calc.Period">
                        <el-select
                            v-model="model.setmod.setfeg.setfel[idx].fecp1.pertyp">
                                <el-option 
                                    v-for="item in codes.pertyp"
                                    :label="item.label"
                                    :value="item.value"
                                    :key="item.value"
                                />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="Min.Periods">
                        <el-input
                            v-model="model.setmod.setfeg.setfel[idx].fecp1.per"
                            style="width: 200px"
                        />
                    </el-form-item>
                    <el-form-item label="Rates to Apply per Period Tier"/>
                    <el-form-item label="from Perimod">
                        <el-input 
                            style="width: 200px" 
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr2"
                        />
                        <el-input
                            disabled
                            style="width: 200px; margin-left: 50px"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perrattr2"
                        />
                    </el-form-item>
                    <el-form-item label="from Perimod">
                        <el-input
                            disabled 
                            style="width: 200px" 
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr3"
                        />
                        <el-input
                            disabled
                            style="width: 200px; margin-left: 50px"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perrattr3"
                        />
                    </el-form-item>
                    <el-form-item label="from Perimod">
                        <el-input 
                            disabled 
                            style="width: 200px" 
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr4"
                        />
                        <el-input
                            disabled
                            style="width: 200px; margin-left: 50px"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perrattr4"
                        />
                    </el-form-item>
                    <el-form-item label="from Perimod">
                        <el-input 
                        disabled 
                        style="width: 200px" 
                        v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr5"
                        />
                        <el-input
                            disabled
                            style="width: 200px; margin-left: 50px"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perrattr5"
                        />
                    </el-form-item>
                </el-col>
                <el-col>&nbsp;</el-col>
                <el-col :span="18" :offset="6">
                    <el-form-item label="收费的说明信息" >
                        <el-input
                            v-model="model.setmod.setfeg.setfel[idx].inftxt"
                            disabled
                            rows="10"
                            type="textarea"
                            style="width: 500px;"
                        />
                    </el-form-item>
                </el-col>
            </el-form>
            <el-col :span="4" :offset="8">
                <el-button type="primary" @click="saveDialog">
                    确 定
                </el-button>
                </el-col>
                <el-col :span="6" >
                <el-button @click="visiable = false">取 消</el-button>
            </el-col>
        </el-col>
    </el-dialog>
        

</template>

<script>
export default {
    props: {
        visible: Boolean,
        model: Object,
        idx: Number,
        codes:Object,
    },
    methods: {
        saveDialog() {
            this.visiable = false;
        },
    },
    computed:{
        visiable:{
            get:function () {return this.visible;},
            set:function (value) {
                this.$parent.$parent.dialogVisible2 =value;
            }
            
            
            }
    }
};
</script>

<style>
</style>
