<template>
    <div class="cost-month" style="border:solid 1px #409eff;margin: 12px 0px;padding: 6px 12px 0px;position: relative;">
        <el-button size="small" type="primary" style="position: absolute;top:10px;right:12px;">增加年份</el-button>
        <el-tabs v-model="activeName">
            <el-tab-pane v-for="(it,idx) in monthInv" :label="''+it.year" :name="''+it.year" :key="idx">
                <el-col v-for="(item,idxx) in it.value" :key="idxx" :span="12">
                    <el-form-item :label="names[item.month]"  class="w200" >
                        <el-input-number :precision="4" v-model="item.money" placeholder="年度投资">                    
                        </el-input-number>
                        <span class="sp-unit">万元</span>
                    </el-form-item>
                </el-col>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
export default {
    name: 'RuoyiUiCostMonth',

    data() {
        return {
            names:['','一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
            activeName:'',
            monthInv:[]
        };
    },

    mounted() {
        
    },

    methods: {
        init(d){
            this.monthInv=d;
            if(d.filter(it=>it.year==new Date().getFullYear()).length>0){
                this.activeName=""+new Date().getFullYear()
            }else{
                this.activeName=""+d.year;
            }
        }
    },
};
</script>

<style lang="scss" scoped>

</style>