<template>
    <el-dialog :visible.sync="visiable" center fullscreen destroy-on-close><c-col>
        <el-form v-model="model.setmod.setfeg.setfel[idx]" inline>
            <c-col>
                <c-col :span="8">
                    <el-form-item label="费用代码">
                        <c-input
                                v-model="model.setmod.setfeg.setfel[idx].feecod"
                                disabled/>
                        </el-form-item>
                    </c-col>
                    <c-col :span="16">
                        <el-form-item label="中文描述">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].feetxt"
                                style="width: 350px"/>
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].modflg"
                                disabled
                                style="width: 350px; margin-left: 100px"/>
                        </el-form-item>
                    </c-col>
                </c-col>
                <c-col>
                    <c-col :span="6">
                        <el-form-item label="详细信息">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].feetxtinf"
                            />
                        </el-form-item
                        >
                    </c-col>
                    <c-col :span="6">
                        <el-form-item label="起算时间">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].dat1"
                                type="date"
                            />
                        </el-form-item
                        >
                    </c-col>
                    <c-col :span="6">
                        <el-form-item label="结束时间">
                            <c-input
                                v-model="
                                    model.setmod.setfeg.setfel[idx].dat2
                                "
                                type="date"
                            />
                        </el-form-item
                        >
                    </c-col>
                    <c-col :span="6">
                        <el-form-item label="收取份数">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].unt"
                            />
                        </el-form-item
                        >
                    </c-col>
                </c-col>
                <c-col>
                    <el-form-item label="费用换算">
                        <c-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"
                                />
                        </c-select>
                        <c-input
                            v-model="model.setmod.setfeg.setfel[idx].usramt"
                            style="width: 200px; margin-left: 50px"
                        />
                    </el-form-item>
                </c-col>
                <c-col>
                    <c-col :span="8">
                        <el-form-item label="应收费用"
                        >
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].cur"
                                disabled
                                style="width: 100px; margin-right: 10px"
                            />
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].ogiamt"
                                disabled
                                style="width: 200px"
                            />
                        </el-form-item
                        >
                    </c-col>
                    <c-col :span="8">
                        <el-form-item label="优惠百分比"
                        >
                            <c-input v-model="model.setmod.setfeg.setfel[idx].dctrat" >
                                <template #append>%</template>
                            </c-input>
                        </el-form-item>
                    </c-col>
                    <c-col :span="8">
                        <el-form-item label="Period calculation starting at">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].datrefbeg"
                                disabled/>
                        </el-form-item
                        >
                    </c-col>
                </c-col>
                <c-col>
                    <c-col :span="8">
                        <el-form-item label="付款方">
                            <c-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"
                                />
                            </c-select>
                        </el-form-item>
                    </c-col>
                    <c-col :span="8">
                        <el-form-item label="优惠金额">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].dctamt"/>
                        </el-form-item>
                    </c-col>
                    <c-col :span="8">
                        <el-form-item label="优惠后实收费用金额">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].amt"/>
                        </el-form-item>
                    </c-col>
                </c-col>
                <c-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.'"
                    />
                </c-col>
                    <c-col :span="12">
                        <c-col v-if="idx==0">
                        <c-col>
                            <el-form-item label="千分率">
                                <c-input
                                    v-model="model.setmod.setfeg.setfel[idx].fecp1.ratcal"
                                    style="width: 200px"
                                />
                            </el-form-item>
                        </c-col>
                        <c-col>
                            <el-form-item label="最小值">
                                <c-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"
                                    />
                                </c-select>
                                <!-- v-model="model.setmod.setfeg.setfel[idx].fecp1.fec.minamt" -->
                                <c-input
                                    style="width: 200px"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.minamt"
                                />
                                <c-input
                                    style="width: 200px"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.minfcc"
                                />
                            </el-form-item>
                        </c-col>
                        <c-col>
                            <el-form-item label="最大值">
                                <c-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"
                                    />
                                </c-select>

                                <c-input
                                    style="width: 200px;"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.maxamt"/>
                                <c-input
                                    style="width: 200px"
                                    v-model="model.setmod.setfeg.setfel[idx].wrkfec.maxfcc"
                                />
                            </el-form-item>
                        </c-col>
                        <c-col>
                            <el-form-item>
                                <c-checkbox 
                                label="CG000652"
                                v-model="model.setmod.setfeg.setfel[idx].fecp1.jnwshx"
                                />
                            </el-form-item>
                        </c-col>
                    </c-col>
                    <c-col v-else>
                        <el-form-item label="Amount">
                            <c-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>
                            </c-select>
                            <c-input  
                            style="width:200px;"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.untamt  "
                            >

                            </c-input>
                        </el-form-item>
                    </c-col>
                    <c-col>
                        <el-form-item label="销项税">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].fecp1.taxrat"
                                disabled
                                style="width: 200px"
                            />
                        </el-form-item>
                    </c-col>
                    <c-col>
                        <el-form-item label="客户属性">
                            <c-input
                                v-model="model.setmod.setfeg.setfel[idx].fecp1.custyp"
                                disabled
                                style="width: 200px"
                            />
                        </el-form-item>
                    </c-col>
                </c-col>
                <c-col v-if="idx==0" :span="12">
                    <el-form-item label="Caiculation Base">
                        <c-input
                            v-model="model.setmod.setfeg.setfel[idx].fecp1.calcbs"
                            disabled
                            style="width: 200px"
                        />
                    </el-form-item>
                    <el-form-item label="Calc.Period">
                        <c-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"
                                />
                        </c-select>
                    </el-form-item>
                    <el-form-item label="Min.Periods">
                        <c-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">
                        <c-input 
                            style="width: 200px" 
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr2"
                        />
                        <c-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">
                        <c-input
                            disabled 
                            style="width: 200px" 
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr3"
                        />
                        <c-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">
                        <c-input 
                            disabled 
                            style="width: 200px" 
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr4"
                        />
                        <c-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">
                        <c-input 
                        disabled 
                        style="width: 200px" 
                        v-model="model.setmod.setfeg.setfel[idx].wrkfec.perbegtr5"
                        />
                        <c-input
                            disabled
                            style="width: 200px; margin-left: 50px"
                            v-model="model.setmod.setfeg.setfel[idx].wrkfec.perrattr5"
                        />
                    </el-form-item>
                </c-col>
                <c-col>&nbsp;</c-col>
                <c-col :span="18" :offset="6">
                    <el-form-item label="收费的说明信息" >
                        <c-input
                            v-model="model.setmod.setfeg.setfel[idx].inftxt"
                            disabled
                            rows="10"
                            type="textarea"
                            style="width: 500px;"
                        />
                    </el-form-item>
                </c-col>
            </el-form>
            <c-col :span="4" :offset="8">
                <c-button type="primary" @click="saveDialog">
                    确 定
                </c-button>
                </c-col>
                <c-col :span="6" >
                <c-button @click="visiable = false">取 消</c-button>
            </c-col>
        </c-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) {
                debugger;
                this.$parent.$parent.dialogVisible2 =value;
            }
            
            
            }
    }
};
</script>

<style>
</style>
